diff --git a/fastremap.cpp b/fastremap.cpp index c83dfa9..68e8008 100644 --- a/fastremap.cpp +++ b/fastremap.cpp @@ -619,7 +619,6 @@ static CYTHON_INLINE float __PYX_NAN() { #define __PYX_HAVE__fastremap #define __PYX_HAVE_API__fastremap /* Early includes */ -#include #include "ios" #include "new" #include "stdexcept" @@ -636,10 +635,14 @@ static CYTHON_INLINE float __PYX_NAN() { #endif -#include +#include "ska_flat_hash_map.hpp" +#include #include #include #include "numpy/arrayobject.h" +#include "numpy/ndarrayobject.h" +#include "numpy/ndarraytypes.h" +#include "numpy/arrayscalars.h" #include "numpy/ufuncobject.h" /* NumPy API declarations from "numpy/__init__.pxd" */ @@ -992,7 +995,7 @@ typedef volatile __pyx_atomic_int_type __pyx_atomic_int; #endif -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":689 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":690 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -1001,7 +1004,7 @@ typedef volatile __pyx_atomic_int_type __pyx_atomic_int; */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":690 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":691 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -1010,7 +1013,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":691 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":692 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -1019,7 +1022,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":692 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":693 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -1028,7 +1031,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":696 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":697 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -1037,7 +1040,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":697 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":698 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -1046,7 +1049,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":698 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":699 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -1055,7 +1058,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":699 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":700 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -1064,7 +1067,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":703 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":704 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -1073,7 +1076,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":704 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":705 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -1082,7 +1085,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":713 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":714 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -1091,7 +1094,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":714 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":715 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -1100,7 +1103,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":715 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":716 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -1109,7 +1112,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":717 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":718 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -1118,7 +1121,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":718 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":719 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -1127,7 +1130,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":719 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":720 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -1136,7 +1139,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":721 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":722 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -1145,7 +1148,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":722 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":723 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1154,7 +1157,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":724 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":725 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1163,7 +1166,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":725 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":726 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1172,7 +1175,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":726 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":727 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -1212,7 +1215,7 @@ struct __pyx_MemviewEnum_obj; struct __pyx_memoryview_obj; struct __pyx_memoryviewslice_obj; -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":728 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":729 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -1221,7 +1224,7 @@ struct __pyx_memoryviewslice_obj; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":729 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":730 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -1230,7 +1233,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":730 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":731 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -1239,7 +1242,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":732 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":733 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -1448,7 +1451,7 @@ struct __pyx_defaults35 { PyObject *__pyx_arg_return_index; }; -/* "fastremap.pyx":712 +/* "fastremap.pyx":728 * return pairs * * def unique(labels, return_index=False, return_inverse=False, return_counts=False, axis=None): # <<<<<<<<<<<<<< @@ -2043,6 +2046,42 @@ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name /* append.proto */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); +/* IterNext.proto */ +#define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL) +static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *); + +/* py_dict_keys.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d); + +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; + +/* CallUnboundCMethod0.proto */ +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CallUnboundCMethod0(cfunc, self)\ + (likely((cfunc)->func) ?\ + (likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\ + (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\ + (PY_VERSION_HEX >= 0x030700A0 ?\ + (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\ + (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\ + (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\ + (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\ + (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\ + ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) :\ + __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\ + __Pyx__CallUnboundCMethod0(cfunc, self)) +#else +#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) +#endif + /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); @@ -2730,16 +2769,14 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/ +/* Module declarations from 'libcpp.utility' */ + /* Module declarations from 'cython.view' */ /* Module declarations from 'cython' */ /* Module declarations from 'libc.stdint' */ -/* Module declarations from 'libcpp.utility' */ - -/* Module declarations from 'libcpp.unordered_map' */ - /* Module declarations from 'cpython.buffer' */ /* Module declarations from 'libc.string' */ @@ -2766,6 +2803,16 @@ static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_generic = 0; +static PyTypeObject *__pyx_ptype_5numpy_number = 0; +static PyTypeObject *__pyx_ptype_5numpy_integer = 0; +static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0; +static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0; +static PyTypeObject *__pyx_ptype_5numpy_inexact = 0; +static PyTypeObject *__pyx_ptype_5numpy_floating = 0; +static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0; +static PyTypeObject *__pyx_ptype_5numpy_flexible = 0; +static PyTypeObject *__pyx_ptype_5numpy_character = 0; static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; /* Module declarations from 'fastremap' */ @@ -2781,16 +2828,16 @@ static PyObject *contiguous = 0; static PyObject *indirect_contiguous = 0; static int __pyx_memoryview_thread_locks_used; static PyThread_type_lock __pyx_memoryview_thread_locks[8]; -static PyObject *__pyx_convert_unordered_map_to_py_uint8_t____uint8_t(std::unordered_map const &); /*proto*/ -static PyObject *__pyx_convert_unordered_map_to_py_uint16_t____uint16_t(std::unordered_map const &); /*proto*/ -static PyObject *__pyx_convert_unordered_map_to_py_uint32_t____uint32_t(std::unordered_map const &); /*proto*/ -static PyObject *__pyx_convert_unordered_map_to_py_uint64_t____uint64_t(std::unordered_map const &); /*proto*/ -static PyObject *__pyx_convert_unordered_map_to_py_int8_t____int8_t(std::unordered_map const &); /*proto*/ -static PyObject *__pyx_convert_unordered_map_to_py_int16_t____int16_t(std::unordered_map const &); /*proto*/ -static PyObject *__pyx_convert_unordered_map_to_py_int32_t____int32_t(std::unordered_map const &); /*proto*/ -static PyObject *__pyx_convert_unordered_map_to_py_int64_t____int64_t(std::unordered_map const &); /*proto*/ -static PyObject *__pyx_convert_unordered_map_to_py_float____float(std::unordered_map const &); /*proto*/ -static PyObject *__pyx_convert_unordered_map_to_py_double____double(std::unordered_map const &); /*proto*/ +static PyObject *__pyx_convert_pair_to_py_uint8_t____uint8_t(std::pair const &); /*proto*/ +static PyObject *__pyx_convert_pair_to_py_uint16_t____uint16_t(std::pair const &); /*proto*/ +static PyObject *__pyx_convert_pair_to_py_uint32_t____uint32_t(std::pair const &); /*proto*/ +static PyObject *__pyx_convert_pair_to_py_uint64_t____uint64_t(std::pair const &); /*proto*/ +static PyObject *__pyx_convert_pair_to_py_int8_t____int8_t(std::pair const &); /*proto*/ +static PyObject *__pyx_convert_pair_to_py_int16_t____int16_t(std::pair const &); /*proto*/ +static PyObject *__pyx_convert_pair_to_py_int32_t____int32_t(std::pair const &); /*proto*/ +static PyObject *__pyx_convert_pair_to_py_int64_t____int64_t(std::pair const &); /*proto*/ +static PyObject *__pyx_convert_pair_to_py_float____float(std::pair const &); /*proto*/ +static PyObject *__pyx_convert_pair_to_py_double____double(std::pair const &); /*proto*/ static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ static void *__pyx_align_pointer(void *, size_t); /*proto*/ static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/ @@ -2914,6 +2961,7 @@ static const char __pyx_k_vals[] = "vals"; static const char __pyx_k_view[] = "view"; static const char __pyx_k_ASCII[] = "ASCII"; static const char __pyx_k_accum[] = "accum"; +static const char __pyx_k_after[] = "after"; static const char __pyx_k_array[] = "array"; static const char __pyx_k_class[] = "__class__"; static const char __pyx_k_dtype[] = "dtype"; @@ -2950,6 +2998,7 @@ static const char __pyx_k_zeros[] = "zeros"; static const char __pyx_k_1_12_2[] = "1.12.2"; static const char __pyx_k_append[] = "append"; static const char __pyx_k_astype[] = "astype"; +static const char __pyx_k_before[] = "before"; static const char __pyx_k_counts[] = "counts"; static const char __pyx_k_double[] = "double"; static const char __pyx_k_encode[] = "encode"; @@ -3189,7 +3238,7 @@ static const char __pyx_k_No_matching_signature_found[] = "No matching signature static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array"; static const char __pyx_k_unique_locals_c_order_index[] = "unique..c_order_index"; static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; -static const char __pyx_k_Functions_related_to_remapping[] = "\nFunctions related to remapping image volumes.\n\nRenumber volumes into smaller data types, mask out labels\nor their complement, and remap the values of image volumes.\n\nThis module also constains the facilities for performing\nand in-place matrix transposition for up to 4D arrays. This is \nhelpful for converting between C and Fortran order in memory\nconstrained environments when format shifting.\n\nAuthor: William Silversmith\nAffiliation: Seung Lab, Princeton Neuroscience Institute\nDate: August 2018 - January 2020\n"; +static const char __pyx_k_Functions_related_to_remapping[] = "\nFunctions related to remapping image volumes.\n\nRenumber volumes into smaller data types, mask out labels\nor their complement, and remap the values of image volumes.\n\nThis module also constains the facilities for performing\nand in-place matrix transposition for up to 4D arrays. This is \nhelpful for converting between C and Fortran order in memory\nconstrained environments when format shifting.\n\nAuthor: William Silversmith\nAffiliation: Seung Lab, Princeton Neuroscience Institute\nDate: August 2018 - May 2022\n"; static const char __pyx_k_strided_and_direct_or_indirect[] = ""; static const char __pyx_k_Unsupported_dtype_Only_standard[] = "Unsupported dtype: {} Only standard floats, integers, and complex types are supported."; static const char __pyx_k_is_negative_but_unsigned_data_t[] = " is negative but unsigned data type {} is selected."; @@ -3255,6 +3304,7 @@ static PyObject *__pyx_n_s_View_MemoryView; static PyObject *__pyx_kp_s__2; static PyObject *__pyx_kp_s__3; static PyObject *__pyx_n_s_accum; +static PyObject *__pyx_n_s_after; static PyObject *__pyx_n_s_all; static PyObject *__pyx_n_s_allocate_buffer; static PyObject *__pyx_n_s_append; @@ -3269,6 +3319,7 @@ static PyObject *__pyx_n_s_asfortranarray; static PyObject *__pyx_n_s_astype; static PyObject *__pyx_n_s_axis; static PyObject *__pyx_n_s_base; +static PyObject *__pyx_n_s_before; static PyObject *__pyx_n_s_c; static PyObject *__pyx_n_u_c; static PyObject *__pyx_n_s_c_order_index; @@ -3924,6 +3975,7 @@ static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_keys = {0, &__pyx_n_s_keys, 0, 0, 0}; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_2; @@ -10475,7 +10527,7 @@ static PyObject *__pyx_fuse_0__pyx_pw_9fastremap_91_renumber(PyObject *__pyx_sel } static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int64_t __pyx_v_start, PyObject *__pyx_v_preserve_zero) { - std::unordered_map __pyx_v_remap_dict; + ska::flat_hash_map __pyx_v_remap_dict; __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; uint8_t __pyx_v_remap_id; uint8_t __pyx_v_elem; @@ -10484,6 +10536,8 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s size_t __pyx_v_size; size_t __pyx_v_i; PyObject *__pyx_v_factor = NULL; + PyObject *__pyx_8genexpr2__pyx_v_k = NULL; + PyObject *__pyx_8genexpr2__pyx_v_v = NULL; __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; __Pyx_Buffer __pyx_pybuffer_arr; PyObject *__pyx_r = NULL; @@ -10501,6 +10555,10 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s size_t __pyx_t_11; size_t __pyx_t_12; size_t __pyx_t_13; + ska::flat_hash_map ::iterator __pyx_t_14; + std::pair __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *(*__pyx_t_17)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -10516,10 +10574,10 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; /* "fastremap.pyx":186 - * cdef unordered_map[NUMBER, NUMBER] remap_dict + * cdef flat_hash_map[NUMBER, NUMBER] remap_dict * * if arr.size == 0: # <<<<<<<<<<<<<< - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) @@ -10534,9 +10592,9 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s /* "fastremap.pyx":187 * * if arr.size == 0: - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict # <<<<<<<<<<<<<< + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} # <<<<<<<<<<<<<< * - * if preserve_zero: + * remap_dict.reserve(1024) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_refit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) @@ -10603,7 +10661,7 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_convert_unordered_map_to_py_uint8_t____uint8_t(__pyx_v_remap_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -10618,25 +10676,34 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L0; /* "fastremap.pyx":186 - * cdef unordered_map[NUMBER, NUMBER] remap_dict + * cdef flat_hash_map[NUMBER, NUMBER] remap_dict * * if arr.size == 0: # <<<<<<<<<<<<<< - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} * */ } /* "fastremap.pyx":189 - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} + * + * remap_dict.reserve(1024) # <<<<<<<<<<<<<< + * + * if preserve_zero: + */ + __pyx_v_remap_dict.reserve(0x400); + + /* "fastremap.pyx":191 + * remap_dict.reserve(1024) * * if preserve_zero: # <<<<<<<<<<<<<< * remap_dict[0] = 0 * */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_preserve_zero); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_preserve_zero); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 191, __pyx_L1_error) if (__pyx_t_3) { - /* "fastremap.pyx":190 + /* "fastremap.pyx":192 * * if preserve_zero: * remap_dict[0] = 0 # <<<<<<<<<<<<<< @@ -10645,8 +10712,8 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s */ (__pyx_v_remap_dict[0]) = 0; - /* "fastremap.pyx":189 - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + /* "fastremap.pyx":191 + * remap_dict.reserve(1024) * * if preserve_zero: # <<<<<<<<<<<<<< * remap_dict[0] = 0 @@ -10654,19 +10721,19 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "fastremap.pyx":192 + /* "fastremap.pyx":194 * remap_dict[0] = 0 * * cdef NUMBER[:] arrview = arr # <<<<<<<<<<<<<< * * cdef NUMBER remap_id = start */ - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 194, __pyx_L1_error) __pyx_v_arrview = __pyx_t_8; __pyx_t_8.memview = NULL; __pyx_t_8.data = NULL; - /* "fastremap.pyx":194 + /* "fastremap.pyx":196 * cdef NUMBER[:] arrview = arr * * cdef NUMBER remap_id = start # <<<<<<<<<<<<<< @@ -10675,7 +10742,7 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s */ __pyx_v_remap_id = __pyx_v_start; - /* "fastremap.pyx":199 + /* "fastremap.pyx":201 * # some value that isn't the first value * # and won't cause an overflow * cdef NUMBER last_elem = (~arr[0]) # <<<<<<<<<<<<<< @@ -10685,7 +10752,7 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_9 = 0; __pyx_v_last_elem = ((uint8_t)(~((uint64_t)(*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_arr.diminfo[0].strides))))); - /* "fastremap.pyx":200 + /* "fastremap.pyx":202 * # and won't cause an overflow * cdef NUMBER last_elem = (~arr[0]) * cdef NUMBER last_remap_id = start # <<<<<<<<<<<<<< @@ -10694,20 +10761,20 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s */ __pyx_v_last_remap_id = __pyx_v_start; - /* "fastremap.pyx":202 + /* "fastremap.pyx":204 * cdef NUMBER last_remap_id = start * * cdef size_t size = arr.size # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_size = __pyx_t_10; - /* "fastremap.pyx":203 + /* "fastremap.pyx":205 * * cdef size_t size = arr.size * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -10716,7 +10783,7 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s */ __pyx_v_i = 0; - /* "fastremap.pyx":205 + /* "fastremap.pyx":207 * cdef size_t i = 0 * * for i in range(size): # <<<<<<<<<<<<<< @@ -10728,7 +10795,7 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; - /* "fastremap.pyx":206 + /* "fastremap.pyx":208 * * for i in range(size): * elem = arrview[i] # <<<<<<<<<<<<<< @@ -10738,7 +10805,7 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_13 = __pyx_v_i; __pyx_v_elem = (*((uint8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":208 + /* "fastremap.pyx":210 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -10748,7 +10815,7 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_3 = ((__pyx_v_elem == __pyx_v_last_elem) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":209 + /* "fastremap.pyx":211 * * if elem == last_elem: * arrview[i] = last_remap_id # <<<<<<<<<<<<<< @@ -10758,7 +10825,7 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_13 = __pyx_v_i; *((uint8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; - /* "fastremap.pyx":210 + /* "fastremap.pyx":212 * if elem == last_elem: * arrview[i] = last_remap_id * continue # <<<<<<<<<<<<<< @@ -10767,7 +10834,7 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s */ goto __pyx_L5_continue; - /* "fastremap.pyx":208 + /* "fastremap.pyx":210 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -10776,7 +10843,7 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "fastremap.pyx":212 + /* "fastremap.pyx":214 * continue * * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -10786,7 +10853,7 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_3 = ((__pyx_v_remap_dict.find(__pyx_v_elem) == __pyx_v_remap_dict.end()) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":213 + /* "fastremap.pyx":215 * * if remap_dict.find(elem) == remap_dict.end(): * arrview[i] = remap_id # <<<<<<<<<<<<<< @@ -10796,7 +10863,7 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_13 = __pyx_v_i; *((uint8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = __pyx_v_remap_id; - /* "fastremap.pyx":214 + /* "fastremap.pyx":216 * if remap_dict.find(elem) == remap_dict.end(): * arrview[i] = remap_id * remap_dict[elem] = remap_id # <<<<<<<<<<<<<< @@ -10805,7 +10872,7 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s */ (__pyx_v_remap_dict[__pyx_v_elem]) = __pyx_v_remap_id; - /* "fastremap.pyx":215 + /* "fastremap.pyx":217 * arrview[i] = remap_id * remap_dict[elem] = remap_id * remap_id += 1 # <<<<<<<<<<<<<< @@ -10814,7 +10881,7 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s */ __pyx_v_remap_id = (__pyx_v_remap_id + 1); - /* "fastremap.pyx":212 + /* "fastremap.pyx":214 * continue * * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -10824,7 +10891,7 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L8; } - /* "fastremap.pyx":217 + /* "fastremap.pyx":219 * remap_id += 1 * else: * arrview[i] = remap_dict[elem] # <<<<<<<<<<<<<< @@ -10837,7 +10904,7 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s } __pyx_L8:; - /* "fastremap.pyx":219 + /* "fastremap.pyx":221 * arrview[i] = remap_dict[elem] * * last_elem = elem # <<<<<<<<<<<<<< @@ -10846,7 +10913,7 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":220 + /* "fastremap.pyx":222 * * last_elem = elem * last_remap_id = arrview[i] # <<<<<<<<<<<<<< @@ -10858,52 +10925,52 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_L5_continue:; } - /* "fastremap.pyx":222 + /* "fastremap.pyx":224 * last_remap_id = arrview[i] * * factor = remap_id # <<<<<<<<<<<<<< * if abs(start) > abs(factor): * factor = start */ - __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_remap_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_remap_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_factor = __pyx_t_5; __pyx_t_5 = 0; - /* "fastremap.pyx":223 + /* "fastremap.pyx":225 * * factor = remap_id * if abs(start) > abs(factor): # <<<<<<<<<<<<<< * factor = start * */ - __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_v_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_v_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "fastremap.pyx":224 + /* "fastremap.pyx":226 * factor = remap_id * if abs(start) > abs(factor): * factor = start # <<<<<<<<<<<<<< * - * return refit(arr, factor), remap_dict + * return refit(arr, factor), { k:v for k,v in remap_dict } */ - __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_factor, __pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":223 + /* "fastremap.pyx":225 * * factor = remap_id * if abs(start) > abs(factor): # <<<<<<<<<<<<<< @@ -10912,15 +10979,15 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "fastremap.pyx":226 + /* "fastremap.pyx":228 * factor = start * - * return refit(arr, factor), remap_dict # <<<<<<<<<<<<<< + * return refit(arr, factor), { k:v for k,v in remap_dict } # <<<<<<<<<<<<<< * * def refit(arr, value=None, increase_only=False, exotics=False): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_refit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_refit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = NULL; __pyx_t_7 = 0; @@ -10937,7 +11004,7 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_arr), __pyx_v_factor}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -10945,13 +11012,13 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_arr), __pyx_v_factor}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL; @@ -10962,14 +11029,83 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s __Pyx_INCREF(__pyx_v_factor); __Pyx_GIVEREF(__pyx_v_factor); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_factor); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __pyx_convert_unordered_map_to_py_uint8_t____uint8_t(__pyx_v_remap_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L1_error) + { /* enter inner scope */ + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = __pyx_v_remap_dict.begin(); + for (;;) { + if (!(__pyx_t_14 != __pyx_v_remap_dict.end())) break; + __pyx_t_15 = *__pyx_t_14; + ++__pyx_t_14; + __pyx_t_6 = __pyx_convert_pair_to_py_uint8_t____uint8_t(__pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 228, __pyx_L12_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_16 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_17 = Py_TYPE(__pyx_t_16)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_1)) goto __pyx_L15_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_4 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_4)) goto __pyx_L15_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 2) < 0) __PYX_ERR(0, 228, __pyx_L12_error) + __pyx_t_17 = NULL; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L16_unpacking_done; + __pyx_L15_unpacking_failed:; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_17 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 228, __pyx_L12_error) + __pyx_L16_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_k, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_v, __pyx_t_4); + __pyx_t_4 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_8genexpr2__pyx_v_k, (PyObject*)__pyx_8genexpr2__pyx_v_v))) __PYX_ERR(0, 228, __pyx_L12_error) + } + __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_k); __pyx_8genexpr2__pyx_v_k = 0; + __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_v); __pyx_8genexpr2__pyx_v_v = 0; + goto __pyx_L17_exit_scope; + __pyx_L12_error:; + __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_k); __pyx_8genexpr2__pyx_v_k = 0; + __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_v); __pyx_8genexpr2__pyx_v_v = 0; + goto __pyx_L1_error; + __pyx_L17_exit_scope:; + } /* exit inner scope */ + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); @@ -10997,6 +11133,7 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __Pyx_XDECREF(__pyx_t_16); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -11011,6 +11148,8 @@ static PyObject *__pyx_pf_9fastremap_90_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_L2:; __PYX_XDEC_MEMVIEW(&__pyx_v_arrview, 1); __Pyx_XDECREF(__pyx_v_factor); + __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_k); + __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -11152,7 +11291,7 @@ static PyObject *__pyx_fuse_1__pyx_pw_9fastremap_93_renumber(PyObject *__pyx_sel } static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int64_t __pyx_v_start, PyObject *__pyx_v_preserve_zero) { - std::unordered_map __pyx_v_remap_dict; + ska::flat_hash_map __pyx_v_remap_dict; __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; uint16_t __pyx_v_remap_id; uint16_t __pyx_v_elem; @@ -11161,6 +11300,8 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s size_t __pyx_v_size; size_t __pyx_v_i; PyObject *__pyx_v_factor = NULL; + PyObject *__pyx_8genexpr3__pyx_v_k = NULL; + PyObject *__pyx_8genexpr3__pyx_v_v = NULL; __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; __Pyx_Buffer __pyx_pybuffer_arr; PyObject *__pyx_r = NULL; @@ -11178,6 +11319,10 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s size_t __pyx_t_11; size_t __pyx_t_12; size_t __pyx_t_13; + ska::flat_hash_map ::iterator __pyx_t_14; + std::pair __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *(*__pyx_t_17)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -11193,10 +11338,10 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; /* "fastremap.pyx":186 - * cdef unordered_map[NUMBER, NUMBER] remap_dict + * cdef flat_hash_map[NUMBER, NUMBER] remap_dict * * if arr.size == 0: # <<<<<<<<<<<<<< - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) @@ -11211,9 +11356,9 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s /* "fastremap.pyx":187 * * if arr.size == 0: - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict # <<<<<<<<<<<<<< + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} # <<<<<<<<<<<<<< * - * if preserve_zero: + * remap_dict.reserve(1024) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_refit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) @@ -11280,7 +11425,7 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_convert_unordered_map_to_py_uint16_t____uint16_t(__pyx_v_remap_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -11295,25 +11440,34 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L0; /* "fastremap.pyx":186 - * cdef unordered_map[NUMBER, NUMBER] remap_dict + * cdef flat_hash_map[NUMBER, NUMBER] remap_dict * * if arr.size == 0: # <<<<<<<<<<<<<< - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} * */ } /* "fastremap.pyx":189 - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} + * + * remap_dict.reserve(1024) # <<<<<<<<<<<<<< + * + * if preserve_zero: + */ + __pyx_v_remap_dict.reserve(0x400); + + /* "fastremap.pyx":191 + * remap_dict.reserve(1024) * * if preserve_zero: # <<<<<<<<<<<<<< * remap_dict[0] = 0 * */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_preserve_zero); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_preserve_zero); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 191, __pyx_L1_error) if (__pyx_t_3) { - /* "fastremap.pyx":190 + /* "fastremap.pyx":192 * * if preserve_zero: * remap_dict[0] = 0 # <<<<<<<<<<<<<< @@ -11322,8 +11476,8 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s */ (__pyx_v_remap_dict[0]) = 0; - /* "fastremap.pyx":189 - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + /* "fastremap.pyx":191 + * remap_dict.reserve(1024) * * if preserve_zero: # <<<<<<<<<<<<<< * remap_dict[0] = 0 @@ -11331,19 +11485,19 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "fastremap.pyx":192 + /* "fastremap.pyx":194 * remap_dict[0] = 0 * * cdef NUMBER[:] arrview = arr # <<<<<<<<<<<<<< * * cdef NUMBER remap_id = start */ - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 194, __pyx_L1_error) __pyx_v_arrview = __pyx_t_8; __pyx_t_8.memview = NULL; __pyx_t_8.data = NULL; - /* "fastremap.pyx":194 + /* "fastremap.pyx":196 * cdef NUMBER[:] arrview = arr * * cdef NUMBER remap_id = start # <<<<<<<<<<<<<< @@ -11352,7 +11506,7 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s */ __pyx_v_remap_id = __pyx_v_start; - /* "fastremap.pyx":199 + /* "fastremap.pyx":201 * # some value that isn't the first value * # and won't cause an overflow * cdef NUMBER last_elem = (~arr[0]) # <<<<<<<<<<<<<< @@ -11362,7 +11516,7 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_9 = 0; __pyx_v_last_elem = ((uint16_t)(~((uint64_t)(*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_arr.diminfo[0].strides))))); - /* "fastremap.pyx":200 + /* "fastremap.pyx":202 * # and won't cause an overflow * cdef NUMBER last_elem = (~arr[0]) * cdef NUMBER last_remap_id = start # <<<<<<<<<<<<<< @@ -11371,20 +11525,20 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s */ __pyx_v_last_remap_id = __pyx_v_start; - /* "fastremap.pyx":202 + /* "fastremap.pyx":204 * cdef NUMBER last_remap_id = start * * cdef size_t size = arr.size # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_size = __pyx_t_10; - /* "fastremap.pyx":203 + /* "fastremap.pyx":205 * * cdef size_t size = arr.size * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -11393,7 +11547,7 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s */ __pyx_v_i = 0; - /* "fastremap.pyx":205 + /* "fastremap.pyx":207 * cdef size_t i = 0 * * for i in range(size): # <<<<<<<<<<<<<< @@ -11405,7 +11559,7 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; - /* "fastremap.pyx":206 + /* "fastremap.pyx":208 * * for i in range(size): * elem = arrview[i] # <<<<<<<<<<<<<< @@ -11415,7 +11569,7 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_13 = __pyx_v_i; __pyx_v_elem = (*((uint16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":208 + /* "fastremap.pyx":210 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -11425,7 +11579,7 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_3 = ((__pyx_v_elem == __pyx_v_last_elem) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":209 + /* "fastremap.pyx":211 * * if elem == last_elem: * arrview[i] = last_remap_id # <<<<<<<<<<<<<< @@ -11435,7 +11589,7 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_13 = __pyx_v_i; *((uint16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; - /* "fastremap.pyx":210 + /* "fastremap.pyx":212 * if elem == last_elem: * arrview[i] = last_remap_id * continue # <<<<<<<<<<<<<< @@ -11444,7 +11598,7 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s */ goto __pyx_L5_continue; - /* "fastremap.pyx":208 + /* "fastremap.pyx":210 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -11453,7 +11607,7 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "fastremap.pyx":212 + /* "fastremap.pyx":214 * continue * * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -11463,7 +11617,7 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_3 = ((__pyx_v_remap_dict.find(__pyx_v_elem) == __pyx_v_remap_dict.end()) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":213 + /* "fastremap.pyx":215 * * if remap_dict.find(elem) == remap_dict.end(): * arrview[i] = remap_id # <<<<<<<<<<<<<< @@ -11473,7 +11627,7 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_13 = __pyx_v_i; *((uint16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = __pyx_v_remap_id; - /* "fastremap.pyx":214 + /* "fastremap.pyx":216 * if remap_dict.find(elem) == remap_dict.end(): * arrview[i] = remap_id * remap_dict[elem] = remap_id # <<<<<<<<<<<<<< @@ -11482,7 +11636,7 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s */ (__pyx_v_remap_dict[__pyx_v_elem]) = __pyx_v_remap_id; - /* "fastremap.pyx":215 + /* "fastremap.pyx":217 * arrview[i] = remap_id * remap_dict[elem] = remap_id * remap_id += 1 # <<<<<<<<<<<<<< @@ -11491,7 +11645,7 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s */ __pyx_v_remap_id = (__pyx_v_remap_id + 1); - /* "fastremap.pyx":212 + /* "fastremap.pyx":214 * continue * * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -11501,7 +11655,7 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L8; } - /* "fastremap.pyx":217 + /* "fastremap.pyx":219 * remap_id += 1 * else: * arrview[i] = remap_dict[elem] # <<<<<<<<<<<<<< @@ -11514,7 +11668,7 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s } __pyx_L8:; - /* "fastremap.pyx":219 + /* "fastremap.pyx":221 * arrview[i] = remap_dict[elem] * * last_elem = elem # <<<<<<<<<<<<<< @@ -11523,7 +11677,7 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":220 + /* "fastremap.pyx":222 * * last_elem = elem * last_remap_id = arrview[i] # <<<<<<<<<<<<<< @@ -11535,52 +11689,52 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_L5_continue:; } - /* "fastremap.pyx":222 + /* "fastremap.pyx":224 * last_remap_id = arrview[i] * * factor = remap_id # <<<<<<<<<<<<<< * if abs(start) > abs(factor): * factor = start */ - __pyx_t_5 = __Pyx_PyInt_From_uint16_t(__pyx_v_remap_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint16_t(__pyx_v_remap_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_factor = __pyx_t_5; __pyx_t_5 = 0; - /* "fastremap.pyx":223 + /* "fastremap.pyx":225 * * factor = remap_id * if abs(start) > abs(factor): # <<<<<<<<<<<<<< * factor = start * */ - __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_v_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_v_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "fastremap.pyx":224 + /* "fastremap.pyx":226 * factor = remap_id * if abs(start) > abs(factor): * factor = start # <<<<<<<<<<<<<< * - * return refit(arr, factor), remap_dict + * return refit(arr, factor), { k:v for k,v in remap_dict } */ - __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_factor, __pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":223 + /* "fastremap.pyx":225 * * factor = remap_id * if abs(start) > abs(factor): # <<<<<<<<<<<<<< @@ -11589,15 +11743,15 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "fastremap.pyx":226 + /* "fastremap.pyx":228 * factor = start * - * return refit(arr, factor), remap_dict # <<<<<<<<<<<<<< + * return refit(arr, factor), { k:v for k,v in remap_dict } # <<<<<<<<<<<<<< * * def refit(arr, value=None, increase_only=False, exotics=False): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_refit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_refit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = NULL; __pyx_t_7 = 0; @@ -11614,7 +11768,7 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_arr), __pyx_v_factor}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -11622,13 +11776,13 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_arr), __pyx_v_factor}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL; @@ -11639,14 +11793,83 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s __Pyx_INCREF(__pyx_v_factor); __Pyx_GIVEREF(__pyx_v_factor); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_factor); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __pyx_convert_unordered_map_to_py_uint16_t____uint16_t(__pyx_v_remap_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L1_error) + { /* enter inner scope */ + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = __pyx_v_remap_dict.begin(); + for (;;) { + if (!(__pyx_t_14 != __pyx_v_remap_dict.end())) break; + __pyx_t_15 = *__pyx_t_14; + ++__pyx_t_14; + __pyx_t_6 = __pyx_convert_pair_to_py_uint16_t____uint16_t(__pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 228, __pyx_L12_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_16 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_17 = Py_TYPE(__pyx_t_16)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_1)) goto __pyx_L15_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_4 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_4)) goto __pyx_L15_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 2) < 0) __PYX_ERR(0, 228, __pyx_L12_error) + __pyx_t_17 = NULL; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L16_unpacking_done; + __pyx_L15_unpacking_failed:; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_17 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 228, __pyx_L12_error) + __pyx_L16_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_k, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_v, __pyx_t_4); + __pyx_t_4 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_8genexpr3__pyx_v_k, (PyObject*)__pyx_8genexpr3__pyx_v_v))) __PYX_ERR(0, 228, __pyx_L12_error) + } + __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_k); __pyx_8genexpr3__pyx_v_k = 0; + __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_v); __pyx_8genexpr3__pyx_v_v = 0; + goto __pyx_L17_exit_scope; + __pyx_L12_error:; + __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_k); __pyx_8genexpr3__pyx_v_k = 0; + __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_v); __pyx_8genexpr3__pyx_v_v = 0; + goto __pyx_L1_error; + __pyx_L17_exit_scope:; + } /* exit inner scope */ + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); @@ -11674,6 +11897,7 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __Pyx_XDECREF(__pyx_t_16); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -11688,6 +11912,8 @@ static PyObject *__pyx_pf_9fastremap_92_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_L2:; __PYX_XDEC_MEMVIEW(&__pyx_v_arrview, 1); __Pyx_XDECREF(__pyx_v_factor); + __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_k); + __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -11829,7 +12055,7 @@ static PyObject *__pyx_fuse_2__pyx_pw_9fastremap_95_renumber(PyObject *__pyx_sel } static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int64_t __pyx_v_start, PyObject *__pyx_v_preserve_zero) { - std::unordered_map __pyx_v_remap_dict; + ska::flat_hash_map __pyx_v_remap_dict; __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; uint32_t __pyx_v_remap_id; uint32_t __pyx_v_elem; @@ -11838,6 +12064,8 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s size_t __pyx_v_size; size_t __pyx_v_i; PyObject *__pyx_v_factor = NULL; + PyObject *__pyx_8genexpr4__pyx_v_k = NULL; + PyObject *__pyx_8genexpr4__pyx_v_v = NULL; __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; __Pyx_Buffer __pyx_pybuffer_arr; PyObject *__pyx_r = NULL; @@ -11855,6 +12083,10 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s size_t __pyx_t_11; size_t __pyx_t_12; size_t __pyx_t_13; + ska::flat_hash_map ::iterator __pyx_t_14; + std::pair __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *(*__pyx_t_17)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -11870,10 +12102,10 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; /* "fastremap.pyx":186 - * cdef unordered_map[NUMBER, NUMBER] remap_dict + * cdef flat_hash_map[NUMBER, NUMBER] remap_dict * * if arr.size == 0: # <<<<<<<<<<<<<< - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) @@ -11888,9 +12120,9 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s /* "fastremap.pyx":187 * * if arr.size == 0: - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict # <<<<<<<<<<<<<< + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} # <<<<<<<<<<<<<< * - * if preserve_zero: + * remap_dict.reserve(1024) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_refit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) @@ -11957,7 +12189,7 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_convert_unordered_map_to_py_uint32_t____uint32_t(__pyx_v_remap_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -11972,25 +12204,34 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L0; /* "fastremap.pyx":186 - * cdef unordered_map[NUMBER, NUMBER] remap_dict + * cdef flat_hash_map[NUMBER, NUMBER] remap_dict * * if arr.size == 0: # <<<<<<<<<<<<<< - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} * */ } /* "fastremap.pyx":189 - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} + * + * remap_dict.reserve(1024) # <<<<<<<<<<<<<< + * + * if preserve_zero: + */ + __pyx_v_remap_dict.reserve(0x400); + + /* "fastremap.pyx":191 + * remap_dict.reserve(1024) * * if preserve_zero: # <<<<<<<<<<<<<< * remap_dict[0] = 0 * */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_preserve_zero); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_preserve_zero); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 191, __pyx_L1_error) if (__pyx_t_3) { - /* "fastremap.pyx":190 + /* "fastremap.pyx":192 * * if preserve_zero: * remap_dict[0] = 0 # <<<<<<<<<<<<<< @@ -11999,8 +12240,8 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s */ (__pyx_v_remap_dict[0]) = 0; - /* "fastremap.pyx":189 - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + /* "fastremap.pyx":191 + * remap_dict.reserve(1024) * * if preserve_zero: # <<<<<<<<<<<<<< * remap_dict[0] = 0 @@ -12008,19 +12249,19 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "fastremap.pyx":192 + /* "fastremap.pyx":194 * remap_dict[0] = 0 * * cdef NUMBER[:] arrview = arr # <<<<<<<<<<<<<< * * cdef NUMBER remap_id = start */ - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 194, __pyx_L1_error) __pyx_v_arrview = __pyx_t_8; __pyx_t_8.memview = NULL; __pyx_t_8.data = NULL; - /* "fastremap.pyx":194 + /* "fastremap.pyx":196 * cdef NUMBER[:] arrview = arr * * cdef NUMBER remap_id = start # <<<<<<<<<<<<<< @@ -12029,7 +12270,7 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s */ __pyx_v_remap_id = __pyx_v_start; - /* "fastremap.pyx":199 + /* "fastremap.pyx":201 * # some value that isn't the first value * # and won't cause an overflow * cdef NUMBER last_elem = (~arr[0]) # <<<<<<<<<<<<<< @@ -12039,7 +12280,7 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_9 = 0; __pyx_v_last_elem = ((uint32_t)(~((uint64_t)(*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_arr.diminfo[0].strides))))); - /* "fastremap.pyx":200 + /* "fastremap.pyx":202 * # and won't cause an overflow * cdef NUMBER last_elem = (~arr[0]) * cdef NUMBER last_remap_id = start # <<<<<<<<<<<<<< @@ -12048,20 +12289,20 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s */ __pyx_v_last_remap_id = __pyx_v_start; - /* "fastremap.pyx":202 + /* "fastremap.pyx":204 * cdef NUMBER last_remap_id = start * * cdef size_t size = arr.size # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_size = __pyx_t_10; - /* "fastremap.pyx":203 + /* "fastremap.pyx":205 * * cdef size_t size = arr.size * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -12070,7 +12311,7 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s */ __pyx_v_i = 0; - /* "fastremap.pyx":205 + /* "fastremap.pyx":207 * cdef size_t i = 0 * * for i in range(size): # <<<<<<<<<<<<<< @@ -12082,7 +12323,7 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; - /* "fastremap.pyx":206 + /* "fastremap.pyx":208 * * for i in range(size): * elem = arrview[i] # <<<<<<<<<<<<<< @@ -12092,7 +12333,7 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_13 = __pyx_v_i; __pyx_v_elem = (*((uint32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":208 + /* "fastremap.pyx":210 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -12102,7 +12343,7 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_3 = ((__pyx_v_elem == __pyx_v_last_elem) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":209 + /* "fastremap.pyx":211 * * if elem == last_elem: * arrview[i] = last_remap_id # <<<<<<<<<<<<<< @@ -12112,7 +12353,7 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_13 = __pyx_v_i; *((uint32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; - /* "fastremap.pyx":210 + /* "fastremap.pyx":212 * if elem == last_elem: * arrview[i] = last_remap_id * continue # <<<<<<<<<<<<<< @@ -12121,7 +12362,7 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s */ goto __pyx_L5_continue; - /* "fastremap.pyx":208 + /* "fastremap.pyx":210 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -12130,7 +12371,7 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "fastremap.pyx":212 + /* "fastremap.pyx":214 * continue * * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -12140,7 +12381,7 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_3 = ((__pyx_v_remap_dict.find(__pyx_v_elem) == __pyx_v_remap_dict.end()) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":213 + /* "fastremap.pyx":215 * * if remap_dict.find(elem) == remap_dict.end(): * arrview[i] = remap_id # <<<<<<<<<<<<<< @@ -12150,7 +12391,7 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_13 = __pyx_v_i; *((uint32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = __pyx_v_remap_id; - /* "fastremap.pyx":214 + /* "fastremap.pyx":216 * if remap_dict.find(elem) == remap_dict.end(): * arrview[i] = remap_id * remap_dict[elem] = remap_id # <<<<<<<<<<<<<< @@ -12159,7 +12400,7 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s */ (__pyx_v_remap_dict[__pyx_v_elem]) = __pyx_v_remap_id; - /* "fastremap.pyx":215 + /* "fastremap.pyx":217 * arrview[i] = remap_id * remap_dict[elem] = remap_id * remap_id += 1 # <<<<<<<<<<<<<< @@ -12168,7 +12409,7 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s */ __pyx_v_remap_id = (__pyx_v_remap_id + 1); - /* "fastremap.pyx":212 + /* "fastremap.pyx":214 * continue * * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -12178,7 +12419,7 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L8; } - /* "fastremap.pyx":217 + /* "fastremap.pyx":219 * remap_id += 1 * else: * arrview[i] = remap_dict[elem] # <<<<<<<<<<<<<< @@ -12191,7 +12432,7 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s } __pyx_L8:; - /* "fastremap.pyx":219 + /* "fastremap.pyx":221 * arrview[i] = remap_dict[elem] * * last_elem = elem # <<<<<<<<<<<<<< @@ -12200,7 +12441,7 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":220 + /* "fastremap.pyx":222 * * last_elem = elem * last_remap_id = arrview[i] # <<<<<<<<<<<<<< @@ -12212,52 +12453,52 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_L5_continue:; } - /* "fastremap.pyx":222 + /* "fastremap.pyx":224 * last_remap_id = arrview[i] * * factor = remap_id # <<<<<<<<<<<<<< * if abs(start) > abs(factor): * factor = start */ - __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_remap_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_remap_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_factor = __pyx_t_5; __pyx_t_5 = 0; - /* "fastremap.pyx":223 + /* "fastremap.pyx":225 * * factor = remap_id * if abs(start) > abs(factor): # <<<<<<<<<<<<<< * factor = start * */ - __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_v_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_v_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "fastremap.pyx":224 + /* "fastremap.pyx":226 * factor = remap_id * if abs(start) > abs(factor): * factor = start # <<<<<<<<<<<<<< * - * return refit(arr, factor), remap_dict + * return refit(arr, factor), { k:v for k,v in remap_dict } */ - __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_factor, __pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":223 + /* "fastremap.pyx":225 * * factor = remap_id * if abs(start) > abs(factor): # <<<<<<<<<<<<<< @@ -12266,15 +12507,15 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "fastremap.pyx":226 + /* "fastremap.pyx":228 * factor = start * - * return refit(arr, factor), remap_dict # <<<<<<<<<<<<<< + * return refit(arr, factor), { k:v for k,v in remap_dict } # <<<<<<<<<<<<<< * * def refit(arr, value=None, increase_only=False, exotics=False): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_refit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_refit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = NULL; __pyx_t_7 = 0; @@ -12291,7 +12532,7 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_arr), __pyx_v_factor}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -12299,13 +12540,13 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_arr), __pyx_v_factor}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL; @@ -12316,14 +12557,83 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s __Pyx_INCREF(__pyx_v_factor); __Pyx_GIVEREF(__pyx_v_factor); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_factor); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __pyx_convert_unordered_map_to_py_uint32_t____uint32_t(__pyx_v_remap_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L1_error) + { /* enter inner scope */ + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = __pyx_v_remap_dict.begin(); + for (;;) { + if (!(__pyx_t_14 != __pyx_v_remap_dict.end())) break; + __pyx_t_15 = *__pyx_t_14; + ++__pyx_t_14; + __pyx_t_6 = __pyx_convert_pair_to_py_uint32_t____uint32_t(__pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 228, __pyx_L12_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_16 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_17 = Py_TYPE(__pyx_t_16)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_1)) goto __pyx_L15_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_4 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_4)) goto __pyx_L15_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 2) < 0) __PYX_ERR(0, 228, __pyx_L12_error) + __pyx_t_17 = NULL; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L16_unpacking_done; + __pyx_L15_unpacking_failed:; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_17 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 228, __pyx_L12_error) + __pyx_L16_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_k, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_v, __pyx_t_4); + __pyx_t_4 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_8genexpr4__pyx_v_k, (PyObject*)__pyx_8genexpr4__pyx_v_v))) __PYX_ERR(0, 228, __pyx_L12_error) + } + __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_k); __pyx_8genexpr4__pyx_v_k = 0; + __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_v); __pyx_8genexpr4__pyx_v_v = 0; + goto __pyx_L17_exit_scope; + __pyx_L12_error:; + __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_k); __pyx_8genexpr4__pyx_v_k = 0; + __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_v); __pyx_8genexpr4__pyx_v_v = 0; + goto __pyx_L1_error; + __pyx_L17_exit_scope:; + } /* exit inner scope */ + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); @@ -12351,6 +12661,7 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __Pyx_XDECREF(__pyx_t_16); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -12365,6 +12676,8 @@ static PyObject *__pyx_pf_9fastremap_94_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_L2:; __PYX_XDEC_MEMVIEW(&__pyx_v_arrview, 1); __Pyx_XDECREF(__pyx_v_factor); + __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_k); + __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -12506,7 +12819,7 @@ static PyObject *__pyx_fuse_3__pyx_pw_9fastremap_97_renumber(PyObject *__pyx_sel } static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int64_t __pyx_v_start, PyObject *__pyx_v_preserve_zero) { - std::unordered_map __pyx_v_remap_dict; + ska::flat_hash_map __pyx_v_remap_dict; __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; uint64_t __pyx_v_remap_id; uint64_t __pyx_v_elem; @@ -12515,6 +12828,8 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s size_t __pyx_v_size; size_t __pyx_v_i; PyObject *__pyx_v_factor = NULL; + PyObject *__pyx_8genexpr5__pyx_v_k = NULL; + PyObject *__pyx_8genexpr5__pyx_v_v = NULL; __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; __Pyx_Buffer __pyx_pybuffer_arr; PyObject *__pyx_r = NULL; @@ -12532,6 +12847,10 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s size_t __pyx_t_11; size_t __pyx_t_12; size_t __pyx_t_13; + ska::flat_hash_map ::iterator __pyx_t_14; + std::pair __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *(*__pyx_t_17)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -12547,10 +12866,10 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; /* "fastremap.pyx":186 - * cdef unordered_map[NUMBER, NUMBER] remap_dict + * cdef flat_hash_map[NUMBER, NUMBER] remap_dict * * if arr.size == 0: # <<<<<<<<<<<<<< - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) @@ -12565,9 +12884,9 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s /* "fastremap.pyx":187 * * if arr.size == 0: - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict # <<<<<<<<<<<<<< + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} # <<<<<<<<<<<<<< * - * if preserve_zero: + * remap_dict.reserve(1024) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_refit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) @@ -12634,7 +12953,7 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_convert_unordered_map_to_py_uint64_t____uint64_t(__pyx_v_remap_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -12649,25 +12968,34 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L0; /* "fastremap.pyx":186 - * cdef unordered_map[NUMBER, NUMBER] remap_dict + * cdef flat_hash_map[NUMBER, NUMBER] remap_dict * * if arr.size == 0: # <<<<<<<<<<<<<< - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} * */ } /* "fastremap.pyx":189 - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} + * + * remap_dict.reserve(1024) # <<<<<<<<<<<<<< + * + * if preserve_zero: + */ + __pyx_v_remap_dict.reserve(0x400); + + /* "fastremap.pyx":191 + * remap_dict.reserve(1024) * * if preserve_zero: # <<<<<<<<<<<<<< * remap_dict[0] = 0 * */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_preserve_zero); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_preserve_zero); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 191, __pyx_L1_error) if (__pyx_t_3) { - /* "fastremap.pyx":190 + /* "fastremap.pyx":192 * * if preserve_zero: * remap_dict[0] = 0 # <<<<<<<<<<<<<< @@ -12676,8 +13004,8 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s */ (__pyx_v_remap_dict[0]) = 0; - /* "fastremap.pyx":189 - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + /* "fastremap.pyx":191 + * remap_dict.reserve(1024) * * if preserve_zero: # <<<<<<<<<<<<<< * remap_dict[0] = 0 @@ -12685,19 +13013,19 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "fastremap.pyx":192 + /* "fastremap.pyx":194 * remap_dict[0] = 0 * * cdef NUMBER[:] arrview = arr # <<<<<<<<<<<<<< * * cdef NUMBER remap_id = start */ - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 194, __pyx_L1_error) __pyx_v_arrview = __pyx_t_8; __pyx_t_8.memview = NULL; __pyx_t_8.data = NULL; - /* "fastremap.pyx":194 + /* "fastremap.pyx":196 * cdef NUMBER[:] arrview = arr * * cdef NUMBER remap_id = start # <<<<<<<<<<<<<< @@ -12706,7 +13034,7 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s */ __pyx_v_remap_id = __pyx_v_start; - /* "fastremap.pyx":199 + /* "fastremap.pyx":201 * # some value that isn't the first value * # and won't cause an overflow * cdef NUMBER last_elem = (~arr[0]) # <<<<<<<<<<<<<< @@ -12716,7 +13044,7 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_9 = 0; __pyx_v_last_elem = ((uint64_t)(~((uint64_t)(*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_arr.diminfo[0].strides))))); - /* "fastremap.pyx":200 + /* "fastremap.pyx":202 * # and won't cause an overflow * cdef NUMBER last_elem = (~arr[0]) * cdef NUMBER last_remap_id = start # <<<<<<<<<<<<<< @@ -12725,20 +13053,20 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s */ __pyx_v_last_remap_id = __pyx_v_start; - /* "fastremap.pyx":202 + /* "fastremap.pyx":204 * cdef NUMBER last_remap_id = start * * cdef size_t size = arr.size # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_size = __pyx_t_10; - /* "fastremap.pyx":203 + /* "fastremap.pyx":205 * * cdef size_t size = arr.size * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -12747,7 +13075,7 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s */ __pyx_v_i = 0; - /* "fastremap.pyx":205 + /* "fastremap.pyx":207 * cdef size_t i = 0 * * for i in range(size): # <<<<<<<<<<<<<< @@ -12759,7 +13087,7 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; - /* "fastremap.pyx":206 + /* "fastremap.pyx":208 * * for i in range(size): * elem = arrview[i] # <<<<<<<<<<<<<< @@ -12769,7 +13097,7 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_13 = __pyx_v_i; __pyx_v_elem = (*((uint64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":208 + /* "fastremap.pyx":210 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -12779,7 +13107,7 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_3 = ((__pyx_v_elem == __pyx_v_last_elem) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":209 + /* "fastremap.pyx":211 * * if elem == last_elem: * arrview[i] = last_remap_id # <<<<<<<<<<<<<< @@ -12789,7 +13117,7 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_13 = __pyx_v_i; *((uint64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; - /* "fastremap.pyx":210 + /* "fastremap.pyx":212 * if elem == last_elem: * arrview[i] = last_remap_id * continue # <<<<<<<<<<<<<< @@ -12798,7 +13126,7 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s */ goto __pyx_L5_continue; - /* "fastremap.pyx":208 + /* "fastremap.pyx":210 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -12807,7 +13135,7 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "fastremap.pyx":212 + /* "fastremap.pyx":214 * continue * * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -12817,7 +13145,7 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_3 = ((__pyx_v_remap_dict.find(__pyx_v_elem) == __pyx_v_remap_dict.end()) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":213 + /* "fastremap.pyx":215 * * if remap_dict.find(elem) == remap_dict.end(): * arrview[i] = remap_id # <<<<<<<<<<<<<< @@ -12827,7 +13155,7 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_13 = __pyx_v_i; *((uint64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = __pyx_v_remap_id; - /* "fastremap.pyx":214 + /* "fastremap.pyx":216 * if remap_dict.find(elem) == remap_dict.end(): * arrview[i] = remap_id * remap_dict[elem] = remap_id # <<<<<<<<<<<<<< @@ -12836,7 +13164,7 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s */ (__pyx_v_remap_dict[__pyx_v_elem]) = __pyx_v_remap_id; - /* "fastremap.pyx":215 + /* "fastremap.pyx":217 * arrview[i] = remap_id * remap_dict[elem] = remap_id * remap_id += 1 # <<<<<<<<<<<<<< @@ -12845,7 +13173,7 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s */ __pyx_v_remap_id = (__pyx_v_remap_id + 1); - /* "fastremap.pyx":212 + /* "fastremap.pyx":214 * continue * * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -12855,7 +13183,7 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L8; } - /* "fastremap.pyx":217 + /* "fastremap.pyx":219 * remap_id += 1 * else: * arrview[i] = remap_dict[elem] # <<<<<<<<<<<<<< @@ -12868,7 +13196,7 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s } __pyx_L8:; - /* "fastremap.pyx":219 + /* "fastremap.pyx":221 * arrview[i] = remap_dict[elem] * * last_elem = elem # <<<<<<<<<<<<<< @@ -12877,7 +13205,7 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":220 + /* "fastremap.pyx":222 * * last_elem = elem * last_remap_id = arrview[i] # <<<<<<<<<<<<<< @@ -12889,52 +13217,52 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_L5_continue:; } - /* "fastremap.pyx":222 + /* "fastremap.pyx":224 * last_remap_id = arrview[i] * * factor = remap_id # <<<<<<<<<<<<<< * if abs(start) > abs(factor): * factor = start */ - __pyx_t_5 = __Pyx_PyInt_From_uint64_t(__pyx_v_remap_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint64_t(__pyx_v_remap_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_factor = __pyx_t_5; __pyx_t_5 = 0; - /* "fastremap.pyx":223 + /* "fastremap.pyx":225 * * factor = remap_id * if abs(start) > abs(factor): # <<<<<<<<<<<<<< * factor = start * */ - __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_v_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_v_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "fastremap.pyx":224 + /* "fastremap.pyx":226 * factor = remap_id * if abs(start) > abs(factor): * factor = start # <<<<<<<<<<<<<< * - * return refit(arr, factor), remap_dict + * return refit(arr, factor), { k:v for k,v in remap_dict } */ - __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_factor, __pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":223 + /* "fastremap.pyx":225 * * factor = remap_id * if abs(start) > abs(factor): # <<<<<<<<<<<<<< @@ -12943,15 +13271,15 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "fastremap.pyx":226 + /* "fastremap.pyx":228 * factor = start * - * return refit(arr, factor), remap_dict # <<<<<<<<<<<<<< + * return refit(arr, factor), { k:v for k,v in remap_dict } # <<<<<<<<<<<<<< * * def refit(arr, value=None, increase_only=False, exotics=False): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_refit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_refit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = NULL; __pyx_t_7 = 0; @@ -12968,7 +13296,7 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_arr), __pyx_v_factor}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -12976,13 +13304,13 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_arr), __pyx_v_factor}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL; @@ -12993,14 +13321,83 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s __Pyx_INCREF(__pyx_v_factor); __Pyx_GIVEREF(__pyx_v_factor); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_factor); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __pyx_convert_unordered_map_to_py_uint64_t____uint64_t(__pyx_v_remap_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L1_error) + { /* enter inner scope */ + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = __pyx_v_remap_dict.begin(); + for (;;) { + if (!(__pyx_t_14 != __pyx_v_remap_dict.end())) break; + __pyx_t_15 = *__pyx_t_14; + ++__pyx_t_14; + __pyx_t_6 = __pyx_convert_pair_to_py_uint64_t____uint64_t(__pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 228, __pyx_L12_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_16 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_17 = Py_TYPE(__pyx_t_16)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_1)) goto __pyx_L15_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_4 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_4)) goto __pyx_L15_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 2) < 0) __PYX_ERR(0, 228, __pyx_L12_error) + __pyx_t_17 = NULL; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L16_unpacking_done; + __pyx_L15_unpacking_failed:; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_17 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 228, __pyx_L12_error) + __pyx_L16_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_k, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_v, __pyx_t_4); + __pyx_t_4 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_8genexpr5__pyx_v_k, (PyObject*)__pyx_8genexpr5__pyx_v_v))) __PYX_ERR(0, 228, __pyx_L12_error) + } + __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_k); __pyx_8genexpr5__pyx_v_k = 0; + __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_v); __pyx_8genexpr5__pyx_v_v = 0; + goto __pyx_L17_exit_scope; + __pyx_L12_error:; + __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_k); __pyx_8genexpr5__pyx_v_k = 0; + __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_v); __pyx_8genexpr5__pyx_v_v = 0; + goto __pyx_L1_error; + __pyx_L17_exit_scope:; + } /* exit inner scope */ + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); @@ -13028,6 +13425,7 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __Pyx_XDECREF(__pyx_t_16); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -13042,6 +13440,8 @@ static PyObject *__pyx_pf_9fastremap_96_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_L2:; __PYX_XDEC_MEMVIEW(&__pyx_v_arrview, 1); __Pyx_XDECREF(__pyx_v_factor); + __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_k); + __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -13183,7 +13583,7 @@ static PyObject *__pyx_fuse_4__pyx_pw_9fastremap_99_renumber(PyObject *__pyx_sel } static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int64_t __pyx_v_start, PyObject *__pyx_v_preserve_zero) { - std::unordered_map __pyx_v_remap_dict; + ska::flat_hash_map __pyx_v_remap_dict; __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; int8_t __pyx_v_remap_id; int8_t __pyx_v_elem; @@ -13192,6 +13592,8 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s size_t __pyx_v_size; size_t __pyx_v_i; PyObject *__pyx_v_factor = NULL; + PyObject *__pyx_8genexpr6__pyx_v_k = NULL; + PyObject *__pyx_8genexpr6__pyx_v_v = NULL; __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; __Pyx_Buffer __pyx_pybuffer_arr; PyObject *__pyx_r = NULL; @@ -13209,6 +13611,10 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s size_t __pyx_t_11; size_t __pyx_t_12; size_t __pyx_t_13; + ska::flat_hash_map ::iterator __pyx_t_14; + std::pair __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *(*__pyx_t_17)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -13224,10 +13630,10 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; /* "fastremap.pyx":186 - * cdef unordered_map[NUMBER, NUMBER] remap_dict + * cdef flat_hash_map[NUMBER, NUMBER] remap_dict * * if arr.size == 0: # <<<<<<<<<<<<<< - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) @@ -13242,9 +13648,9 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s /* "fastremap.pyx":187 * * if arr.size == 0: - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict # <<<<<<<<<<<<<< + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} # <<<<<<<<<<<<<< * - * if preserve_zero: + * remap_dict.reserve(1024) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_refit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) @@ -13311,7 +13717,7 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_convert_unordered_map_to_py_int8_t____int8_t(__pyx_v_remap_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -13326,25 +13732,34 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L0; /* "fastremap.pyx":186 - * cdef unordered_map[NUMBER, NUMBER] remap_dict + * cdef flat_hash_map[NUMBER, NUMBER] remap_dict * * if arr.size == 0: # <<<<<<<<<<<<<< - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} * */ } /* "fastremap.pyx":189 - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} + * + * remap_dict.reserve(1024) # <<<<<<<<<<<<<< + * + * if preserve_zero: + */ + __pyx_v_remap_dict.reserve(0x400); + + /* "fastremap.pyx":191 + * remap_dict.reserve(1024) * * if preserve_zero: # <<<<<<<<<<<<<< * remap_dict[0] = 0 * */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_preserve_zero); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_preserve_zero); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 191, __pyx_L1_error) if (__pyx_t_3) { - /* "fastremap.pyx":190 + /* "fastremap.pyx":192 * * if preserve_zero: * remap_dict[0] = 0 # <<<<<<<<<<<<<< @@ -13353,8 +13768,8 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s */ (__pyx_v_remap_dict[0]) = 0; - /* "fastremap.pyx":189 - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + /* "fastremap.pyx":191 + * remap_dict.reserve(1024) * * if preserve_zero: # <<<<<<<<<<<<<< * remap_dict[0] = 0 @@ -13362,19 +13777,19 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "fastremap.pyx":192 + /* "fastremap.pyx":194 * remap_dict[0] = 0 * * cdef NUMBER[:] arrview = arr # <<<<<<<<<<<<<< * * cdef NUMBER remap_id = start */ - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 194, __pyx_L1_error) __pyx_v_arrview = __pyx_t_8; __pyx_t_8.memview = NULL; __pyx_t_8.data = NULL; - /* "fastremap.pyx":194 + /* "fastremap.pyx":196 * cdef NUMBER[:] arrview = arr * * cdef NUMBER remap_id = start # <<<<<<<<<<<<<< @@ -13383,7 +13798,7 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s */ __pyx_v_remap_id = __pyx_v_start; - /* "fastremap.pyx":199 + /* "fastremap.pyx":201 * # some value that isn't the first value * # and won't cause an overflow * cdef NUMBER last_elem = (~arr[0]) # <<<<<<<<<<<<<< @@ -13393,7 +13808,7 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_9 = 0; __pyx_v_last_elem = ((int8_t)(~((uint64_t)(*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_arr.diminfo[0].strides))))); - /* "fastremap.pyx":200 + /* "fastremap.pyx":202 * # and won't cause an overflow * cdef NUMBER last_elem = (~arr[0]) * cdef NUMBER last_remap_id = start # <<<<<<<<<<<<<< @@ -13402,20 +13817,20 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s */ __pyx_v_last_remap_id = __pyx_v_start; - /* "fastremap.pyx":202 + /* "fastremap.pyx":204 * cdef NUMBER last_remap_id = start * * cdef size_t size = arr.size # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_size = __pyx_t_10; - /* "fastremap.pyx":203 + /* "fastremap.pyx":205 * * cdef size_t size = arr.size * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -13424,7 +13839,7 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s */ __pyx_v_i = 0; - /* "fastremap.pyx":205 + /* "fastremap.pyx":207 * cdef size_t i = 0 * * for i in range(size): # <<<<<<<<<<<<<< @@ -13436,7 +13851,7 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; - /* "fastremap.pyx":206 + /* "fastremap.pyx":208 * * for i in range(size): * elem = arrview[i] # <<<<<<<<<<<<<< @@ -13446,7 +13861,7 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_13 = __pyx_v_i; __pyx_v_elem = (*((int8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":208 + /* "fastremap.pyx":210 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -13456,7 +13871,7 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_3 = ((__pyx_v_elem == __pyx_v_last_elem) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":209 + /* "fastremap.pyx":211 * * if elem == last_elem: * arrview[i] = last_remap_id # <<<<<<<<<<<<<< @@ -13466,7 +13881,7 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_13 = __pyx_v_i; *((int8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; - /* "fastremap.pyx":210 + /* "fastremap.pyx":212 * if elem == last_elem: * arrview[i] = last_remap_id * continue # <<<<<<<<<<<<<< @@ -13475,7 +13890,7 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s */ goto __pyx_L5_continue; - /* "fastremap.pyx":208 + /* "fastremap.pyx":210 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -13484,7 +13899,7 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "fastremap.pyx":212 + /* "fastremap.pyx":214 * continue * * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -13494,7 +13909,7 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_3 = ((__pyx_v_remap_dict.find(__pyx_v_elem) == __pyx_v_remap_dict.end()) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":213 + /* "fastremap.pyx":215 * * if remap_dict.find(elem) == remap_dict.end(): * arrview[i] = remap_id # <<<<<<<<<<<<<< @@ -13504,7 +13919,7 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_13 = __pyx_v_i; *((int8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = __pyx_v_remap_id; - /* "fastremap.pyx":214 + /* "fastremap.pyx":216 * if remap_dict.find(elem) == remap_dict.end(): * arrview[i] = remap_id * remap_dict[elem] = remap_id # <<<<<<<<<<<<<< @@ -13513,7 +13928,7 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s */ (__pyx_v_remap_dict[__pyx_v_elem]) = __pyx_v_remap_id; - /* "fastremap.pyx":215 + /* "fastremap.pyx":217 * arrview[i] = remap_id * remap_dict[elem] = remap_id * remap_id += 1 # <<<<<<<<<<<<<< @@ -13522,7 +13937,7 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s */ __pyx_v_remap_id = (__pyx_v_remap_id + 1); - /* "fastremap.pyx":212 + /* "fastremap.pyx":214 * continue * * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -13532,7 +13947,7 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L8; } - /* "fastremap.pyx":217 + /* "fastremap.pyx":219 * remap_id += 1 * else: * arrview[i] = remap_dict[elem] # <<<<<<<<<<<<<< @@ -13545,7 +13960,7 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s } __pyx_L8:; - /* "fastremap.pyx":219 + /* "fastremap.pyx":221 * arrview[i] = remap_dict[elem] * * last_elem = elem # <<<<<<<<<<<<<< @@ -13554,7 +13969,7 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":220 + /* "fastremap.pyx":222 * * last_elem = elem * last_remap_id = arrview[i] # <<<<<<<<<<<<<< @@ -13566,52 +13981,52 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_L5_continue:; } - /* "fastremap.pyx":222 + /* "fastremap.pyx":224 * last_remap_id = arrview[i] * * factor = remap_id # <<<<<<<<<<<<<< * if abs(start) > abs(factor): * factor = start */ - __pyx_t_5 = __Pyx_PyInt_From_int8_t(__pyx_v_remap_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int8_t(__pyx_v_remap_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_factor = __pyx_t_5; __pyx_t_5 = 0; - /* "fastremap.pyx":223 + /* "fastremap.pyx":225 * * factor = remap_id * if abs(start) > abs(factor): # <<<<<<<<<<<<<< * factor = start * */ - __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_v_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_v_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "fastremap.pyx":224 + /* "fastremap.pyx":226 * factor = remap_id * if abs(start) > abs(factor): * factor = start # <<<<<<<<<<<<<< * - * return refit(arr, factor), remap_dict + * return refit(arr, factor), { k:v for k,v in remap_dict } */ - __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_factor, __pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":223 + /* "fastremap.pyx":225 * * factor = remap_id * if abs(start) > abs(factor): # <<<<<<<<<<<<<< @@ -13620,15 +14035,15 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "fastremap.pyx":226 + /* "fastremap.pyx":228 * factor = start * - * return refit(arr, factor), remap_dict # <<<<<<<<<<<<<< + * return refit(arr, factor), { k:v for k,v in remap_dict } # <<<<<<<<<<<<<< * * def refit(arr, value=None, increase_only=False, exotics=False): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_refit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_refit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = NULL; __pyx_t_7 = 0; @@ -13645,7 +14060,7 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_arr), __pyx_v_factor}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -13653,13 +14068,13 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_arr), __pyx_v_factor}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL; @@ -13670,14 +14085,83 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s __Pyx_INCREF(__pyx_v_factor); __Pyx_GIVEREF(__pyx_v_factor); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_factor); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __pyx_convert_unordered_map_to_py_int8_t____int8_t(__pyx_v_remap_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L1_error) + { /* enter inner scope */ + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = __pyx_v_remap_dict.begin(); + for (;;) { + if (!(__pyx_t_14 != __pyx_v_remap_dict.end())) break; + __pyx_t_15 = *__pyx_t_14; + ++__pyx_t_14; + __pyx_t_6 = __pyx_convert_pair_to_py_int8_t____int8_t(__pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 228, __pyx_L12_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_16 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_17 = Py_TYPE(__pyx_t_16)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_1)) goto __pyx_L15_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_4 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_4)) goto __pyx_L15_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 2) < 0) __PYX_ERR(0, 228, __pyx_L12_error) + __pyx_t_17 = NULL; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L16_unpacking_done; + __pyx_L15_unpacking_failed:; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_17 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 228, __pyx_L12_error) + __pyx_L16_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_k, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_v, __pyx_t_4); + __pyx_t_4 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_8genexpr6__pyx_v_k, (PyObject*)__pyx_8genexpr6__pyx_v_v))) __PYX_ERR(0, 228, __pyx_L12_error) + } + __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_k); __pyx_8genexpr6__pyx_v_k = 0; + __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_v); __pyx_8genexpr6__pyx_v_v = 0; + goto __pyx_L17_exit_scope; + __pyx_L12_error:; + __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_k); __pyx_8genexpr6__pyx_v_k = 0; + __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_v); __pyx_8genexpr6__pyx_v_v = 0; + goto __pyx_L1_error; + __pyx_L17_exit_scope:; + } /* exit inner scope */ + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); @@ -13705,6 +14189,7 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __Pyx_XDECREF(__pyx_t_16); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -13719,6 +14204,8 @@ static PyObject *__pyx_pf_9fastremap_98_renumber(CYTHON_UNUSED PyObject *__pyx_s __pyx_L2:; __PYX_XDEC_MEMVIEW(&__pyx_v_arrview, 1); __Pyx_XDECREF(__pyx_v_factor); + __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_k); + __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -13860,7 +14347,7 @@ static PyObject *__pyx_fuse_5__pyx_pw_9fastremap_101_renumber(PyObject *__pyx_se } static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int64_t __pyx_v_start, PyObject *__pyx_v_preserve_zero) { - std::unordered_map __pyx_v_remap_dict; + ska::flat_hash_map __pyx_v_remap_dict; __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; int16_t __pyx_v_remap_id; int16_t __pyx_v_elem; @@ -13869,6 +14356,8 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ size_t __pyx_v_size; size_t __pyx_v_i; PyObject *__pyx_v_factor = NULL; + PyObject *__pyx_8genexpr7__pyx_v_k = NULL; + PyObject *__pyx_8genexpr7__pyx_v_v = NULL; __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; __Pyx_Buffer __pyx_pybuffer_arr; PyObject *__pyx_r = NULL; @@ -13886,6 +14375,10 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ size_t __pyx_t_11; size_t __pyx_t_12; size_t __pyx_t_13; + ska::flat_hash_map ::iterator __pyx_t_14; + std::pair __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *(*__pyx_t_17)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -13901,10 +14394,10 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; /* "fastremap.pyx":186 - * cdef unordered_map[NUMBER, NUMBER] remap_dict + * cdef flat_hash_map[NUMBER, NUMBER] remap_dict * * if arr.size == 0: # <<<<<<<<<<<<<< - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) @@ -13919,9 +14412,9 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ /* "fastremap.pyx":187 * * if arr.size == 0: - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict # <<<<<<<<<<<<<< + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} # <<<<<<<<<<<<<< * - * if preserve_zero: + * remap_dict.reserve(1024) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_refit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) @@ -13988,7 +14481,7 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_convert_unordered_map_to_py_int16_t____int16_t(__pyx_v_remap_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -14003,25 +14496,34 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ goto __pyx_L0; /* "fastremap.pyx":186 - * cdef unordered_map[NUMBER, NUMBER] remap_dict + * cdef flat_hash_map[NUMBER, NUMBER] remap_dict * * if arr.size == 0: # <<<<<<<<<<<<<< - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} * */ } /* "fastremap.pyx":189 - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} + * + * remap_dict.reserve(1024) # <<<<<<<<<<<<<< + * + * if preserve_zero: + */ + __pyx_v_remap_dict.reserve(0x400); + + /* "fastremap.pyx":191 + * remap_dict.reserve(1024) * * if preserve_zero: # <<<<<<<<<<<<<< * remap_dict[0] = 0 * */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_preserve_zero); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_preserve_zero); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 191, __pyx_L1_error) if (__pyx_t_3) { - /* "fastremap.pyx":190 + /* "fastremap.pyx":192 * * if preserve_zero: * remap_dict[0] = 0 # <<<<<<<<<<<<<< @@ -14030,8 +14532,8 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ */ (__pyx_v_remap_dict[0]) = 0; - /* "fastremap.pyx":189 - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + /* "fastremap.pyx":191 + * remap_dict.reserve(1024) * * if preserve_zero: # <<<<<<<<<<<<<< * remap_dict[0] = 0 @@ -14039,19 +14541,19 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ */ } - /* "fastremap.pyx":192 + /* "fastremap.pyx":194 * remap_dict[0] = 0 * * cdef NUMBER[:] arrview = arr # <<<<<<<<<<<<<< * * cdef NUMBER remap_id = start */ - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 194, __pyx_L1_error) __pyx_v_arrview = __pyx_t_8; __pyx_t_8.memview = NULL; __pyx_t_8.data = NULL; - /* "fastremap.pyx":194 + /* "fastremap.pyx":196 * cdef NUMBER[:] arrview = arr * * cdef NUMBER remap_id = start # <<<<<<<<<<<<<< @@ -14060,7 +14562,7 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_remap_id = __pyx_v_start; - /* "fastremap.pyx":199 + /* "fastremap.pyx":201 * # some value that isn't the first value * # and won't cause an overflow * cdef NUMBER last_elem = (~arr[0]) # <<<<<<<<<<<<<< @@ -14070,7 +14572,7 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_9 = 0; __pyx_v_last_elem = ((int16_t)(~((uint64_t)(*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_arr.diminfo[0].strides))))); - /* "fastremap.pyx":200 + /* "fastremap.pyx":202 * # and won't cause an overflow * cdef NUMBER last_elem = (~arr[0]) * cdef NUMBER last_remap_id = start # <<<<<<<<<<<<<< @@ -14079,20 +14581,20 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_last_remap_id = __pyx_v_start; - /* "fastremap.pyx":202 + /* "fastremap.pyx":204 * cdef NUMBER last_remap_id = start * * cdef size_t size = arr.size # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_size = __pyx_t_10; - /* "fastremap.pyx":203 + /* "fastremap.pyx":205 * * cdef size_t size = arr.size * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -14101,7 +14603,7 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_i = 0; - /* "fastremap.pyx":205 + /* "fastremap.pyx":207 * cdef size_t i = 0 * * for i in range(size): # <<<<<<<<<<<<<< @@ -14113,7 +14615,7 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; - /* "fastremap.pyx":206 + /* "fastremap.pyx":208 * * for i in range(size): * elem = arrview[i] # <<<<<<<<<<<<<< @@ -14123,7 +14625,7 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_13 = __pyx_v_i; __pyx_v_elem = (*((int16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":208 + /* "fastremap.pyx":210 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -14133,7 +14635,7 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_3 = ((__pyx_v_elem == __pyx_v_last_elem) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":209 + /* "fastremap.pyx":211 * * if elem == last_elem: * arrview[i] = last_remap_id # <<<<<<<<<<<<<< @@ -14143,7 +14645,7 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_13 = __pyx_v_i; *((int16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; - /* "fastremap.pyx":210 + /* "fastremap.pyx":212 * if elem == last_elem: * arrview[i] = last_remap_id * continue # <<<<<<<<<<<<<< @@ -14152,7 +14654,7 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ */ goto __pyx_L5_continue; - /* "fastremap.pyx":208 + /* "fastremap.pyx":210 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -14161,7 +14663,7 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ */ } - /* "fastremap.pyx":212 + /* "fastremap.pyx":214 * continue * * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -14171,7 +14673,7 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_3 = ((__pyx_v_remap_dict.find(__pyx_v_elem) == __pyx_v_remap_dict.end()) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":213 + /* "fastremap.pyx":215 * * if remap_dict.find(elem) == remap_dict.end(): * arrview[i] = remap_id # <<<<<<<<<<<<<< @@ -14181,7 +14683,7 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_13 = __pyx_v_i; *((int16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = __pyx_v_remap_id; - /* "fastremap.pyx":214 + /* "fastremap.pyx":216 * if remap_dict.find(elem) == remap_dict.end(): * arrview[i] = remap_id * remap_dict[elem] = remap_id # <<<<<<<<<<<<<< @@ -14190,7 +14692,7 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ */ (__pyx_v_remap_dict[__pyx_v_elem]) = __pyx_v_remap_id; - /* "fastremap.pyx":215 + /* "fastremap.pyx":217 * arrview[i] = remap_id * remap_dict[elem] = remap_id * remap_id += 1 # <<<<<<<<<<<<<< @@ -14199,7 +14701,7 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_remap_id = (__pyx_v_remap_id + 1); - /* "fastremap.pyx":212 + /* "fastremap.pyx":214 * continue * * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -14209,7 +14711,7 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ goto __pyx_L8; } - /* "fastremap.pyx":217 + /* "fastremap.pyx":219 * remap_id += 1 * else: * arrview[i] = remap_dict[elem] # <<<<<<<<<<<<<< @@ -14222,7 +14724,7 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ } __pyx_L8:; - /* "fastremap.pyx":219 + /* "fastremap.pyx":221 * arrview[i] = remap_dict[elem] * * last_elem = elem # <<<<<<<<<<<<<< @@ -14231,7 +14733,7 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":220 + /* "fastremap.pyx":222 * * last_elem = elem * last_remap_id = arrview[i] # <<<<<<<<<<<<<< @@ -14243,52 +14745,52 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_L5_continue:; } - /* "fastremap.pyx":222 + /* "fastremap.pyx":224 * last_remap_id = arrview[i] * * factor = remap_id # <<<<<<<<<<<<<< * if abs(start) > abs(factor): * factor = start */ - __pyx_t_5 = __Pyx_PyInt_From_int16_t(__pyx_v_remap_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int16_t(__pyx_v_remap_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_factor = __pyx_t_5; __pyx_t_5 = 0; - /* "fastremap.pyx":223 + /* "fastremap.pyx":225 * * factor = remap_id * if abs(start) > abs(factor): # <<<<<<<<<<<<<< * factor = start * */ - __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_v_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_v_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "fastremap.pyx":224 + /* "fastremap.pyx":226 * factor = remap_id * if abs(start) > abs(factor): * factor = start # <<<<<<<<<<<<<< * - * return refit(arr, factor), remap_dict + * return refit(arr, factor), { k:v for k,v in remap_dict } */ - __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_factor, __pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":223 + /* "fastremap.pyx":225 * * factor = remap_id * if abs(start) > abs(factor): # <<<<<<<<<<<<<< @@ -14297,15 +14799,15 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ */ } - /* "fastremap.pyx":226 + /* "fastremap.pyx":228 * factor = start * - * return refit(arr, factor), remap_dict # <<<<<<<<<<<<<< + * return refit(arr, factor), { k:v for k,v in remap_dict } # <<<<<<<<<<<<<< * * def refit(arr, value=None, increase_only=False, exotics=False): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_refit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_refit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = NULL; __pyx_t_7 = 0; @@ -14322,7 +14824,7 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_arr), __pyx_v_factor}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -14330,13 +14832,13 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_arr), __pyx_v_factor}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL; @@ -14347,14 +14849,83 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ __Pyx_INCREF(__pyx_v_factor); __Pyx_GIVEREF(__pyx_v_factor); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_factor); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __pyx_convert_unordered_map_to_py_int16_t____int16_t(__pyx_v_remap_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L1_error) + { /* enter inner scope */ + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = __pyx_v_remap_dict.begin(); + for (;;) { + if (!(__pyx_t_14 != __pyx_v_remap_dict.end())) break; + __pyx_t_15 = *__pyx_t_14; + ++__pyx_t_14; + __pyx_t_6 = __pyx_convert_pair_to_py_int16_t____int16_t(__pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 228, __pyx_L12_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_16 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_17 = Py_TYPE(__pyx_t_16)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_1)) goto __pyx_L15_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_4 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_4)) goto __pyx_L15_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 2) < 0) __PYX_ERR(0, 228, __pyx_L12_error) + __pyx_t_17 = NULL; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L16_unpacking_done; + __pyx_L15_unpacking_failed:; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_17 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 228, __pyx_L12_error) + __pyx_L16_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_k, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_v, __pyx_t_4); + __pyx_t_4 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_8genexpr7__pyx_v_k, (PyObject*)__pyx_8genexpr7__pyx_v_v))) __PYX_ERR(0, 228, __pyx_L12_error) + } + __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_k); __pyx_8genexpr7__pyx_v_k = 0; + __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_v); __pyx_8genexpr7__pyx_v_v = 0; + goto __pyx_L17_exit_scope; + __pyx_L12_error:; + __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_k); __pyx_8genexpr7__pyx_v_k = 0; + __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_v); __pyx_8genexpr7__pyx_v_v = 0; + goto __pyx_L1_error; + __pyx_L17_exit_scope:; + } /* exit inner scope */ + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); @@ -14382,6 +14953,7 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __Pyx_XDECREF(__pyx_t_16); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -14396,6 +14968,8 @@ static PyObject *__pyx_pf_9fastremap_100_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_L2:; __PYX_XDEC_MEMVIEW(&__pyx_v_arrview, 1); __Pyx_XDECREF(__pyx_v_factor); + __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_k); + __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -14537,7 +15111,7 @@ static PyObject *__pyx_fuse_6__pyx_pw_9fastremap_103_renumber(PyObject *__pyx_se } static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int64_t __pyx_v_start, PyObject *__pyx_v_preserve_zero) { - std::unordered_map __pyx_v_remap_dict; + ska::flat_hash_map __pyx_v_remap_dict; __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; int32_t __pyx_v_remap_id; int32_t __pyx_v_elem; @@ -14546,6 +15120,8 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ size_t __pyx_v_size; size_t __pyx_v_i; PyObject *__pyx_v_factor = NULL; + PyObject *__pyx_8genexpr8__pyx_v_k = NULL; + PyObject *__pyx_8genexpr8__pyx_v_v = NULL; __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; __Pyx_Buffer __pyx_pybuffer_arr; PyObject *__pyx_r = NULL; @@ -14563,6 +15139,10 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ size_t __pyx_t_11; size_t __pyx_t_12; size_t __pyx_t_13; + ska::flat_hash_map ::iterator __pyx_t_14; + std::pair __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *(*__pyx_t_17)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -14578,10 +15158,10 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; /* "fastremap.pyx":186 - * cdef unordered_map[NUMBER, NUMBER] remap_dict + * cdef flat_hash_map[NUMBER, NUMBER] remap_dict * * if arr.size == 0: # <<<<<<<<<<<<<< - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) @@ -14596,9 +15176,9 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ /* "fastremap.pyx":187 * * if arr.size == 0: - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict # <<<<<<<<<<<<<< + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} # <<<<<<<<<<<<<< * - * if preserve_zero: + * remap_dict.reserve(1024) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_refit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) @@ -14665,7 +15245,7 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_convert_unordered_map_to_py_int32_t____int32_t(__pyx_v_remap_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -14680,25 +15260,34 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ goto __pyx_L0; /* "fastremap.pyx":186 - * cdef unordered_map[NUMBER, NUMBER] remap_dict + * cdef flat_hash_map[NUMBER, NUMBER] remap_dict * * if arr.size == 0: # <<<<<<<<<<<<<< - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} * */ } /* "fastremap.pyx":189 - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} + * + * remap_dict.reserve(1024) # <<<<<<<<<<<<<< + * + * if preserve_zero: + */ + __pyx_v_remap_dict.reserve(0x400); + + /* "fastremap.pyx":191 + * remap_dict.reserve(1024) * * if preserve_zero: # <<<<<<<<<<<<<< * remap_dict[0] = 0 * */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_preserve_zero); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_preserve_zero); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 191, __pyx_L1_error) if (__pyx_t_3) { - /* "fastremap.pyx":190 + /* "fastremap.pyx":192 * * if preserve_zero: * remap_dict[0] = 0 # <<<<<<<<<<<<<< @@ -14707,8 +15296,8 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ */ (__pyx_v_remap_dict[0]) = 0; - /* "fastremap.pyx":189 - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + /* "fastremap.pyx":191 + * remap_dict.reserve(1024) * * if preserve_zero: # <<<<<<<<<<<<<< * remap_dict[0] = 0 @@ -14716,19 +15305,19 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ */ } - /* "fastremap.pyx":192 + /* "fastremap.pyx":194 * remap_dict[0] = 0 * * cdef NUMBER[:] arrview = arr # <<<<<<<<<<<<<< * * cdef NUMBER remap_id = start */ - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 194, __pyx_L1_error) __pyx_v_arrview = __pyx_t_8; __pyx_t_8.memview = NULL; __pyx_t_8.data = NULL; - /* "fastremap.pyx":194 + /* "fastremap.pyx":196 * cdef NUMBER[:] arrview = arr * * cdef NUMBER remap_id = start # <<<<<<<<<<<<<< @@ -14737,7 +15326,7 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_remap_id = __pyx_v_start; - /* "fastremap.pyx":199 + /* "fastremap.pyx":201 * # some value that isn't the first value * # and won't cause an overflow * cdef NUMBER last_elem = (~arr[0]) # <<<<<<<<<<<<<< @@ -14747,7 +15336,7 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_9 = 0; __pyx_v_last_elem = ((int32_t)(~((uint64_t)(*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_arr.diminfo[0].strides))))); - /* "fastremap.pyx":200 + /* "fastremap.pyx":202 * # and won't cause an overflow * cdef NUMBER last_elem = (~arr[0]) * cdef NUMBER last_remap_id = start # <<<<<<<<<<<<<< @@ -14756,20 +15345,20 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_last_remap_id = __pyx_v_start; - /* "fastremap.pyx":202 + /* "fastremap.pyx":204 * cdef NUMBER last_remap_id = start * * cdef size_t size = arr.size # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_size = __pyx_t_10; - /* "fastremap.pyx":203 + /* "fastremap.pyx":205 * * cdef size_t size = arr.size * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -14778,7 +15367,7 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_i = 0; - /* "fastremap.pyx":205 + /* "fastremap.pyx":207 * cdef size_t i = 0 * * for i in range(size): # <<<<<<<<<<<<<< @@ -14790,7 +15379,7 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; - /* "fastremap.pyx":206 + /* "fastremap.pyx":208 * * for i in range(size): * elem = arrview[i] # <<<<<<<<<<<<<< @@ -14800,7 +15389,7 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_13 = __pyx_v_i; __pyx_v_elem = (*((int32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":208 + /* "fastremap.pyx":210 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -14810,7 +15399,7 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_3 = ((__pyx_v_elem == __pyx_v_last_elem) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":209 + /* "fastremap.pyx":211 * * if elem == last_elem: * arrview[i] = last_remap_id # <<<<<<<<<<<<<< @@ -14820,7 +15409,7 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_13 = __pyx_v_i; *((int32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; - /* "fastremap.pyx":210 + /* "fastremap.pyx":212 * if elem == last_elem: * arrview[i] = last_remap_id * continue # <<<<<<<<<<<<<< @@ -14829,7 +15418,7 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ */ goto __pyx_L5_continue; - /* "fastremap.pyx":208 + /* "fastremap.pyx":210 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -14838,7 +15427,7 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ */ } - /* "fastremap.pyx":212 + /* "fastremap.pyx":214 * continue * * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -14848,7 +15437,7 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_3 = ((__pyx_v_remap_dict.find(__pyx_v_elem) == __pyx_v_remap_dict.end()) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":213 + /* "fastremap.pyx":215 * * if remap_dict.find(elem) == remap_dict.end(): * arrview[i] = remap_id # <<<<<<<<<<<<<< @@ -14858,7 +15447,7 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_13 = __pyx_v_i; *((int32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = __pyx_v_remap_id; - /* "fastremap.pyx":214 + /* "fastremap.pyx":216 * if remap_dict.find(elem) == remap_dict.end(): * arrview[i] = remap_id * remap_dict[elem] = remap_id # <<<<<<<<<<<<<< @@ -14867,7 +15456,7 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ */ (__pyx_v_remap_dict[__pyx_v_elem]) = __pyx_v_remap_id; - /* "fastremap.pyx":215 + /* "fastremap.pyx":217 * arrview[i] = remap_id * remap_dict[elem] = remap_id * remap_id += 1 # <<<<<<<<<<<<<< @@ -14876,7 +15465,7 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_remap_id = (__pyx_v_remap_id + 1); - /* "fastremap.pyx":212 + /* "fastremap.pyx":214 * continue * * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -14886,7 +15475,7 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ goto __pyx_L8; } - /* "fastremap.pyx":217 + /* "fastremap.pyx":219 * remap_id += 1 * else: * arrview[i] = remap_dict[elem] # <<<<<<<<<<<<<< @@ -14899,7 +15488,7 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ } __pyx_L8:; - /* "fastremap.pyx":219 + /* "fastremap.pyx":221 * arrview[i] = remap_dict[elem] * * last_elem = elem # <<<<<<<<<<<<<< @@ -14908,7 +15497,7 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":220 + /* "fastremap.pyx":222 * * last_elem = elem * last_remap_id = arrview[i] # <<<<<<<<<<<<<< @@ -14920,52 +15509,52 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_L5_continue:; } - /* "fastremap.pyx":222 + /* "fastremap.pyx":224 * last_remap_id = arrview[i] * * factor = remap_id # <<<<<<<<<<<<<< * if abs(start) > abs(factor): * factor = start */ - __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_remap_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_remap_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_factor = __pyx_t_5; __pyx_t_5 = 0; - /* "fastremap.pyx":223 + /* "fastremap.pyx":225 * * factor = remap_id * if abs(start) > abs(factor): # <<<<<<<<<<<<<< * factor = start * */ - __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_v_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_v_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "fastremap.pyx":224 + /* "fastremap.pyx":226 * factor = remap_id * if abs(start) > abs(factor): * factor = start # <<<<<<<<<<<<<< * - * return refit(arr, factor), remap_dict + * return refit(arr, factor), { k:v for k,v in remap_dict } */ - __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_factor, __pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":223 + /* "fastremap.pyx":225 * * factor = remap_id * if abs(start) > abs(factor): # <<<<<<<<<<<<<< @@ -14974,15 +15563,15 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ */ } - /* "fastremap.pyx":226 + /* "fastremap.pyx":228 * factor = start * - * return refit(arr, factor), remap_dict # <<<<<<<<<<<<<< + * return refit(arr, factor), { k:v for k,v in remap_dict } # <<<<<<<<<<<<<< * * def refit(arr, value=None, increase_only=False, exotics=False): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_refit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_refit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = NULL; __pyx_t_7 = 0; @@ -14999,7 +15588,7 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_arr), __pyx_v_factor}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -15007,13 +15596,13 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_arr), __pyx_v_factor}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL; @@ -15024,14 +15613,83 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ __Pyx_INCREF(__pyx_v_factor); __Pyx_GIVEREF(__pyx_v_factor); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_factor); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __pyx_convert_unordered_map_to_py_int32_t____int32_t(__pyx_v_remap_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L1_error) + { /* enter inner scope */ + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = __pyx_v_remap_dict.begin(); + for (;;) { + if (!(__pyx_t_14 != __pyx_v_remap_dict.end())) break; + __pyx_t_15 = *__pyx_t_14; + ++__pyx_t_14; + __pyx_t_6 = __pyx_convert_pair_to_py_int32_t____int32_t(__pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 228, __pyx_L12_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_16 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_17 = Py_TYPE(__pyx_t_16)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_1)) goto __pyx_L15_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_4 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_4)) goto __pyx_L15_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 2) < 0) __PYX_ERR(0, 228, __pyx_L12_error) + __pyx_t_17 = NULL; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L16_unpacking_done; + __pyx_L15_unpacking_failed:; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_17 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 228, __pyx_L12_error) + __pyx_L16_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_k, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_v, __pyx_t_4); + __pyx_t_4 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_8genexpr8__pyx_v_k, (PyObject*)__pyx_8genexpr8__pyx_v_v))) __PYX_ERR(0, 228, __pyx_L12_error) + } + __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_k); __pyx_8genexpr8__pyx_v_k = 0; + __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_v); __pyx_8genexpr8__pyx_v_v = 0; + goto __pyx_L17_exit_scope; + __pyx_L12_error:; + __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_k); __pyx_8genexpr8__pyx_v_k = 0; + __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_v); __pyx_8genexpr8__pyx_v_v = 0; + goto __pyx_L1_error; + __pyx_L17_exit_scope:; + } /* exit inner scope */ + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); @@ -15059,6 +15717,7 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __Pyx_XDECREF(__pyx_t_16); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -15073,6 +15732,8 @@ static PyObject *__pyx_pf_9fastremap_102_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_L2:; __PYX_XDEC_MEMVIEW(&__pyx_v_arrview, 1); __Pyx_XDECREF(__pyx_v_factor); + __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_k); + __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -15214,7 +15875,7 @@ static PyObject *__pyx_fuse_7__pyx_pw_9fastremap_105_renumber(PyObject *__pyx_se } static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int64_t __pyx_v_start, PyObject *__pyx_v_preserve_zero) { - std::unordered_map __pyx_v_remap_dict; + ska::flat_hash_map __pyx_v_remap_dict; __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; int64_t __pyx_v_remap_id; int64_t __pyx_v_elem; @@ -15223,6 +15884,8 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ size_t __pyx_v_size; size_t __pyx_v_i; PyObject *__pyx_v_factor = NULL; + PyObject *__pyx_8genexpr9__pyx_v_k = NULL; + PyObject *__pyx_8genexpr9__pyx_v_v = NULL; __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; __Pyx_Buffer __pyx_pybuffer_arr; PyObject *__pyx_r = NULL; @@ -15240,6 +15903,10 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ size_t __pyx_t_11; size_t __pyx_t_12; size_t __pyx_t_13; + ska::flat_hash_map ::iterator __pyx_t_14; + std::pair __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *(*__pyx_t_17)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -15255,10 +15922,10 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; /* "fastremap.pyx":186 - * cdef unordered_map[NUMBER, NUMBER] remap_dict + * cdef flat_hash_map[NUMBER, NUMBER] remap_dict * * if arr.size == 0: # <<<<<<<<<<<<<< - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) @@ -15273,9 +15940,9 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ /* "fastremap.pyx":187 * * if arr.size == 0: - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict # <<<<<<<<<<<<<< + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} # <<<<<<<<<<<<<< * - * if preserve_zero: + * remap_dict.reserve(1024) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_refit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) @@ -15342,7 +16009,7 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_convert_unordered_map_to_py_int64_t____int64_t(__pyx_v_remap_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -15357,25 +16024,34 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ goto __pyx_L0; /* "fastremap.pyx":186 - * cdef unordered_map[NUMBER, NUMBER] remap_dict + * cdef flat_hash_map[NUMBER, NUMBER] remap_dict * * if arr.size == 0: # <<<<<<<<<<<<<< - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} * */ } /* "fastremap.pyx":189 - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} + * + * remap_dict.reserve(1024) # <<<<<<<<<<<<<< + * + * if preserve_zero: + */ + __pyx_v_remap_dict.reserve(0x400); + + /* "fastremap.pyx":191 + * remap_dict.reserve(1024) * * if preserve_zero: # <<<<<<<<<<<<<< * remap_dict[0] = 0 * */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_preserve_zero); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_preserve_zero); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 191, __pyx_L1_error) if (__pyx_t_3) { - /* "fastremap.pyx":190 + /* "fastremap.pyx":192 * * if preserve_zero: * remap_dict[0] = 0 # <<<<<<<<<<<<<< @@ -15384,8 +16060,8 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ */ (__pyx_v_remap_dict[0]) = 0; - /* "fastremap.pyx":189 - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + /* "fastremap.pyx":191 + * remap_dict.reserve(1024) * * if preserve_zero: # <<<<<<<<<<<<<< * remap_dict[0] = 0 @@ -15393,19 +16069,19 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ */ } - /* "fastremap.pyx":192 + /* "fastremap.pyx":194 * remap_dict[0] = 0 * * cdef NUMBER[:] arrview = arr # <<<<<<<<<<<<<< * * cdef NUMBER remap_id = start */ - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 194, __pyx_L1_error) __pyx_v_arrview = __pyx_t_8; __pyx_t_8.memview = NULL; __pyx_t_8.data = NULL; - /* "fastremap.pyx":194 + /* "fastremap.pyx":196 * cdef NUMBER[:] arrview = arr * * cdef NUMBER remap_id = start # <<<<<<<<<<<<<< @@ -15414,7 +16090,7 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_remap_id = __pyx_v_start; - /* "fastremap.pyx":199 + /* "fastremap.pyx":201 * # some value that isn't the first value * # and won't cause an overflow * cdef NUMBER last_elem = (~arr[0]) # <<<<<<<<<<<<<< @@ -15424,7 +16100,7 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_9 = 0; __pyx_v_last_elem = ((int64_t)(~((uint64_t)(*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_arr.diminfo[0].strides))))); - /* "fastremap.pyx":200 + /* "fastremap.pyx":202 * # and won't cause an overflow * cdef NUMBER last_elem = (~arr[0]) * cdef NUMBER last_remap_id = start # <<<<<<<<<<<<<< @@ -15433,20 +16109,20 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_last_remap_id = __pyx_v_start; - /* "fastremap.pyx":202 + /* "fastremap.pyx":204 * cdef NUMBER last_remap_id = start * * cdef size_t size = arr.size # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_size = __pyx_t_10; - /* "fastremap.pyx":203 + /* "fastremap.pyx":205 * * cdef size_t size = arr.size * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -15455,7 +16131,7 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_i = 0; - /* "fastremap.pyx":205 + /* "fastremap.pyx":207 * cdef size_t i = 0 * * for i in range(size): # <<<<<<<<<<<<<< @@ -15467,7 +16143,7 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; - /* "fastremap.pyx":206 + /* "fastremap.pyx":208 * * for i in range(size): * elem = arrview[i] # <<<<<<<<<<<<<< @@ -15477,7 +16153,7 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_13 = __pyx_v_i; __pyx_v_elem = (*((int64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":208 + /* "fastremap.pyx":210 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -15487,7 +16163,7 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_3 = ((__pyx_v_elem == __pyx_v_last_elem) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":209 + /* "fastremap.pyx":211 * * if elem == last_elem: * arrview[i] = last_remap_id # <<<<<<<<<<<<<< @@ -15497,7 +16173,7 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_13 = __pyx_v_i; *((int64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; - /* "fastremap.pyx":210 + /* "fastremap.pyx":212 * if elem == last_elem: * arrview[i] = last_remap_id * continue # <<<<<<<<<<<<<< @@ -15506,7 +16182,7 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ */ goto __pyx_L5_continue; - /* "fastremap.pyx":208 + /* "fastremap.pyx":210 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -15515,7 +16191,7 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ */ } - /* "fastremap.pyx":212 + /* "fastremap.pyx":214 * continue * * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -15525,7 +16201,7 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_3 = ((__pyx_v_remap_dict.find(__pyx_v_elem) == __pyx_v_remap_dict.end()) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":213 + /* "fastremap.pyx":215 * * if remap_dict.find(elem) == remap_dict.end(): * arrview[i] = remap_id # <<<<<<<<<<<<<< @@ -15535,7 +16211,7 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_13 = __pyx_v_i; *((int64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = __pyx_v_remap_id; - /* "fastremap.pyx":214 + /* "fastremap.pyx":216 * if remap_dict.find(elem) == remap_dict.end(): * arrview[i] = remap_id * remap_dict[elem] = remap_id # <<<<<<<<<<<<<< @@ -15544,7 +16220,7 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ */ (__pyx_v_remap_dict[__pyx_v_elem]) = __pyx_v_remap_id; - /* "fastremap.pyx":215 + /* "fastremap.pyx":217 * arrview[i] = remap_id * remap_dict[elem] = remap_id * remap_id += 1 # <<<<<<<<<<<<<< @@ -15553,7 +16229,7 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_remap_id = (__pyx_v_remap_id + 1); - /* "fastremap.pyx":212 + /* "fastremap.pyx":214 * continue * * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -15563,7 +16239,7 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ goto __pyx_L8; } - /* "fastremap.pyx":217 + /* "fastremap.pyx":219 * remap_id += 1 * else: * arrview[i] = remap_dict[elem] # <<<<<<<<<<<<<< @@ -15576,7 +16252,7 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ } __pyx_L8:; - /* "fastremap.pyx":219 + /* "fastremap.pyx":221 * arrview[i] = remap_dict[elem] * * last_elem = elem # <<<<<<<<<<<<<< @@ -15585,7 +16261,7 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":220 + /* "fastremap.pyx":222 * * last_elem = elem * last_remap_id = arrview[i] # <<<<<<<<<<<<<< @@ -15597,52 +16273,52 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_L5_continue:; } - /* "fastremap.pyx":222 + /* "fastremap.pyx":224 * last_remap_id = arrview[i] * * factor = remap_id # <<<<<<<<<<<<<< * if abs(start) > abs(factor): * factor = start */ - __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_remap_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_remap_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_factor = __pyx_t_5; __pyx_t_5 = 0; - /* "fastremap.pyx":223 + /* "fastremap.pyx":225 * * factor = remap_id * if abs(start) > abs(factor): # <<<<<<<<<<<<<< * factor = start * */ - __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_v_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_v_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "fastremap.pyx":224 + /* "fastremap.pyx":226 * factor = remap_id * if abs(start) > abs(factor): * factor = start # <<<<<<<<<<<<<< * - * return refit(arr, factor), remap_dict + * return refit(arr, factor), { k:v for k,v in remap_dict } */ - __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_factor, __pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":223 + /* "fastremap.pyx":225 * * factor = remap_id * if abs(start) > abs(factor): # <<<<<<<<<<<<<< @@ -15651,15 +16327,15 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ */ } - /* "fastremap.pyx":226 + /* "fastremap.pyx":228 * factor = start * - * return refit(arr, factor), remap_dict # <<<<<<<<<<<<<< + * return refit(arr, factor), { k:v for k,v in remap_dict } # <<<<<<<<<<<<<< * * def refit(arr, value=None, increase_only=False, exotics=False): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_refit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_refit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = NULL; __pyx_t_7 = 0; @@ -15676,7 +16352,7 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_arr), __pyx_v_factor}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -15684,13 +16360,13 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_arr), __pyx_v_factor}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL; @@ -15701,14 +16377,83 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ __Pyx_INCREF(__pyx_v_factor); __Pyx_GIVEREF(__pyx_v_factor); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_factor); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __pyx_convert_unordered_map_to_py_int64_t____int64_t(__pyx_v_remap_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L1_error) + { /* enter inner scope */ + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = __pyx_v_remap_dict.begin(); + for (;;) { + if (!(__pyx_t_14 != __pyx_v_remap_dict.end())) break; + __pyx_t_15 = *__pyx_t_14; + ++__pyx_t_14; + __pyx_t_6 = __pyx_convert_pair_to_py_int64_t____int64_t(__pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 228, __pyx_L12_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_16 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_17 = Py_TYPE(__pyx_t_16)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_1)) goto __pyx_L15_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_4 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_4)) goto __pyx_L15_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 2) < 0) __PYX_ERR(0, 228, __pyx_L12_error) + __pyx_t_17 = NULL; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L16_unpacking_done; + __pyx_L15_unpacking_failed:; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_17 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 228, __pyx_L12_error) + __pyx_L16_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_k, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_v, __pyx_t_4); + __pyx_t_4 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_8genexpr9__pyx_v_k, (PyObject*)__pyx_8genexpr9__pyx_v_v))) __PYX_ERR(0, 228, __pyx_L12_error) + } + __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_k); __pyx_8genexpr9__pyx_v_k = 0; + __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_v); __pyx_8genexpr9__pyx_v_v = 0; + goto __pyx_L17_exit_scope; + __pyx_L12_error:; + __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_k); __pyx_8genexpr9__pyx_v_k = 0; + __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_v); __pyx_8genexpr9__pyx_v_v = 0; + goto __pyx_L1_error; + __pyx_L17_exit_scope:; + } /* exit inner scope */ + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); @@ -15736,6 +16481,7 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __Pyx_XDECREF(__pyx_t_16); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -15750,6 +16496,8 @@ static PyObject *__pyx_pf_9fastremap_104_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_L2:; __PYX_XDEC_MEMVIEW(&__pyx_v_arrview, 1); __Pyx_XDECREF(__pyx_v_factor); + __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_k); + __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -15891,7 +16639,7 @@ static PyObject *__pyx_fuse_8__pyx_pw_9fastremap_107_renumber(PyObject *__pyx_se } static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int64_t __pyx_v_start, PyObject *__pyx_v_preserve_zero) { - std::unordered_map __pyx_v_remap_dict; + ska::flat_hash_map __pyx_v_remap_dict; __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; float __pyx_v_remap_id; float __pyx_v_elem; @@ -15900,6 +16648,8 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ size_t __pyx_v_size; size_t __pyx_v_i; double __pyx_v_factor; + PyObject *__pyx_9genexpr10__pyx_v_k = NULL; + PyObject *__pyx_9genexpr10__pyx_v_v = NULL; __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; __Pyx_Buffer __pyx_pybuffer_arr; PyObject *__pyx_r = NULL; @@ -15917,6 +16667,10 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ size_t __pyx_t_11; size_t __pyx_t_12; size_t __pyx_t_13; + ska::flat_hash_map ::iterator __pyx_t_14; + std::pair __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *(*__pyx_t_17)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -15932,10 +16686,10 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; /* "fastremap.pyx":186 - * cdef unordered_map[NUMBER, NUMBER] remap_dict + * cdef flat_hash_map[NUMBER, NUMBER] remap_dict * * if arr.size == 0: # <<<<<<<<<<<<<< - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) @@ -15950,9 +16704,9 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ /* "fastremap.pyx":187 * * if arr.size == 0: - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict # <<<<<<<<<<<<<< + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} # <<<<<<<<<<<<<< * - * if preserve_zero: + * remap_dict.reserve(1024) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_refit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) @@ -16019,7 +16773,7 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_convert_unordered_map_to_py_float____float(__pyx_v_remap_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -16034,25 +16788,34 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ goto __pyx_L0; /* "fastremap.pyx":186 - * cdef unordered_map[NUMBER, NUMBER] remap_dict + * cdef flat_hash_map[NUMBER, NUMBER] remap_dict * * if arr.size == 0: # <<<<<<<<<<<<<< - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} * */ } /* "fastremap.pyx":189 - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} + * + * remap_dict.reserve(1024) # <<<<<<<<<<<<<< + * + * if preserve_zero: + */ + __pyx_v_remap_dict.reserve(0x400); + + /* "fastremap.pyx":191 + * remap_dict.reserve(1024) * * if preserve_zero: # <<<<<<<<<<<<<< * remap_dict[0] = 0 * */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_preserve_zero); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_preserve_zero); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 191, __pyx_L1_error) if (__pyx_t_3) { - /* "fastremap.pyx":190 + /* "fastremap.pyx":192 * * if preserve_zero: * remap_dict[0] = 0 # <<<<<<<<<<<<<< @@ -16061,8 +16824,8 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ */ (__pyx_v_remap_dict[0.0]) = 0.0; - /* "fastremap.pyx":189 - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + /* "fastremap.pyx":191 + * remap_dict.reserve(1024) * * if preserve_zero: # <<<<<<<<<<<<<< * remap_dict[0] = 0 @@ -16070,19 +16833,19 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ */ } - /* "fastremap.pyx":192 + /* "fastremap.pyx":194 * remap_dict[0] = 0 * * cdef NUMBER[:] arrview = arr # <<<<<<<<<<<<<< * * cdef NUMBER remap_id = start */ - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 194, __pyx_L1_error) __pyx_v_arrview = __pyx_t_8; __pyx_t_8.memview = NULL; __pyx_t_8.data = NULL; - /* "fastremap.pyx":194 + /* "fastremap.pyx":196 * cdef NUMBER[:] arrview = arr * * cdef NUMBER remap_id = start # <<<<<<<<<<<<<< @@ -16091,7 +16854,7 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_remap_id = __pyx_v_start; - /* "fastremap.pyx":199 + /* "fastremap.pyx":201 * # some value that isn't the first value * # and won't cause an overflow * cdef NUMBER last_elem = (~arr[0]) # <<<<<<<<<<<<<< @@ -16101,7 +16864,7 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_9 = 0; __pyx_v_last_elem = ((float)(~((uint64_t)(*__Pyx_BufPtrStrided1d(float *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_arr.diminfo[0].strides))))); - /* "fastremap.pyx":200 + /* "fastremap.pyx":202 * # and won't cause an overflow * cdef NUMBER last_elem = (~arr[0]) * cdef NUMBER last_remap_id = start # <<<<<<<<<<<<<< @@ -16110,20 +16873,20 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_last_remap_id = __pyx_v_start; - /* "fastremap.pyx":202 + /* "fastremap.pyx":204 * cdef NUMBER last_remap_id = start * * cdef size_t size = arr.size # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_size = __pyx_t_10; - /* "fastremap.pyx":203 + /* "fastremap.pyx":205 * * cdef size_t size = arr.size * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -16132,7 +16895,7 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_i = 0; - /* "fastremap.pyx":205 + /* "fastremap.pyx":207 * cdef size_t i = 0 * * for i in range(size): # <<<<<<<<<<<<<< @@ -16144,7 +16907,7 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; - /* "fastremap.pyx":206 + /* "fastremap.pyx":208 * * for i in range(size): * elem = arrview[i] # <<<<<<<<<<<<<< @@ -16154,7 +16917,7 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_13 = __pyx_v_i; __pyx_v_elem = (*((float *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":208 + /* "fastremap.pyx":210 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -16164,7 +16927,7 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_3 = ((__pyx_v_elem == __pyx_v_last_elem) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":209 + /* "fastremap.pyx":211 * * if elem == last_elem: * arrview[i] = last_remap_id # <<<<<<<<<<<<<< @@ -16174,7 +16937,7 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_13 = __pyx_v_i; *((float *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; - /* "fastremap.pyx":210 + /* "fastremap.pyx":212 * if elem == last_elem: * arrview[i] = last_remap_id * continue # <<<<<<<<<<<<<< @@ -16183,7 +16946,7 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ */ goto __pyx_L5_continue; - /* "fastremap.pyx":208 + /* "fastremap.pyx":210 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -16192,7 +16955,7 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ */ } - /* "fastremap.pyx":212 + /* "fastremap.pyx":214 * continue * * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -16202,7 +16965,7 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_3 = ((__pyx_v_remap_dict.find(__pyx_v_elem) == __pyx_v_remap_dict.end()) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":213 + /* "fastremap.pyx":215 * * if remap_dict.find(elem) == remap_dict.end(): * arrview[i] = remap_id # <<<<<<<<<<<<<< @@ -16212,7 +16975,7 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_13 = __pyx_v_i; *((float *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = __pyx_v_remap_id; - /* "fastremap.pyx":214 + /* "fastremap.pyx":216 * if remap_dict.find(elem) == remap_dict.end(): * arrview[i] = remap_id * remap_dict[elem] = remap_id # <<<<<<<<<<<<<< @@ -16221,7 +16984,7 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ */ (__pyx_v_remap_dict[__pyx_v_elem]) = __pyx_v_remap_id; - /* "fastremap.pyx":215 + /* "fastremap.pyx":217 * arrview[i] = remap_id * remap_dict[elem] = remap_id * remap_id += 1 # <<<<<<<<<<<<<< @@ -16230,7 +16993,7 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_remap_id = (__pyx_v_remap_id + 1.0); - /* "fastremap.pyx":212 + /* "fastremap.pyx":214 * continue * * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -16240,7 +17003,7 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ goto __pyx_L8; } - /* "fastremap.pyx":217 + /* "fastremap.pyx":219 * remap_id += 1 * else: * arrview[i] = remap_dict[elem] # <<<<<<<<<<<<<< @@ -16253,7 +17016,7 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ } __pyx_L8:; - /* "fastremap.pyx":219 + /* "fastremap.pyx":221 * arrview[i] = remap_dict[elem] * * last_elem = elem # <<<<<<<<<<<<<< @@ -16262,7 +17025,7 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":220 + /* "fastremap.pyx":222 * * last_elem = elem * last_remap_id = arrview[i] # <<<<<<<<<<<<<< @@ -16274,7 +17037,7 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_L5_continue:; } - /* "fastremap.pyx":222 + /* "fastremap.pyx":224 * last_remap_id = arrview[i] * * factor = remap_id # <<<<<<<<<<<<<< @@ -16283,37 +17046,37 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_factor = __pyx_v_remap_id; - /* "fastremap.pyx":223 + /* "fastremap.pyx":225 * * factor = remap_id * if abs(start) > abs(factor): # <<<<<<<<<<<<<< * factor = start * */ - __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyFloat_FromDouble(fabs(__pyx_v_factor)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(fabs(__pyx_v_factor)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "fastremap.pyx":224 + /* "fastremap.pyx":226 * factor = remap_id * if abs(start) > abs(factor): * factor = start # <<<<<<<<<<<<<< * - * return refit(arr, factor), remap_dict + * return refit(arr, factor), { k:v for k,v in remap_dict } */ __pyx_v_factor = __pyx_v_start; - /* "fastremap.pyx":223 + /* "fastremap.pyx":225 * * factor = remap_id * if abs(start) > abs(factor): # <<<<<<<<<<<<<< @@ -16322,17 +17085,17 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ */ } - /* "fastremap.pyx":226 + /* "fastremap.pyx":228 * factor = start * - * return refit(arr, factor), remap_dict # <<<<<<<<<<<<<< + * return refit(arr, factor), { k:v for k,v in remap_dict } # <<<<<<<<<<<<<< * * def refit(arr, value=None, increase_only=False, exotics=False): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_refit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_refit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_factor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_factor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -16349,7 +17112,7 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_arr), __pyx_t_1}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -16358,14 +17121,14 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_arr), __pyx_t_1}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_4 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -16376,14 +17139,83 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __pyx_convert_unordered_map_to_py_float____float(__pyx_v_remap_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error) + { /* enter inner scope */ + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = __pyx_v_remap_dict.begin(); + for (;;) { + if (!(__pyx_t_14 != __pyx_v_remap_dict.end())) break; + __pyx_t_15 = *__pyx_t_14; + ++__pyx_t_14; + __pyx_t_4 = __pyx_convert_pair_to_py_float____float(__pyx_t_15); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_4); + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { + PyObject* sequence = __pyx_t_4; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 228, __pyx_L12_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_16 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_17 = Py_TYPE(__pyx_t_16)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_1)) goto __pyx_L15_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_6 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_6)) goto __pyx_L15_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 2) < 0) __PYX_ERR(0, 228, __pyx_L12_error) + __pyx_t_17 = NULL; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L16_unpacking_done; + __pyx_L15_unpacking_failed:; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_17 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 228, __pyx_L12_error) + __pyx_L16_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_k, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_v, __pyx_t_6); + __pyx_t_6 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_9genexpr10__pyx_v_k, (PyObject*)__pyx_9genexpr10__pyx_v_v))) __PYX_ERR(0, 228, __pyx_L12_error) + } + __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_k); __pyx_9genexpr10__pyx_v_k = 0; + __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_v); __pyx_9genexpr10__pyx_v_v = 0; + goto __pyx_L17_exit_scope; + __pyx_L12_error:; + __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_k); __pyx_9genexpr10__pyx_v_k = 0; + __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_v); __pyx_9genexpr10__pyx_v_v = 0; + goto __pyx_L1_error; + __pyx_L17_exit_scope:; + } /* exit inner scope */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); @@ -16411,6 +17243,7 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __Pyx_XDECREF(__pyx_t_16); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -16424,6 +17257,8 @@ static PyObject *__pyx_pf_9fastremap_106_renumber(CYTHON_UNUSED PyObject *__pyx_ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); __pyx_L2:; __PYX_XDEC_MEMVIEW(&__pyx_v_arrview, 1); + __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_k); + __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -16565,7 +17400,7 @@ static PyObject *__pyx_fuse_9__pyx_pw_9fastremap_109_renumber(PyObject *__pyx_se } static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_arr, int64_t __pyx_v_start, PyObject *__pyx_v_preserve_zero) { - std::unordered_map __pyx_v_remap_dict; + ska::flat_hash_map __pyx_v_remap_dict; __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; double __pyx_v_remap_id; double __pyx_v_elem; @@ -16574,6 +17409,8 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ size_t __pyx_v_size; size_t __pyx_v_i; double __pyx_v_factor; + PyObject *__pyx_9genexpr11__pyx_v_k = NULL; + PyObject *__pyx_9genexpr11__pyx_v_v = NULL; __Pyx_LocalBuf_ND __pyx_pybuffernd_arr; __Pyx_Buffer __pyx_pybuffer_arr; PyObject *__pyx_r = NULL; @@ -16591,6 +17428,10 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ size_t __pyx_t_11; size_t __pyx_t_12; size_t __pyx_t_13; + ska::flat_hash_map ::iterator __pyx_t_14; + std::pair __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *(*__pyx_t_17)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -16606,10 +17447,10 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; /* "fastremap.pyx":186 - * cdef unordered_map[NUMBER, NUMBER] remap_dict + * cdef flat_hash_map[NUMBER, NUMBER] remap_dict * * if arr.size == 0: # <<<<<<<<<<<<<< - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) @@ -16624,9 +17465,9 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ /* "fastremap.pyx":187 * * if arr.size == 0: - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict # <<<<<<<<<<<<<< + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} # <<<<<<<<<<<<<< * - * if preserve_zero: + * remap_dict.reserve(1024) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_refit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) @@ -16693,7 +17534,7 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_convert_unordered_map_to_py_double____double(__pyx_v_remap_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -16708,25 +17549,34 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ goto __pyx_L0; /* "fastremap.pyx":186 - * cdef unordered_map[NUMBER, NUMBER] remap_dict + * cdef flat_hash_map[NUMBER, NUMBER] remap_dict * * if arr.size == 0: # <<<<<<<<<<<<<< - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} * */ } /* "fastremap.pyx":189 - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} + * + * remap_dict.reserve(1024) # <<<<<<<<<<<<<< + * + * if preserve_zero: + */ + __pyx_v_remap_dict.reserve(0x400); + + /* "fastremap.pyx":191 + * remap_dict.reserve(1024) * * if preserve_zero: # <<<<<<<<<<<<<< * remap_dict[0] = 0 * */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_preserve_zero); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_preserve_zero); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 191, __pyx_L1_error) if (__pyx_t_3) { - /* "fastremap.pyx":190 + /* "fastremap.pyx":192 * * if preserve_zero: * remap_dict[0] = 0 # <<<<<<<<<<<<<< @@ -16735,8 +17585,8 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ */ (__pyx_v_remap_dict[0.0]) = 0.0; - /* "fastremap.pyx":189 - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + /* "fastremap.pyx":191 + * remap_dict.reserve(1024) * * if preserve_zero: # <<<<<<<<<<<<<< * remap_dict[0] = 0 @@ -16744,19 +17594,19 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ */ } - /* "fastremap.pyx":192 + /* "fastremap.pyx":194 * remap_dict[0] = 0 * * cdef NUMBER[:] arrview = arr # <<<<<<<<<<<<<< * * cdef NUMBER remap_id = start */ - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 194, __pyx_L1_error) __pyx_v_arrview = __pyx_t_8; __pyx_t_8.memview = NULL; __pyx_t_8.data = NULL; - /* "fastremap.pyx":194 + /* "fastremap.pyx":196 * cdef NUMBER[:] arrview = arr * * cdef NUMBER remap_id = start # <<<<<<<<<<<<<< @@ -16765,7 +17615,7 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_remap_id = __pyx_v_start; - /* "fastremap.pyx":199 + /* "fastremap.pyx":201 * # some value that isn't the first value * # and won't cause an overflow * cdef NUMBER last_elem = (~arr[0]) # <<<<<<<<<<<<<< @@ -16775,7 +17625,7 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_9 = 0; __pyx_v_last_elem = ((double)(~((uint64_t)(*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_arr.diminfo[0].strides))))); - /* "fastremap.pyx":200 + /* "fastremap.pyx":202 * # and won't cause an overflow * cdef NUMBER last_elem = (~arr[0]) * cdef NUMBER last_remap_id = start # <<<<<<<<<<<<<< @@ -16784,20 +17634,20 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_last_remap_id = __pyx_v_start; - /* "fastremap.pyx":202 + /* "fastremap.pyx":204 * cdef NUMBER last_remap_id = start * * cdef size_t size = arr.size # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_size = __pyx_t_10; - /* "fastremap.pyx":203 + /* "fastremap.pyx":205 * * cdef size_t size = arr.size * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -16806,7 +17656,7 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_i = 0; - /* "fastremap.pyx":205 + /* "fastremap.pyx":207 * cdef size_t i = 0 * * for i in range(size): # <<<<<<<<<<<<<< @@ -16818,7 +17668,7 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; - /* "fastremap.pyx":206 + /* "fastremap.pyx":208 * * for i in range(size): * elem = arrview[i] # <<<<<<<<<<<<<< @@ -16828,7 +17678,7 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_13 = __pyx_v_i; __pyx_v_elem = (*((double *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":208 + /* "fastremap.pyx":210 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -16838,7 +17688,7 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_3 = ((__pyx_v_elem == __pyx_v_last_elem) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":209 + /* "fastremap.pyx":211 * * if elem == last_elem: * arrview[i] = last_remap_id # <<<<<<<<<<<<<< @@ -16848,7 +17698,7 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_13 = __pyx_v_i; *((double *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; - /* "fastremap.pyx":210 + /* "fastremap.pyx":212 * if elem == last_elem: * arrview[i] = last_remap_id * continue # <<<<<<<<<<<<<< @@ -16857,7 +17707,7 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ */ goto __pyx_L5_continue; - /* "fastremap.pyx":208 + /* "fastremap.pyx":210 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -16866,7 +17716,7 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ */ } - /* "fastremap.pyx":212 + /* "fastremap.pyx":214 * continue * * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -16876,7 +17726,7 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_3 = ((__pyx_v_remap_dict.find(__pyx_v_elem) == __pyx_v_remap_dict.end()) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":213 + /* "fastremap.pyx":215 * * if remap_dict.find(elem) == remap_dict.end(): * arrview[i] = remap_id # <<<<<<<<<<<<<< @@ -16886,7 +17736,7 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_13 = __pyx_v_i; *((double *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = __pyx_v_remap_id; - /* "fastremap.pyx":214 + /* "fastremap.pyx":216 * if remap_dict.find(elem) == remap_dict.end(): * arrview[i] = remap_id * remap_dict[elem] = remap_id # <<<<<<<<<<<<<< @@ -16895,7 +17745,7 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ */ (__pyx_v_remap_dict[__pyx_v_elem]) = __pyx_v_remap_id; - /* "fastremap.pyx":215 + /* "fastremap.pyx":217 * arrview[i] = remap_id * remap_dict[elem] = remap_id * remap_id += 1 # <<<<<<<<<<<<<< @@ -16904,7 +17754,7 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_remap_id = (__pyx_v_remap_id + 1.0); - /* "fastremap.pyx":212 + /* "fastremap.pyx":214 * continue * * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -16914,7 +17764,7 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ goto __pyx_L8; } - /* "fastremap.pyx":217 + /* "fastremap.pyx":219 * remap_id += 1 * else: * arrview[i] = remap_dict[elem] # <<<<<<<<<<<<<< @@ -16927,7 +17777,7 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ } __pyx_L8:; - /* "fastremap.pyx":219 + /* "fastremap.pyx":221 * arrview[i] = remap_dict[elem] * * last_elem = elem # <<<<<<<<<<<<<< @@ -16936,7 +17786,7 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":220 + /* "fastremap.pyx":222 * * last_elem = elem * last_remap_id = arrview[i] # <<<<<<<<<<<<<< @@ -16948,7 +17798,7 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ __pyx_L5_continue:; } - /* "fastremap.pyx":222 + /* "fastremap.pyx":224 * last_remap_id = arrview[i] * * factor = remap_id # <<<<<<<<<<<<<< @@ -16957,37 +17807,37 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ */ __pyx_v_factor = __pyx_v_remap_id; - /* "fastremap.pyx":223 + /* "fastremap.pyx":225 * * factor = remap_id * if abs(start) > abs(factor): # <<<<<<<<<<<<<< * factor = start * */ - __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyFloat_FromDouble(fabs(__pyx_v_factor)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(fabs(__pyx_v_factor)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "fastremap.pyx":224 + /* "fastremap.pyx":226 * factor = remap_id * if abs(start) > abs(factor): * factor = start # <<<<<<<<<<<<<< * - * return refit(arr, factor), remap_dict + * return refit(arr, factor), { k:v for k,v in remap_dict } */ __pyx_v_factor = __pyx_v_start; - /* "fastremap.pyx":223 + /* "fastremap.pyx":225 * * factor = remap_id * if abs(start) > abs(factor): # <<<<<<<<<<<<<< @@ -16996,17 +17846,17 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ */ } - /* "fastremap.pyx":226 + /* "fastremap.pyx":228 * factor = start * - * return refit(arr, factor), remap_dict # <<<<<<<<<<<<<< + * return refit(arr, factor), { k:v for k,v in remap_dict } # <<<<<<<<<<<<<< * * def refit(arr, value=None, increase_only=False, exotics=False): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_refit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_refit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_factor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_factor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -17023,7 +17873,7 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_arr), __pyx_t_1}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -17032,14 +17882,14 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_arr), __pyx_t_1}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_4 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -17050,14 +17900,83 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __pyx_convert_unordered_map_to_py_double____double(__pyx_v_remap_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error) + { /* enter inner scope */ + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = __pyx_v_remap_dict.begin(); + for (;;) { + if (!(__pyx_t_14 != __pyx_v_remap_dict.end())) break; + __pyx_t_15 = *__pyx_t_14; + ++__pyx_t_14; + __pyx_t_4 = __pyx_convert_pair_to_py_double____double(__pyx_t_15); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_4); + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { + PyObject* sequence = __pyx_t_4; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 228, __pyx_L12_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_16 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 228, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_17 = Py_TYPE(__pyx_t_16)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_1)) goto __pyx_L15_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_6 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_6)) goto __pyx_L15_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 2) < 0) __PYX_ERR(0, 228, __pyx_L12_error) + __pyx_t_17 = NULL; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L16_unpacking_done; + __pyx_L15_unpacking_failed:; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_17 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 228, __pyx_L12_error) + __pyx_L16_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_k, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_v, __pyx_t_6); + __pyx_t_6 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_9genexpr11__pyx_v_k, (PyObject*)__pyx_9genexpr11__pyx_v_v))) __PYX_ERR(0, 228, __pyx_L12_error) + } + __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_k); __pyx_9genexpr11__pyx_v_k = 0; + __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_v); __pyx_9genexpr11__pyx_v_v = 0; + goto __pyx_L17_exit_scope; + __pyx_L12_error:; + __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_k); __pyx_9genexpr11__pyx_v_k = 0; + __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_v); __pyx_9genexpr11__pyx_v_v = 0; + goto __pyx_L1_error; + __pyx_L17_exit_scope:; + } /* exit inner scope */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); @@ -17085,6 +18004,7 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __Pyx_XDECREF(__pyx_t_16); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -17098,13 +18018,15 @@ static PyObject *__pyx_pf_9fastremap_108_renumber(CYTHON_UNUSED PyObject *__pyx_ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_arr.rcbuffer->pybuffer); __pyx_L2:; __PYX_XDEC_MEMVIEW(&__pyx_v_arrview, 1); + __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_k); + __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "fastremap.pyx":228 - * return refit(arr, factor), remap_dict +/* "fastremap.pyx":230 + * return refit(arr, factor), { k:v for k,v in remap_dict } * * def refit(arr, value=None, increase_only=False, exotics=False): # <<<<<<<<<<<<<< * """ @@ -17172,7 +18094,7 @@ static PyObject *__pyx_pw_9fastremap_11refit(PyObject *__pyx_self, PyObject *__p } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "refit") < 0)) __PYX_ERR(0, 228, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "refit") < 0)) __PYX_ERR(0, 230, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -17194,7 +18116,7 @@ static PyObject *__pyx_pw_9fastremap_11refit(PyObject *__pyx_self, PyObject *__p } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("refit", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 228, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("refit", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 230, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.refit", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -17228,7 +18150,7 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_RefNannySetupContext("refit", 0); __Pyx_INCREF(__pyx_v_value); - /* "fastremap.pyx":253 + /* "fastremap.pyx":255 * """ * * if value is None: # <<<<<<<<<<<<<< @@ -17239,14 +18161,14 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "fastremap.pyx":254 + /* "fastremap.pyx":256 * * if value is None: * min_value, max_value = minmax(arr) # <<<<<<<<<<<<<< * if min_value is None or max_value is None: * min_value = 0 */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_minmax_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_minmax_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -17260,7 +18182,7 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_arr) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_arr); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 254, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { @@ -17269,7 +18191,7 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 254, __pyx_L1_error) + __PYX_ERR(0, 256, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -17282,15 +18204,15 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; @@ -17298,7 +18220,7 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 254, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 256, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_unpacking_done; @@ -17306,7 +18228,7 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 254, __pyx_L1_error) + __PYX_ERR(0, 256, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_v_min_value = __pyx_t_4; @@ -17314,7 +18236,7 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, __pyx_v_max_value = __pyx_t_5; __pyx_t_5 = 0; - /* "fastremap.pyx":255 + /* "fastremap.pyx":257 * if value is None: * min_value, max_value = minmax(arr) * if min_value is None or max_value is None: # <<<<<<<<<<<<<< @@ -17334,7 +18256,7 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, __pyx_L7_bool_binop_done:; if (__pyx_t_2) { - /* "fastremap.pyx":256 + /* "fastremap.pyx":258 * min_value, max_value = minmax(arr) * if min_value is None or max_value is None: * min_value = 0 # <<<<<<<<<<<<<< @@ -17344,7 +18266,7 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_INCREF(__pyx_int_0); __Pyx_DECREF_SET(__pyx_v_min_value, __pyx_int_0); - /* "fastremap.pyx":257 + /* "fastremap.pyx":259 * if min_value is None or max_value is None: * min_value = 0 * max_value = 0 # <<<<<<<<<<<<<< @@ -17354,7 +18276,7 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_INCREF(__pyx_int_0); __Pyx_DECREF_SET(__pyx_v_max_value, __pyx_int_0); - /* "fastremap.pyx":255 + /* "fastremap.pyx":257 * if value is None: * min_value, max_value = minmax(arr) * if min_value is None or max_value is None: # <<<<<<<<<<<<<< @@ -17363,25 +18285,25 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, */ } - /* "fastremap.pyx":259 + /* "fastremap.pyx":261 * max_value = 0 * * if abs(max_value) > abs(min_value): # <<<<<<<<<<<<<< * value = max_value * else: */ - __pyx_t_3 = __Pyx_PyNumber_Absolute(__pyx_v_max_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyNumber_Absolute(__pyx_v_max_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_v_min_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_v_min_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { - /* "fastremap.pyx":260 + /* "fastremap.pyx":262 * * if abs(max_value) > abs(min_value): * value = max_value # <<<<<<<<<<<<<< @@ -17391,7 +18313,7 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_INCREF(__pyx_v_max_value); __Pyx_DECREF_SET(__pyx_v_value, __pyx_v_max_value); - /* "fastremap.pyx":259 + /* "fastremap.pyx":261 * max_value = 0 * * if abs(max_value) > abs(min_value): # <<<<<<<<<<<<<< @@ -17401,7 +18323,7 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, goto __pyx_L9; } - /* "fastremap.pyx":262 + /* "fastremap.pyx":264 * value = max_value * else: * value = min_value # <<<<<<<<<<<<<< @@ -17414,7 +18336,7 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, } __pyx_L9:; - /* "fastremap.pyx":253 + /* "fastremap.pyx":255 * """ * * if value is None: # <<<<<<<<<<<<<< @@ -17423,18 +18345,18 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, */ } - /* "fastremap.pyx":264 + /* "fastremap.pyx":266 * value = min_value * * dtype = fit_dtype(arr.dtype, value, exotics=exotics) # <<<<<<<<<<<<<< * * if increase_only and np.dtype(dtype).itemsize <= np.dtype(arr.dtype).itemsize: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_fit_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_fit_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); @@ -17442,10 +18364,10 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_value); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_exotics, __pyx_v_exotics) < 0) __PYX_ERR(0, 264, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 264, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_exotics, __pyx_v_exotics) < 0) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -17453,22 +18375,22 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; - /* "fastremap.pyx":266 + /* "fastremap.pyx":268 * dtype = fit_dtype(arr.dtype, value, exotics=exotics) * * if increase_only and np.dtype(dtype).itemsize <= np.dtype(arr.dtype).itemsize: # <<<<<<<<<<<<<< * return arr * elif dtype == arr.dtype: */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_increase_only); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_increase_only); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 268, __pyx_L1_error) if (__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L11_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -17483,18 +18405,18 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, } __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_dtype); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 266, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -17509,22 +18431,22 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 266, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = __pyx_t_1; __pyx_L11_bool_binop_done:; if (__pyx_t_2) { - /* "fastremap.pyx":267 + /* "fastremap.pyx":269 * * if increase_only and np.dtype(dtype).itemsize <= np.dtype(arr.dtype).itemsize: * return arr # <<<<<<<<<<<<<< @@ -17536,7 +18458,7 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "fastremap.pyx":266 + /* "fastremap.pyx":268 * dtype = fit_dtype(arr.dtype, value, exotics=exotics) * * if increase_only and np.dtype(dtype).itemsize <= np.dtype(arr.dtype).itemsize: # <<<<<<<<<<<<<< @@ -17545,22 +18467,22 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, */ } - /* "fastremap.pyx":268 + /* "fastremap.pyx":270 * if increase_only and np.dtype(dtype).itemsize <= np.dtype(arr.dtype).itemsize: * return arr * elif dtype == arr.dtype: # <<<<<<<<<<<<<< * return arr * return arr.astype(dtype) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { - /* "fastremap.pyx":269 + /* "fastremap.pyx":271 * return arr * elif dtype == arr.dtype: * return arr # <<<<<<<<<<<<<< @@ -17572,7 +18494,7 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "fastremap.pyx":268 + /* "fastremap.pyx":270 * if increase_only and np.dtype(dtype).itemsize <= np.dtype(arr.dtype).itemsize: * return arr * elif dtype == arr.dtype: # <<<<<<<<<<<<<< @@ -17581,7 +18503,7 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, */ } - /* "fastremap.pyx":270 + /* "fastremap.pyx":272 * elif dtype == arr.dtype: * return arr * return arr.astype(dtype) # <<<<<<<<<<<<<< @@ -17589,7 +18511,7 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, * def fit_dtype(dtype, value, exotics=False): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -17603,15 +18525,15 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, } __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_dtype); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 270, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "fastremap.pyx":228 - * return refit(arr, factor), remap_dict + /* "fastremap.pyx":230 + * return refit(arr, factor), { k:v for k,v in remap_dict } * * def refit(arr, value=None, increase_only=False, exotics=False): # <<<<<<<<<<<<<< * """ @@ -17637,7 +18559,7 @@ static PyObject *__pyx_pf_9fastremap_10refit(CYTHON_UNUSED PyObject *__pyx_self, return __pyx_r; } -/* "fastremap.pyx":272 +/* "fastremap.pyx":274 * return arr.astype(dtype) * * def fit_dtype(dtype, value, exotics=False): # <<<<<<<<<<<<<< @@ -17685,7 +18607,7 @@ static PyObject *__pyx_pw_9fastremap_13fit_dtype(PyObject *__pyx_self, PyObject case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_dtype", 0, 2, 3, 1); __PYX_ERR(0, 272, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_dtype", 0, 2, 3, 1); __PYX_ERR(0, 274, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -17695,7 +18617,7 @@ static PyObject *__pyx_pw_9fastremap_13fit_dtype(PyObject *__pyx_self, PyObject } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fit_dtype") < 0)) __PYX_ERR(0, 272, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fit_dtype") < 0)) __PYX_ERR(0, 274, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -17713,7 +18635,7 @@ static PyObject *__pyx_pw_9fastremap_13fit_dtype(PyObject *__pyx_self, PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("fit_dtype", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 272, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_dtype", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 274, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.fit_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -17748,16 +18670,16 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s __Pyx_RefNannySetupContext("fit_dtype", 0); __Pyx_INCREF(__pyx_v_dtype); - /* "fastremap.pyx":290 + /* "fastremap.pyx":292 * Return: refitted array * """ * dtype = np.dtype(dtype) # <<<<<<<<<<<<<< * if np.issubdtype(dtype, np.floating): * if exotics: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -17772,27 +18694,27 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_dtype); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":291 + /* "fastremap.pyx":293 * """ * dtype = np.dtype(dtype) * if np.issubdtype(dtype, np.floating): # <<<<<<<<<<<<<< * if exotics: * sequence = [ np.float16, np.float32, np.float64 ] */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_issubdtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_issubdtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_floating); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_floating); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -17810,7 +18732,7 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_dtype, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -17819,14 +18741,14 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_dtype, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; @@ -17837,48 +18759,48 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { - /* "fastremap.pyx":292 + /* "fastremap.pyx":294 * dtype = np.dtype(dtype) * if np.issubdtype(dtype, np.floating): * if exotics: # <<<<<<<<<<<<<< * sequence = [ np.float16, np.float32, np.float64 ] * else: */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_exotics); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 292, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_exotics); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 294, __pyx_L1_error) if (__pyx_t_7) { - /* "fastremap.pyx":293 + /* "fastremap.pyx":295 * if np.issubdtype(dtype, np.floating): * if exotics: * sequence = [ np.float16, np.float32, np.float64 ] # <<<<<<<<<<<<<< * else: * sequence = [ np.float32, np.float64 ] */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 293, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 293, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 293, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error) + __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); @@ -17892,7 +18814,7 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s __pyx_v_sequence = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":292 + /* "fastremap.pyx":294 * dtype = np.dtype(dtype) * if np.issubdtype(dtype, np.floating): * if exotics: # <<<<<<<<<<<<<< @@ -17902,7 +18824,7 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L4; } - /* "fastremap.pyx":295 + /* "fastremap.pyx":297 * sequence = [ np.float16, np.float32, np.float64 ] * else: * sequence = [ np.float32, np.float64 ] # <<<<<<<<<<<<<< @@ -17910,17 +18832,17 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s * elif np.issubdtype(dtype, np.unsignedinteger): */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 295, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 295, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error) + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); @@ -17933,22 +18855,22 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s } __pyx_L4:; - /* "fastremap.pyx":296 + /* "fastremap.pyx":298 * else: * sequence = [ np.float32, np.float64 ] * infofn = np.finfo # <<<<<<<<<<<<<< * elif np.issubdtype(dtype, np.unsignedinteger): * sequence = [ np.uint8, np.uint16, np.uint32, np.uint64 ] */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_finfo); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_finfo); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_infofn = __pyx_t_6; __pyx_t_6 = 0; - /* "fastremap.pyx":291 + /* "fastremap.pyx":293 * """ * dtype = np.dtype(dtype) * if np.issubdtype(dtype, np.floating): # <<<<<<<<<<<<<< @@ -17958,21 +18880,21 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L3; } - /* "fastremap.pyx":297 + /* "fastremap.pyx":299 * sequence = [ np.float32, np.float64 ] * infofn = np.finfo * elif np.issubdtype(dtype, np.unsignedinteger): # <<<<<<<<<<<<<< * sequence = [ np.uint8, np.uint16, np.uint32, np.uint64 ] * infofn = np.iinfo */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_issubdtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_issubdtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_unsignedinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_unsignedinteger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -17990,7 +18912,7 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_dtype, __pyx_t_2}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -17999,14 +18921,14 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_dtype, __pyx_t_2}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { - __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL; @@ -18017,43 +18939,43 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_7) { - /* "fastremap.pyx":298 + /* "fastremap.pyx":300 * infofn = np.finfo * elif np.issubdtype(dtype, np.unsignedinteger): * sequence = [ np.uint8, np.uint16, np.uint32, np.uint64 ] # <<<<<<<<<<<<<< * infofn = np.iinfo * if value < 0: */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyList_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_6 = PyList_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); @@ -18070,43 +18992,43 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s __pyx_v_sequence = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":299 + /* "fastremap.pyx":301 * elif np.issubdtype(dtype, np.unsignedinteger): * sequence = [ np.uint8, np.uint16, np.uint32, np.uint64 ] * infofn = np.iinfo # <<<<<<<<<<<<<< * if value < 0: * raise ValueError(str(value) + " is negative but unsigned data type {} is selected.".format(dtype)) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 299, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_infofn = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":300 + /* "fastremap.pyx":302 * sequence = [ np.uint8, np.uint16, np.uint32, np.uint64 ] * infofn = np.iinfo * if value < 0: # <<<<<<<<<<<<<< * raise ValueError(str(value) + " is negative but unsigned data type {} is selected.".format(dtype)) * elif np.issubdtype(dtype, np.complexfloating): */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_value, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 300, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_value, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_7)) { - /* "fastremap.pyx":301 + /* "fastremap.pyx":303 * infofn = np.iinfo * if value < 0: * raise ValueError(str(value) + " is negative but unsigned data type {} is selected.".format(dtype)) # <<<<<<<<<<<<<< * elif np.issubdtype(dtype, np.complexfloating): * if exotics: */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_is_negative_but_unsigned_data_t, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_is_negative_but_unsigned_data_t, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -18120,21 +19042,21 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s } __pyx_t_6 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_dtype); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 301, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 301, __pyx_L1_error) + __PYX_ERR(0, 303, __pyx_L1_error) - /* "fastremap.pyx":300 + /* "fastremap.pyx":302 * sequence = [ np.uint8, np.uint16, np.uint32, np.uint64 ] * infofn = np.iinfo * if value < 0: # <<<<<<<<<<<<<< @@ -18143,7 +19065,7 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "fastremap.pyx":297 + /* "fastremap.pyx":299 * sequence = [ np.float32, np.float64 ] * infofn = np.finfo * elif np.issubdtype(dtype, np.unsignedinteger): # <<<<<<<<<<<<<< @@ -18153,21 +19075,21 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L3; } - /* "fastremap.pyx":302 + /* "fastremap.pyx":304 * if value < 0: * raise ValueError(str(value) + " is negative but unsigned data type {} is selected.".format(dtype)) * elif np.issubdtype(dtype, np.complexfloating): # <<<<<<<<<<<<<< * if exotics: * sequence = [ np.csingle, np.cdouble ] */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_issubdtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_issubdtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_complexfloating); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_complexfloating); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -18185,7 +19107,7 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_dtype, __pyx_t_3}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -18194,14 +19116,14 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_dtype, __pyx_t_3}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; @@ -18212,43 +19134,43 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __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, 302, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_7) { - /* "fastremap.pyx":303 + /* "fastremap.pyx":305 * raise ValueError(str(value) + " is negative but unsigned data type {} is selected.".format(dtype)) * elif np.issubdtype(dtype, np.complexfloating): * if exotics: # <<<<<<<<<<<<<< * sequence = [ np.csingle, np.cdouble ] * else: */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_exotics); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_exotics); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 305, __pyx_L1_error) if (__pyx_t_7) { - /* "fastremap.pyx":304 + /* "fastremap.pyx":306 * elif np.issubdtype(dtype, np.complexfloating): * if exotics: * sequence = [ np.csingle, np.cdouble ] # <<<<<<<<<<<<<< * else: * sequence = [ np.csingle ] */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_csingle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_csingle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_cdouble); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_cdouble); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); @@ -18259,7 +19181,7 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s __pyx_v_sequence = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":303 + /* "fastremap.pyx":305 * raise ValueError(str(value) + " is negative but unsigned data type {} is selected.".format(dtype)) * elif np.issubdtype(dtype, np.complexfloating): * if exotics: # <<<<<<<<<<<<<< @@ -18269,7 +19191,7 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L6; } - /* "fastremap.pyx":306 + /* "fastremap.pyx":308 * sequence = [ np.csingle, np.cdouble ] * else: * sequence = [ np.csingle ] # <<<<<<<<<<<<<< @@ -18277,12 +19199,12 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s * elif np.issubdtype(dtype, np.integer): */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_csingle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_csingle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __pyx_L1_error) + __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); @@ -18292,22 +19214,22 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s } __pyx_L6:; - /* "fastremap.pyx":307 + /* "fastremap.pyx":309 * else: * sequence = [ np.csingle ] * infofn = np.finfo # <<<<<<<<<<<<<< * elif np.issubdtype(dtype, np.integer): * sequence = [ np.int8, np.int16, np.int32, np.int64 ] */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 307, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_finfo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_finfo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_infofn = __pyx_t_4; __pyx_t_4 = 0; - /* "fastremap.pyx":302 + /* "fastremap.pyx":304 * if value < 0: * raise ValueError(str(value) + " is negative but unsigned data type {} is selected.".format(dtype)) * elif np.issubdtype(dtype, np.complexfloating): # <<<<<<<<<<<<<< @@ -18317,21 +19239,21 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L3; } - /* "fastremap.pyx":308 + /* "fastremap.pyx":310 * sequence = [ np.csingle ] * infofn = np.finfo * elif np.issubdtype(dtype, np.integer): # <<<<<<<<<<<<<< * sequence = [ np.int8, np.int16, np.int32, np.int64 ] * infofn = np.iinfo */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_issubdtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_issubdtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_integer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_integer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -18349,7 +19271,7 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_dtype, __pyx_t_3}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -18358,14 +19280,14 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_dtype, __pyx_t_3}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_2 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -18376,43 +19298,43 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_5, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (likely(__pyx_t_7)) { - /* "fastremap.pyx":309 + /* "fastremap.pyx":311 * infofn = np.finfo * elif np.issubdtype(dtype, np.integer): * sequence = [ np.int8, np.int16, np.int32, np.int64 ] # <<<<<<<<<<<<<< * infofn = np.iinfo * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyList_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_4 = PyList_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -18429,22 +19351,22 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s __pyx_v_sequence = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":310 + /* "fastremap.pyx":312 * elif np.issubdtype(dtype, np.integer): * sequence = [ np.int8, np.int16, np.int32, np.int64 ] * infofn = np.iinfo # <<<<<<<<<<<<<< * else: * raise ValueError( */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_infofn = __pyx_t_6; __pyx_t_6 = 0; - /* "fastremap.pyx":308 + /* "fastremap.pyx":310 * sequence = [ np.csingle ] * infofn = np.finfo * elif np.issubdtype(dtype, np.integer): # <<<<<<<<<<<<<< @@ -18454,7 +19376,7 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L3; } - /* "fastremap.pyx":312 + /* "fastremap.pyx":314 * infofn = np.iinfo * else: * raise ValueError( # <<<<<<<<<<<<<< @@ -18463,14 +19385,14 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s */ /*else*/ { - /* "fastremap.pyx":313 + /* "fastremap.pyx":315 * else: * raise ValueError( * "Unsupported dtype: {} Only standard floats, integers, and complex types are supported.".format(dtype) # <<<<<<<<<<<<<< * ) * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unsupported_dtype_Only_standard, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unsupported_dtype_Only_standard, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -18484,36 +19406,36 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s } __pyx_t_6 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_dtype); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":312 + /* "fastremap.pyx":314 * infofn = np.iinfo * else: * raise ValueError( # <<<<<<<<<<<<<< * "Unsupported dtype: {} Only standard floats, integers, and complex types are supported.".format(dtype) * ) */ - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 312, __pyx_L1_error) + __PYX_ERR(0, 314, __pyx_L1_error) } __pyx_L3:; - /* "fastremap.pyx":316 + /* "fastremap.pyx":318 * ) * * test_value = np.real(value) # <<<<<<<<<<<<<< * if abs(np.real(value)) < abs(np.imag(value)): * test_value = np.imag(value) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_real); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_real); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -18528,22 +19450,22 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s } __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_value); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 316, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_test_value = __pyx_t_4; __pyx_t_4 = 0; - /* "fastremap.pyx":317 + /* "fastremap.pyx":319 * * test_value = np.real(value) * if abs(np.real(value)) < abs(np.imag(value)): # <<<<<<<<<<<<<< * test_value = np.imag(value) * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_real); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_real); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -18558,15 +19480,15 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s } __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_imag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_imag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -18581,29 +19503,29 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s } __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_7) { - /* "fastremap.pyx":318 + /* "fastremap.pyx":320 * test_value = np.real(value) * if abs(np.real(value)) < abs(np.imag(value)): * test_value = np.imag(value) # <<<<<<<<<<<<<< * * for seq_dtype in sequence: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_imag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_imag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -18618,13 +19540,13 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s } __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_2, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_value); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_test_value, __pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":317 + /* "fastremap.pyx":319 * * test_value = np.real(value) * if abs(np.real(value)) < abs(np.imag(value)): # <<<<<<<<<<<<<< @@ -18633,7 +19555,7 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "fastremap.pyx":320 + /* "fastremap.pyx":322 * test_value = np.imag(value) * * for seq_dtype in sequence: # <<<<<<<<<<<<<< @@ -18644,23 +19566,23 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s for (;;) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 320, __pyx_L1_error) + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 322, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 320, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_XDECREF_SET(__pyx_v_seq_dtype, __pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":321 + /* "fastremap.pyx":323 * * for seq_dtype in sequence: * if test_value >= 0 and infofn(seq_dtype).max >= test_value: # <<<<<<<<<<<<<< * return seq_dtype * elif test_value < 0 and infofn(seq_dtype).min <= test_value: */ - __pyx_t_6 = PyObject_RichCompare(__pyx_v_test_value, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 321, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_test_value, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_9) { } else { @@ -18680,21 +19602,21 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s } __pyx_t_6 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_seq_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_seq_dtype); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 321, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_v_test_value, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_v_test_value, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = __pyx_t_9; __pyx_L11_bool_binop_done:; if (__pyx_t_7) { - /* "fastremap.pyx":322 + /* "fastremap.pyx":324 * for seq_dtype in sequence: * if test_value >= 0 and infofn(seq_dtype).max >= test_value: * return seq_dtype # <<<<<<<<<<<<<< @@ -18707,7 +19629,7 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "fastremap.pyx":321 + /* "fastremap.pyx":323 * * for seq_dtype in sequence: * if test_value >= 0 and infofn(seq_dtype).max >= test_value: # <<<<<<<<<<<<<< @@ -18716,15 +19638,15 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "fastremap.pyx":323 + /* "fastremap.pyx":325 * if test_value >= 0 and infofn(seq_dtype).max >= test_value: * return seq_dtype * elif test_value < 0 and infofn(seq_dtype).min <= test_value: # <<<<<<<<<<<<<< * return seq_dtype * */ - __pyx_t_6 = PyObject_RichCompare(__pyx_v_test_value, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_test_value, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_9) { } else { @@ -18744,21 +19666,21 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s } __pyx_t_6 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_seq_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_seq_dtype); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_min); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_min); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_v_test_value, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_v_test_value, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = __pyx_t_9; __pyx_L13_bool_binop_done:; if (__pyx_t_7) { - /* "fastremap.pyx":324 + /* "fastremap.pyx":326 * return seq_dtype * elif test_value < 0 and infofn(seq_dtype).min <= test_value: * return seq_dtype # <<<<<<<<<<<<<< @@ -18771,7 +19693,7 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "fastremap.pyx":323 + /* "fastremap.pyx":325 * if test_value >= 0 and infofn(seq_dtype).max >= test_value: * return seq_dtype * elif test_value < 0 and infofn(seq_dtype).min <= test_value: # <<<<<<<<<<<<<< @@ -18780,7 +19702,7 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "fastremap.pyx":320 + /* "fastremap.pyx":322 * test_value = np.imag(value) * * for seq_dtype in sequence: # <<<<<<<<<<<<<< @@ -18790,17 +19712,17 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":326 + /* "fastremap.pyx":328 * return seq_dtype * * raise ValueError("Unable to find a compatible dtype for {} that can fit {}".format( # <<<<<<<<<<<<<< * dtype, value * )) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unable_to_find_a_compatible_dtyp, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unable_to_find_a_compatible_dtyp, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - /* "fastremap.pyx":327 + /* "fastremap.pyx":329 * * raise ValueError("Unable to find a compatible dtype for {} that can fit {}".format( * dtype, value # <<<<<<<<<<<<<< @@ -18822,7 +19744,7 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_dtype, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_4); } else @@ -18830,13 +19752,13 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_dtype, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { - __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL; @@ -18847,27 +19769,27 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_value); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":326 + /* "fastremap.pyx":328 * return seq_dtype * * raise ValueError("Unable to find a compatible dtype for {} that can fit {}".format( # <<<<<<<<<<<<<< * dtype, value * )) */ - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 326, __pyx_L1_error) + __PYX_ERR(0, 328, __pyx_L1_error) - /* "fastremap.pyx":272 + /* "fastremap.pyx":274 * return arr.astype(dtype) * * def fit_dtype(dtype, value, exotics=False): # <<<<<<<<<<<<<< @@ -18895,7 +19817,7 @@ static PyObject *__pyx_pf_9fastremap_12fit_dtype(CYTHON_UNUSED PyObject *__pyx_s return __pyx_r; } -/* "fastremap.pyx":330 +/* "fastremap.pyx":332 * )) * * def mask(arr, labels, in_place=False, value=0): # <<<<<<<<<<<<<< @@ -18947,7 +19869,7 @@ static PyObject *__pyx_pw_9fastremap_15mask(PyObject *__pyx_self, PyObject *__py case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("mask", 0, 2, 4, 1); __PYX_ERR(0, 330, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("mask", 0, 2, 4, 1); __PYX_ERR(0, 332, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -18963,7 +19885,7 @@ static PyObject *__pyx_pw_9fastremap_15mask(PyObject *__pyx_self, PyObject *__py } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mask") < 0)) __PYX_ERR(0, 330, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mask") < 0)) __PYX_ERR(0, 332, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -18984,7 +19906,7 @@ static PyObject *__pyx_pw_9fastremap_15mask(PyObject *__pyx_self, PyObject *__py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("mask", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 330, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("mask", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.mask", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -18998,7 +19920,7 @@ static PyObject *__pyx_pw_9fastremap_15mask(PyObject *__pyx_self, PyObject *__py } static PyObject *__pyx_pf_9fastremap_14mask(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr, PyObject *__pyx_v_labels, PyObject *__pyx_v_in_place, PyObject *__pyx_v_value) { - PyObject *__pyx_8genexpr2__pyx_v_lbl = NULL; + PyObject *__pyx_9genexpr12__pyx_v_lbl = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -19013,7 +19935,7 @@ static PyObject *__pyx_pf_9fastremap_14mask(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_RefNannySetupContext("mask", 0); __Pyx_INCREF(__pyx_v_labels); - /* "fastremap.pyx":349 + /* "fastremap.pyx":351 * Returns: arr with `labels` masked out * """ * labels = { lbl: value for lbl in labels } # <<<<<<<<<<<<<< @@ -19021,32 +19943,32 @@ static PyObject *__pyx_pf_9fastremap_14mask(CYTHON_UNUSED PyObject *__pyx_self, * */ { /* enter inner scope */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L5_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_v_labels)) || PyTuple_CheckExact(__pyx_v_labels)) { __pyx_t_2 = __pyx_v_labels; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_labels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L5_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_labels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 349, __pyx_L5_error) + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L5_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 349, __pyx_L5_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 351, __pyx_L5_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 349, __pyx_L5_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 349, __pyx_L5_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 351, __pyx_L5_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 349, __pyx_L5_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -19056,28 +19978,28 @@ static PyObject *__pyx_pf_9fastremap_14mask(CYTHON_UNUSED PyObject *__pyx_self, PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 349, __pyx_L5_error) + else __PYX_ERR(0, 351, __pyx_L5_error) } break; } __Pyx_GOTREF(__pyx_t_5); } - __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_lbl, __pyx_t_5); + __Pyx_XDECREF_SET(__pyx_9genexpr12__pyx_v_lbl, __pyx_t_5); __pyx_t_5 = 0; - if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_8genexpr2__pyx_v_lbl, (PyObject*)__pyx_v_value))) __PYX_ERR(0, 349, __pyx_L5_error) + if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_9genexpr12__pyx_v_lbl, (PyObject*)__pyx_v_value))) __PYX_ERR(0, 351, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_lbl); __pyx_8genexpr2__pyx_v_lbl = 0; + __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_lbl); __pyx_9genexpr12__pyx_v_lbl = 0; goto __pyx_L8_exit_scope; __pyx_L5_error:; - __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_lbl); __pyx_8genexpr2__pyx_v_lbl = 0; + __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_lbl); __pyx_9genexpr12__pyx_v_lbl = 0; goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ __Pyx_DECREF_SET(__pyx_v_labels, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":350 + /* "fastremap.pyx":352 * """ * labels = { lbl: value for lbl in labels } * return remap(arr, labels, preserve_missing_labels=True, in_place=in_place) # <<<<<<<<<<<<<< @@ -19085,9 +20007,9 @@ static PyObject *__pyx_pf_9fastremap_14mask(CYTHON_UNUSED PyObject *__pyx_self, * def mask_except(arr, labels, in_place=False, value=0): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_remap); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_remap); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); @@ -19095,11 +20017,11 @@ static PyObject *__pyx_pf_9fastremap_14mask(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_INCREF(__pyx_v_labels); __Pyx_GIVEREF(__pyx_v_labels); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_labels); - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 350, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_preserve_missing_labels, Py_True) < 0) __PYX_ERR(0, 350, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_in_place, __pyx_v_in_place) < 0) __PYX_ERR(0, 350, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_preserve_missing_labels, Py_True) < 0) __PYX_ERR(0, 352, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_in_place, __pyx_v_in_place) < 0) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -19108,7 +20030,7 @@ static PyObject *__pyx_pf_9fastremap_14mask(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_6 = 0; goto __pyx_L0; - /* "fastremap.pyx":330 + /* "fastremap.pyx":332 * )) * * def mask(arr, labels, in_place=False, value=0): # <<<<<<<<<<<<<< @@ -19125,14 +20047,14 @@ static PyObject *__pyx_pf_9fastremap_14mask(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_AddTraceback("fastremap.mask", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_lbl); + __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_lbl); __Pyx_XDECREF(__pyx_v_labels); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "fastremap.pyx":352 +/* "fastremap.pyx":354 * return remap(arr, labels, preserve_missing_labels=True, in_place=in_place) * * def mask_except(arr, labels, in_place=False, value=0): # <<<<<<<<<<<<<< @@ -19184,7 +20106,7 @@ static PyObject *__pyx_pw_9fastremap_17mask_except(PyObject *__pyx_self, PyObjec case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("mask_except", 0, 2, 4, 1); __PYX_ERR(0, 352, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("mask_except", 0, 2, 4, 1); __PYX_ERR(0, 354, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -19200,7 +20122,7 @@ static PyObject *__pyx_pw_9fastremap_17mask_except(PyObject *__pyx_self, PyObjec } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mask_except") < 0)) __PYX_ERR(0, 352, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mask_except") < 0)) __PYX_ERR(0, 354, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -19221,7 +20143,7 @@ static PyObject *__pyx_pw_9fastremap_17mask_except(PyObject *__pyx_self, PyObjec } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("mask_except", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 352, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("mask_except", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 354, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.mask_except", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -19253,35 +20175,35 @@ static PyObject *__pyx_pf_9fastremap_16mask_except(CYTHON_UNUSED PyObject *__pyx __Pyx_RefNannySetupContext("mask_except", 0); __Pyx_INCREF(__pyx_v_arr); - /* "fastremap.pyx":370 + /* "fastremap.pyx":372 * Returns: arr with all labels except `labels` masked out * """ * shape = arr.shape # <<<<<<<<<<<<<< * * if arr.flags['F_CONTIGUOUS']: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_shape = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":372 + /* "fastremap.pyx":374 * shape = arr.shape * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * order = 'F' * else: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "fastremap.pyx":373 + /* "fastremap.pyx":375 * * if arr.flags['F_CONTIGUOUS']: * order = 'F' # <<<<<<<<<<<<<< @@ -19291,7 +20213,7 @@ static PyObject *__pyx_pf_9fastremap_16mask_except(CYTHON_UNUSED PyObject *__pyx __Pyx_INCREF(__pyx_n_u_F); __pyx_v_order = __pyx_n_u_F; - /* "fastremap.pyx":372 + /* "fastremap.pyx":374 * shape = arr.shape * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -19301,7 +20223,7 @@ static PyObject *__pyx_pf_9fastremap_16mask_except(CYTHON_UNUSED PyObject *__pyx goto __pyx_L3; } - /* "fastremap.pyx":375 + /* "fastremap.pyx":377 * order = 'F' * else: * order = 'C' # <<<<<<<<<<<<<< @@ -19314,38 +20236,38 @@ static PyObject *__pyx_pf_9fastremap_16mask_except(CYTHON_UNUSED PyObject *__pyx } __pyx_L3:; - /* "fastremap.pyx":377 + /* "fastremap.pyx":379 * order = 'C' * * if not in_place: # <<<<<<<<<<<<<< * arr = np.copy(arr, order=order) * */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_in_place); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_in_place); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 379, __pyx_L1_error) __pyx_t_4 = ((!__pyx_t_3) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":378 + /* "fastremap.pyx":380 * * if not in_place: * arr = np.copy(arr, order=order) # <<<<<<<<<<<<<< * * arr = reshape(arr, (arr.size,)) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 378, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 378, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_arr); - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 378, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_v_order) < 0) __PYX_ERR(0, 378, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 378, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_v_order) < 0) __PYX_ERR(0, 380, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -19353,7 +20275,7 @@ static PyObject *__pyx_pf_9fastremap_16mask_except(CYTHON_UNUSED PyObject *__pyx __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":377 + /* "fastremap.pyx":379 * order = 'C' * * if not in_place: # <<<<<<<<<<<<<< @@ -19362,18 +20284,18 @@ static PyObject *__pyx_pf_9fastremap_16mask_except(CYTHON_UNUSED PyObject *__pyx */ } - /* "fastremap.pyx":380 + /* "fastremap.pyx":382 * arr = np.copy(arr, order=order) * * arr = reshape(arr, (arr.size,)) # <<<<<<<<<<<<<< * arr = _mask_except(arr, labels, value) * return reshape(arr, shape, order=order) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 380, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); @@ -19393,7 +20315,7 @@ static PyObject *__pyx_pf_9fastremap_16mask_except(CYTHON_UNUSED PyObject *__pyx #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_arr, __pyx_t_1}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 380, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -19402,14 +20324,14 @@ static PyObject *__pyx_pf_9fastremap_16mask_except(CYTHON_UNUSED PyObject *__pyx #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_arr, __pyx_t_1}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 380, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 380, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __pyx_t_2 = NULL; @@ -19420,7 +20342,7 @@ static PyObject *__pyx_pf_9fastremap_16mask_except(CYTHON_UNUSED PyObject *__pyx __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 380, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -19428,14 +20350,14 @@ static PyObject *__pyx_pf_9fastremap_16mask_except(CYTHON_UNUSED PyObject *__pyx __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":381 + /* "fastremap.pyx":383 * * arr = reshape(arr, (arr.size,)) * arr = _mask_except(arr, labels, value) # <<<<<<<<<<<<<< * return reshape(arr, shape, order=order) * */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_mask_except); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 381, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_mask_except); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = NULL; __pyx_t_7 = 0; @@ -19452,7 +20374,7 @@ static PyObject *__pyx_pf_9fastremap_16mask_except(CYTHON_UNUSED PyObject *__pyx #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_v_arr, __pyx_v_labels, __pyx_v_value}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 381, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_6); } else @@ -19460,13 +20382,13 @@ static PyObject *__pyx_pf_9fastremap_16mask_except(CYTHON_UNUSED PyObject *__pyx #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_v_arr, __pyx_v_labels, __pyx_v_value}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 381, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif { - __pyx_t_1 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); __pyx_t_8 = NULL; @@ -19480,7 +20402,7 @@ static PyObject *__pyx_pf_9fastremap_16mask_except(CYTHON_UNUSED PyObject *__pyx __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_7, __pyx_v_value); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 381, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -19488,7 +20410,7 @@ static PyObject *__pyx_pf_9fastremap_16mask_except(CYTHON_UNUSED PyObject *__pyx __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":382 + /* "fastremap.pyx":384 * arr = reshape(arr, (arr.size,)) * arr = _mask_except(arr, labels, value) * return reshape(arr, shape, order=order) # <<<<<<<<<<<<<< @@ -19496,9 +20418,9 @@ static PyObject *__pyx_pf_9fastremap_16mask_except(CYTHON_UNUSED PyObject *__pyx * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 382, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 382, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); @@ -19506,10 +20428,10 @@ static PyObject *__pyx_pf_9fastremap_16mask_except(CYTHON_UNUSED PyObject *__pyx __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_shape); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_order, __pyx_v_order) < 0) __PYX_ERR(0, 382, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 382, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_order, __pyx_v_order) < 0) __PYX_ERR(0, 384, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -19518,7 +20440,7 @@ static PyObject *__pyx_pf_9fastremap_16mask_except(CYTHON_UNUSED PyObject *__pyx __pyx_t_8 = 0; goto __pyx_L0; - /* "fastremap.pyx":352 + /* "fastremap.pyx":354 * return remap(arr, labels, preserve_missing_labels=True, in_place=in_place) * * def mask_except(arr, labels, in_place=False, value=0): # <<<<<<<<<<<<<< @@ -19544,7 +20466,7 @@ static PyObject *__pyx_pf_9fastremap_16mask_except(CYTHON_UNUSED PyObject *__pyx return __pyx_r; } -/* "fastremap.pyx":387 +/* "fastremap.pyx":389 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): # <<<<<<<<<<<<<< @@ -19593,23 +20515,23 @@ static PyObject *__pyx_pw_9fastremap_19_mask_except(PyObject *__pyx_self, PyObje case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 389, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 389, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 389, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 387, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 389, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -19626,7 +20548,7 @@ static PyObject *__pyx_pw_9fastremap_19_mask_except(PyObject *__pyx_self, PyObje } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 389, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -19688,7 +20610,7 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_mask_except", 0); __Pyx_INCREF(__pyx_v_kwargs); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -19702,7 +20624,7 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 389, __pyx_L1_error) __pyx_t_3 = ((!__pyx_t_4) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; @@ -19710,7 +20632,7 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_kwargs, Py_None); } - __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -19725,14 +20647,14 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_v____pyx_int64_t_is_signed = (!((((int64_t)-1L) > 0) != 0)); if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 387, __pyx_L1_error) + __PYX_ERR(0, 389, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 389, __pyx_L1_error) __pyx_t_2 = ((0 < __pyx_t_5) != 0); if (__pyx_t_2) { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 387, __pyx_L1_error) + __PYX_ERR(0, 389, __pyx_L1_error) } __pyx_t_1 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0); __Pyx_INCREF(__pyx_t_1); @@ -19749,18 +20671,18 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 387, __pyx_L1_error) + __PYX_ERR(0, 389, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_arr, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_arr, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 389, __pyx_L1_error) __pyx_t_3 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_3; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 387, __pyx_L1_error) + __PYX_ERR(0, 389, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -19769,12 +20691,12 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 387, __pyx_L1_error) + __PYX_ERR(0, 389, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 387, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 389, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_3); __Pyx_GIVEREF(__pyx_int_3); @@ -19785,15 +20707,15 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 387, __pyx_L1_error) + __PYX_ERR(0, 389, __pyx_L1_error) } __pyx_L6:; while (1) { @@ -19803,7 +20725,7 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -19812,14 +20734,14 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -19841,14 +20763,14 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_2 = (__pyx_v_dtype != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_itemsize = __pyx_t_5; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_kind = __pyx_t_7; __pyx_v_dtype_signed = (__pyx_v_kind == 'i'); @@ -19861,9 +20783,9 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -19875,7 +20797,7 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; __pyx_L16_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 389, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint16_t)) == __pyx_v_itemsize) != 0); @@ -19884,9 +20806,9 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; goto __pyx_L20_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -19898,7 +20820,7 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; __pyx_L20_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 389, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint32_t)) == __pyx_v_itemsize) != 0); @@ -19907,9 +20829,9 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; goto __pyx_L24_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -19921,7 +20843,7 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; __pyx_L24_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 389, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint64_t)) == __pyx_v_itemsize) != 0); @@ -19930,9 +20852,9 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; goto __pyx_L28_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -19944,7 +20866,7 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 389, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int8_t)) == __pyx_v_itemsize) != 0); @@ -19953,9 +20875,9 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; goto __pyx_L32_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -19967,7 +20889,7 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; __pyx_L32_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 389, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int16_t)) == __pyx_v_itemsize) != 0); @@ -19976,9 +20898,9 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; goto __pyx_L36_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -19990,7 +20912,7 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; __pyx_L36_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 389, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int32_t)) == __pyx_v_itemsize) != 0); @@ -19999,9 +20921,9 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; goto __pyx_L40_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -20013,7 +20935,7 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; __pyx_L40_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 389, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int64_t)) == __pyx_v_itemsize) != 0); @@ -20022,9 +20944,9 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; goto __pyx_L44_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -20036,7 +20958,7 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; __pyx_L44_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 389, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -20065,7 +20987,7 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 389, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -20087,7 +21009,7 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 389, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -20109,7 +21031,7 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 389, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -20131,7 +21053,7 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 389, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -20153,7 +21075,7 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 389, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -20175,7 +21097,7 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 389, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -20197,7 +21119,7 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 389, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -20219,27 +21141,27 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 389, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); } } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 389, __pyx_L1_error) goto __pyx_L10_break; } __pyx_L10_break:; - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_candidates = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = 0; if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 387, __pyx_L1_error) + __PYX_ERR(0, 389, __pyx_L1_error) } - __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_1; @@ -20247,12 +21169,12 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py while (1) { __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_9, &__pyx_t_5, &__pyx_t_1, NULL, NULL, __pyx_t_10); if (unlikely(__pyx_t_11 == 0)) break; - if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_1); __pyx_t_1 = 0; __pyx_v_match_found = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { @@ -20266,10 +21188,10 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py } __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, __pyx_kp_s__2) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__2); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -20284,12 +21206,12 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py } __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_12, __pyx_kp_s__3) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__3); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_src_sig, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 389, __pyx_L1_error) __pyx_t_16 = __pyx_t_15; for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; @@ -20300,11 +21222,11 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_t_3 = (__pyx_v_dst_type != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_2) { __pyx_v_match_found = 1; @@ -20320,35 +21242,35 @@ static PyObject *__pyx_pf_9fastremap_18_mask_except(CYTHON_UNUSED PyObject *__py __pyx_L82_break:; __pyx_t_2 = (__pyx_v_match_found != 0); if (__pyx_t_2) { - __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 389, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_candidates) != 0); __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 387, __pyx_L1_error) + __PYX_ERR(0, 389, __pyx_L1_error) } - __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 389, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_9 > 1) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 387, __pyx_L1_error) + __PYX_ERR(0, 389, __pyx_L1_error) } /*else*/ { __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 387, __pyx_L1_error) + __PYX_ERR(0, 389, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; @@ -20418,17 +21340,17 @@ static PyObject *__pyx_fuse_0__pyx_pw_9fastremap_113_mask_except(PyObject *__pyx case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 1); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 1); __PYX_ERR(0, 389, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 2); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 2); __PYX_ERR(0, 389, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_mask_except") < 0)) __PYX_ERR(0, 387, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_mask_except") < 0)) __PYX_ERR(0, 389, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -20439,18 +21361,18 @@ static PyObject *__pyx_fuse_0__pyx_pw_9fastremap_113_mask_except(PyObject *__pyx } __pyx_v_arr = ((PyArrayObject *)values[0]); __pyx_v_labels = ((PyObject*)values[1]); - __pyx_v_value = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L3_error) + __pyx_v_value = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 389, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._mask_except", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 387, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), (&PyList_Type), 1, "labels", 1))) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 389, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), (&PyList_Type), 1, "labels", 1))) __PYX_ERR(0, 389, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_112_mask_except(__pyx_self, __pyx_v_arr, __pyx_v_labels, __pyx_v_value); /* function exit code */ @@ -20466,7 +21388,7 @@ static PyObject *__pyx_pf_9fastremap_112_mask_except(CYTHON_UNUSED PyObject *__p __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; size_t __pyx_v_i; size_t __pyx_v_size; - std::unordered_map __pyx_v_tbl; + ska::flat_hash_map __pyx_v_tbl; PyObject *__pyx_v_label = NULL; uint8_t __pyx_v_last_elem; uint8_t __pyx_v_last_elem_value; @@ -20496,23 +21418,23 @@ static PyObject *__pyx_pf_9fastremap_112_mask_except(CYTHON_UNUSED PyObject *__p __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 389, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":388 + /* "fastremap.pyx":390 * @cython.nonecheck(False) * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): * cdef ALLINT[:] arrview = arr # <<<<<<<<<<<<<< * cdef size_t i = 0 * cdef size_t size = arr.size */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 390, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":389 + /* "fastremap.pyx":391 * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): * cdef ALLINT[:] arrview = arr * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -20521,20 +21443,20 @@ static PyObject *__pyx_pf_9fastremap_112_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_i = 0; - /* "fastremap.pyx":390 + /* "fastremap.pyx":392 * cdef ALLINT[:] arrview = arr * cdef size_t i = 0 * cdef size_t size = arr.size # <<<<<<<<<<<<<< * * if size == 0: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_size = __pyx_t_3; - /* "fastremap.pyx":392 + /* "fastremap.pyx":394 * cdef size_t size = arr.size * * if size == 0: # <<<<<<<<<<<<<< @@ -20544,19 +21466,19 @@ static PyObject *__pyx_pf_9fastremap_112_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = ((__pyx_v_size == 0) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":393 + /* "fastremap.pyx":395 * * if size == 0: * return arr # <<<<<<<<<<<<<< * - * cdef unordered_map[ALLINT, ALLINT] tbl + * cdef flat_hash_map[ALLINT, ALLINT] tbl */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_arr)); __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":392 + /* "fastremap.pyx":394 * cdef size_t size = arr.size * * if size == 0: # <<<<<<<<<<<<<< @@ -20565,8 +21487,8 @@ static PyObject *__pyx_pf_9fastremap_112_mask_except(CYTHON_UNUSED PyObject *__p */ } - /* "fastremap.pyx":397 - * cdef unordered_map[ALLINT, ALLINT] tbl + /* "fastremap.pyx":399 + * cdef flat_hash_map[ALLINT, ALLINT] tbl * * for label in labels: # <<<<<<<<<<<<<< * tbl[label] = label @@ -20574,33 +21496,33 @@ static PyObject *__pyx_pf_9fastremap_112_mask_except(CYTHON_UNUSED PyObject *__p */ if (unlikely(__pyx_v_labels == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 397, __pyx_L1_error) + __PYX_ERR(0, 399, __pyx_L1_error) } __pyx_t_2 = __pyx_v_labels; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; for (;;) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 399, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":398 + /* "fastremap.pyx":400 * * for label in labels: * tbl[label] = label # <<<<<<<<<<<<<< * * cdef ALLINT last_elem = arrview[0] */ - __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_v_label); if (unlikely((__pyx_t_7 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_v_label); if (unlikely((__pyx_t_8 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_v_label); if (unlikely((__pyx_t_7 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_v_label); if (unlikely((__pyx_t_8 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L1_error) (__pyx_v_tbl[__pyx_t_8]) = __pyx_t_7; - /* "fastremap.pyx":397 - * cdef unordered_map[ALLINT, ALLINT] tbl + /* "fastremap.pyx":399 + * cdef flat_hash_map[ALLINT, ALLINT] tbl * * for label in labels: # <<<<<<<<<<<<<< * tbl[label] = label @@ -20609,7 +21531,7 @@ static PyObject *__pyx_pf_9fastremap_112_mask_except(CYTHON_UNUSED PyObject *__p } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":400 + /* "fastremap.pyx":402 * tbl[label] = label * * cdef ALLINT last_elem = arrview[0] # <<<<<<<<<<<<<< @@ -20619,7 +21541,7 @@ static PyObject *__pyx_pf_9fastremap_112_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_9 = 0; __pyx_v_last_elem = (*((uint8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_9 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":401 + /* "fastremap.pyx":403 * * cdef ALLINT last_elem = arrview[0] * cdef ALLINT last_elem_value = 0 # <<<<<<<<<<<<<< @@ -20628,7 +21550,7 @@ static PyObject *__pyx_pf_9fastremap_112_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_last_elem_value = 0; - /* "fastremap.pyx":403 + /* "fastremap.pyx":405 * cdef ALLINT last_elem_value = 0 * * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -20638,7 +21560,7 @@ static PyObject *__pyx_pf_9fastremap_112_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_last_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":404 + /* "fastremap.pyx":406 * * if tbl.find(last_elem) == tbl.end(): * last_elem_value = value # <<<<<<<<<<<<<< @@ -20647,7 +21569,7 @@ static PyObject *__pyx_pf_9fastremap_112_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_last_elem_value = __pyx_v_value; - /* "fastremap.pyx":403 + /* "fastremap.pyx":405 * cdef ALLINT last_elem_value = 0 * * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -20657,7 +21579,7 @@ static PyObject *__pyx_pf_9fastremap_112_mask_except(CYTHON_UNUSED PyObject *__p goto __pyx_L6; } - /* "fastremap.pyx":406 + /* "fastremap.pyx":408 * last_elem_value = value * else: * last_elem_value = last_elem # <<<<<<<<<<<<<< @@ -20669,7 +21591,7 @@ static PyObject *__pyx_pf_9fastremap_112_mask_except(CYTHON_UNUSED PyObject *__p } __pyx_L6:; - /* "fastremap.pyx":408 + /* "fastremap.pyx":410 * last_elem_value = last_elem * * for i in range(size): # <<<<<<<<<<<<<< @@ -20681,7 +21603,7 @@ static PyObject *__pyx_pf_9fastremap_112_mask_except(CYTHON_UNUSED PyObject *__p for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "fastremap.pyx":409 + /* "fastremap.pyx":411 * * for i in range(size): * if arrview[i] == last_elem: # <<<<<<<<<<<<<< @@ -20692,7 +21614,7 @@ static PyObject *__pyx_pf_9fastremap_112_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = (((*((uint8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) ))) == __pyx_v_last_elem) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":410 + /* "fastremap.pyx":412 * for i in range(size): * if arrview[i] == last_elem: * arrview[i] = last_elem_value # <<<<<<<<<<<<<< @@ -20702,7 +21624,7 @@ static PyObject *__pyx_pf_9fastremap_112_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; *((uint8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_elem_value; - /* "fastremap.pyx":409 + /* "fastremap.pyx":411 * * for i in range(size): * if arrview[i] == last_elem: # <<<<<<<<<<<<<< @@ -20712,7 +21634,7 @@ static PyObject *__pyx_pf_9fastremap_112_mask_except(CYTHON_UNUSED PyObject *__p goto __pyx_L9; } - /* "fastremap.pyx":411 + /* "fastremap.pyx":413 * if arrview[i] == last_elem: * arrview[i] = last_elem_value * elif tbl.find(arrview[i]) == tbl.end(): # <<<<<<<<<<<<<< @@ -20723,7 +21645,7 @@ static PyObject *__pyx_pf_9fastremap_112_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = ((__pyx_v_tbl.find((*((uint8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) )))) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":412 + /* "fastremap.pyx":414 * arrview[i] = last_elem_value * elif tbl.find(arrview[i]) == tbl.end(): * last_elem = arrview[i] # <<<<<<<<<<<<<< @@ -20733,7 +21655,7 @@ static PyObject *__pyx_pf_9fastremap_112_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; __pyx_v_last_elem = (*((uint8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":413 + /* "fastremap.pyx":415 * elif tbl.find(arrview[i]) == tbl.end(): * last_elem = arrview[i] * last_elem_value = value # <<<<<<<<<<<<<< @@ -20742,7 +21664,7 @@ static PyObject *__pyx_pf_9fastremap_112_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_last_elem_value = __pyx_v_value; - /* "fastremap.pyx":414 + /* "fastremap.pyx":416 * last_elem = arrview[i] * last_elem_value = value * arrview[i] = value # <<<<<<<<<<<<<< @@ -20752,7 +21674,7 @@ static PyObject *__pyx_pf_9fastremap_112_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; *((uint8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) )) = __pyx_v_value; - /* "fastremap.pyx":411 + /* "fastremap.pyx":413 * if arrview[i] == last_elem: * arrview[i] = last_elem_value * elif tbl.find(arrview[i]) == tbl.end(): # <<<<<<<<<<<<<< @@ -20762,7 +21684,7 @@ static PyObject *__pyx_pf_9fastremap_112_mask_except(CYTHON_UNUSED PyObject *__p goto __pyx_L9; } - /* "fastremap.pyx":416 + /* "fastremap.pyx":418 * arrview[i] = value * else: * last_elem = arrview[i] # <<<<<<<<<<<<<< @@ -20773,7 +21695,7 @@ static PyObject *__pyx_pf_9fastremap_112_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; __pyx_v_last_elem = (*((uint8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":417 + /* "fastremap.pyx":419 * else: * last_elem = arrview[i] * last_elem_value = arrview[i] # <<<<<<<<<<<<<< @@ -20786,7 +21708,7 @@ static PyObject *__pyx_pf_9fastremap_112_mask_except(CYTHON_UNUSED PyObject *__p __pyx_L9:; } - /* "fastremap.pyx":419 + /* "fastremap.pyx":421 * last_elem_value = arrview[i] * * return arr # <<<<<<<<<<<<<< @@ -20798,7 +21720,7 @@ static PyObject *__pyx_pf_9fastremap_112_mask_except(CYTHON_UNUSED PyObject *__p __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":387 + /* "fastremap.pyx":389 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): # <<<<<<<<<<<<<< @@ -20868,17 +21790,17 @@ static PyObject *__pyx_fuse_1__pyx_pw_9fastremap_115_mask_except(PyObject *__pyx case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 1); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 1); __PYX_ERR(0, 389, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 2); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 2); __PYX_ERR(0, 389, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_mask_except") < 0)) __PYX_ERR(0, 387, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_mask_except") < 0)) __PYX_ERR(0, 389, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -20889,18 +21811,18 @@ static PyObject *__pyx_fuse_1__pyx_pw_9fastremap_115_mask_except(PyObject *__pyx } __pyx_v_arr = ((PyArrayObject *)values[0]); __pyx_v_labels = ((PyObject*)values[1]); - __pyx_v_value = __Pyx_PyInt_As_uint16_t(values[2]); if (unlikely((__pyx_v_value == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L3_error) + __pyx_v_value = __Pyx_PyInt_As_uint16_t(values[2]); if (unlikely((__pyx_v_value == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 389, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._mask_except", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 387, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), (&PyList_Type), 1, "labels", 1))) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 389, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), (&PyList_Type), 1, "labels", 1))) __PYX_ERR(0, 389, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_114_mask_except(__pyx_self, __pyx_v_arr, __pyx_v_labels, __pyx_v_value); /* function exit code */ @@ -20916,7 +21838,7 @@ static PyObject *__pyx_pf_9fastremap_114_mask_except(CYTHON_UNUSED PyObject *__p __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; size_t __pyx_v_i; size_t __pyx_v_size; - std::unordered_map __pyx_v_tbl; + ska::flat_hash_map __pyx_v_tbl; PyObject *__pyx_v_label = NULL; uint16_t __pyx_v_last_elem; uint16_t __pyx_v_last_elem_value; @@ -20946,23 +21868,23 @@ static PyObject *__pyx_pf_9fastremap_114_mask_except(CYTHON_UNUSED PyObject *__p __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 389, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":388 + /* "fastremap.pyx":390 * @cython.nonecheck(False) * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): * cdef ALLINT[:] arrview = arr # <<<<<<<<<<<<<< * cdef size_t i = 0 * cdef size_t size = arr.size */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 390, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":389 + /* "fastremap.pyx":391 * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): * cdef ALLINT[:] arrview = arr * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -20971,20 +21893,20 @@ static PyObject *__pyx_pf_9fastremap_114_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_i = 0; - /* "fastremap.pyx":390 + /* "fastremap.pyx":392 * cdef ALLINT[:] arrview = arr * cdef size_t i = 0 * cdef size_t size = arr.size # <<<<<<<<<<<<<< * * if size == 0: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_size = __pyx_t_3; - /* "fastremap.pyx":392 + /* "fastremap.pyx":394 * cdef size_t size = arr.size * * if size == 0: # <<<<<<<<<<<<<< @@ -20994,19 +21916,19 @@ static PyObject *__pyx_pf_9fastremap_114_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = ((__pyx_v_size == 0) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":393 + /* "fastremap.pyx":395 * * if size == 0: * return arr # <<<<<<<<<<<<<< * - * cdef unordered_map[ALLINT, ALLINT] tbl + * cdef flat_hash_map[ALLINT, ALLINT] tbl */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_arr)); __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":392 + /* "fastremap.pyx":394 * cdef size_t size = arr.size * * if size == 0: # <<<<<<<<<<<<<< @@ -21015,8 +21937,8 @@ static PyObject *__pyx_pf_9fastremap_114_mask_except(CYTHON_UNUSED PyObject *__p */ } - /* "fastremap.pyx":397 - * cdef unordered_map[ALLINT, ALLINT] tbl + /* "fastremap.pyx":399 + * cdef flat_hash_map[ALLINT, ALLINT] tbl * * for label in labels: # <<<<<<<<<<<<<< * tbl[label] = label @@ -21024,33 +21946,33 @@ static PyObject *__pyx_pf_9fastremap_114_mask_except(CYTHON_UNUSED PyObject *__p */ if (unlikely(__pyx_v_labels == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 397, __pyx_L1_error) + __PYX_ERR(0, 399, __pyx_L1_error) } __pyx_t_2 = __pyx_v_labels; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; for (;;) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 399, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":398 + /* "fastremap.pyx":400 * * for label in labels: * tbl[label] = label # <<<<<<<<<<<<<< * * cdef ALLINT last_elem = arrview[0] */ - __pyx_t_7 = __Pyx_PyInt_As_uint16_t(__pyx_v_label); if (unlikely((__pyx_t_7 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyInt_As_uint16_t(__pyx_v_label); if (unlikely((__pyx_t_8 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_uint16_t(__pyx_v_label); if (unlikely((__pyx_t_7 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_uint16_t(__pyx_v_label); if (unlikely((__pyx_t_8 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L1_error) (__pyx_v_tbl[__pyx_t_8]) = __pyx_t_7; - /* "fastremap.pyx":397 - * cdef unordered_map[ALLINT, ALLINT] tbl + /* "fastremap.pyx":399 + * cdef flat_hash_map[ALLINT, ALLINT] tbl * * for label in labels: # <<<<<<<<<<<<<< * tbl[label] = label @@ -21059,7 +21981,7 @@ static PyObject *__pyx_pf_9fastremap_114_mask_except(CYTHON_UNUSED PyObject *__p } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":400 + /* "fastremap.pyx":402 * tbl[label] = label * * cdef ALLINT last_elem = arrview[0] # <<<<<<<<<<<<<< @@ -21069,7 +21991,7 @@ static PyObject *__pyx_pf_9fastremap_114_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_9 = 0; __pyx_v_last_elem = (*((uint16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_9 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":401 + /* "fastremap.pyx":403 * * cdef ALLINT last_elem = arrview[0] * cdef ALLINT last_elem_value = 0 # <<<<<<<<<<<<<< @@ -21078,7 +22000,7 @@ static PyObject *__pyx_pf_9fastremap_114_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_last_elem_value = 0; - /* "fastremap.pyx":403 + /* "fastremap.pyx":405 * cdef ALLINT last_elem_value = 0 * * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -21088,7 +22010,7 @@ static PyObject *__pyx_pf_9fastremap_114_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_last_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":404 + /* "fastremap.pyx":406 * * if tbl.find(last_elem) == tbl.end(): * last_elem_value = value # <<<<<<<<<<<<<< @@ -21097,7 +22019,7 @@ static PyObject *__pyx_pf_9fastremap_114_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_last_elem_value = __pyx_v_value; - /* "fastremap.pyx":403 + /* "fastremap.pyx":405 * cdef ALLINT last_elem_value = 0 * * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -21107,7 +22029,7 @@ static PyObject *__pyx_pf_9fastremap_114_mask_except(CYTHON_UNUSED PyObject *__p goto __pyx_L6; } - /* "fastremap.pyx":406 + /* "fastremap.pyx":408 * last_elem_value = value * else: * last_elem_value = last_elem # <<<<<<<<<<<<<< @@ -21119,7 +22041,7 @@ static PyObject *__pyx_pf_9fastremap_114_mask_except(CYTHON_UNUSED PyObject *__p } __pyx_L6:; - /* "fastremap.pyx":408 + /* "fastremap.pyx":410 * last_elem_value = last_elem * * for i in range(size): # <<<<<<<<<<<<<< @@ -21131,7 +22053,7 @@ static PyObject *__pyx_pf_9fastremap_114_mask_except(CYTHON_UNUSED PyObject *__p for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "fastremap.pyx":409 + /* "fastremap.pyx":411 * * for i in range(size): * if arrview[i] == last_elem: # <<<<<<<<<<<<<< @@ -21142,7 +22064,7 @@ static PyObject *__pyx_pf_9fastremap_114_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = (((*((uint16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) ))) == __pyx_v_last_elem) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":410 + /* "fastremap.pyx":412 * for i in range(size): * if arrview[i] == last_elem: * arrview[i] = last_elem_value # <<<<<<<<<<<<<< @@ -21152,7 +22074,7 @@ static PyObject *__pyx_pf_9fastremap_114_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; *((uint16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_elem_value; - /* "fastremap.pyx":409 + /* "fastremap.pyx":411 * * for i in range(size): * if arrview[i] == last_elem: # <<<<<<<<<<<<<< @@ -21162,7 +22084,7 @@ static PyObject *__pyx_pf_9fastremap_114_mask_except(CYTHON_UNUSED PyObject *__p goto __pyx_L9; } - /* "fastremap.pyx":411 + /* "fastremap.pyx":413 * if arrview[i] == last_elem: * arrview[i] = last_elem_value * elif tbl.find(arrview[i]) == tbl.end(): # <<<<<<<<<<<<<< @@ -21173,7 +22095,7 @@ static PyObject *__pyx_pf_9fastremap_114_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = ((__pyx_v_tbl.find((*((uint16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) )))) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":412 + /* "fastremap.pyx":414 * arrview[i] = last_elem_value * elif tbl.find(arrview[i]) == tbl.end(): * last_elem = arrview[i] # <<<<<<<<<<<<<< @@ -21183,7 +22105,7 @@ static PyObject *__pyx_pf_9fastremap_114_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; __pyx_v_last_elem = (*((uint16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":413 + /* "fastremap.pyx":415 * elif tbl.find(arrview[i]) == tbl.end(): * last_elem = arrview[i] * last_elem_value = value # <<<<<<<<<<<<<< @@ -21192,7 +22114,7 @@ static PyObject *__pyx_pf_9fastremap_114_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_last_elem_value = __pyx_v_value; - /* "fastremap.pyx":414 + /* "fastremap.pyx":416 * last_elem = arrview[i] * last_elem_value = value * arrview[i] = value # <<<<<<<<<<<<<< @@ -21202,7 +22124,7 @@ static PyObject *__pyx_pf_9fastremap_114_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; *((uint16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) )) = __pyx_v_value; - /* "fastremap.pyx":411 + /* "fastremap.pyx":413 * if arrview[i] == last_elem: * arrview[i] = last_elem_value * elif tbl.find(arrview[i]) == tbl.end(): # <<<<<<<<<<<<<< @@ -21212,7 +22134,7 @@ static PyObject *__pyx_pf_9fastremap_114_mask_except(CYTHON_UNUSED PyObject *__p goto __pyx_L9; } - /* "fastremap.pyx":416 + /* "fastremap.pyx":418 * arrview[i] = value * else: * last_elem = arrview[i] # <<<<<<<<<<<<<< @@ -21223,7 +22145,7 @@ static PyObject *__pyx_pf_9fastremap_114_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; __pyx_v_last_elem = (*((uint16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":417 + /* "fastremap.pyx":419 * else: * last_elem = arrview[i] * last_elem_value = arrview[i] # <<<<<<<<<<<<<< @@ -21236,7 +22158,7 @@ static PyObject *__pyx_pf_9fastremap_114_mask_except(CYTHON_UNUSED PyObject *__p __pyx_L9:; } - /* "fastremap.pyx":419 + /* "fastremap.pyx":421 * last_elem_value = arrview[i] * * return arr # <<<<<<<<<<<<<< @@ -21248,7 +22170,7 @@ static PyObject *__pyx_pf_9fastremap_114_mask_except(CYTHON_UNUSED PyObject *__p __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":387 + /* "fastremap.pyx":389 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): # <<<<<<<<<<<<<< @@ -21318,17 +22240,17 @@ static PyObject *__pyx_fuse_2__pyx_pw_9fastremap_117_mask_except(PyObject *__pyx case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 1); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 1); __PYX_ERR(0, 389, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 2); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 2); __PYX_ERR(0, 389, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_mask_except") < 0)) __PYX_ERR(0, 387, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_mask_except") < 0)) __PYX_ERR(0, 389, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -21339,18 +22261,18 @@ static PyObject *__pyx_fuse_2__pyx_pw_9fastremap_117_mask_except(PyObject *__pyx } __pyx_v_arr = ((PyArrayObject *)values[0]); __pyx_v_labels = ((PyObject*)values[1]); - __pyx_v_value = __Pyx_PyInt_As_uint32_t(values[2]); if (unlikely((__pyx_v_value == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L3_error) + __pyx_v_value = __Pyx_PyInt_As_uint32_t(values[2]); if (unlikely((__pyx_v_value == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 389, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._mask_except", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 387, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), (&PyList_Type), 1, "labels", 1))) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 389, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), (&PyList_Type), 1, "labels", 1))) __PYX_ERR(0, 389, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_116_mask_except(__pyx_self, __pyx_v_arr, __pyx_v_labels, __pyx_v_value); /* function exit code */ @@ -21366,7 +22288,7 @@ static PyObject *__pyx_pf_9fastremap_116_mask_except(CYTHON_UNUSED PyObject *__p __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; size_t __pyx_v_i; size_t __pyx_v_size; - std::unordered_map __pyx_v_tbl; + ska::flat_hash_map __pyx_v_tbl; PyObject *__pyx_v_label = NULL; uint32_t __pyx_v_last_elem; uint32_t __pyx_v_last_elem_value; @@ -21396,23 +22318,23 @@ static PyObject *__pyx_pf_9fastremap_116_mask_except(CYTHON_UNUSED PyObject *__p __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 389, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":388 + /* "fastremap.pyx":390 * @cython.nonecheck(False) * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): * cdef ALLINT[:] arrview = arr # <<<<<<<<<<<<<< * cdef size_t i = 0 * cdef size_t size = arr.size */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 390, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":389 + /* "fastremap.pyx":391 * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): * cdef ALLINT[:] arrview = arr * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -21421,20 +22343,20 @@ static PyObject *__pyx_pf_9fastremap_116_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_i = 0; - /* "fastremap.pyx":390 + /* "fastremap.pyx":392 * cdef ALLINT[:] arrview = arr * cdef size_t i = 0 * cdef size_t size = arr.size # <<<<<<<<<<<<<< * * if size == 0: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_size = __pyx_t_3; - /* "fastremap.pyx":392 + /* "fastremap.pyx":394 * cdef size_t size = arr.size * * if size == 0: # <<<<<<<<<<<<<< @@ -21444,19 +22366,19 @@ static PyObject *__pyx_pf_9fastremap_116_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = ((__pyx_v_size == 0) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":393 + /* "fastremap.pyx":395 * * if size == 0: * return arr # <<<<<<<<<<<<<< * - * cdef unordered_map[ALLINT, ALLINT] tbl + * cdef flat_hash_map[ALLINT, ALLINT] tbl */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_arr)); __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":392 + /* "fastremap.pyx":394 * cdef size_t size = arr.size * * if size == 0: # <<<<<<<<<<<<<< @@ -21465,8 +22387,8 @@ static PyObject *__pyx_pf_9fastremap_116_mask_except(CYTHON_UNUSED PyObject *__p */ } - /* "fastremap.pyx":397 - * cdef unordered_map[ALLINT, ALLINT] tbl + /* "fastremap.pyx":399 + * cdef flat_hash_map[ALLINT, ALLINT] tbl * * for label in labels: # <<<<<<<<<<<<<< * tbl[label] = label @@ -21474,33 +22396,33 @@ static PyObject *__pyx_pf_9fastremap_116_mask_except(CYTHON_UNUSED PyObject *__p */ if (unlikely(__pyx_v_labels == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 397, __pyx_L1_error) + __PYX_ERR(0, 399, __pyx_L1_error) } __pyx_t_2 = __pyx_v_labels; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; for (;;) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 399, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":398 + /* "fastremap.pyx":400 * * for label in labels: * tbl[label] = label # <<<<<<<<<<<<<< * * cdef ALLINT last_elem = arrview[0] */ - __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_v_label); if (unlikely((__pyx_t_7 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyInt_As_uint32_t(__pyx_v_label); if (unlikely((__pyx_t_8 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_v_label); if (unlikely((__pyx_t_7 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_uint32_t(__pyx_v_label); if (unlikely((__pyx_t_8 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L1_error) (__pyx_v_tbl[__pyx_t_8]) = __pyx_t_7; - /* "fastremap.pyx":397 - * cdef unordered_map[ALLINT, ALLINT] tbl + /* "fastremap.pyx":399 + * cdef flat_hash_map[ALLINT, ALLINT] tbl * * for label in labels: # <<<<<<<<<<<<<< * tbl[label] = label @@ -21509,7 +22431,7 @@ static PyObject *__pyx_pf_9fastremap_116_mask_except(CYTHON_UNUSED PyObject *__p } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":400 + /* "fastremap.pyx":402 * tbl[label] = label * * cdef ALLINT last_elem = arrview[0] # <<<<<<<<<<<<<< @@ -21519,7 +22441,7 @@ static PyObject *__pyx_pf_9fastremap_116_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_9 = 0; __pyx_v_last_elem = (*((uint32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_9 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":401 + /* "fastremap.pyx":403 * * cdef ALLINT last_elem = arrview[0] * cdef ALLINT last_elem_value = 0 # <<<<<<<<<<<<<< @@ -21528,7 +22450,7 @@ static PyObject *__pyx_pf_9fastremap_116_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_last_elem_value = 0; - /* "fastremap.pyx":403 + /* "fastremap.pyx":405 * cdef ALLINT last_elem_value = 0 * * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -21538,7 +22460,7 @@ static PyObject *__pyx_pf_9fastremap_116_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_last_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":404 + /* "fastremap.pyx":406 * * if tbl.find(last_elem) == tbl.end(): * last_elem_value = value # <<<<<<<<<<<<<< @@ -21547,7 +22469,7 @@ static PyObject *__pyx_pf_9fastremap_116_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_last_elem_value = __pyx_v_value; - /* "fastremap.pyx":403 + /* "fastremap.pyx":405 * cdef ALLINT last_elem_value = 0 * * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -21557,7 +22479,7 @@ static PyObject *__pyx_pf_9fastremap_116_mask_except(CYTHON_UNUSED PyObject *__p goto __pyx_L6; } - /* "fastremap.pyx":406 + /* "fastremap.pyx":408 * last_elem_value = value * else: * last_elem_value = last_elem # <<<<<<<<<<<<<< @@ -21569,7 +22491,7 @@ static PyObject *__pyx_pf_9fastremap_116_mask_except(CYTHON_UNUSED PyObject *__p } __pyx_L6:; - /* "fastremap.pyx":408 + /* "fastremap.pyx":410 * last_elem_value = last_elem * * for i in range(size): # <<<<<<<<<<<<<< @@ -21581,7 +22503,7 @@ static PyObject *__pyx_pf_9fastremap_116_mask_except(CYTHON_UNUSED PyObject *__p for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "fastremap.pyx":409 + /* "fastremap.pyx":411 * * for i in range(size): * if arrview[i] == last_elem: # <<<<<<<<<<<<<< @@ -21592,7 +22514,7 @@ static PyObject *__pyx_pf_9fastremap_116_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = (((*((uint32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) ))) == __pyx_v_last_elem) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":410 + /* "fastremap.pyx":412 * for i in range(size): * if arrview[i] == last_elem: * arrview[i] = last_elem_value # <<<<<<<<<<<<<< @@ -21602,7 +22524,7 @@ static PyObject *__pyx_pf_9fastremap_116_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; *((uint32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_elem_value; - /* "fastremap.pyx":409 + /* "fastremap.pyx":411 * * for i in range(size): * if arrview[i] == last_elem: # <<<<<<<<<<<<<< @@ -21612,7 +22534,7 @@ static PyObject *__pyx_pf_9fastremap_116_mask_except(CYTHON_UNUSED PyObject *__p goto __pyx_L9; } - /* "fastremap.pyx":411 + /* "fastremap.pyx":413 * if arrview[i] == last_elem: * arrview[i] = last_elem_value * elif tbl.find(arrview[i]) == tbl.end(): # <<<<<<<<<<<<<< @@ -21623,7 +22545,7 @@ static PyObject *__pyx_pf_9fastremap_116_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = ((__pyx_v_tbl.find((*((uint32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) )))) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":412 + /* "fastremap.pyx":414 * arrview[i] = last_elem_value * elif tbl.find(arrview[i]) == tbl.end(): * last_elem = arrview[i] # <<<<<<<<<<<<<< @@ -21633,7 +22555,7 @@ static PyObject *__pyx_pf_9fastremap_116_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; __pyx_v_last_elem = (*((uint32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":413 + /* "fastremap.pyx":415 * elif tbl.find(arrview[i]) == tbl.end(): * last_elem = arrview[i] * last_elem_value = value # <<<<<<<<<<<<<< @@ -21642,7 +22564,7 @@ static PyObject *__pyx_pf_9fastremap_116_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_last_elem_value = __pyx_v_value; - /* "fastremap.pyx":414 + /* "fastremap.pyx":416 * last_elem = arrview[i] * last_elem_value = value * arrview[i] = value # <<<<<<<<<<<<<< @@ -21652,7 +22574,7 @@ static PyObject *__pyx_pf_9fastremap_116_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; *((uint32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) )) = __pyx_v_value; - /* "fastremap.pyx":411 + /* "fastremap.pyx":413 * if arrview[i] == last_elem: * arrview[i] = last_elem_value * elif tbl.find(arrview[i]) == tbl.end(): # <<<<<<<<<<<<<< @@ -21662,7 +22584,7 @@ static PyObject *__pyx_pf_9fastremap_116_mask_except(CYTHON_UNUSED PyObject *__p goto __pyx_L9; } - /* "fastremap.pyx":416 + /* "fastremap.pyx":418 * arrview[i] = value * else: * last_elem = arrview[i] # <<<<<<<<<<<<<< @@ -21673,7 +22595,7 @@ static PyObject *__pyx_pf_9fastremap_116_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; __pyx_v_last_elem = (*((uint32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":417 + /* "fastremap.pyx":419 * else: * last_elem = arrview[i] * last_elem_value = arrview[i] # <<<<<<<<<<<<<< @@ -21686,7 +22608,7 @@ static PyObject *__pyx_pf_9fastremap_116_mask_except(CYTHON_UNUSED PyObject *__p __pyx_L9:; } - /* "fastremap.pyx":419 + /* "fastremap.pyx":421 * last_elem_value = arrview[i] * * return arr # <<<<<<<<<<<<<< @@ -21698,7 +22620,7 @@ static PyObject *__pyx_pf_9fastremap_116_mask_except(CYTHON_UNUSED PyObject *__p __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":387 + /* "fastremap.pyx":389 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): # <<<<<<<<<<<<<< @@ -21768,17 +22690,17 @@ static PyObject *__pyx_fuse_3__pyx_pw_9fastremap_119_mask_except(PyObject *__pyx case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 1); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 1); __PYX_ERR(0, 389, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 2); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 2); __PYX_ERR(0, 389, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_mask_except") < 0)) __PYX_ERR(0, 387, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_mask_except") < 0)) __PYX_ERR(0, 389, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -21789,18 +22711,18 @@ static PyObject *__pyx_fuse_3__pyx_pw_9fastremap_119_mask_except(PyObject *__pyx } __pyx_v_arr = ((PyArrayObject *)values[0]); __pyx_v_labels = ((PyObject*)values[1]); - __pyx_v_value = __Pyx_PyInt_As_uint64_t(values[2]); if (unlikely((__pyx_v_value == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L3_error) + __pyx_v_value = __Pyx_PyInt_As_uint64_t(values[2]); if (unlikely((__pyx_v_value == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 389, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._mask_except", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 387, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), (&PyList_Type), 1, "labels", 1))) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 389, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), (&PyList_Type), 1, "labels", 1))) __PYX_ERR(0, 389, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_118_mask_except(__pyx_self, __pyx_v_arr, __pyx_v_labels, __pyx_v_value); /* function exit code */ @@ -21816,7 +22738,7 @@ static PyObject *__pyx_pf_9fastremap_118_mask_except(CYTHON_UNUSED PyObject *__p __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; size_t __pyx_v_i; size_t __pyx_v_size; - std::unordered_map __pyx_v_tbl; + ska::flat_hash_map __pyx_v_tbl; PyObject *__pyx_v_label = NULL; uint64_t __pyx_v_last_elem; uint64_t __pyx_v_last_elem_value; @@ -21846,23 +22768,23 @@ static PyObject *__pyx_pf_9fastremap_118_mask_except(CYTHON_UNUSED PyObject *__p __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 389, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":388 + /* "fastremap.pyx":390 * @cython.nonecheck(False) * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): * cdef ALLINT[:] arrview = arr # <<<<<<<<<<<<<< * cdef size_t i = 0 * cdef size_t size = arr.size */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 390, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":389 + /* "fastremap.pyx":391 * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): * cdef ALLINT[:] arrview = arr * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -21871,20 +22793,20 @@ static PyObject *__pyx_pf_9fastremap_118_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_i = 0; - /* "fastremap.pyx":390 + /* "fastremap.pyx":392 * cdef ALLINT[:] arrview = arr * cdef size_t i = 0 * cdef size_t size = arr.size # <<<<<<<<<<<<<< * * if size == 0: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_size = __pyx_t_3; - /* "fastremap.pyx":392 + /* "fastremap.pyx":394 * cdef size_t size = arr.size * * if size == 0: # <<<<<<<<<<<<<< @@ -21894,19 +22816,19 @@ static PyObject *__pyx_pf_9fastremap_118_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = ((__pyx_v_size == 0) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":393 + /* "fastremap.pyx":395 * * if size == 0: * return arr # <<<<<<<<<<<<<< * - * cdef unordered_map[ALLINT, ALLINT] tbl + * cdef flat_hash_map[ALLINT, ALLINT] tbl */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_arr)); __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":392 + /* "fastremap.pyx":394 * cdef size_t size = arr.size * * if size == 0: # <<<<<<<<<<<<<< @@ -21915,8 +22837,8 @@ static PyObject *__pyx_pf_9fastremap_118_mask_except(CYTHON_UNUSED PyObject *__p */ } - /* "fastremap.pyx":397 - * cdef unordered_map[ALLINT, ALLINT] tbl + /* "fastremap.pyx":399 + * cdef flat_hash_map[ALLINT, ALLINT] tbl * * for label in labels: # <<<<<<<<<<<<<< * tbl[label] = label @@ -21924,33 +22846,33 @@ static PyObject *__pyx_pf_9fastremap_118_mask_except(CYTHON_UNUSED PyObject *__p */ if (unlikely(__pyx_v_labels == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 397, __pyx_L1_error) + __PYX_ERR(0, 399, __pyx_L1_error) } __pyx_t_2 = __pyx_v_labels; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; for (;;) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 399, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":398 + /* "fastremap.pyx":400 * * for label in labels: * tbl[label] = label # <<<<<<<<<<<<<< * * cdef ALLINT last_elem = arrview[0] */ - __pyx_t_7 = __Pyx_PyInt_As_uint64_t(__pyx_v_label); if (unlikely((__pyx_t_7 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyInt_As_uint64_t(__pyx_v_label); if (unlikely((__pyx_t_8 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_uint64_t(__pyx_v_label); if (unlikely((__pyx_t_7 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_uint64_t(__pyx_v_label); if (unlikely((__pyx_t_8 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L1_error) (__pyx_v_tbl[__pyx_t_8]) = __pyx_t_7; - /* "fastremap.pyx":397 - * cdef unordered_map[ALLINT, ALLINT] tbl + /* "fastremap.pyx":399 + * cdef flat_hash_map[ALLINT, ALLINT] tbl * * for label in labels: # <<<<<<<<<<<<<< * tbl[label] = label @@ -21959,7 +22881,7 @@ static PyObject *__pyx_pf_9fastremap_118_mask_except(CYTHON_UNUSED PyObject *__p } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":400 + /* "fastremap.pyx":402 * tbl[label] = label * * cdef ALLINT last_elem = arrview[0] # <<<<<<<<<<<<<< @@ -21969,7 +22891,7 @@ static PyObject *__pyx_pf_9fastremap_118_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_9 = 0; __pyx_v_last_elem = (*((uint64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_9 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":401 + /* "fastremap.pyx":403 * * cdef ALLINT last_elem = arrview[0] * cdef ALLINT last_elem_value = 0 # <<<<<<<<<<<<<< @@ -21978,7 +22900,7 @@ static PyObject *__pyx_pf_9fastremap_118_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_last_elem_value = 0; - /* "fastremap.pyx":403 + /* "fastremap.pyx":405 * cdef ALLINT last_elem_value = 0 * * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -21988,7 +22910,7 @@ static PyObject *__pyx_pf_9fastremap_118_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_last_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":404 + /* "fastremap.pyx":406 * * if tbl.find(last_elem) == tbl.end(): * last_elem_value = value # <<<<<<<<<<<<<< @@ -21997,7 +22919,7 @@ static PyObject *__pyx_pf_9fastremap_118_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_last_elem_value = __pyx_v_value; - /* "fastremap.pyx":403 + /* "fastremap.pyx":405 * cdef ALLINT last_elem_value = 0 * * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -22007,7 +22929,7 @@ static PyObject *__pyx_pf_9fastremap_118_mask_except(CYTHON_UNUSED PyObject *__p goto __pyx_L6; } - /* "fastremap.pyx":406 + /* "fastremap.pyx":408 * last_elem_value = value * else: * last_elem_value = last_elem # <<<<<<<<<<<<<< @@ -22019,7 +22941,7 @@ static PyObject *__pyx_pf_9fastremap_118_mask_except(CYTHON_UNUSED PyObject *__p } __pyx_L6:; - /* "fastremap.pyx":408 + /* "fastremap.pyx":410 * last_elem_value = last_elem * * for i in range(size): # <<<<<<<<<<<<<< @@ -22031,7 +22953,7 @@ static PyObject *__pyx_pf_9fastremap_118_mask_except(CYTHON_UNUSED PyObject *__p for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "fastremap.pyx":409 + /* "fastremap.pyx":411 * * for i in range(size): * if arrview[i] == last_elem: # <<<<<<<<<<<<<< @@ -22042,7 +22964,7 @@ static PyObject *__pyx_pf_9fastremap_118_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = (((*((uint64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) ))) == __pyx_v_last_elem) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":410 + /* "fastremap.pyx":412 * for i in range(size): * if arrview[i] == last_elem: * arrview[i] = last_elem_value # <<<<<<<<<<<<<< @@ -22052,7 +22974,7 @@ static PyObject *__pyx_pf_9fastremap_118_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; *((uint64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_elem_value; - /* "fastremap.pyx":409 + /* "fastremap.pyx":411 * * for i in range(size): * if arrview[i] == last_elem: # <<<<<<<<<<<<<< @@ -22062,7 +22984,7 @@ static PyObject *__pyx_pf_9fastremap_118_mask_except(CYTHON_UNUSED PyObject *__p goto __pyx_L9; } - /* "fastremap.pyx":411 + /* "fastremap.pyx":413 * if arrview[i] == last_elem: * arrview[i] = last_elem_value * elif tbl.find(arrview[i]) == tbl.end(): # <<<<<<<<<<<<<< @@ -22073,7 +22995,7 @@ static PyObject *__pyx_pf_9fastremap_118_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = ((__pyx_v_tbl.find((*((uint64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) )))) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":412 + /* "fastremap.pyx":414 * arrview[i] = last_elem_value * elif tbl.find(arrview[i]) == tbl.end(): * last_elem = arrview[i] # <<<<<<<<<<<<<< @@ -22083,7 +23005,7 @@ static PyObject *__pyx_pf_9fastremap_118_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; __pyx_v_last_elem = (*((uint64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":413 + /* "fastremap.pyx":415 * elif tbl.find(arrview[i]) == tbl.end(): * last_elem = arrview[i] * last_elem_value = value # <<<<<<<<<<<<<< @@ -22092,7 +23014,7 @@ static PyObject *__pyx_pf_9fastremap_118_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_last_elem_value = __pyx_v_value; - /* "fastremap.pyx":414 + /* "fastremap.pyx":416 * last_elem = arrview[i] * last_elem_value = value * arrview[i] = value # <<<<<<<<<<<<<< @@ -22102,7 +23024,7 @@ static PyObject *__pyx_pf_9fastremap_118_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; *((uint64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) )) = __pyx_v_value; - /* "fastremap.pyx":411 + /* "fastremap.pyx":413 * if arrview[i] == last_elem: * arrview[i] = last_elem_value * elif tbl.find(arrview[i]) == tbl.end(): # <<<<<<<<<<<<<< @@ -22112,7 +23034,7 @@ static PyObject *__pyx_pf_9fastremap_118_mask_except(CYTHON_UNUSED PyObject *__p goto __pyx_L9; } - /* "fastremap.pyx":416 + /* "fastremap.pyx":418 * arrview[i] = value * else: * last_elem = arrview[i] # <<<<<<<<<<<<<< @@ -22123,7 +23045,7 @@ static PyObject *__pyx_pf_9fastremap_118_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; __pyx_v_last_elem = (*((uint64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":417 + /* "fastremap.pyx":419 * else: * last_elem = arrview[i] * last_elem_value = arrview[i] # <<<<<<<<<<<<<< @@ -22136,7 +23058,7 @@ static PyObject *__pyx_pf_9fastremap_118_mask_except(CYTHON_UNUSED PyObject *__p __pyx_L9:; } - /* "fastremap.pyx":419 + /* "fastremap.pyx":421 * last_elem_value = arrview[i] * * return arr # <<<<<<<<<<<<<< @@ -22148,7 +23070,7 @@ static PyObject *__pyx_pf_9fastremap_118_mask_except(CYTHON_UNUSED PyObject *__p __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":387 + /* "fastremap.pyx":389 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): # <<<<<<<<<<<<<< @@ -22218,17 +23140,17 @@ static PyObject *__pyx_fuse_4__pyx_pw_9fastremap_121_mask_except(PyObject *__pyx case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 1); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 1); __PYX_ERR(0, 389, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 2); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 2); __PYX_ERR(0, 389, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_mask_except") < 0)) __PYX_ERR(0, 387, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_mask_except") < 0)) __PYX_ERR(0, 389, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -22239,18 +23161,18 @@ static PyObject *__pyx_fuse_4__pyx_pw_9fastremap_121_mask_except(PyObject *__pyx } __pyx_v_arr = ((PyArrayObject *)values[0]); __pyx_v_labels = ((PyObject*)values[1]); - __pyx_v_value = __Pyx_PyInt_As_int8_t(values[2]); if (unlikely((__pyx_v_value == ((int8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L3_error) + __pyx_v_value = __Pyx_PyInt_As_int8_t(values[2]); if (unlikely((__pyx_v_value == ((int8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 389, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._mask_except", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 387, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), (&PyList_Type), 1, "labels", 1))) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 389, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), (&PyList_Type), 1, "labels", 1))) __PYX_ERR(0, 389, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_120_mask_except(__pyx_self, __pyx_v_arr, __pyx_v_labels, __pyx_v_value); /* function exit code */ @@ -22266,7 +23188,7 @@ static PyObject *__pyx_pf_9fastremap_120_mask_except(CYTHON_UNUSED PyObject *__p __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; size_t __pyx_v_i; size_t __pyx_v_size; - std::unordered_map __pyx_v_tbl; + ska::flat_hash_map __pyx_v_tbl; PyObject *__pyx_v_label = NULL; int8_t __pyx_v_last_elem; int8_t __pyx_v_last_elem_value; @@ -22296,23 +23218,23 @@ static PyObject *__pyx_pf_9fastremap_120_mask_except(CYTHON_UNUSED PyObject *__p __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 389, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":388 + /* "fastremap.pyx":390 * @cython.nonecheck(False) * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): * cdef ALLINT[:] arrview = arr # <<<<<<<<<<<<<< * cdef size_t i = 0 * cdef size_t size = arr.size */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 390, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":389 + /* "fastremap.pyx":391 * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): * cdef ALLINT[:] arrview = arr * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -22321,20 +23243,20 @@ static PyObject *__pyx_pf_9fastremap_120_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_i = 0; - /* "fastremap.pyx":390 + /* "fastremap.pyx":392 * cdef ALLINT[:] arrview = arr * cdef size_t i = 0 * cdef size_t size = arr.size # <<<<<<<<<<<<<< * * if size == 0: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_size = __pyx_t_3; - /* "fastremap.pyx":392 + /* "fastremap.pyx":394 * cdef size_t size = arr.size * * if size == 0: # <<<<<<<<<<<<<< @@ -22344,19 +23266,19 @@ static PyObject *__pyx_pf_9fastremap_120_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = ((__pyx_v_size == 0) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":393 + /* "fastremap.pyx":395 * * if size == 0: * return arr # <<<<<<<<<<<<<< * - * cdef unordered_map[ALLINT, ALLINT] tbl + * cdef flat_hash_map[ALLINT, ALLINT] tbl */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_arr)); __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":392 + /* "fastremap.pyx":394 * cdef size_t size = arr.size * * if size == 0: # <<<<<<<<<<<<<< @@ -22365,8 +23287,8 @@ static PyObject *__pyx_pf_9fastremap_120_mask_except(CYTHON_UNUSED PyObject *__p */ } - /* "fastremap.pyx":397 - * cdef unordered_map[ALLINT, ALLINT] tbl + /* "fastremap.pyx":399 + * cdef flat_hash_map[ALLINT, ALLINT] tbl * * for label in labels: # <<<<<<<<<<<<<< * tbl[label] = label @@ -22374,33 +23296,33 @@ static PyObject *__pyx_pf_9fastremap_120_mask_except(CYTHON_UNUSED PyObject *__p */ if (unlikely(__pyx_v_labels == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 397, __pyx_L1_error) + __PYX_ERR(0, 399, __pyx_L1_error) } __pyx_t_2 = __pyx_v_labels; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; for (;;) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 399, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":398 + /* "fastremap.pyx":400 * * for label in labels: * tbl[label] = label # <<<<<<<<<<<<<< * * cdef ALLINT last_elem = arrview[0] */ - __pyx_t_7 = __Pyx_PyInt_As_int8_t(__pyx_v_label); if (unlikely((__pyx_t_7 == ((int8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyInt_As_int8_t(__pyx_v_label); if (unlikely((__pyx_t_8 == ((int8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int8_t(__pyx_v_label); if (unlikely((__pyx_t_7 == ((int8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_int8_t(__pyx_v_label); if (unlikely((__pyx_t_8 == ((int8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L1_error) (__pyx_v_tbl[__pyx_t_8]) = __pyx_t_7; - /* "fastremap.pyx":397 - * cdef unordered_map[ALLINT, ALLINT] tbl + /* "fastremap.pyx":399 + * cdef flat_hash_map[ALLINT, ALLINT] tbl * * for label in labels: # <<<<<<<<<<<<<< * tbl[label] = label @@ -22409,7 +23331,7 @@ static PyObject *__pyx_pf_9fastremap_120_mask_except(CYTHON_UNUSED PyObject *__p } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":400 + /* "fastremap.pyx":402 * tbl[label] = label * * cdef ALLINT last_elem = arrview[0] # <<<<<<<<<<<<<< @@ -22419,7 +23341,7 @@ static PyObject *__pyx_pf_9fastremap_120_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_9 = 0; __pyx_v_last_elem = (*((int8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_9 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":401 + /* "fastremap.pyx":403 * * cdef ALLINT last_elem = arrview[0] * cdef ALLINT last_elem_value = 0 # <<<<<<<<<<<<<< @@ -22428,7 +23350,7 @@ static PyObject *__pyx_pf_9fastremap_120_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_last_elem_value = 0; - /* "fastremap.pyx":403 + /* "fastremap.pyx":405 * cdef ALLINT last_elem_value = 0 * * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -22438,7 +23360,7 @@ static PyObject *__pyx_pf_9fastremap_120_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_last_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":404 + /* "fastremap.pyx":406 * * if tbl.find(last_elem) == tbl.end(): * last_elem_value = value # <<<<<<<<<<<<<< @@ -22447,7 +23369,7 @@ static PyObject *__pyx_pf_9fastremap_120_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_last_elem_value = __pyx_v_value; - /* "fastremap.pyx":403 + /* "fastremap.pyx":405 * cdef ALLINT last_elem_value = 0 * * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -22457,7 +23379,7 @@ static PyObject *__pyx_pf_9fastremap_120_mask_except(CYTHON_UNUSED PyObject *__p goto __pyx_L6; } - /* "fastremap.pyx":406 + /* "fastremap.pyx":408 * last_elem_value = value * else: * last_elem_value = last_elem # <<<<<<<<<<<<<< @@ -22469,7 +23391,7 @@ static PyObject *__pyx_pf_9fastremap_120_mask_except(CYTHON_UNUSED PyObject *__p } __pyx_L6:; - /* "fastremap.pyx":408 + /* "fastremap.pyx":410 * last_elem_value = last_elem * * for i in range(size): # <<<<<<<<<<<<<< @@ -22481,7 +23403,7 @@ static PyObject *__pyx_pf_9fastremap_120_mask_except(CYTHON_UNUSED PyObject *__p for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "fastremap.pyx":409 + /* "fastremap.pyx":411 * * for i in range(size): * if arrview[i] == last_elem: # <<<<<<<<<<<<<< @@ -22492,7 +23414,7 @@ static PyObject *__pyx_pf_9fastremap_120_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = (((*((int8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) ))) == __pyx_v_last_elem) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":410 + /* "fastremap.pyx":412 * for i in range(size): * if arrview[i] == last_elem: * arrview[i] = last_elem_value # <<<<<<<<<<<<<< @@ -22502,7 +23424,7 @@ static PyObject *__pyx_pf_9fastremap_120_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; *((int8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_elem_value; - /* "fastremap.pyx":409 + /* "fastremap.pyx":411 * * for i in range(size): * if arrview[i] == last_elem: # <<<<<<<<<<<<<< @@ -22512,7 +23434,7 @@ static PyObject *__pyx_pf_9fastremap_120_mask_except(CYTHON_UNUSED PyObject *__p goto __pyx_L9; } - /* "fastremap.pyx":411 + /* "fastremap.pyx":413 * if arrview[i] == last_elem: * arrview[i] = last_elem_value * elif tbl.find(arrview[i]) == tbl.end(): # <<<<<<<<<<<<<< @@ -22523,7 +23445,7 @@ static PyObject *__pyx_pf_9fastremap_120_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = ((__pyx_v_tbl.find((*((int8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) )))) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":412 + /* "fastremap.pyx":414 * arrview[i] = last_elem_value * elif tbl.find(arrview[i]) == tbl.end(): * last_elem = arrview[i] # <<<<<<<<<<<<<< @@ -22533,7 +23455,7 @@ static PyObject *__pyx_pf_9fastremap_120_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; __pyx_v_last_elem = (*((int8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":413 + /* "fastremap.pyx":415 * elif tbl.find(arrview[i]) == tbl.end(): * last_elem = arrview[i] * last_elem_value = value # <<<<<<<<<<<<<< @@ -22542,7 +23464,7 @@ static PyObject *__pyx_pf_9fastremap_120_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_last_elem_value = __pyx_v_value; - /* "fastremap.pyx":414 + /* "fastremap.pyx":416 * last_elem = arrview[i] * last_elem_value = value * arrview[i] = value # <<<<<<<<<<<<<< @@ -22552,7 +23474,7 @@ static PyObject *__pyx_pf_9fastremap_120_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; *((int8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) )) = __pyx_v_value; - /* "fastremap.pyx":411 + /* "fastremap.pyx":413 * if arrview[i] == last_elem: * arrview[i] = last_elem_value * elif tbl.find(arrview[i]) == tbl.end(): # <<<<<<<<<<<<<< @@ -22562,7 +23484,7 @@ static PyObject *__pyx_pf_9fastremap_120_mask_except(CYTHON_UNUSED PyObject *__p goto __pyx_L9; } - /* "fastremap.pyx":416 + /* "fastremap.pyx":418 * arrview[i] = value * else: * last_elem = arrview[i] # <<<<<<<<<<<<<< @@ -22573,7 +23495,7 @@ static PyObject *__pyx_pf_9fastremap_120_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; __pyx_v_last_elem = (*((int8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":417 + /* "fastremap.pyx":419 * else: * last_elem = arrview[i] * last_elem_value = arrview[i] # <<<<<<<<<<<<<< @@ -22586,7 +23508,7 @@ static PyObject *__pyx_pf_9fastremap_120_mask_except(CYTHON_UNUSED PyObject *__p __pyx_L9:; } - /* "fastremap.pyx":419 + /* "fastremap.pyx":421 * last_elem_value = arrview[i] * * return arr # <<<<<<<<<<<<<< @@ -22598,7 +23520,7 @@ static PyObject *__pyx_pf_9fastremap_120_mask_except(CYTHON_UNUSED PyObject *__p __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":387 + /* "fastremap.pyx":389 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): # <<<<<<<<<<<<<< @@ -22668,17 +23590,17 @@ static PyObject *__pyx_fuse_5__pyx_pw_9fastremap_123_mask_except(PyObject *__pyx case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 1); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 1); __PYX_ERR(0, 389, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 2); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 2); __PYX_ERR(0, 389, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_mask_except") < 0)) __PYX_ERR(0, 387, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_mask_except") < 0)) __PYX_ERR(0, 389, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -22689,18 +23611,18 @@ static PyObject *__pyx_fuse_5__pyx_pw_9fastremap_123_mask_except(PyObject *__pyx } __pyx_v_arr = ((PyArrayObject *)values[0]); __pyx_v_labels = ((PyObject*)values[1]); - __pyx_v_value = __Pyx_PyInt_As_int16_t(values[2]); if (unlikely((__pyx_v_value == ((int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L3_error) + __pyx_v_value = __Pyx_PyInt_As_int16_t(values[2]); if (unlikely((__pyx_v_value == ((int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 389, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._mask_except", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 387, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), (&PyList_Type), 1, "labels", 1))) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 389, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), (&PyList_Type), 1, "labels", 1))) __PYX_ERR(0, 389, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_122_mask_except(__pyx_self, __pyx_v_arr, __pyx_v_labels, __pyx_v_value); /* function exit code */ @@ -22716,7 +23638,7 @@ static PyObject *__pyx_pf_9fastremap_122_mask_except(CYTHON_UNUSED PyObject *__p __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; size_t __pyx_v_i; size_t __pyx_v_size; - std::unordered_map __pyx_v_tbl; + ska::flat_hash_map __pyx_v_tbl; PyObject *__pyx_v_label = NULL; int16_t __pyx_v_last_elem; int16_t __pyx_v_last_elem_value; @@ -22746,23 +23668,23 @@ static PyObject *__pyx_pf_9fastremap_122_mask_except(CYTHON_UNUSED PyObject *__p __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 389, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":388 + /* "fastremap.pyx":390 * @cython.nonecheck(False) * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): * cdef ALLINT[:] arrview = arr # <<<<<<<<<<<<<< * cdef size_t i = 0 * cdef size_t size = arr.size */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 390, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":389 + /* "fastremap.pyx":391 * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): * cdef ALLINT[:] arrview = arr * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -22771,20 +23693,20 @@ static PyObject *__pyx_pf_9fastremap_122_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_i = 0; - /* "fastremap.pyx":390 + /* "fastremap.pyx":392 * cdef ALLINT[:] arrview = arr * cdef size_t i = 0 * cdef size_t size = arr.size # <<<<<<<<<<<<<< * * if size == 0: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_size = __pyx_t_3; - /* "fastremap.pyx":392 + /* "fastremap.pyx":394 * cdef size_t size = arr.size * * if size == 0: # <<<<<<<<<<<<<< @@ -22794,19 +23716,19 @@ static PyObject *__pyx_pf_9fastremap_122_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = ((__pyx_v_size == 0) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":393 + /* "fastremap.pyx":395 * * if size == 0: * return arr # <<<<<<<<<<<<<< * - * cdef unordered_map[ALLINT, ALLINT] tbl + * cdef flat_hash_map[ALLINT, ALLINT] tbl */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_arr)); __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":392 + /* "fastremap.pyx":394 * cdef size_t size = arr.size * * if size == 0: # <<<<<<<<<<<<<< @@ -22815,8 +23737,8 @@ static PyObject *__pyx_pf_9fastremap_122_mask_except(CYTHON_UNUSED PyObject *__p */ } - /* "fastremap.pyx":397 - * cdef unordered_map[ALLINT, ALLINT] tbl + /* "fastremap.pyx":399 + * cdef flat_hash_map[ALLINT, ALLINT] tbl * * for label in labels: # <<<<<<<<<<<<<< * tbl[label] = label @@ -22824,33 +23746,33 @@ static PyObject *__pyx_pf_9fastremap_122_mask_except(CYTHON_UNUSED PyObject *__p */ if (unlikely(__pyx_v_labels == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 397, __pyx_L1_error) + __PYX_ERR(0, 399, __pyx_L1_error) } __pyx_t_2 = __pyx_v_labels; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; for (;;) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 399, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":398 + /* "fastremap.pyx":400 * * for label in labels: * tbl[label] = label # <<<<<<<<<<<<<< * * cdef ALLINT last_elem = arrview[0] */ - __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_label); if (unlikely((__pyx_t_7 == ((int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_v_label); if (unlikely((__pyx_t_8 == ((int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_label); if (unlikely((__pyx_t_7 == ((int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_v_label); if (unlikely((__pyx_t_8 == ((int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L1_error) (__pyx_v_tbl[__pyx_t_8]) = __pyx_t_7; - /* "fastremap.pyx":397 - * cdef unordered_map[ALLINT, ALLINT] tbl + /* "fastremap.pyx":399 + * cdef flat_hash_map[ALLINT, ALLINT] tbl * * for label in labels: # <<<<<<<<<<<<<< * tbl[label] = label @@ -22859,7 +23781,7 @@ static PyObject *__pyx_pf_9fastremap_122_mask_except(CYTHON_UNUSED PyObject *__p } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":400 + /* "fastremap.pyx":402 * tbl[label] = label * * cdef ALLINT last_elem = arrview[0] # <<<<<<<<<<<<<< @@ -22869,7 +23791,7 @@ static PyObject *__pyx_pf_9fastremap_122_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_9 = 0; __pyx_v_last_elem = (*((int16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_9 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":401 + /* "fastremap.pyx":403 * * cdef ALLINT last_elem = arrview[0] * cdef ALLINT last_elem_value = 0 # <<<<<<<<<<<<<< @@ -22878,7 +23800,7 @@ static PyObject *__pyx_pf_9fastremap_122_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_last_elem_value = 0; - /* "fastremap.pyx":403 + /* "fastremap.pyx":405 * cdef ALLINT last_elem_value = 0 * * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -22888,7 +23810,7 @@ static PyObject *__pyx_pf_9fastremap_122_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_last_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":404 + /* "fastremap.pyx":406 * * if tbl.find(last_elem) == tbl.end(): * last_elem_value = value # <<<<<<<<<<<<<< @@ -22897,7 +23819,7 @@ static PyObject *__pyx_pf_9fastremap_122_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_last_elem_value = __pyx_v_value; - /* "fastremap.pyx":403 + /* "fastremap.pyx":405 * cdef ALLINT last_elem_value = 0 * * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -22907,7 +23829,7 @@ static PyObject *__pyx_pf_9fastremap_122_mask_except(CYTHON_UNUSED PyObject *__p goto __pyx_L6; } - /* "fastremap.pyx":406 + /* "fastremap.pyx":408 * last_elem_value = value * else: * last_elem_value = last_elem # <<<<<<<<<<<<<< @@ -22919,7 +23841,7 @@ static PyObject *__pyx_pf_9fastremap_122_mask_except(CYTHON_UNUSED PyObject *__p } __pyx_L6:; - /* "fastremap.pyx":408 + /* "fastremap.pyx":410 * last_elem_value = last_elem * * for i in range(size): # <<<<<<<<<<<<<< @@ -22931,7 +23853,7 @@ static PyObject *__pyx_pf_9fastremap_122_mask_except(CYTHON_UNUSED PyObject *__p for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "fastremap.pyx":409 + /* "fastremap.pyx":411 * * for i in range(size): * if arrview[i] == last_elem: # <<<<<<<<<<<<<< @@ -22942,7 +23864,7 @@ static PyObject *__pyx_pf_9fastremap_122_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = (((*((int16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) ))) == __pyx_v_last_elem) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":410 + /* "fastremap.pyx":412 * for i in range(size): * if arrview[i] == last_elem: * arrview[i] = last_elem_value # <<<<<<<<<<<<<< @@ -22952,7 +23874,7 @@ static PyObject *__pyx_pf_9fastremap_122_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; *((int16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_elem_value; - /* "fastremap.pyx":409 + /* "fastremap.pyx":411 * * for i in range(size): * if arrview[i] == last_elem: # <<<<<<<<<<<<<< @@ -22962,7 +23884,7 @@ static PyObject *__pyx_pf_9fastremap_122_mask_except(CYTHON_UNUSED PyObject *__p goto __pyx_L9; } - /* "fastremap.pyx":411 + /* "fastremap.pyx":413 * if arrview[i] == last_elem: * arrview[i] = last_elem_value * elif tbl.find(arrview[i]) == tbl.end(): # <<<<<<<<<<<<<< @@ -22973,7 +23895,7 @@ static PyObject *__pyx_pf_9fastremap_122_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = ((__pyx_v_tbl.find((*((int16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) )))) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":412 + /* "fastremap.pyx":414 * arrview[i] = last_elem_value * elif tbl.find(arrview[i]) == tbl.end(): * last_elem = arrview[i] # <<<<<<<<<<<<<< @@ -22983,7 +23905,7 @@ static PyObject *__pyx_pf_9fastremap_122_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; __pyx_v_last_elem = (*((int16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":413 + /* "fastremap.pyx":415 * elif tbl.find(arrview[i]) == tbl.end(): * last_elem = arrview[i] * last_elem_value = value # <<<<<<<<<<<<<< @@ -22992,7 +23914,7 @@ static PyObject *__pyx_pf_9fastremap_122_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_last_elem_value = __pyx_v_value; - /* "fastremap.pyx":414 + /* "fastremap.pyx":416 * last_elem = arrview[i] * last_elem_value = value * arrview[i] = value # <<<<<<<<<<<<<< @@ -23002,7 +23924,7 @@ static PyObject *__pyx_pf_9fastremap_122_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; *((int16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) )) = __pyx_v_value; - /* "fastremap.pyx":411 + /* "fastremap.pyx":413 * if arrview[i] == last_elem: * arrview[i] = last_elem_value * elif tbl.find(arrview[i]) == tbl.end(): # <<<<<<<<<<<<<< @@ -23012,7 +23934,7 @@ static PyObject *__pyx_pf_9fastremap_122_mask_except(CYTHON_UNUSED PyObject *__p goto __pyx_L9; } - /* "fastremap.pyx":416 + /* "fastremap.pyx":418 * arrview[i] = value * else: * last_elem = arrview[i] # <<<<<<<<<<<<<< @@ -23023,7 +23945,7 @@ static PyObject *__pyx_pf_9fastremap_122_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; __pyx_v_last_elem = (*((int16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":417 + /* "fastremap.pyx":419 * else: * last_elem = arrview[i] * last_elem_value = arrview[i] # <<<<<<<<<<<<<< @@ -23036,7 +23958,7 @@ static PyObject *__pyx_pf_9fastremap_122_mask_except(CYTHON_UNUSED PyObject *__p __pyx_L9:; } - /* "fastremap.pyx":419 + /* "fastremap.pyx":421 * last_elem_value = arrview[i] * * return arr # <<<<<<<<<<<<<< @@ -23048,7 +23970,7 @@ static PyObject *__pyx_pf_9fastremap_122_mask_except(CYTHON_UNUSED PyObject *__p __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":387 + /* "fastremap.pyx":389 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): # <<<<<<<<<<<<<< @@ -23118,17 +24040,17 @@ static PyObject *__pyx_fuse_6__pyx_pw_9fastremap_125_mask_except(PyObject *__pyx case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 1); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 1); __PYX_ERR(0, 389, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 2); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 2); __PYX_ERR(0, 389, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_mask_except") < 0)) __PYX_ERR(0, 387, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_mask_except") < 0)) __PYX_ERR(0, 389, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -23139,18 +24061,18 @@ static PyObject *__pyx_fuse_6__pyx_pw_9fastremap_125_mask_except(PyObject *__pyx } __pyx_v_arr = ((PyArrayObject *)values[0]); __pyx_v_labels = ((PyObject*)values[1]); - __pyx_v_value = __Pyx_PyInt_As_int32_t(values[2]); if (unlikely((__pyx_v_value == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L3_error) + __pyx_v_value = __Pyx_PyInt_As_int32_t(values[2]); if (unlikely((__pyx_v_value == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 389, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._mask_except", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 387, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), (&PyList_Type), 1, "labels", 1))) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 389, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), (&PyList_Type), 1, "labels", 1))) __PYX_ERR(0, 389, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_124_mask_except(__pyx_self, __pyx_v_arr, __pyx_v_labels, __pyx_v_value); /* function exit code */ @@ -23166,7 +24088,7 @@ static PyObject *__pyx_pf_9fastremap_124_mask_except(CYTHON_UNUSED PyObject *__p __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; size_t __pyx_v_i; size_t __pyx_v_size; - std::unordered_map __pyx_v_tbl; + ska::flat_hash_map __pyx_v_tbl; PyObject *__pyx_v_label = NULL; int32_t __pyx_v_last_elem; int32_t __pyx_v_last_elem_value; @@ -23196,23 +24118,23 @@ static PyObject *__pyx_pf_9fastremap_124_mask_except(CYTHON_UNUSED PyObject *__p __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 389, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":388 + /* "fastremap.pyx":390 * @cython.nonecheck(False) * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): * cdef ALLINT[:] arrview = arr # <<<<<<<<<<<<<< * cdef size_t i = 0 * cdef size_t size = arr.size */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 390, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":389 + /* "fastremap.pyx":391 * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): * cdef ALLINT[:] arrview = arr * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -23221,20 +24143,20 @@ static PyObject *__pyx_pf_9fastremap_124_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_i = 0; - /* "fastremap.pyx":390 + /* "fastremap.pyx":392 * cdef ALLINT[:] arrview = arr * cdef size_t i = 0 * cdef size_t size = arr.size # <<<<<<<<<<<<<< * * if size == 0: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_size = __pyx_t_3; - /* "fastremap.pyx":392 + /* "fastremap.pyx":394 * cdef size_t size = arr.size * * if size == 0: # <<<<<<<<<<<<<< @@ -23244,19 +24166,19 @@ static PyObject *__pyx_pf_9fastremap_124_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = ((__pyx_v_size == 0) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":393 + /* "fastremap.pyx":395 * * if size == 0: * return arr # <<<<<<<<<<<<<< * - * cdef unordered_map[ALLINT, ALLINT] tbl + * cdef flat_hash_map[ALLINT, ALLINT] tbl */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_arr)); __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":392 + /* "fastremap.pyx":394 * cdef size_t size = arr.size * * if size == 0: # <<<<<<<<<<<<<< @@ -23265,8 +24187,8 @@ static PyObject *__pyx_pf_9fastremap_124_mask_except(CYTHON_UNUSED PyObject *__p */ } - /* "fastremap.pyx":397 - * cdef unordered_map[ALLINT, ALLINT] tbl + /* "fastremap.pyx":399 + * cdef flat_hash_map[ALLINT, ALLINT] tbl * * for label in labels: # <<<<<<<<<<<<<< * tbl[label] = label @@ -23274,33 +24196,33 @@ static PyObject *__pyx_pf_9fastremap_124_mask_except(CYTHON_UNUSED PyObject *__p */ if (unlikely(__pyx_v_labels == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 397, __pyx_L1_error) + __PYX_ERR(0, 399, __pyx_L1_error) } __pyx_t_2 = __pyx_v_labels; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; for (;;) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 399, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":398 + /* "fastremap.pyx":400 * * for label in labels: * tbl[label] = label # <<<<<<<<<<<<<< * * cdef ALLINT last_elem = arrview[0] */ - __pyx_t_7 = __Pyx_PyInt_As_int32_t(__pyx_v_label); if (unlikely((__pyx_t_7 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_v_label); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int32_t(__pyx_v_label); if (unlikely((__pyx_t_7 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_v_label); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L1_error) (__pyx_v_tbl[__pyx_t_8]) = __pyx_t_7; - /* "fastremap.pyx":397 - * cdef unordered_map[ALLINT, ALLINT] tbl + /* "fastremap.pyx":399 + * cdef flat_hash_map[ALLINT, ALLINT] tbl * * for label in labels: # <<<<<<<<<<<<<< * tbl[label] = label @@ -23309,7 +24231,7 @@ static PyObject *__pyx_pf_9fastremap_124_mask_except(CYTHON_UNUSED PyObject *__p } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":400 + /* "fastremap.pyx":402 * tbl[label] = label * * cdef ALLINT last_elem = arrview[0] # <<<<<<<<<<<<<< @@ -23319,7 +24241,7 @@ static PyObject *__pyx_pf_9fastremap_124_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_9 = 0; __pyx_v_last_elem = (*((int32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_9 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":401 + /* "fastremap.pyx":403 * * cdef ALLINT last_elem = arrview[0] * cdef ALLINT last_elem_value = 0 # <<<<<<<<<<<<<< @@ -23328,7 +24250,7 @@ static PyObject *__pyx_pf_9fastremap_124_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_last_elem_value = 0; - /* "fastremap.pyx":403 + /* "fastremap.pyx":405 * cdef ALLINT last_elem_value = 0 * * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -23338,7 +24260,7 @@ static PyObject *__pyx_pf_9fastremap_124_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_last_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":404 + /* "fastremap.pyx":406 * * if tbl.find(last_elem) == tbl.end(): * last_elem_value = value # <<<<<<<<<<<<<< @@ -23347,7 +24269,7 @@ static PyObject *__pyx_pf_9fastremap_124_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_last_elem_value = __pyx_v_value; - /* "fastremap.pyx":403 + /* "fastremap.pyx":405 * cdef ALLINT last_elem_value = 0 * * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -23357,7 +24279,7 @@ static PyObject *__pyx_pf_9fastremap_124_mask_except(CYTHON_UNUSED PyObject *__p goto __pyx_L6; } - /* "fastremap.pyx":406 + /* "fastremap.pyx":408 * last_elem_value = value * else: * last_elem_value = last_elem # <<<<<<<<<<<<<< @@ -23369,7 +24291,7 @@ static PyObject *__pyx_pf_9fastremap_124_mask_except(CYTHON_UNUSED PyObject *__p } __pyx_L6:; - /* "fastremap.pyx":408 + /* "fastremap.pyx":410 * last_elem_value = last_elem * * for i in range(size): # <<<<<<<<<<<<<< @@ -23381,7 +24303,7 @@ static PyObject *__pyx_pf_9fastremap_124_mask_except(CYTHON_UNUSED PyObject *__p for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "fastremap.pyx":409 + /* "fastremap.pyx":411 * * for i in range(size): * if arrview[i] == last_elem: # <<<<<<<<<<<<<< @@ -23392,7 +24314,7 @@ static PyObject *__pyx_pf_9fastremap_124_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = (((*((int32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) ))) == __pyx_v_last_elem) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":410 + /* "fastremap.pyx":412 * for i in range(size): * if arrview[i] == last_elem: * arrview[i] = last_elem_value # <<<<<<<<<<<<<< @@ -23402,7 +24324,7 @@ static PyObject *__pyx_pf_9fastremap_124_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; *((int32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_elem_value; - /* "fastremap.pyx":409 + /* "fastremap.pyx":411 * * for i in range(size): * if arrview[i] == last_elem: # <<<<<<<<<<<<<< @@ -23412,7 +24334,7 @@ static PyObject *__pyx_pf_9fastremap_124_mask_except(CYTHON_UNUSED PyObject *__p goto __pyx_L9; } - /* "fastremap.pyx":411 + /* "fastremap.pyx":413 * if arrview[i] == last_elem: * arrview[i] = last_elem_value * elif tbl.find(arrview[i]) == tbl.end(): # <<<<<<<<<<<<<< @@ -23423,7 +24345,7 @@ static PyObject *__pyx_pf_9fastremap_124_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = ((__pyx_v_tbl.find((*((int32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) )))) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":412 + /* "fastremap.pyx":414 * arrview[i] = last_elem_value * elif tbl.find(arrview[i]) == tbl.end(): * last_elem = arrview[i] # <<<<<<<<<<<<<< @@ -23433,7 +24355,7 @@ static PyObject *__pyx_pf_9fastremap_124_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; __pyx_v_last_elem = (*((int32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":413 + /* "fastremap.pyx":415 * elif tbl.find(arrview[i]) == tbl.end(): * last_elem = arrview[i] * last_elem_value = value # <<<<<<<<<<<<<< @@ -23442,7 +24364,7 @@ static PyObject *__pyx_pf_9fastremap_124_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_last_elem_value = __pyx_v_value; - /* "fastremap.pyx":414 + /* "fastremap.pyx":416 * last_elem = arrview[i] * last_elem_value = value * arrview[i] = value # <<<<<<<<<<<<<< @@ -23452,7 +24374,7 @@ static PyObject *__pyx_pf_9fastremap_124_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; *((int32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) )) = __pyx_v_value; - /* "fastremap.pyx":411 + /* "fastremap.pyx":413 * if arrview[i] == last_elem: * arrview[i] = last_elem_value * elif tbl.find(arrview[i]) == tbl.end(): # <<<<<<<<<<<<<< @@ -23462,7 +24384,7 @@ static PyObject *__pyx_pf_9fastremap_124_mask_except(CYTHON_UNUSED PyObject *__p goto __pyx_L9; } - /* "fastremap.pyx":416 + /* "fastremap.pyx":418 * arrview[i] = value * else: * last_elem = arrview[i] # <<<<<<<<<<<<<< @@ -23473,7 +24395,7 @@ static PyObject *__pyx_pf_9fastremap_124_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; __pyx_v_last_elem = (*((int32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":417 + /* "fastremap.pyx":419 * else: * last_elem = arrview[i] * last_elem_value = arrview[i] # <<<<<<<<<<<<<< @@ -23486,7 +24408,7 @@ static PyObject *__pyx_pf_9fastremap_124_mask_except(CYTHON_UNUSED PyObject *__p __pyx_L9:; } - /* "fastremap.pyx":419 + /* "fastremap.pyx":421 * last_elem_value = arrview[i] * * return arr # <<<<<<<<<<<<<< @@ -23498,7 +24420,7 @@ static PyObject *__pyx_pf_9fastremap_124_mask_except(CYTHON_UNUSED PyObject *__p __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":387 + /* "fastremap.pyx":389 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): # <<<<<<<<<<<<<< @@ -23568,17 +24490,17 @@ static PyObject *__pyx_fuse_7__pyx_pw_9fastremap_127_mask_except(PyObject *__pyx case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 1); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 1); __PYX_ERR(0, 389, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 2); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, 2); __PYX_ERR(0, 389, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_mask_except") < 0)) __PYX_ERR(0, 387, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_mask_except") < 0)) __PYX_ERR(0, 389, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -23589,18 +24511,18 @@ static PyObject *__pyx_fuse_7__pyx_pw_9fastremap_127_mask_except(PyObject *__pyx } __pyx_v_arr = ((PyArrayObject *)values[0]); __pyx_v_labels = ((PyObject*)values[1]); - __pyx_v_value = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_value == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L3_error) + __pyx_v_value = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_value == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_mask_except", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 389, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._mask_except", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 387, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), (&PyList_Type), 1, "labels", 1))) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 389, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), (&PyList_Type), 1, "labels", 1))) __PYX_ERR(0, 389, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_126_mask_except(__pyx_self, __pyx_v_arr, __pyx_v_labels, __pyx_v_value); /* function exit code */ @@ -23616,7 +24538,7 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; size_t __pyx_v_i; size_t __pyx_v_size; - std::unordered_map __pyx_v_tbl; + ska::flat_hash_map __pyx_v_tbl; PyObject *__pyx_v_label = NULL; int64_t __pyx_v_last_elem; int64_t __pyx_v_last_elem_value; @@ -23646,23 +24568,23 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 389, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":388 + /* "fastremap.pyx":390 * @cython.nonecheck(False) * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): * cdef ALLINT[:] arrview = arr # <<<<<<<<<<<<<< * cdef size_t i = 0 * cdef size_t size = arr.size */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 390, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":389 + /* "fastremap.pyx":391 * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): * cdef ALLINT[:] arrview = arr * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -23671,20 +24593,20 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_i = 0; - /* "fastremap.pyx":390 + /* "fastremap.pyx":392 * cdef ALLINT[:] arrview = arr * cdef size_t i = 0 * cdef size_t size = arr.size # <<<<<<<<<<<<<< * * if size == 0: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_size = __pyx_t_3; - /* "fastremap.pyx":392 + /* "fastremap.pyx":394 * cdef size_t size = arr.size * * if size == 0: # <<<<<<<<<<<<<< @@ -23694,19 +24616,19 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = ((__pyx_v_size == 0) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":393 + /* "fastremap.pyx":395 * * if size == 0: * return arr # <<<<<<<<<<<<<< * - * cdef unordered_map[ALLINT, ALLINT] tbl + * cdef flat_hash_map[ALLINT, ALLINT] tbl */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_arr)); __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":392 + /* "fastremap.pyx":394 * cdef size_t size = arr.size * * if size == 0: # <<<<<<<<<<<<<< @@ -23715,8 +24637,8 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p */ } - /* "fastremap.pyx":397 - * cdef unordered_map[ALLINT, ALLINT] tbl + /* "fastremap.pyx":399 + * cdef flat_hash_map[ALLINT, ALLINT] tbl * * for label in labels: # <<<<<<<<<<<<<< * tbl[label] = label @@ -23724,33 +24646,33 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p */ if (unlikely(__pyx_v_labels == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 397, __pyx_L1_error) + __PYX_ERR(0, 399, __pyx_L1_error) } __pyx_t_2 = __pyx_v_labels; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; for (;;) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 399, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":398 + /* "fastremap.pyx":400 * * for label in labels: * tbl[label] = label # <<<<<<<<<<<<<< * * cdef ALLINT last_elem = arrview[0] */ - __pyx_t_7 = __Pyx_PyInt_As_int64_t(__pyx_v_label); if (unlikely((__pyx_t_7 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_v_label); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int64_t(__pyx_v_label); if (unlikely((__pyx_t_7 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_v_label); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L1_error) (__pyx_v_tbl[__pyx_t_8]) = __pyx_t_7; - /* "fastremap.pyx":397 - * cdef unordered_map[ALLINT, ALLINT] tbl + /* "fastremap.pyx":399 + * cdef flat_hash_map[ALLINT, ALLINT] tbl * * for label in labels: # <<<<<<<<<<<<<< * tbl[label] = label @@ -23759,7 +24681,7 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":400 + /* "fastremap.pyx":402 * tbl[label] = label * * cdef ALLINT last_elem = arrview[0] # <<<<<<<<<<<<<< @@ -23769,7 +24691,7 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_9 = 0; __pyx_v_last_elem = (*((int64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_9 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":401 + /* "fastremap.pyx":403 * * cdef ALLINT last_elem = arrview[0] * cdef ALLINT last_elem_value = 0 # <<<<<<<<<<<<<< @@ -23778,7 +24700,7 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_last_elem_value = 0; - /* "fastremap.pyx":403 + /* "fastremap.pyx":405 * cdef ALLINT last_elem_value = 0 * * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -23788,7 +24710,7 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_last_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":404 + /* "fastremap.pyx":406 * * if tbl.find(last_elem) == tbl.end(): * last_elem_value = value # <<<<<<<<<<<<<< @@ -23797,7 +24719,7 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_last_elem_value = __pyx_v_value; - /* "fastremap.pyx":403 + /* "fastremap.pyx":405 * cdef ALLINT last_elem_value = 0 * * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -23807,7 +24729,7 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p goto __pyx_L6; } - /* "fastremap.pyx":406 + /* "fastremap.pyx":408 * last_elem_value = value * else: * last_elem_value = last_elem # <<<<<<<<<<<<<< @@ -23819,7 +24741,7 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p } __pyx_L6:; - /* "fastremap.pyx":408 + /* "fastremap.pyx":410 * last_elem_value = last_elem * * for i in range(size): # <<<<<<<<<<<<<< @@ -23831,7 +24753,7 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "fastremap.pyx":409 + /* "fastremap.pyx":411 * * for i in range(size): * if arrview[i] == last_elem: # <<<<<<<<<<<<<< @@ -23842,7 +24764,7 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = (((*((int64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) ))) == __pyx_v_last_elem) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":410 + /* "fastremap.pyx":412 * for i in range(size): * if arrview[i] == last_elem: * arrview[i] = last_elem_value # <<<<<<<<<<<<<< @@ -23852,7 +24774,7 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; *((int64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_elem_value; - /* "fastremap.pyx":409 + /* "fastremap.pyx":411 * * for i in range(size): * if arrview[i] == last_elem: # <<<<<<<<<<<<<< @@ -23862,7 +24784,7 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p goto __pyx_L9; } - /* "fastremap.pyx":411 + /* "fastremap.pyx":413 * if arrview[i] == last_elem: * arrview[i] = last_elem_value * elif tbl.find(arrview[i]) == tbl.end(): # <<<<<<<<<<<<<< @@ -23873,7 +24795,7 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_4 = ((__pyx_v_tbl.find((*((int64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) )))) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":412 + /* "fastremap.pyx":414 * arrview[i] = last_elem_value * elif tbl.find(arrview[i]) == tbl.end(): * last_elem = arrview[i] # <<<<<<<<<<<<<< @@ -23883,7 +24805,7 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; __pyx_v_last_elem = (*((int64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":413 + /* "fastremap.pyx":415 * elif tbl.find(arrview[i]) == tbl.end(): * last_elem = arrview[i] * last_elem_value = value # <<<<<<<<<<<<<< @@ -23892,7 +24814,7 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p */ __pyx_v_last_elem_value = __pyx_v_value; - /* "fastremap.pyx":414 + /* "fastremap.pyx":416 * last_elem = arrview[i] * last_elem_value = value * arrview[i] = value # <<<<<<<<<<<<<< @@ -23902,7 +24824,7 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; *((int64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) )) = __pyx_v_value; - /* "fastremap.pyx":411 + /* "fastremap.pyx":413 * if arrview[i] == last_elem: * arrview[i] = last_elem_value * elif tbl.find(arrview[i]) == tbl.end(): # <<<<<<<<<<<<<< @@ -23912,7 +24834,7 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p goto __pyx_L9; } - /* "fastremap.pyx":416 + /* "fastremap.pyx":418 * arrview[i] = value * else: * last_elem = arrview[i] # <<<<<<<<<<<<<< @@ -23923,7 +24845,7 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p __pyx_t_12 = __pyx_v_i; __pyx_v_last_elem = (*((int64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_12 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":417 + /* "fastremap.pyx":419 * else: * last_elem = arrview[i] * last_elem_value = arrview[i] # <<<<<<<<<<<<<< @@ -23936,7 +24858,7 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p __pyx_L9:; } - /* "fastremap.pyx":419 + /* "fastremap.pyx":421 * last_elem_value = arrview[i] * * return arr # <<<<<<<<<<<<<< @@ -23948,7 +24870,7 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":387 + /* "fastremap.pyx":389 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): # <<<<<<<<<<<<<< @@ -23980,7 +24902,7 @@ static PyObject *__pyx_pf_9fastremap_126_mask_except(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "fastremap.pyx":421 +/* "fastremap.pyx":423 * return arr * * def component_map(component_labels, parent_labels): # <<<<<<<<<<<<<< @@ -24024,11 +24946,11 @@ static PyObject *__pyx_pw_9fastremap_21component_map(PyObject *__pyx_self, PyObj case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("component_map", 1, 2, 2, 1); __PYX_ERR(0, 421, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("component_map", 1, 2, 2, 1); __PYX_ERR(0, 423, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "component_map") < 0)) __PYX_ERR(0, 421, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "component_map") < 0)) __PYX_ERR(0, 423, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -24041,7 +24963,7 @@ static PyObject *__pyx_pw_9fastremap_21component_map(PyObject *__pyx_self, PyObj } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 421, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 423, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -24074,33 +24996,33 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p __Pyx_INCREF(__pyx_v_component_labels); __Pyx_INCREF(__pyx_v_parent_labels); - /* "fastremap.pyx":434 + /* "fastremap.pyx":436 * Returns: { $COMPONENT_LABEL: $PARENT_LABEL } * """ * if not isinstance(component_labels, np.ndarray): # <<<<<<<<<<<<<< * component_labels = np.array(component_labels) * if not isinstance(parent_labels, np.ndarray): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = PyObject_IsInstance(__pyx_v_component_labels, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_3 = PyObject_IsInstance(__pyx_v_component_labels, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":435 + /* "fastremap.pyx":437 * """ * if not isinstance(component_labels, np.ndarray): * component_labels = np.array(component_labels) # <<<<<<<<<<<<<< * if not isinstance(parent_labels, np.ndarray): * parent_labels = np.array(parent_labels) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 435, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -24115,13 +25037,13 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_v_component_labels) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_component_labels); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 435, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_component_labels, __pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":434 + /* "fastremap.pyx":436 * Returns: { $COMPONENT_LABEL: $PARENT_LABEL } * """ * if not isinstance(component_labels, np.ndarray): # <<<<<<<<<<<<<< @@ -24130,33 +25052,33 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p */ } - /* "fastremap.pyx":436 + /* "fastremap.pyx":438 * if not isinstance(component_labels, np.ndarray): * component_labels = np.array(component_labels) * if not isinstance(parent_labels, np.ndarray): # <<<<<<<<<<<<<< * parent_labels = np.array(parent_labels) * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = PyObject_IsInstance(__pyx_v_parent_labels, __pyx_t_5); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_4 = PyObject_IsInstance(__pyx_v_parent_labels, __pyx_t_5); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":437 + /* "fastremap.pyx":439 * component_labels = np.array(component_labels) * if not isinstance(parent_labels, np.ndarray): * parent_labels = np.array(parent_labels) # <<<<<<<<<<<<<< * * if component_labels.size == 0: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -24171,13 +25093,13 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p } __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_parent_labels) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_parent_labels); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 437, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_parent_labels, __pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":436 + /* "fastremap.pyx":438 * if not isinstance(component_labels, np.ndarray): * component_labels = np.array(component_labels) * if not isinstance(parent_labels, np.ndarray): # <<<<<<<<<<<<<< @@ -24186,23 +25108,23 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p */ } - /* "fastremap.pyx":439 + /* "fastremap.pyx":441 * parent_labels = np.array(parent_labels) * * if component_labels.size == 0: # <<<<<<<<<<<<<< * return {} * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_component_labels, __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_component_labels, __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_5, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_5, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "fastremap.pyx":440 + /* "fastremap.pyx":442 * * if component_labels.size == 0: * return {} # <<<<<<<<<<<<<< @@ -24210,13 +25132,13 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p * if component_labels.shape != parent_labels.shape: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":439 + /* "fastremap.pyx":441 * parent_labels = np.array(parent_labels) * * if component_labels.size == 0: # <<<<<<<<<<<<<< @@ -24225,44 +25147,44 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p */ } - /* "fastremap.pyx":442 + /* "fastremap.pyx":444 * return {} * * if component_labels.shape != parent_labels.shape: # <<<<<<<<<<<<<< * raise ValueError("The size of the inputs must match: {} vs {}".format( * component_labels.shape, parent_labels.shape */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_component_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_component_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_3)) { - /* "fastremap.pyx":443 + /* "fastremap.pyx":445 * * if component_labels.shape != parent_labels.shape: * raise ValueError("The size of the inputs must match: {} vs {}".format( # <<<<<<<<<<<<<< * component_labels.shape, parent_labels.shape * )) */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_The_size_of_the_inputs_must_matc, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_The_size_of_the_inputs_must_matc, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - /* "fastremap.pyx":444 + /* "fastremap.pyx":446 * if component_labels.shape != parent_labels.shape: * raise ValueError("The size of the inputs must match: {} vs {}".format( * component_labels.shape, parent_labels.shape # <<<<<<<<<<<<<< * )) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_component_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_component_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -24279,7 +25201,7 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_6}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -24289,7 +25211,7 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_6}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -24297,7 +25219,7 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -24308,27 +25230,27 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":443 + /* "fastremap.pyx":445 * * if component_labels.shape != parent_labels.shape: * raise ValueError("The size of the inputs must match: {} vs {}".format( # <<<<<<<<<<<<<< * component_labels.shape, parent_labels.shape * )) */ - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 443, __pyx_L1_error) + __PYX_ERR(0, 445, __pyx_L1_error) - /* "fastremap.pyx":442 + /* "fastremap.pyx":444 * return {} * * if component_labels.shape != parent_labels.shape: # <<<<<<<<<<<<<< @@ -24337,30 +25259,30 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p */ } - /* "fastremap.pyx":447 + /* "fastremap.pyx":449 * )) * * shape = component_labels.shape # <<<<<<<<<<<<<< * * component_labels = reshape(component_labels, (component_labels.size,)) */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_component_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_component_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_shape = __pyx_t_5; __pyx_t_5 = 0; - /* "fastremap.pyx":449 + /* "fastremap.pyx":451 * shape = component_labels.shape * * component_labels = reshape(component_labels, (component_labels.size,)) # <<<<<<<<<<<<<< * parent_labels = reshape(parent_labels, (parent_labels.size,)) * return _component_map(component_labels, parent_labels) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_component_labels, __pyx_n_s_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_component_labels, __pyx_n_s_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); @@ -24380,7 +25302,7 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_component_labels, __pyx_t_6}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -24389,14 +25311,14 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_component_labels, __pyx_t_6}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_1 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); __pyx_t_9 = NULL; @@ -24407,7 +25329,7 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_8, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -24415,18 +25337,18 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p __Pyx_DECREF_SET(__pyx_v_component_labels, __pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":450 + /* "fastremap.pyx":452 * * component_labels = reshape(component_labels, (component_labels.size,)) * parent_labels = reshape(parent_labels, (parent_labels.size,)) # <<<<<<<<<<<<<< * return _component_map(component_labels, parent_labels) * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent_labels, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent_labels, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 450, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); @@ -24446,7 +25368,7 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_parent_labels, __pyx_t_6}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 450, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -24455,14 +25377,14 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_parent_labels, __pyx_t_6}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 450, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 450, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); __pyx_t_1 = NULL; @@ -24473,7 +25395,7 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 450, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -24481,7 +25403,7 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p __Pyx_DECREF_SET(__pyx_v_parent_labels, __pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":451 + /* "fastremap.pyx":453 * component_labels = reshape(component_labels, (component_labels.size,)) * parent_labels = reshape(parent_labels, (parent_labels.size,)) * return _component_map(component_labels, parent_labels) # <<<<<<<<<<<<<< @@ -24489,7 +25411,7 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_component_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_component_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = NULL; __pyx_t_8 = 0; @@ -24506,7 +25428,7 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_component_labels, __pyx_v_parent_labels}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_5); } else @@ -24514,13 +25436,13 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_component_labels, __pyx_v_parent_labels}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = NULL; @@ -24531,7 +25453,7 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p __Pyx_INCREF(__pyx_v_parent_labels); __Pyx_GIVEREF(__pyx_v_parent_labels); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_v_parent_labels); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -24540,7 +25462,7 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p __pyx_t_5 = 0; goto __pyx_L0; - /* "fastremap.pyx":421 + /* "fastremap.pyx":423 * return arr * * def component_map(component_labels, parent_labels): # <<<<<<<<<<<<<< @@ -24567,7 +25489,7 @@ static PyObject *__pyx_pf_9fastremap_20component_map(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "fastremap.pyx":456 +/* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -24616,23 +25538,23 @@ static PyObject *__pyx_pw_9fastremap_23_component_map(PyObject *__pyx_self, PyOb case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 458, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 458, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -24649,7 +25571,7 @@ static PyObject *__pyx_pw_9fastremap_23_component_map(PyObject *__pyx_self, PyOb } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -24711,7 +25633,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_component_map", 0); __Pyx_INCREF(__pyx_v_kwargs); - __pyx_t_1 = PyList_New(1 * 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = PyList_New(1 * 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < 2; __pyx_temp++) { @@ -24729,7 +25651,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 458, __pyx_L1_error) __pyx_t_3 = ((!__pyx_t_4) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; @@ -24737,7 +25659,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_kwargs, Py_None); } - __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -24752,14 +25674,14 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_v____pyx_int64_t_is_signed = (!((((int64_t)-1L) > 0) != 0)); if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 456, __pyx_L1_error) + __PYX_ERR(0, 458, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 458, __pyx_L1_error) __pyx_t_2 = ((0 < __pyx_t_5) != 0); if (__pyx_t_2) { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 456, __pyx_L1_error) + __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_t_1 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0); __Pyx_INCREF(__pyx_t_1); @@ -24776,18 +25698,18 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 456, __pyx_L1_error) + __PYX_ERR(0, 458, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_component_labels, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_component_labels, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 458, __pyx_L1_error) __pyx_t_3 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_3; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 456, __pyx_L1_error) + __PYX_ERR(0, 458, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_component_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_component_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -24796,12 +25718,12 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 456, __pyx_L1_error) + __PYX_ERR(0, 458, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 456, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_2); __Pyx_GIVEREF(__pyx_int_2); @@ -24812,15 +25734,15 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 456, __pyx_L1_error) + __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_L6:; while (1) { @@ -24830,7 +25752,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -24839,14 +25761,14 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -24868,14 +25790,14 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = (__pyx_v_dtype != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_itemsize = __pyx_t_5; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_kind = __pyx_t_7; __pyx_v_dtype_signed = (__pyx_v_kind == 'i'); @@ -24888,9 +25810,9 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -24902,7 +25824,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = __pyx_t_2; __pyx_L16_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint16_t)) == __pyx_v_itemsize) != 0); @@ -24911,9 +25833,9 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = __pyx_t_2; goto __pyx_L20_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -24925,7 +25847,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = __pyx_t_2; __pyx_L20_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint32_t)) == __pyx_v_itemsize) != 0); @@ -24934,9 +25856,9 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = __pyx_t_2; goto __pyx_L24_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -24948,7 +25870,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = __pyx_t_2; __pyx_L24_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint64_t)) == __pyx_v_itemsize) != 0); @@ -24957,9 +25879,9 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = __pyx_t_2; goto __pyx_L28_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -24971,7 +25893,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = __pyx_t_2; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int8_t)) == __pyx_v_itemsize) != 0); @@ -24980,9 +25902,9 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = __pyx_t_2; goto __pyx_L32_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -24994,7 +25916,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = __pyx_t_2; __pyx_L32_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int16_t)) == __pyx_v_itemsize) != 0); @@ -25003,9 +25925,9 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = __pyx_t_2; goto __pyx_L36_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -25017,7 +25939,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = __pyx_t_2; __pyx_L36_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int32_t)) == __pyx_v_itemsize) != 0); @@ -25026,9 +25948,9 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = __pyx_t_2; goto __pyx_L40_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -25040,7 +25962,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = __pyx_t_2; __pyx_L40_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int64_t)) == __pyx_v_itemsize) != 0); @@ -25049,9 +25971,9 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = __pyx_t_2; goto __pyx_L44_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -25063,7 +25985,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = __pyx_t_2; __pyx_L44_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -25092,7 +26014,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -25114,7 +26036,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -25136,7 +26058,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -25158,7 +26080,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -25180,7 +26102,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -25202,7 +26124,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -25224,7 +26146,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -25246,27 +26168,27 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); } } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L10_break; } __pyx_L10_break:; if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 456, __pyx_L1_error) + __PYX_ERR(0, 458, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 458, __pyx_L1_error) __pyx_t_3 = ((1 < __pyx_t_5) != 0); if (__pyx_t_3) { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 456, __pyx_L1_error) + __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_t_6 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 1); __Pyx_INCREF(__pyx_t_6); @@ -25283,18 +26205,18 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 456, __pyx_L1_error) + __PYX_ERR(0, 458, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_parent_labels, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_parent_labels, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 458, __pyx_L1_error) __pyx_t_2 = (__pyx_t_4 != 0); __pyx_t_3 = __pyx_t_2; __pyx_L80_bool_binop_done:; if (__pyx_t_3) { if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 456, __pyx_L1_error) + __PYX_ERR(0, 458, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_parent_labels); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_parent_labels); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_arg, __pyx_t_6); __pyx_t_6 = 0; @@ -25303,12 +26225,12 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 456, __pyx_L1_error) + __PYX_ERR(0, 458, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 456, __pyx_L1_error) - __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_2); __Pyx_GIVEREF(__pyx_int_2); @@ -25319,15 +26241,15 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 456, __pyx_L1_error) + __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_L79:; while (1) { @@ -25337,7 +26259,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_dtype, __pyx_t_1); __pyx_t_1 = 0; @@ -25346,14 +26268,14 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_arg_base, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_dtype, __pyx_t_1); __pyx_t_1 = 0; @@ -25375,14 +26297,14 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_3 = (__pyx_v_dtype != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_itemsize = __pyx_t_5; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_1); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_1); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_kind = __pyx_t_7; __pyx_v_dtype_signed = (__pyx_v_kind == 'i'); @@ -25395,9 +26317,9 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = __pyx_t_3; goto __pyx_L89_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_3) { @@ -25409,7 +26331,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = __pyx_t_3; __pyx_L89_bool_binop_done:; if (__pyx_t_2) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L83_break; } __pyx_t_3 = (((sizeof(uint16_t)) == __pyx_v_itemsize) != 0); @@ -25418,9 +26340,9 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = __pyx_t_3; goto __pyx_L93_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_3) { @@ -25432,7 +26354,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = __pyx_t_3; __pyx_L93_bool_binop_done:; if (__pyx_t_2) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L83_break; } __pyx_t_3 = (((sizeof(uint32_t)) == __pyx_v_itemsize) != 0); @@ -25441,9 +26363,9 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = __pyx_t_3; goto __pyx_L97_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_3) { @@ -25455,7 +26377,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = __pyx_t_3; __pyx_L97_bool_binop_done:; if (__pyx_t_2) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L83_break; } __pyx_t_3 = (((sizeof(uint64_t)) == __pyx_v_itemsize) != 0); @@ -25464,9 +26386,9 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = __pyx_t_3; goto __pyx_L101_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_3) { @@ -25478,7 +26400,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = __pyx_t_3; __pyx_L101_bool_binop_done:; if (__pyx_t_2) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L83_break; } __pyx_t_3 = (((sizeof(int8_t)) == __pyx_v_itemsize) != 0); @@ -25487,9 +26409,9 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = __pyx_t_3; goto __pyx_L105_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_3) { @@ -25501,7 +26423,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = __pyx_t_3; __pyx_L105_bool_binop_done:; if (__pyx_t_2) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L83_break; } __pyx_t_3 = (((sizeof(int16_t)) == __pyx_v_itemsize) != 0); @@ -25510,9 +26432,9 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = __pyx_t_3; goto __pyx_L109_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_3) { @@ -25524,7 +26446,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = __pyx_t_3; __pyx_L109_bool_binop_done:; if (__pyx_t_2) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L83_break; } __pyx_t_3 = (((sizeof(int32_t)) == __pyx_v_itemsize) != 0); @@ -25533,9 +26455,9 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = __pyx_t_3; goto __pyx_L113_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_3) { @@ -25547,7 +26469,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = __pyx_t_3; __pyx_L113_bool_binop_done:; if (__pyx_t_2) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L83_break; } __pyx_t_3 = (((sizeof(int64_t)) == __pyx_v_itemsize) != 0); @@ -25556,9 +26478,9 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = __pyx_t_3; goto __pyx_L117_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_3) { @@ -25570,7 +26492,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = __pyx_t_3; __pyx_L117_bool_binop_done:; if (__pyx_t_2) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L83_break; } break; @@ -25599,7 +26521,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = (__pyx_v_memslice.memview != 0); if (__pyx_t_2) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L83_break; } /*else*/ { @@ -25621,7 +26543,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = (__pyx_v_memslice.memview != 0); if (__pyx_t_2) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L83_break; } /*else*/ { @@ -25643,7 +26565,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = (__pyx_v_memslice.memview != 0); if (__pyx_t_2) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L83_break; } /*else*/ { @@ -25665,7 +26587,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = (__pyx_v_memslice.memview != 0); if (__pyx_t_2) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L83_break; } /*else*/ { @@ -25687,7 +26609,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = (__pyx_v_memslice.memview != 0); if (__pyx_t_2) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L83_break; } /*else*/ { @@ -25709,7 +26631,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = (__pyx_v_memslice.memview != 0); if (__pyx_t_2) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L83_break; } /*else*/ { @@ -25731,7 +26653,7 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = (__pyx_v_memslice.memview != 0); if (__pyx_t_2) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L83_break; } /*else*/ { @@ -25753,27 +26675,27 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = (__pyx_v_memslice.memview != 0); if (__pyx_t_2) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L83_break; } /*else*/ { PyErr_Clear(); } } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 458, __pyx_L1_error) goto __pyx_L83_break; } __pyx_L83_break:; - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_candidates = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = 0; if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 456, __pyx_L1_error) + __PYX_ERR(0, 458, __pyx_L1_error) } - __pyx_t_6 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_6 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_6; @@ -25781,12 +26703,12 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ while (1) { __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_5, &__pyx_t_6, NULL, NULL, __pyx_t_10); if (unlikely(__pyx_t_11 == 0)) break; - if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_6); __pyx_t_6 = 0; __pyx_v_match_found = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { @@ -25800,10 +26722,10 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ } __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, __pyx_kp_s__2) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__2); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -25818,12 +26740,12 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ } __pyx_t_6 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_12, __pyx_kp_s__3) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__3); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_src_sig, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 458, __pyx_L1_error) __pyx_t_16 = __pyx_t_15; for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; @@ -25834,11 +26756,11 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_t_2 = (__pyx_v_dst_type != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_13 = PyObject_RichCompare(__pyx_t_6, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_6, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_3) { __pyx_v_match_found = 1; @@ -25854,35 +26776,35 @@ static PyObject *__pyx_pf_9fastremap_22_component_map(CYTHON_UNUSED PyObject *__ __pyx_L155_break:; __pyx_t_3 = (__pyx_v_match_found != 0); if (__pyx_t_3) { - __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 458, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (PyList_GET_SIZE(__pyx_v_candidates) != 0); __pyx_t_2 = ((!__pyx_t_3) != 0); if (__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 456, __pyx_L1_error) + __PYX_ERR(0, 458, __pyx_L1_error) } - __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 458, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_9 > 1) != 0); if (__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 456, __pyx_L1_error) + __PYX_ERR(0, 458, __pyx_L1_error) } /*else*/ { __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 456, __pyx_L1_error) + __PYX_ERR(0, 458, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -25949,11 +26871,11 @@ static PyObject *__pyx_fuse_0_0__pyx_pw_9fastremap_131_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -25966,14 +26888,14 @@ static PyObject *__pyx_fuse_0_0__pyx_pw_9fastremap_131_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_130_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -26018,29 +26940,29 @@ static PyObject *__pyx_pf_9fastremap_130_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -26050,7 +26972,7 @@ static PyObject *__pyx_pf_9fastremap_130_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -26058,13 +26980,13 @@ static PyObject *__pyx_pf_9fastremap_130_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -26073,19 +26995,19 @@ static PyObject *__pyx_pf_9fastremap_130_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -26094,7 +27016,7 @@ static PyObject *__pyx_pf_9fastremap_130_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -26104,7 +27026,7 @@ static PyObject *__pyx_pf_9fastremap_130_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -26112,16 +27034,16 @@ static PyObject *__pyx_pf_9fastremap_130_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -26133,7 +27055,7 @@ static PyObject *__pyx_pf_9fastremap_130_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -26144,7 +27066,7 @@ static PyObject *__pyx_pf_9fastremap_130_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -26153,7 +27075,7 @@ static PyObject *__pyx_pf_9fastremap_130_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -26162,7 +27084,7 @@ static PyObject *__pyx_pf_9fastremap_130_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -26170,16 +27092,16 @@ static PyObject *__pyx_pf_9fastremap_130_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -26191,7 +27113,7 @@ static PyObject *__pyx_pf_9fastremap_130_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -26203,7 +27125,7 @@ static PyObject *__pyx_pf_9fastremap_130_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -26270,11 +27192,11 @@ static PyObject *__pyx_fuse_0_1__pyx_pw_9fastremap_133_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -26287,14 +27209,14 @@ static PyObject *__pyx_fuse_0_1__pyx_pw_9fastremap_133_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_132_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -26339,29 +27261,29 @@ static PyObject *__pyx_pf_9fastremap_132_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -26371,7 +27293,7 @@ static PyObject *__pyx_pf_9fastremap_132_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -26379,13 +27301,13 @@ static PyObject *__pyx_pf_9fastremap_132_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -26394,19 +27316,19 @@ static PyObject *__pyx_pf_9fastremap_132_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -26415,7 +27337,7 @@ static PyObject *__pyx_pf_9fastremap_132_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -26425,7 +27347,7 @@ static PyObject *__pyx_pf_9fastremap_132_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -26433,16 +27355,16 @@ static PyObject *__pyx_pf_9fastremap_132_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -26454,7 +27376,7 @@ static PyObject *__pyx_pf_9fastremap_132_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -26465,7 +27387,7 @@ static PyObject *__pyx_pf_9fastremap_132_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -26474,7 +27396,7 @@ static PyObject *__pyx_pf_9fastremap_132_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -26483,7 +27405,7 @@ static PyObject *__pyx_pf_9fastremap_132_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -26491,16 +27413,16 @@ static PyObject *__pyx_pf_9fastremap_132_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -26512,7 +27434,7 @@ static PyObject *__pyx_pf_9fastremap_132_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -26524,7 +27446,7 @@ static PyObject *__pyx_pf_9fastremap_132_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -26591,11 +27513,11 @@ static PyObject *__pyx_fuse_0_2__pyx_pw_9fastremap_135_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -26608,14 +27530,14 @@ static PyObject *__pyx_fuse_0_2__pyx_pw_9fastremap_135_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_134_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -26660,29 +27582,29 @@ static PyObject *__pyx_pf_9fastremap_134_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -26692,7 +27614,7 @@ static PyObject *__pyx_pf_9fastremap_134_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -26700,13 +27622,13 @@ static PyObject *__pyx_pf_9fastremap_134_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -26715,19 +27637,19 @@ static PyObject *__pyx_pf_9fastremap_134_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -26736,7 +27658,7 @@ static PyObject *__pyx_pf_9fastremap_134_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -26746,7 +27668,7 @@ static PyObject *__pyx_pf_9fastremap_134_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -26754,16 +27676,16 @@ static PyObject *__pyx_pf_9fastremap_134_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -26775,7 +27697,7 @@ static PyObject *__pyx_pf_9fastremap_134_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -26786,7 +27708,7 @@ static PyObject *__pyx_pf_9fastremap_134_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -26795,7 +27717,7 @@ static PyObject *__pyx_pf_9fastremap_134_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -26804,7 +27726,7 @@ static PyObject *__pyx_pf_9fastremap_134_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -26812,16 +27734,16 @@ static PyObject *__pyx_pf_9fastremap_134_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -26833,7 +27755,7 @@ static PyObject *__pyx_pf_9fastremap_134_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -26845,7 +27767,7 @@ static PyObject *__pyx_pf_9fastremap_134_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -26912,11 +27834,11 @@ static PyObject *__pyx_fuse_0_3__pyx_pw_9fastremap_137_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -26929,14 +27851,14 @@ static PyObject *__pyx_fuse_0_3__pyx_pw_9fastremap_137_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_136_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -26981,29 +27903,29 @@ static PyObject *__pyx_pf_9fastremap_136_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -27013,7 +27935,7 @@ static PyObject *__pyx_pf_9fastremap_136_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -27021,13 +27943,13 @@ static PyObject *__pyx_pf_9fastremap_136_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -27036,19 +27958,19 @@ static PyObject *__pyx_pf_9fastremap_136_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -27057,7 +27979,7 @@ static PyObject *__pyx_pf_9fastremap_136_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -27067,7 +27989,7 @@ static PyObject *__pyx_pf_9fastremap_136_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -27075,16 +27997,16 @@ static PyObject *__pyx_pf_9fastremap_136_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -27096,7 +28018,7 @@ static PyObject *__pyx_pf_9fastremap_136_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -27107,7 +28029,7 @@ static PyObject *__pyx_pf_9fastremap_136_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -27116,7 +28038,7 @@ static PyObject *__pyx_pf_9fastremap_136_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -27125,7 +28047,7 @@ static PyObject *__pyx_pf_9fastremap_136_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -27133,16 +28055,16 @@ static PyObject *__pyx_pf_9fastremap_136_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -27154,7 +28076,7 @@ static PyObject *__pyx_pf_9fastremap_136_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -27166,7 +28088,7 @@ static PyObject *__pyx_pf_9fastremap_136_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -27233,11 +28155,11 @@ static PyObject *__pyx_fuse_0_4__pyx_pw_9fastremap_139_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -27250,14 +28172,14 @@ static PyObject *__pyx_fuse_0_4__pyx_pw_9fastremap_139_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_138_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -27302,29 +28224,29 @@ static PyObject *__pyx_pf_9fastremap_138_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -27334,7 +28256,7 @@ static PyObject *__pyx_pf_9fastremap_138_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -27342,13 +28264,13 @@ static PyObject *__pyx_pf_9fastremap_138_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -27357,19 +28279,19 @@ static PyObject *__pyx_pf_9fastremap_138_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -27378,7 +28300,7 @@ static PyObject *__pyx_pf_9fastremap_138_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -27388,7 +28310,7 @@ static PyObject *__pyx_pf_9fastremap_138_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -27396,16 +28318,16 @@ static PyObject *__pyx_pf_9fastremap_138_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -27417,7 +28339,7 @@ static PyObject *__pyx_pf_9fastremap_138_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -27428,7 +28350,7 @@ static PyObject *__pyx_pf_9fastremap_138_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -27437,7 +28359,7 @@ static PyObject *__pyx_pf_9fastremap_138_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -27446,7 +28368,7 @@ static PyObject *__pyx_pf_9fastremap_138_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -27454,16 +28376,16 @@ static PyObject *__pyx_pf_9fastremap_138_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -27475,7 +28397,7 @@ static PyObject *__pyx_pf_9fastremap_138_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -27487,7 +28409,7 @@ static PyObject *__pyx_pf_9fastremap_138_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -27554,11 +28476,11 @@ static PyObject *__pyx_fuse_0_5__pyx_pw_9fastremap_141_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -27571,14 +28493,14 @@ static PyObject *__pyx_fuse_0_5__pyx_pw_9fastremap_141_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_140_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -27623,29 +28545,29 @@ static PyObject *__pyx_pf_9fastremap_140_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -27655,7 +28577,7 @@ static PyObject *__pyx_pf_9fastremap_140_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -27663,13 +28585,13 @@ static PyObject *__pyx_pf_9fastremap_140_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -27678,19 +28600,19 @@ static PyObject *__pyx_pf_9fastremap_140_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -27699,7 +28621,7 @@ static PyObject *__pyx_pf_9fastremap_140_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -27709,7 +28631,7 @@ static PyObject *__pyx_pf_9fastremap_140_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -27717,16 +28639,16 @@ static PyObject *__pyx_pf_9fastremap_140_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -27738,7 +28660,7 @@ static PyObject *__pyx_pf_9fastremap_140_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -27749,7 +28671,7 @@ static PyObject *__pyx_pf_9fastremap_140_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -27758,7 +28680,7 @@ static PyObject *__pyx_pf_9fastremap_140_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -27767,7 +28689,7 @@ static PyObject *__pyx_pf_9fastremap_140_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -27775,16 +28697,16 @@ static PyObject *__pyx_pf_9fastremap_140_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -27796,7 +28718,7 @@ static PyObject *__pyx_pf_9fastremap_140_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -27808,7 +28730,7 @@ static PyObject *__pyx_pf_9fastremap_140_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -27875,11 +28797,11 @@ static PyObject *__pyx_fuse_0_6__pyx_pw_9fastremap_143_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -27892,14 +28814,14 @@ static PyObject *__pyx_fuse_0_6__pyx_pw_9fastremap_143_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_142_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -27944,29 +28866,29 @@ static PyObject *__pyx_pf_9fastremap_142_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -27976,7 +28898,7 @@ static PyObject *__pyx_pf_9fastremap_142_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -27984,13 +28906,13 @@ static PyObject *__pyx_pf_9fastremap_142_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -27999,19 +28921,19 @@ static PyObject *__pyx_pf_9fastremap_142_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -28020,7 +28942,7 @@ static PyObject *__pyx_pf_9fastremap_142_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -28030,7 +28952,7 @@ static PyObject *__pyx_pf_9fastremap_142_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -28038,16 +28960,16 @@ static PyObject *__pyx_pf_9fastremap_142_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -28059,7 +28981,7 @@ static PyObject *__pyx_pf_9fastremap_142_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -28070,7 +28992,7 @@ static PyObject *__pyx_pf_9fastremap_142_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -28079,7 +29001,7 @@ static PyObject *__pyx_pf_9fastremap_142_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -28088,7 +29010,7 @@ static PyObject *__pyx_pf_9fastremap_142_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -28096,16 +29018,16 @@ static PyObject *__pyx_pf_9fastremap_142_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -28117,7 +29039,7 @@ static PyObject *__pyx_pf_9fastremap_142_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -28129,7 +29051,7 @@ static PyObject *__pyx_pf_9fastremap_142_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -28196,11 +29118,11 @@ static PyObject *__pyx_fuse_0_7__pyx_pw_9fastremap_145_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -28213,14 +29135,14 @@ static PyObject *__pyx_fuse_0_7__pyx_pw_9fastremap_145_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_144_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -28265,29 +29187,29 @@ static PyObject *__pyx_pf_9fastremap_144_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -28297,7 +29219,7 @@ static PyObject *__pyx_pf_9fastremap_144_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -28305,13 +29227,13 @@ static PyObject *__pyx_pf_9fastremap_144_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -28320,19 +29242,19 @@ static PyObject *__pyx_pf_9fastremap_144_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -28341,7 +29263,7 @@ static PyObject *__pyx_pf_9fastremap_144_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -28351,7 +29273,7 @@ static PyObject *__pyx_pf_9fastremap_144_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -28359,16 +29281,16 @@ static PyObject *__pyx_pf_9fastremap_144_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -28380,7 +29302,7 @@ static PyObject *__pyx_pf_9fastremap_144_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -28391,7 +29313,7 @@ static PyObject *__pyx_pf_9fastremap_144_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -28400,7 +29322,7 @@ static PyObject *__pyx_pf_9fastremap_144_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -28409,7 +29331,7 @@ static PyObject *__pyx_pf_9fastremap_144_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -28417,16 +29339,16 @@ static PyObject *__pyx_pf_9fastremap_144_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -28438,7 +29360,7 @@ static PyObject *__pyx_pf_9fastremap_144_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -28450,7 +29372,7 @@ static PyObject *__pyx_pf_9fastremap_144_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -28517,11 +29439,11 @@ static PyObject *__pyx_fuse_1_0__pyx_pw_9fastremap_147_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -28534,14 +29456,14 @@ static PyObject *__pyx_fuse_1_0__pyx_pw_9fastremap_147_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_146_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -28586,29 +29508,29 @@ static PyObject *__pyx_pf_9fastremap_146_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -28618,7 +29540,7 @@ static PyObject *__pyx_pf_9fastremap_146_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -28626,13 +29548,13 @@ static PyObject *__pyx_pf_9fastremap_146_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -28641,19 +29563,19 @@ static PyObject *__pyx_pf_9fastremap_146_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -28662,7 +29584,7 @@ static PyObject *__pyx_pf_9fastremap_146_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -28672,7 +29594,7 @@ static PyObject *__pyx_pf_9fastremap_146_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -28680,16 +29602,16 @@ static PyObject *__pyx_pf_9fastremap_146_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -28701,7 +29623,7 @@ static PyObject *__pyx_pf_9fastremap_146_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -28712,7 +29634,7 @@ static PyObject *__pyx_pf_9fastremap_146_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -28721,7 +29643,7 @@ static PyObject *__pyx_pf_9fastremap_146_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -28730,7 +29652,7 @@ static PyObject *__pyx_pf_9fastremap_146_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -28738,16 +29660,16 @@ static PyObject *__pyx_pf_9fastremap_146_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -28759,7 +29681,7 @@ static PyObject *__pyx_pf_9fastremap_146_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -28771,7 +29693,7 @@ static PyObject *__pyx_pf_9fastremap_146_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -28838,11 +29760,11 @@ static PyObject *__pyx_fuse_1_1__pyx_pw_9fastremap_149_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -28855,14 +29777,14 @@ static PyObject *__pyx_fuse_1_1__pyx_pw_9fastremap_149_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_148_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -28907,29 +29829,29 @@ static PyObject *__pyx_pf_9fastremap_148_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -28939,7 +29861,7 @@ static PyObject *__pyx_pf_9fastremap_148_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -28947,13 +29869,13 @@ static PyObject *__pyx_pf_9fastremap_148_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -28962,19 +29884,19 @@ static PyObject *__pyx_pf_9fastremap_148_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -28983,7 +29905,7 @@ static PyObject *__pyx_pf_9fastremap_148_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -28993,7 +29915,7 @@ static PyObject *__pyx_pf_9fastremap_148_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -29001,16 +29923,16 @@ static PyObject *__pyx_pf_9fastremap_148_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -29022,7 +29944,7 @@ static PyObject *__pyx_pf_9fastremap_148_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -29033,7 +29955,7 @@ static PyObject *__pyx_pf_9fastremap_148_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -29042,7 +29964,7 @@ static PyObject *__pyx_pf_9fastremap_148_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -29051,7 +29973,7 @@ static PyObject *__pyx_pf_9fastremap_148_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -29059,16 +29981,16 @@ static PyObject *__pyx_pf_9fastremap_148_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -29080,7 +30002,7 @@ static PyObject *__pyx_pf_9fastremap_148_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -29092,7 +30014,7 @@ static PyObject *__pyx_pf_9fastremap_148_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -29159,11 +30081,11 @@ static PyObject *__pyx_fuse_1_2__pyx_pw_9fastremap_151_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -29176,14 +30098,14 @@ static PyObject *__pyx_fuse_1_2__pyx_pw_9fastremap_151_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_150_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -29228,29 +30150,29 @@ static PyObject *__pyx_pf_9fastremap_150_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -29260,7 +30182,7 @@ static PyObject *__pyx_pf_9fastremap_150_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -29268,13 +30190,13 @@ static PyObject *__pyx_pf_9fastremap_150_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -29283,19 +30205,19 @@ static PyObject *__pyx_pf_9fastremap_150_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -29304,7 +30226,7 @@ static PyObject *__pyx_pf_9fastremap_150_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -29314,7 +30236,7 @@ static PyObject *__pyx_pf_9fastremap_150_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -29322,16 +30244,16 @@ static PyObject *__pyx_pf_9fastremap_150_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -29343,7 +30265,7 @@ static PyObject *__pyx_pf_9fastremap_150_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -29354,7 +30276,7 @@ static PyObject *__pyx_pf_9fastremap_150_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -29363,7 +30285,7 @@ static PyObject *__pyx_pf_9fastremap_150_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -29372,7 +30294,7 @@ static PyObject *__pyx_pf_9fastremap_150_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -29380,16 +30302,16 @@ static PyObject *__pyx_pf_9fastremap_150_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -29401,7 +30323,7 @@ static PyObject *__pyx_pf_9fastremap_150_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -29413,7 +30335,7 @@ static PyObject *__pyx_pf_9fastremap_150_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -29480,11 +30402,11 @@ static PyObject *__pyx_fuse_1_3__pyx_pw_9fastremap_153_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -29497,14 +30419,14 @@ static PyObject *__pyx_fuse_1_3__pyx_pw_9fastremap_153_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_152_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -29549,29 +30471,29 @@ static PyObject *__pyx_pf_9fastremap_152_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -29581,7 +30503,7 @@ static PyObject *__pyx_pf_9fastremap_152_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -29589,13 +30511,13 @@ static PyObject *__pyx_pf_9fastremap_152_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -29604,19 +30526,19 @@ static PyObject *__pyx_pf_9fastremap_152_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -29625,7 +30547,7 @@ static PyObject *__pyx_pf_9fastremap_152_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -29635,7 +30557,7 @@ static PyObject *__pyx_pf_9fastremap_152_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -29643,16 +30565,16 @@ static PyObject *__pyx_pf_9fastremap_152_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -29664,7 +30586,7 @@ static PyObject *__pyx_pf_9fastremap_152_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -29675,7 +30597,7 @@ static PyObject *__pyx_pf_9fastremap_152_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -29684,7 +30606,7 @@ static PyObject *__pyx_pf_9fastremap_152_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -29693,7 +30615,7 @@ static PyObject *__pyx_pf_9fastremap_152_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -29701,16 +30623,16 @@ static PyObject *__pyx_pf_9fastremap_152_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -29722,7 +30644,7 @@ static PyObject *__pyx_pf_9fastremap_152_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -29734,7 +30656,7 @@ static PyObject *__pyx_pf_9fastremap_152_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -29801,11 +30723,11 @@ static PyObject *__pyx_fuse_1_4__pyx_pw_9fastremap_155_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -29818,14 +30740,14 @@ static PyObject *__pyx_fuse_1_4__pyx_pw_9fastremap_155_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_154_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -29870,29 +30792,29 @@ static PyObject *__pyx_pf_9fastremap_154_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -29902,7 +30824,7 @@ static PyObject *__pyx_pf_9fastremap_154_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -29910,13 +30832,13 @@ static PyObject *__pyx_pf_9fastremap_154_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -29925,19 +30847,19 @@ static PyObject *__pyx_pf_9fastremap_154_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -29946,7 +30868,7 @@ static PyObject *__pyx_pf_9fastremap_154_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -29956,7 +30878,7 @@ static PyObject *__pyx_pf_9fastremap_154_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -29964,16 +30886,16 @@ static PyObject *__pyx_pf_9fastremap_154_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -29985,7 +30907,7 @@ static PyObject *__pyx_pf_9fastremap_154_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -29996,7 +30918,7 @@ static PyObject *__pyx_pf_9fastremap_154_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -30005,7 +30927,7 @@ static PyObject *__pyx_pf_9fastremap_154_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -30014,7 +30936,7 @@ static PyObject *__pyx_pf_9fastremap_154_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -30022,16 +30944,16 @@ static PyObject *__pyx_pf_9fastremap_154_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -30043,7 +30965,7 @@ static PyObject *__pyx_pf_9fastremap_154_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -30055,7 +30977,7 @@ static PyObject *__pyx_pf_9fastremap_154_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -30122,11 +31044,11 @@ static PyObject *__pyx_fuse_1_5__pyx_pw_9fastremap_157_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -30139,14 +31061,14 @@ static PyObject *__pyx_fuse_1_5__pyx_pw_9fastremap_157_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_156_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -30191,29 +31113,29 @@ static PyObject *__pyx_pf_9fastremap_156_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -30223,7 +31145,7 @@ static PyObject *__pyx_pf_9fastremap_156_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -30231,13 +31153,13 @@ static PyObject *__pyx_pf_9fastremap_156_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -30246,19 +31168,19 @@ static PyObject *__pyx_pf_9fastremap_156_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -30267,7 +31189,7 @@ static PyObject *__pyx_pf_9fastremap_156_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -30277,7 +31199,7 @@ static PyObject *__pyx_pf_9fastremap_156_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -30285,16 +31207,16 @@ static PyObject *__pyx_pf_9fastremap_156_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -30306,7 +31228,7 @@ static PyObject *__pyx_pf_9fastremap_156_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -30317,7 +31239,7 @@ static PyObject *__pyx_pf_9fastremap_156_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -30326,7 +31248,7 @@ static PyObject *__pyx_pf_9fastremap_156_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -30335,7 +31257,7 @@ static PyObject *__pyx_pf_9fastremap_156_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -30343,16 +31265,16 @@ static PyObject *__pyx_pf_9fastremap_156_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -30364,7 +31286,7 @@ static PyObject *__pyx_pf_9fastremap_156_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -30376,7 +31298,7 @@ static PyObject *__pyx_pf_9fastremap_156_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -30443,11 +31365,11 @@ static PyObject *__pyx_fuse_1_6__pyx_pw_9fastremap_159_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -30460,14 +31382,14 @@ static PyObject *__pyx_fuse_1_6__pyx_pw_9fastremap_159_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_158_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -30512,29 +31434,29 @@ static PyObject *__pyx_pf_9fastremap_158_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -30544,7 +31466,7 @@ static PyObject *__pyx_pf_9fastremap_158_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -30552,13 +31474,13 @@ static PyObject *__pyx_pf_9fastremap_158_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -30567,19 +31489,19 @@ static PyObject *__pyx_pf_9fastremap_158_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -30588,7 +31510,7 @@ static PyObject *__pyx_pf_9fastremap_158_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -30598,7 +31520,7 @@ static PyObject *__pyx_pf_9fastremap_158_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -30606,16 +31528,16 @@ static PyObject *__pyx_pf_9fastremap_158_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -30627,7 +31549,7 @@ static PyObject *__pyx_pf_9fastremap_158_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -30638,7 +31560,7 @@ static PyObject *__pyx_pf_9fastremap_158_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -30647,7 +31569,7 @@ static PyObject *__pyx_pf_9fastremap_158_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -30656,7 +31578,7 @@ static PyObject *__pyx_pf_9fastremap_158_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -30664,16 +31586,16 @@ static PyObject *__pyx_pf_9fastremap_158_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -30685,7 +31607,7 @@ static PyObject *__pyx_pf_9fastremap_158_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -30697,7 +31619,7 @@ static PyObject *__pyx_pf_9fastremap_158_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -30764,11 +31686,11 @@ static PyObject *__pyx_fuse_1_7__pyx_pw_9fastremap_161_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -30781,14 +31703,14 @@ static PyObject *__pyx_fuse_1_7__pyx_pw_9fastremap_161_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_160_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -30833,29 +31755,29 @@ static PyObject *__pyx_pf_9fastremap_160_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -30865,7 +31787,7 @@ static PyObject *__pyx_pf_9fastremap_160_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -30873,13 +31795,13 @@ static PyObject *__pyx_pf_9fastremap_160_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -30888,19 +31810,19 @@ static PyObject *__pyx_pf_9fastremap_160_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -30909,7 +31831,7 @@ static PyObject *__pyx_pf_9fastremap_160_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -30919,7 +31841,7 @@ static PyObject *__pyx_pf_9fastremap_160_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -30927,16 +31849,16 @@ static PyObject *__pyx_pf_9fastremap_160_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -30948,7 +31870,7 @@ static PyObject *__pyx_pf_9fastremap_160_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -30959,7 +31881,7 @@ static PyObject *__pyx_pf_9fastremap_160_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -30968,7 +31890,7 @@ static PyObject *__pyx_pf_9fastremap_160_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -30977,7 +31899,7 @@ static PyObject *__pyx_pf_9fastremap_160_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -30985,16 +31907,16 @@ static PyObject *__pyx_pf_9fastremap_160_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -31006,7 +31928,7 @@ static PyObject *__pyx_pf_9fastremap_160_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -31018,7 +31940,7 @@ static PyObject *__pyx_pf_9fastremap_160_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -31085,11 +32007,11 @@ static PyObject *__pyx_fuse_2_0__pyx_pw_9fastremap_163_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -31102,14 +32024,14 @@ static PyObject *__pyx_fuse_2_0__pyx_pw_9fastremap_163_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_162_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -31154,29 +32076,29 @@ static PyObject *__pyx_pf_9fastremap_162_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -31186,7 +32108,7 @@ static PyObject *__pyx_pf_9fastremap_162_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -31194,13 +32116,13 @@ static PyObject *__pyx_pf_9fastremap_162_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -31209,19 +32131,19 @@ static PyObject *__pyx_pf_9fastremap_162_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -31230,7 +32152,7 @@ static PyObject *__pyx_pf_9fastremap_162_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -31240,7 +32162,7 @@ static PyObject *__pyx_pf_9fastremap_162_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -31248,16 +32170,16 @@ static PyObject *__pyx_pf_9fastremap_162_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -31269,7 +32191,7 @@ static PyObject *__pyx_pf_9fastremap_162_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -31280,7 +32202,7 @@ static PyObject *__pyx_pf_9fastremap_162_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -31289,7 +32211,7 @@ static PyObject *__pyx_pf_9fastremap_162_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -31298,7 +32220,7 @@ static PyObject *__pyx_pf_9fastremap_162_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -31306,16 +32228,16 @@ static PyObject *__pyx_pf_9fastremap_162_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -31327,7 +32249,7 @@ static PyObject *__pyx_pf_9fastremap_162_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -31339,7 +32261,7 @@ static PyObject *__pyx_pf_9fastremap_162_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -31406,11 +32328,11 @@ static PyObject *__pyx_fuse_2_1__pyx_pw_9fastremap_165_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -31423,14 +32345,14 @@ static PyObject *__pyx_fuse_2_1__pyx_pw_9fastremap_165_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_164_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -31475,29 +32397,29 @@ static PyObject *__pyx_pf_9fastremap_164_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -31507,7 +32429,7 @@ static PyObject *__pyx_pf_9fastremap_164_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -31515,13 +32437,13 @@ static PyObject *__pyx_pf_9fastremap_164_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -31530,19 +32452,19 @@ static PyObject *__pyx_pf_9fastremap_164_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -31551,7 +32473,7 @@ static PyObject *__pyx_pf_9fastremap_164_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -31561,7 +32483,7 @@ static PyObject *__pyx_pf_9fastremap_164_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -31569,16 +32491,16 @@ static PyObject *__pyx_pf_9fastremap_164_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -31590,7 +32512,7 @@ static PyObject *__pyx_pf_9fastremap_164_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -31601,7 +32523,7 @@ static PyObject *__pyx_pf_9fastremap_164_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -31610,7 +32532,7 @@ static PyObject *__pyx_pf_9fastremap_164_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -31619,7 +32541,7 @@ static PyObject *__pyx_pf_9fastremap_164_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -31627,16 +32549,16 @@ static PyObject *__pyx_pf_9fastremap_164_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -31648,7 +32570,7 @@ static PyObject *__pyx_pf_9fastremap_164_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -31660,7 +32582,7 @@ static PyObject *__pyx_pf_9fastremap_164_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -31727,11 +32649,11 @@ static PyObject *__pyx_fuse_2_2__pyx_pw_9fastremap_167_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -31744,14 +32666,14 @@ static PyObject *__pyx_fuse_2_2__pyx_pw_9fastremap_167_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_166_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -31796,29 +32718,29 @@ static PyObject *__pyx_pf_9fastremap_166_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -31828,7 +32750,7 @@ static PyObject *__pyx_pf_9fastremap_166_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -31836,13 +32758,13 @@ static PyObject *__pyx_pf_9fastremap_166_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -31851,19 +32773,19 @@ static PyObject *__pyx_pf_9fastremap_166_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -31872,7 +32794,7 @@ static PyObject *__pyx_pf_9fastremap_166_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -31882,7 +32804,7 @@ static PyObject *__pyx_pf_9fastremap_166_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -31890,16 +32812,16 @@ static PyObject *__pyx_pf_9fastremap_166_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -31911,7 +32833,7 @@ static PyObject *__pyx_pf_9fastremap_166_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -31922,7 +32844,7 @@ static PyObject *__pyx_pf_9fastremap_166_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -31931,7 +32853,7 @@ static PyObject *__pyx_pf_9fastremap_166_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -31940,7 +32862,7 @@ static PyObject *__pyx_pf_9fastremap_166_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -31948,16 +32870,16 @@ static PyObject *__pyx_pf_9fastremap_166_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -31969,7 +32891,7 @@ static PyObject *__pyx_pf_9fastremap_166_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -31981,7 +32903,7 @@ static PyObject *__pyx_pf_9fastremap_166_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -32048,11 +32970,11 @@ static PyObject *__pyx_fuse_2_3__pyx_pw_9fastremap_169_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -32065,14 +32987,14 @@ static PyObject *__pyx_fuse_2_3__pyx_pw_9fastremap_169_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_168_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -32117,29 +33039,29 @@ static PyObject *__pyx_pf_9fastremap_168_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -32149,7 +33071,7 @@ static PyObject *__pyx_pf_9fastremap_168_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -32157,13 +33079,13 @@ static PyObject *__pyx_pf_9fastremap_168_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -32172,19 +33094,19 @@ static PyObject *__pyx_pf_9fastremap_168_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -32193,7 +33115,7 @@ static PyObject *__pyx_pf_9fastremap_168_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -32203,7 +33125,7 @@ static PyObject *__pyx_pf_9fastremap_168_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -32211,16 +33133,16 @@ static PyObject *__pyx_pf_9fastremap_168_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -32232,7 +33154,7 @@ static PyObject *__pyx_pf_9fastremap_168_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -32243,7 +33165,7 @@ static PyObject *__pyx_pf_9fastremap_168_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -32252,7 +33174,7 @@ static PyObject *__pyx_pf_9fastremap_168_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -32261,7 +33183,7 @@ static PyObject *__pyx_pf_9fastremap_168_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -32269,16 +33191,16 @@ static PyObject *__pyx_pf_9fastremap_168_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -32290,7 +33212,7 @@ static PyObject *__pyx_pf_9fastremap_168_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -32302,7 +33224,7 @@ static PyObject *__pyx_pf_9fastremap_168_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -32369,11 +33291,11 @@ static PyObject *__pyx_fuse_2_4__pyx_pw_9fastremap_171_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -32386,14 +33308,14 @@ static PyObject *__pyx_fuse_2_4__pyx_pw_9fastremap_171_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_170_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -32438,29 +33360,29 @@ static PyObject *__pyx_pf_9fastremap_170_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -32470,7 +33392,7 @@ static PyObject *__pyx_pf_9fastremap_170_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -32478,13 +33400,13 @@ static PyObject *__pyx_pf_9fastremap_170_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -32493,19 +33415,19 @@ static PyObject *__pyx_pf_9fastremap_170_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -32514,7 +33436,7 @@ static PyObject *__pyx_pf_9fastremap_170_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -32524,7 +33446,7 @@ static PyObject *__pyx_pf_9fastremap_170_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -32532,16 +33454,16 @@ static PyObject *__pyx_pf_9fastremap_170_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -32553,7 +33475,7 @@ static PyObject *__pyx_pf_9fastremap_170_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -32564,7 +33486,7 @@ static PyObject *__pyx_pf_9fastremap_170_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -32573,7 +33495,7 @@ static PyObject *__pyx_pf_9fastremap_170_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -32582,7 +33504,7 @@ static PyObject *__pyx_pf_9fastremap_170_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -32590,16 +33512,16 @@ static PyObject *__pyx_pf_9fastremap_170_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -32611,7 +33533,7 @@ static PyObject *__pyx_pf_9fastremap_170_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -32623,7 +33545,7 @@ static PyObject *__pyx_pf_9fastremap_170_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -32690,11 +33612,11 @@ static PyObject *__pyx_fuse_2_5__pyx_pw_9fastremap_173_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -32707,14 +33629,14 @@ static PyObject *__pyx_fuse_2_5__pyx_pw_9fastremap_173_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_172_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -32759,29 +33681,29 @@ static PyObject *__pyx_pf_9fastremap_172_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -32791,7 +33713,7 @@ static PyObject *__pyx_pf_9fastremap_172_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -32799,13 +33721,13 @@ static PyObject *__pyx_pf_9fastremap_172_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -32814,19 +33736,19 @@ static PyObject *__pyx_pf_9fastremap_172_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -32835,7 +33757,7 @@ static PyObject *__pyx_pf_9fastremap_172_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -32845,7 +33767,7 @@ static PyObject *__pyx_pf_9fastremap_172_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -32853,16 +33775,16 @@ static PyObject *__pyx_pf_9fastremap_172_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -32874,7 +33796,7 @@ static PyObject *__pyx_pf_9fastremap_172_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -32885,7 +33807,7 @@ static PyObject *__pyx_pf_9fastremap_172_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -32894,7 +33816,7 @@ static PyObject *__pyx_pf_9fastremap_172_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -32903,7 +33825,7 @@ static PyObject *__pyx_pf_9fastremap_172_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -32911,16 +33833,16 @@ static PyObject *__pyx_pf_9fastremap_172_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -32932,7 +33854,7 @@ static PyObject *__pyx_pf_9fastremap_172_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -32944,7 +33866,7 @@ static PyObject *__pyx_pf_9fastremap_172_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -33011,11 +33933,11 @@ static PyObject *__pyx_fuse_2_6__pyx_pw_9fastremap_175_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -33028,14 +33950,14 @@ static PyObject *__pyx_fuse_2_6__pyx_pw_9fastremap_175_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_174_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -33080,29 +34002,29 @@ static PyObject *__pyx_pf_9fastremap_174_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -33112,7 +34034,7 @@ static PyObject *__pyx_pf_9fastremap_174_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -33120,13 +34042,13 @@ static PyObject *__pyx_pf_9fastremap_174_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -33135,19 +34057,19 @@ static PyObject *__pyx_pf_9fastremap_174_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -33156,7 +34078,7 @@ static PyObject *__pyx_pf_9fastremap_174_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -33166,7 +34088,7 @@ static PyObject *__pyx_pf_9fastremap_174_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -33174,16 +34096,16 @@ static PyObject *__pyx_pf_9fastremap_174_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -33195,7 +34117,7 @@ static PyObject *__pyx_pf_9fastremap_174_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -33206,7 +34128,7 @@ static PyObject *__pyx_pf_9fastremap_174_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -33215,7 +34137,7 @@ static PyObject *__pyx_pf_9fastremap_174_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -33224,7 +34146,7 @@ static PyObject *__pyx_pf_9fastremap_174_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -33232,16 +34154,16 @@ static PyObject *__pyx_pf_9fastremap_174_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -33253,7 +34175,7 @@ static PyObject *__pyx_pf_9fastremap_174_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -33265,7 +34187,7 @@ static PyObject *__pyx_pf_9fastremap_174_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -33332,11 +34254,11 @@ static PyObject *__pyx_fuse_2_7__pyx_pw_9fastremap_177_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -33349,14 +34271,14 @@ static PyObject *__pyx_fuse_2_7__pyx_pw_9fastremap_177_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_176_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -33401,29 +34323,29 @@ static PyObject *__pyx_pf_9fastremap_176_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -33433,7 +34355,7 @@ static PyObject *__pyx_pf_9fastremap_176_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -33441,13 +34363,13 @@ static PyObject *__pyx_pf_9fastremap_176_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -33456,19 +34378,19 @@ static PyObject *__pyx_pf_9fastremap_176_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -33477,7 +34399,7 @@ static PyObject *__pyx_pf_9fastremap_176_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -33487,7 +34409,7 @@ static PyObject *__pyx_pf_9fastremap_176_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -33495,16 +34417,16 @@ static PyObject *__pyx_pf_9fastremap_176_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -33516,7 +34438,7 @@ static PyObject *__pyx_pf_9fastremap_176_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -33527,7 +34449,7 @@ static PyObject *__pyx_pf_9fastremap_176_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -33536,7 +34458,7 @@ static PyObject *__pyx_pf_9fastremap_176_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -33545,7 +34467,7 @@ static PyObject *__pyx_pf_9fastremap_176_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -33553,16 +34475,16 @@ static PyObject *__pyx_pf_9fastremap_176_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -33574,7 +34496,7 @@ static PyObject *__pyx_pf_9fastremap_176_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -33586,7 +34508,7 @@ static PyObject *__pyx_pf_9fastremap_176_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -33653,11 +34575,11 @@ static PyObject *__pyx_fuse_3_0__pyx_pw_9fastremap_179_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -33670,14 +34592,14 @@ static PyObject *__pyx_fuse_3_0__pyx_pw_9fastremap_179_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_178_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -33722,29 +34644,29 @@ static PyObject *__pyx_pf_9fastremap_178_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -33754,7 +34676,7 @@ static PyObject *__pyx_pf_9fastremap_178_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -33762,13 +34684,13 @@ static PyObject *__pyx_pf_9fastremap_178_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -33777,19 +34699,19 @@ static PyObject *__pyx_pf_9fastremap_178_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -33798,7 +34720,7 @@ static PyObject *__pyx_pf_9fastremap_178_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -33808,7 +34730,7 @@ static PyObject *__pyx_pf_9fastremap_178_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -33816,16 +34738,16 @@ static PyObject *__pyx_pf_9fastremap_178_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -33837,7 +34759,7 @@ static PyObject *__pyx_pf_9fastremap_178_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -33848,7 +34770,7 @@ static PyObject *__pyx_pf_9fastremap_178_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -33857,7 +34779,7 @@ static PyObject *__pyx_pf_9fastremap_178_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -33866,7 +34788,7 @@ static PyObject *__pyx_pf_9fastremap_178_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -33874,16 +34796,16 @@ static PyObject *__pyx_pf_9fastremap_178_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -33895,7 +34817,7 @@ static PyObject *__pyx_pf_9fastremap_178_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -33907,7 +34829,7 @@ static PyObject *__pyx_pf_9fastremap_178_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -33974,11 +34896,11 @@ static PyObject *__pyx_fuse_3_1__pyx_pw_9fastremap_181_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -33991,14 +34913,14 @@ static PyObject *__pyx_fuse_3_1__pyx_pw_9fastremap_181_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_180_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -34043,29 +34965,29 @@ static PyObject *__pyx_pf_9fastremap_180_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -34075,7 +34997,7 @@ static PyObject *__pyx_pf_9fastremap_180_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -34083,13 +35005,13 @@ static PyObject *__pyx_pf_9fastremap_180_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -34098,19 +35020,19 @@ static PyObject *__pyx_pf_9fastremap_180_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -34119,7 +35041,7 @@ static PyObject *__pyx_pf_9fastremap_180_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -34129,7 +35051,7 @@ static PyObject *__pyx_pf_9fastremap_180_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -34137,16 +35059,16 @@ static PyObject *__pyx_pf_9fastremap_180_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -34158,7 +35080,7 @@ static PyObject *__pyx_pf_9fastremap_180_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -34169,7 +35091,7 @@ static PyObject *__pyx_pf_9fastremap_180_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -34178,7 +35100,7 @@ static PyObject *__pyx_pf_9fastremap_180_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -34187,7 +35109,7 @@ static PyObject *__pyx_pf_9fastremap_180_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -34195,16 +35117,16 @@ static PyObject *__pyx_pf_9fastremap_180_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -34216,7 +35138,7 @@ static PyObject *__pyx_pf_9fastremap_180_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -34228,7 +35150,7 @@ static PyObject *__pyx_pf_9fastremap_180_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -34295,11 +35217,11 @@ static PyObject *__pyx_fuse_3_2__pyx_pw_9fastremap_183_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -34312,14 +35234,14 @@ static PyObject *__pyx_fuse_3_2__pyx_pw_9fastremap_183_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_182_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -34364,29 +35286,29 @@ static PyObject *__pyx_pf_9fastremap_182_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -34396,7 +35318,7 @@ static PyObject *__pyx_pf_9fastremap_182_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -34404,13 +35326,13 @@ static PyObject *__pyx_pf_9fastremap_182_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -34419,19 +35341,19 @@ static PyObject *__pyx_pf_9fastremap_182_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -34440,7 +35362,7 @@ static PyObject *__pyx_pf_9fastremap_182_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -34450,7 +35372,7 @@ static PyObject *__pyx_pf_9fastremap_182_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -34458,16 +35380,16 @@ static PyObject *__pyx_pf_9fastremap_182_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -34479,7 +35401,7 @@ static PyObject *__pyx_pf_9fastremap_182_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -34490,7 +35412,7 @@ static PyObject *__pyx_pf_9fastremap_182_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -34499,7 +35421,7 @@ static PyObject *__pyx_pf_9fastremap_182_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -34508,7 +35430,7 @@ static PyObject *__pyx_pf_9fastremap_182_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -34516,16 +35438,16 @@ static PyObject *__pyx_pf_9fastremap_182_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -34537,7 +35459,7 @@ static PyObject *__pyx_pf_9fastremap_182_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -34549,7 +35471,7 @@ static PyObject *__pyx_pf_9fastremap_182_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -34616,11 +35538,11 @@ static PyObject *__pyx_fuse_3_3__pyx_pw_9fastremap_185_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -34633,14 +35555,14 @@ static PyObject *__pyx_fuse_3_3__pyx_pw_9fastremap_185_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_184_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -34685,29 +35607,29 @@ static PyObject *__pyx_pf_9fastremap_184_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -34717,7 +35639,7 @@ static PyObject *__pyx_pf_9fastremap_184_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -34725,13 +35647,13 @@ static PyObject *__pyx_pf_9fastremap_184_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -34740,19 +35662,19 @@ static PyObject *__pyx_pf_9fastremap_184_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -34761,7 +35683,7 @@ static PyObject *__pyx_pf_9fastremap_184_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -34771,7 +35693,7 @@ static PyObject *__pyx_pf_9fastremap_184_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -34779,16 +35701,16 @@ static PyObject *__pyx_pf_9fastremap_184_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -34800,7 +35722,7 @@ static PyObject *__pyx_pf_9fastremap_184_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -34811,7 +35733,7 @@ static PyObject *__pyx_pf_9fastremap_184_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -34820,7 +35742,7 @@ static PyObject *__pyx_pf_9fastremap_184_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -34829,7 +35751,7 @@ static PyObject *__pyx_pf_9fastremap_184_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -34837,16 +35759,16 @@ static PyObject *__pyx_pf_9fastremap_184_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -34858,7 +35780,7 @@ static PyObject *__pyx_pf_9fastremap_184_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -34870,7 +35792,7 @@ static PyObject *__pyx_pf_9fastremap_184_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -34937,11 +35859,11 @@ static PyObject *__pyx_fuse_3_4__pyx_pw_9fastremap_187_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -34954,14 +35876,14 @@ static PyObject *__pyx_fuse_3_4__pyx_pw_9fastremap_187_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_186_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -35006,29 +35928,29 @@ static PyObject *__pyx_pf_9fastremap_186_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -35038,7 +35960,7 @@ static PyObject *__pyx_pf_9fastremap_186_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -35046,13 +35968,13 @@ static PyObject *__pyx_pf_9fastremap_186_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -35061,19 +35983,19 @@ static PyObject *__pyx_pf_9fastremap_186_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -35082,7 +36004,7 @@ static PyObject *__pyx_pf_9fastremap_186_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -35092,7 +36014,7 @@ static PyObject *__pyx_pf_9fastremap_186_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -35100,16 +36022,16 @@ static PyObject *__pyx_pf_9fastremap_186_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -35121,7 +36043,7 @@ static PyObject *__pyx_pf_9fastremap_186_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -35132,7 +36054,7 @@ static PyObject *__pyx_pf_9fastremap_186_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -35141,7 +36063,7 @@ static PyObject *__pyx_pf_9fastremap_186_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -35150,7 +36072,7 @@ static PyObject *__pyx_pf_9fastremap_186_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -35158,16 +36080,16 @@ static PyObject *__pyx_pf_9fastremap_186_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -35179,7 +36101,7 @@ static PyObject *__pyx_pf_9fastremap_186_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -35191,7 +36113,7 @@ static PyObject *__pyx_pf_9fastremap_186_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -35258,11 +36180,11 @@ static PyObject *__pyx_fuse_3_5__pyx_pw_9fastremap_189_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -35275,14 +36197,14 @@ static PyObject *__pyx_fuse_3_5__pyx_pw_9fastremap_189_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_188_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -35327,29 +36249,29 @@ static PyObject *__pyx_pf_9fastremap_188_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -35359,7 +36281,7 @@ static PyObject *__pyx_pf_9fastremap_188_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -35367,13 +36289,13 @@ static PyObject *__pyx_pf_9fastremap_188_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -35382,19 +36304,19 @@ static PyObject *__pyx_pf_9fastremap_188_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -35403,7 +36325,7 @@ static PyObject *__pyx_pf_9fastremap_188_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -35413,7 +36335,7 @@ static PyObject *__pyx_pf_9fastremap_188_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -35421,16 +36343,16 @@ static PyObject *__pyx_pf_9fastremap_188_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -35442,7 +36364,7 @@ static PyObject *__pyx_pf_9fastremap_188_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -35453,7 +36375,7 @@ static PyObject *__pyx_pf_9fastremap_188_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -35462,7 +36384,7 @@ static PyObject *__pyx_pf_9fastremap_188_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -35471,7 +36393,7 @@ static PyObject *__pyx_pf_9fastremap_188_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -35479,16 +36401,16 @@ static PyObject *__pyx_pf_9fastremap_188_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -35500,7 +36422,7 @@ static PyObject *__pyx_pf_9fastremap_188_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -35512,7 +36434,7 @@ static PyObject *__pyx_pf_9fastremap_188_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -35579,11 +36501,11 @@ static PyObject *__pyx_fuse_3_6__pyx_pw_9fastremap_191_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -35596,14 +36518,14 @@ static PyObject *__pyx_fuse_3_6__pyx_pw_9fastremap_191_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_190_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -35648,29 +36570,29 @@ static PyObject *__pyx_pf_9fastremap_190_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -35680,7 +36602,7 @@ static PyObject *__pyx_pf_9fastremap_190_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -35688,13 +36610,13 @@ static PyObject *__pyx_pf_9fastremap_190_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -35703,19 +36625,19 @@ static PyObject *__pyx_pf_9fastremap_190_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -35724,7 +36646,7 @@ static PyObject *__pyx_pf_9fastremap_190_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -35734,7 +36656,7 @@ static PyObject *__pyx_pf_9fastremap_190_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -35742,16 +36664,16 @@ static PyObject *__pyx_pf_9fastremap_190_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -35763,7 +36685,7 @@ static PyObject *__pyx_pf_9fastremap_190_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -35774,7 +36696,7 @@ static PyObject *__pyx_pf_9fastremap_190_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -35783,7 +36705,7 @@ static PyObject *__pyx_pf_9fastremap_190_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -35792,7 +36714,7 @@ static PyObject *__pyx_pf_9fastremap_190_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -35800,16 +36722,16 @@ static PyObject *__pyx_pf_9fastremap_190_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -35821,7 +36743,7 @@ static PyObject *__pyx_pf_9fastremap_190_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -35833,7 +36755,7 @@ static PyObject *__pyx_pf_9fastremap_190_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -35900,11 +36822,11 @@ static PyObject *__pyx_fuse_3_7__pyx_pw_9fastremap_193_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -35917,14 +36839,14 @@ static PyObject *__pyx_fuse_3_7__pyx_pw_9fastremap_193_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_192_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -35969,29 +36891,29 @@ static PyObject *__pyx_pf_9fastremap_192_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -36001,7 +36923,7 @@ static PyObject *__pyx_pf_9fastremap_192_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -36009,13 +36931,13 @@ static PyObject *__pyx_pf_9fastremap_192_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -36024,19 +36946,19 @@ static PyObject *__pyx_pf_9fastremap_192_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -36045,7 +36967,7 @@ static PyObject *__pyx_pf_9fastremap_192_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -36055,7 +36977,7 @@ static PyObject *__pyx_pf_9fastremap_192_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -36063,16 +36985,16 @@ static PyObject *__pyx_pf_9fastremap_192_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -36084,7 +37006,7 @@ static PyObject *__pyx_pf_9fastremap_192_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -36095,7 +37017,7 @@ static PyObject *__pyx_pf_9fastremap_192_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -36104,7 +37026,7 @@ static PyObject *__pyx_pf_9fastremap_192_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -36113,7 +37035,7 @@ static PyObject *__pyx_pf_9fastremap_192_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -36121,16 +37043,16 @@ static PyObject *__pyx_pf_9fastremap_192_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -36142,7 +37064,7 @@ static PyObject *__pyx_pf_9fastremap_192_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -36154,7 +37076,7 @@ static PyObject *__pyx_pf_9fastremap_192_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -36221,11 +37143,11 @@ static PyObject *__pyx_fuse_4_0__pyx_pw_9fastremap_195_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -36238,14 +37160,14 @@ static PyObject *__pyx_fuse_4_0__pyx_pw_9fastremap_195_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_194_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -36290,29 +37212,29 @@ static PyObject *__pyx_pf_9fastremap_194_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -36322,7 +37244,7 @@ static PyObject *__pyx_pf_9fastremap_194_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -36330,13 +37252,13 @@ static PyObject *__pyx_pf_9fastremap_194_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -36345,19 +37267,19 @@ static PyObject *__pyx_pf_9fastremap_194_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -36366,7 +37288,7 @@ static PyObject *__pyx_pf_9fastremap_194_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -36376,7 +37298,7 @@ static PyObject *__pyx_pf_9fastremap_194_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -36384,16 +37306,16 @@ static PyObject *__pyx_pf_9fastremap_194_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -36405,7 +37327,7 @@ static PyObject *__pyx_pf_9fastremap_194_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -36416,7 +37338,7 @@ static PyObject *__pyx_pf_9fastremap_194_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -36425,7 +37347,7 @@ static PyObject *__pyx_pf_9fastremap_194_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -36434,7 +37356,7 @@ static PyObject *__pyx_pf_9fastremap_194_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -36442,16 +37364,16 @@ static PyObject *__pyx_pf_9fastremap_194_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -36463,7 +37385,7 @@ static PyObject *__pyx_pf_9fastremap_194_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -36475,7 +37397,7 @@ static PyObject *__pyx_pf_9fastremap_194_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -36542,11 +37464,11 @@ static PyObject *__pyx_fuse_4_1__pyx_pw_9fastremap_197_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -36559,14 +37481,14 @@ static PyObject *__pyx_fuse_4_1__pyx_pw_9fastremap_197_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_196_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -36611,29 +37533,29 @@ static PyObject *__pyx_pf_9fastremap_196_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -36643,7 +37565,7 @@ static PyObject *__pyx_pf_9fastremap_196_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -36651,13 +37573,13 @@ static PyObject *__pyx_pf_9fastremap_196_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -36666,19 +37588,19 @@ static PyObject *__pyx_pf_9fastremap_196_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -36687,7 +37609,7 @@ static PyObject *__pyx_pf_9fastremap_196_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -36697,7 +37619,7 @@ static PyObject *__pyx_pf_9fastremap_196_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -36705,16 +37627,16 @@ static PyObject *__pyx_pf_9fastremap_196_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -36726,7 +37648,7 @@ static PyObject *__pyx_pf_9fastremap_196_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -36737,7 +37659,7 @@ static PyObject *__pyx_pf_9fastremap_196_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -36746,7 +37668,7 @@ static PyObject *__pyx_pf_9fastremap_196_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -36755,7 +37677,7 @@ static PyObject *__pyx_pf_9fastremap_196_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -36763,16 +37685,16 @@ static PyObject *__pyx_pf_9fastremap_196_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -36784,7 +37706,7 @@ static PyObject *__pyx_pf_9fastremap_196_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -36796,7 +37718,7 @@ static PyObject *__pyx_pf_9fastremap_196_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -36863,11 +37785,11 @@ static PyObject *__pyx_fuse_4_2__pyx_pw_9fastremap_199_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -36880,14 +37802,14 @@ static PyObject *__pyx_fuse_4_2__pyx_pw_9fastremap_199_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_198_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -36932,29 +37854,29 @@ static PyObject *__pyx_pf_9fastremap_198_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -36964,7 +37886,7 @@ static PyObject *__pyx_pf_9fastremap_198_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -36972,13 +37894,13 @@ static PyObject *__pyx_pf_9fastremap_198_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -36987,19 +37909,19 @@ static PyObject *__pyx_pf_9fastremap_198_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -37008,7 +37930,7 @@ static PyObject *__pyx_pf_9fastremap_198_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -37018,7 +37940,7 @@ static PyObject *__pyx_pf_9fastremap_198_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -37026,16 +37948,16 @@ static PyObject *__pyx_pf_9fastremap_198_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -37047,7 +37969,7 @@ static PyObject *__pyx_pf_9fastremap_198_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -37058,7 +37980,7 @@ static PyObject *__pyx_pf_9fastremap_198_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -37067,7 +37989,7 @@ static PyObject *__pyx_pf_9fastremap_198_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -37076,7 +37998,7 @@ static PyObject *__pyx_pf_9fastremap_198_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -37084,16 +38006,16 @@ static PyObject *__pyx_pf_9fastremap_198_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -37105,7 +38027,7 @@ static PyObject *__pyx_pf_9fastremap_198_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -37117,7 +38039,7 @@ static PyObject *__pyx_pf_9fastremap_198_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -37184,11 +38106,11 @@ static PyObject *__pyx_fuse_4_3__pyx_pw_9fastremap_201_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -37201,14 +38123,14 @@ static PyObject *__pyx_fuse_4_3__pyx_pw_9fastremap_201_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_200_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -37253,29 +38175,29 @@ static PyObject *__pyx_pf_9fastremap_200_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -37285,7 +38207,7 @@ static PyObject *__pyx_pf_9fastremap_200_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -37293,13 +38215,13 @@ static PyObject *__pyx_pf_9fastremap_200_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -37308,19 +38230,19 @@ static PyObject *__pyx_pf_9fastremap_200_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -37329,7 +38251,7 @@ static PyObject *__pyx_pf_9fastremap_200_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -37339,7 +38261,7 @@ static PyObject *__pyx_pf_9fastremap_200_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -37347,16 +38269,16 @@ static PyObject *__pyx_pf_9fastremap_200_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -37368,7 +38290,7 @@ static PyObject *__pyx_pf_9fastremap_200_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -37379,7 +38301,7 @@ static PyObject *__pyx_pf_9fastremap_200_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -37388,7 +38310,7 @@ static PyObject *__pyx_pf_9fastremap_200_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -37397,7 +38319,7 @@ static PyObject *__pyx_pf_9fastremap_200_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -37405,16 +38327,16 @@ static PyObject *__pyx_pf_9fastremap_200_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -37426,7 +38348,7 @@ static PyObject *__pyx_pf_9fastremap_200_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -37438,7 +38360,7 @@ static PyObject *__pyx_pf_9fastremap_200_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -37505,11 +38427,11 @@ static PyObject *__pyx_fuse_4_4__pyx_pw_9fastremap_203_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -37522,14 +38444,14 @@ static PyObject *__pyx_fuse_4_4__pyx_pw_9fastremap_203_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_202_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -37574,29 +38496,29 @@ static PyObject *__pyx_pf_9fastremap_202_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -37606,7 +38528,7 @@ static PyObject *__pyx_pf_9fastremap_202_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -37614,13 +38536,13 @@ static PyObject *__pyx_pf_9fastremap_202_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -37629,19 +38551,19 @@ static PyObject *__pyx_pf_9fastremap_202_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -37650,7 +38572,7 @@ static PyObject *__pyx_pf_9fastremap_202_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -37660,7 +38582,7 @@ static PyObject *__pyx_pf_9fastremap_202_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -37668,16 +38590,16 @@ static PyObject *__pyx_pf_9fastremap_202_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -37689,7 +38611,7 @@ static PyObject *__pyx_pf_9fastremap_202_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -37700,7 +38622,7 @@ static PyObject *__pyx_pf_9fastremap_202_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -37709,7 +38631,7 @@ static PyObject *__pyx_pf_9fastremap_202_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -37718,7 +38640,7 @@ static PyObject *__pyx_pf_9fastremap_202_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -37726,16 +38648,16 @@ static PyObject *__pyx_pf_9fastremap_202_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -37747,7 +38669,7 @@ static PyObject *__pyx_pf_9fastremap_202_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -37759,7 +38681,7 @@ static PyObject *__pyx_pf_9fastremap_202_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -37826,11 +38748,11 @@ static PyObject *__pyx_fuse_4_5__pyx_pw_9fastremap_205_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -37843,14 +38765,14 @@ static PyObject *__pyx_fuse_4_5__pyx_pw_9fastremap_205_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_204_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -37895,29 +38817,29 @@ static PyObject *__pyx_pf_9fastremap_204_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -37927,7 +38849,7 @@ static PyObject *__pyx_pf_9fastremap_204_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -37935,13 +38857,13 @@ static PyObject *__pyx_pf_9fastremap_204_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -37950,19 +38872,19 @@ static PyObject *__pyx_pf_9fastremap_204_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -37971,7 +38893,7 @@ static PyObject *__pyx_pf_9fastremap_204_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -37981,7 +38903,7 @@ static PyObject *__pyx_pf_9fastremap_204_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -37989,16 +38911,16 @@ static PyObject *__pyx_pf_9fastremap_204_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -38010,7 +38932,7 @@ static PyObject *__pyx_pf_9fastremap_204_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -38021,7 +38943,7 @@ static PyObject *__pyx_pf_9fastremap_204_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -38030,7 +38952,7 @@ static PyObject *__pyx_pf_9fastremap_204_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -38039,7 +38961,7 @@ static PyObject *__pyx_pf_9fastremap_204_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -38047,16 +38969,16 @@ static PyObject *__pyx_pf_9fastremap_204_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -38068,7 +38990,7 @@ static PyObject *__pyx_pf_9fastremap_204_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -38080,7 +39002,7 @@ static PyObject *__pyx_pf_9fastremap_204_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -38147,11 +39069,11 @@ static PyObject *__pyx_fuse_4_6__pyx_pw_9fastremap_207_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -38164,14 +39086,14 @@ static PyObject *__pyx_fuse_4_6__pyx_pw_9fastremap_207_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_206_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -38216,29 +39138,29 @@ static PyObject *__pyx_pf_9fastremap_206_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -38248,7 +39170,7 @@ static PyObject *__pyx_pf_9fastremap_206_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -38256,13 +39178,13 @@ static PyObject *__pyx_pf_9fastremap_206_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -38271,19 +39193,19 @@ static PyObject *__pyx_pf_9fastremap_206_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -38292,7 +39214,7 @@ static PyObject *__pyx_pf_9fastremap_206_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -38302,7 +39224,7 @@ static PyObject *__pyx_pf_9fastremap_206_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -38310,16 +39232,16 @@ static PyObject *__pyx_pf_9fastremap_206_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -38331,7 +39253,7 @@ static PyObject *__pyx_pf_9fastremap_206_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -38342,7 +39264,7 @@ static PyObject *__pyx_pf_9fastremap_206_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -38351,7 +39273,7 @@ static PyObject *__pyx_pf_9fastremap_206_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -38360,7 +39282,7 @@ static PyObject *__pyx_pf_9fastremap_206_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -38368,16 +39290,16 @@ static PyObject *__pyx_pf_9fastremap_206_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -38389,7 +39311,7 @@ static PyObject *__pyx_pf_9fastremap_206_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -38401,7 +39323,7 @@ static PyObject *__pyx_pf_9fastremap_206_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -38468,11 +39390,11 @@ static PyObject *__pyx_fuse_4_7__pyx_pw_9fastremap_209_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -38485,14 +39407,14 @@ static PyObject *__pyx_fuse_4_7__pyx_pw_9fastremap_209_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_208_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -38537,29 +39459,29 @@ static PyObject *__pyx_pf_9fastremap_208_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -38569,7 +39491,7 @@ static PyObject *__pyx_pf_9fastremap_208_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -38577,13 +39499,13 @@ static PyObject *__pyx_pf_9fastremap_208_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -38592,19 +39514,19 @@ static PyObject *__pyx_pf_9fastremap_208_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -38613,7 +39535,7 @@ static PyObject *__pyx_pf_9fastremap_208_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -38623,7 +39545,7 @@ static PyObject *__pyx_pf_9fastremap_208_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -38631,16 +39553,16 @@ static PyObject *__pyx_pf_9fastremap_208_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -38652,7 +39574,7 @@ static PyObject *__pyx_pf_9fastremap_208_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -38663,7 +39585,7 @@ static PyObject *__pyx_pf_9fastremap_208_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -38672,7 +39594,7 @@ static PyObject *__pyx_pf_9fastremap_208_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -38681,7 +39603,7 @@ static PyObject *__pyx_pf_9fastremap_208_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -38689,16 +39611,16 @@ static PyObject *__pyx_pf_9fastremap_208_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -38710,7 +39632,7 @@ static PyObject *__pyx_pf_9fastremap_208_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -38722,7 +39644,7 @@ static PyObject *__pyx_pf_9fastremap_208_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -38789,11 +39711,11 @@ static PyObject *__pyx_fuse_5_0__pyx_pw_9fastremap_211_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -38806,14 +39728,14 @@ static PyObject *__pyx_fuse_5_0__pyx_pw_9fastremap_211_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_210_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -38858,29 +39780,29 @@ static PyObject *__pyx_pf_9fastremap_210_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -38890,7 +39812,7 @@ static PyObject *__pyx_pf_9fastremap_210_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -38898,13 +39820,13 @@ static PyObject *__pyx_pf_9fastremap_210_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -38913,19 +39835,19 @@ static PyObject *__pyx_pf_9fastremap_210_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -38934,7 +39856,7 @@ static PyObject *__pyx_pf_9fastremap_210_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -38944,7 +39866,7 @@ static PyObject *__pyx_pf_9fastremap_210_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -38952,16 +39874,16 @@ static PyObject *__pyx_pf_9fastremap_210_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -38973,7 +39895,7 @@ static PyObject *__pyx_pf_9fastremap_210_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -38984,7 +39906,7 @@ static PyObject *__pyx_pf_9fastremap_210_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -38993,7 +39915,7 @@ static PyObject *__pyx_pf_9fastremap_210_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -39002,7 +39924,7 @@ static PyObject *__pyx_pf_9fastremap_210_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -39010,16 +39932,16 @@ static PyObject *__pyx_pf_9fastremap_210_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -39031,7 +39953,7 @@ static PyObject *__pyx_pf_9fastremap_210_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -39043,7 +39965,7 @@ static PyObject *__pyx_pf_9fastremap_210_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -39110,11 +40032,11 @@ static PyObject *__pyx_fuse_5_1__pyx_pw_9fastremap_213_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -39127,14 +40049,14 @@ static PyObject *__pyx_fuse_5_1__pyx_pw_9fastremap_213_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_212_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -39179,29 +40101,29 @@ static PyObject *__pyx_pf_9fastremap_212_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -39211,7 +40133,7 @@ static PyObject *__pyx_pf_9fastremap_212_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -39219,13 +40141,13 @@ static PyObject *__pyx_pf_9fastremap_212_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -39234,19 +40156,19 @@ static PyObject *__pyx_pf_9fastremap_212_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -39255,7 +40177,7 @@ static PyObject *__pyx_pf_9fastremap_212_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -39265,7 +40187,7 @@ static PyObject *__pyx_pf_9fastremap_212_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -39273,16 +40195,16 @@ static PyObject *__pyx_pf_9fastremap_212_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -39294,7 +40216,7 @@ static PyObject *__pyx_pf_9fastremap_212_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -39305,7 +40227,7 @@ static PyObject *__pyx_pf_9fastremap_212_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -39314,7 +40236,7 @@ static PyObject *__pyx_pf_9fastremap_212_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -39323,7 +40245,7 @@ static PyObject *__pyx_pf_9fastremap_212_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -39331,16 +40253,16 @@ static PyObject *__pyx_pf_9fastremap_212_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -39352,7 +40274,7 @@ static PyObject *__pyx_pf_9fastremap_212_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -39364,7 +40286,7 @@ static PyObject *__pyx_pf_9fastremap_212_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -39431,11 +40353,11 @@ static PyObject *__pyx_fuse_5_2__pyx_pw_9fastremap_215_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -39448,14 +40370,14 @@ static PyObject *__pyx_fuse_5_2__pyx_pw_9fastremap_215_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_214_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -39500,29 +40422,29 @@ static PyObject *__pyx_pf_9fastremap_214_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -39532,7 +40454,7 @@ static PyObject *__pyx_pf_9fastremap_214_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -39540,13 +40462,13 @@ static PyObject *__pyx_pf_9fastremap_214_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -39555,19 +40477,19 @@ static PyObject *__pyx_pf_9fastremap_214_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -39576,7 +40498,7 @@ static PyObject *__pyx_pf_9fastremap_214_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -39586,7 +40508,7 @@ static PyObject *__pyx_pf_9fastremap_214_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -39594,16 +40516,16 @@ static PyObject *__pyx_pf_9fastremap_214_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -39615,7 +40537,7 @@ static PyObject *__pyx_pf_9fastremap_214_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -39626,7 +40548,7 @@ static PyObject *__pyx_pf_9fastremap_214_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -39635,7 +40557,7 @@ static PyObject *__pyx_pf_9fastremap_214_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -39644,7 +40566,7 @@ static PyObject *__pyx_pf_9fastremap_214_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -39652,16 +40574,16 @@ static PyObject *__pyx_pf_9fastremap_214_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -39673,7 +40595,7 @@ static PyObject *__pyx_pf_9fastremap_214_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -39685,7 +40607,7 @@ static PyObject *__pyx_pf_9fastremap_214_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -39752,11 +40674,11 @@ static PyObject *__pyx_fuse_5_3__pyx_pw_9fastremap_217_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -39769,14 +40691,14 @@ static PyObject *__pyx_fuse_5_3__pyx_pw_9fastremap_217_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_216_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -39821,29 +40743,29 @@ static PyObject *__pyx_pf_9fastremap_216_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -39853,7 +40775,7 @@ static PyObject *__pyx_pf_9fastremap_216_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -39861,13 +40783,13 @@ static PyObject *__pyx_pf_9fastremap_216_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -39876,19 +40798,19 @@ static PyObject *__pyx_pf_9fastremap_216_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -39897,7 +40819,7 @@ static PyObject *__pyx_pf_9fastremap_216_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -39907,7 +40829,7 @@ static PyObject *__pyx_pf_9fastremap_216_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -39915,16 +40837,16 @@ static PyObject *__pyx_pf_9fastremap_216_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -39936,7 +40858,7 @@ static PyObject *__pyx_pf_9fastremap_216_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -39947,7 +40869,7 @@ static PyObject *__pyx_pf_9fastremap_216_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -39956,7 +40878,7 @@ static PyObject *__pyx_pf_9fastremap_216_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -39965,7 +40887,7 @@ static PyObject *__pyx_pf_9fastremap_216_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -39973,16 +40895,16 @@ static PyObject *__pyx_pf_9fastremap_216_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -39994,7 +40916,7 @@ static PyObject *__pyx_pf_9fastremap_216_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -40006,7 +40928,7 @@ static PyObject *__pyx_pf_9fastremap_216_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -40073,11 +40995,11 @@ static PyObject *__pyx_fuse_5_4__pyx_pw_9fastremap_219_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -40090,14 +41012,14 @@ static PyObject *__pyx_fuse_5_4__pyx_pw_9fastremap_219_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_218_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -40142,29 +41064,29 @@ static PyObject *__pyx_pf_9fastremap_218_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -40174,7 +41096,7 @@ static PyObject *__pyx_pf_9fastremap_218_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -40182,13 +41104,13 @@ static PyObject *__pyx_pf_9fastremap_218_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -40197,19 +41119,19 @@ static PyObject *__pyx_pf_9fastremap_218_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -40218,7 +41140,7 @@ static PyObject *__pyx_pf_9fastremap_218_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -40228,7 +41150,7 @@ static PyObject *__pyx_pf_9fastremap_218_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -40236,16 +41158,16 @@ static PyObject *__pyx_pf_9fastremap_218_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -40257,7 +41179,7 @@ static PyObject *__pyx_pf_9fastremap_218_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -40268,7 +41190,7 @@ static PyObject *__pyx_pf_9fastremap_218_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -40277,7 +41199,7 @@ static PyObject *__pyx_pf_9fastremap_218_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -40286,7 +41208,7 @@ static PyObject *__pyx_pf_9fastremap_218_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -40294,16 +41216,16 @@ static PyObject *__pyx_pf_9fastremap_218_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -40315,7 +41237,7 @@ static PyObject *__pyx_pf_9fastremap_218_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -40327,7 +41249,7 @@ static PyObject *__pyx_pf_9fastremap_218_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -40394,11 +41316,11 @@ static PyObject *__pyx_fuse_5_5__pyx_pw_9fastremap_221_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -40411,14 +41333,14 @@ static PyObject *__pyx_fuse_5_5__pyx_pw_9fastremap_221_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_220_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -40463,29 +41385,29 @@ static PyObject *__pyx_pf_9fastremap_220_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -40495,7 +41417,7 @@ static PyObject *__pyx_pf_9fastremap_220_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -40503,13 +41425,13 @@ static PyObject *__pyx_pf_9fastremap_220_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -40518,19 +41440,19 @@ static PyObject *__pyx_pf_9fastremap_220_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -40539,7 +41461,7 @@ static PyObject *__pyx_pf_9fastremap_220_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -40549,7 +41471,7 @@ static PyObject *__pyx_pf_9fastremap_220_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -40557,16 +41479,16 @@ static PyObject *__pyx_pf_9fastremap_220_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -40578,7 +41500,7 @@ static PyObject *__pyx_pf_9fastremap_220_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -40589,7 +41511,7 @@ static PyObject *__pyx_pf_9fastremap_220_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -40598,7 +41520,7 @@ static PyObject *__pyx_pf_9fastremap_220_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -40607,7 +41529,7 @@ static PyObject *__pyx_pf_9fastremap_220_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -40615,16 +41537,16 @@ static PyObject *__pyx_pf_9fastremap_220_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -40636,7 +41558,7 @@ static PyObject *__pyx_pf_9fastremap_220_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -40648,7 +41570,7 @@ static PyObject *__pyx_pf_9fastremap_220_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -40715,11 +41637,11 @@ static PyObject *__pyx_fuse_5_6__pyx_pw_9fastremap_223_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -40732,14 +41654,14 @@ static PyObject *__pyx_fuse_5_6__pyx_pw_9fastremap_223_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_222_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -40784,29 +41706,29 @@ static PyObject *__pyx_pf_9fastremap_222_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -40816,7 +41738,7 @@ static PyObject *__pyx_pf_9fastremap_222_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -40824,13 +41746,13 @@ static PyObject *__pyx_pf_9fastremap_222_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -40839,19 +41761,19 @@ static PyObject *__pyx_pf_9fastremap_222_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -40860,7 +41782,7 @@ static PyObject *__pyx_pf_9fastremap_222_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -40870,7 +41792,7 @@ static PyObject *__pyx_pf_9fastremap_222_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -40878,16 +41800,16 @@ static PyObject *__pyx_pf_9fastremap_222_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -40899,7 +41821,7 @@ static PyObject *__pyx_pf_9fastremap_222_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -40910,7 +41832,7 @@ static PyObject *__pyx_pf_9fastremap_222_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -40919,7 +41841,7 @@ static PyObject *__pyx_pf_9fastremap_222_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -40928,7 +41850,7 @@ static PyObject *__pyx_pf_9fastremap_222_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -40936,16 +41858,16 @@ static PyObject *__pyx_pf_9fastremap_222_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -40957,7 +41879,7 @@ static PyObject *__pyx_pf_9fastremap_222_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -40969,7 +41891,7 @@ static PyObject *__pyx_pf_9fastremap_222_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -41036,11 +41958,11 @@ static PyObject *__pyx_fuse_5_7__pyx_pw_9fastremap_225_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -41053,14 +41975,14 @@ static PyObject *__pyx_fuse_5_7__pyx_pw_9fastremap_225_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_224_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -41105,29 +42027,29 @@ static PyObject *__pyx_pf_9fastremap_224_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -41137,7 +42059,7 @@ static PyObject *__pyx_pf_9fastremap_224_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -41145,13 +42067,13 @@ static PyObject *__pyx_pf_9fastremap_224_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -41160,19 +42082,19 @@ static PyObject *__pyx_pf_9fastremap_224_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -41181,7 +42103,7 @@ static PyObject *__pyx_pf_9fastremap_224_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -41191,7 +42113,7 @@ static PyObject *__pyx_pf_9fastremap_224_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -41199,16 +42121,16 @@ static PyObject *__pyx_pf_9fastremap_224_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -41220,7 +42142,7 @@ static PyObject *__pyx_pf_9fastremap_224_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -41231,7 +42153,7 @@ static PyObject *__pyx_pf_9fastremap_224_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -41240,7 +42162,7 @@ static PyObject *__pyx_pf_9fastremap_224_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -41249,7 +42171,7 @@ static PyObject *__pyx_pf_9fastremap_224_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -41257,16 +42179,16 @@ static PyObject *__pyx_pf_9fastremap_224_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -41278,7 +42200,7 @@ static PyObject *__pyx_pf_9fastremap_224_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -41290,7 +42212,7 @@ static PyObject *__pyx_pf_9fastremap_224_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -41357,11 +42279,11 @@ static PyObject *__pyx_fuse_6_0__pyx_pw_9fastremap_227_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -41374,14 +42296,14 @@ static PyObject *__pyx_fuse_6_0__pyx_pw_9fastremap_227_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_226_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -41426,29 +42348,29 @@ static PyObject *__pyx_pf_9fastremap_226_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -41458,7 +42380,7 @@ static PyObject *__pyx_pf_9fastremap_226_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -41466,13 +42388,13 @@ static PyObject *__pyx_pf_9fastremap_226_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -41481,19 +42403,19 @@ static PyObject *__pyx_pf_9fastremap_226_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -41502,7 +42424,7 @@ static PyObject *__pyx_pf_9fastremap_226_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -41512,7 +42434,7 @@ static PyObject *__pyx_pf_9fastremap_226_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -41520,16 +42442,16 @@ static PyObject *__pyx_pf_9fastremap_226_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -41541,7 +42463,7 @@ static PyObject *__pyx_pf_9fastremap_226_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -41552,7 +42474,7 @@ static PyObject *__pyx_pf_9fastremap_226_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -41561,7 +42483,7 @@ static PyObject *__pyx_pf_9fastremap_226_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -41570,7 +42492,7 @@ static PyObject *__pyx_pf_9fastremap_226_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -41578,16 +42500,16 @@ static PyObject *__pyx_pf_9fastremap_226_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -41599,7 +42521,7 @@ static PyObject *__pyx_pf_9fastremap_226_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -41611,7 +42533,7 @@ static PyObject *__pyx_pf_9fastremap_226_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -41678,11 +42600,11 @@ static PyObject *__pyx_fuse_6_1__pyx_pw_9fastremap_229_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -41695,14 +42617,14 @@ static PyObject *__pyx_fuse_6_1__pyx_pw_9fastremap_229_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_228_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -41747,29 +42669,29 @@ static PyObject *__pyx_pf_9fastremap_228_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -41779,7 +42701,7 @@ static PyObject *__pyx_pf_9fastremap_228_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -41787,13 +42709,13 @@ static PyObject *__pyx_pf_9fastremap_228_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -41802,19 +42724,19 @@ static PyObject *__pyx_pf_9fastremap_228_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -41823,7 +42745,7 @@ static PyObject *__pyx_pf_9fastremap_228_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -41833,7 +42755,7 @@ static PyObject *__pyx_pf_9fastremap_228_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -41841,16 +42763,16 @@ static PyObject *__pyx_pf_9fastremap_228_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -41862,7 +42784,7 @@ static PyObject *__pyx_pf_9fastremap_228_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -41873,7 +42795,7 @@ static PyObject *__pyx_pf_9fastremap_228_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -41882,7 +42804,7 @@ static PyObject *__pyx_pf_9fastremap_228_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -41891,7 +42813,7 @@ static PyObject *__pyx_pf_9fastremap_228_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -41899,16 +42821,16 @@ static PyObject *__pyx_pf_9fastremap_228_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -41920,7 +42842,7 @@ static PyObject *__pyx_pf_9fastremap_228_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -41932,7 +42854,7 @@ static PyObject *__pyx_pf_9fastremap_228_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -41999,11 +42921,11 @@ static PyObject *__pyx_fuse_6_2__pyx_pw_9fastremap_231_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -42016,14 +42938,14 @@ static PyObject *__pyx_fuse_6_2__pyx_pw_9fastremap_231_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_230_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -42068,29 +42990,29 @@ static PyObject *__pyx_pf_9fastremap_230_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -42100,7 +43022,7 @@ static PyObject *__pyx_pf_9fastremap_230_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -42108,13 +43030,13 @@ static PyObject *__pyx_pf_9fastremap_230_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -42123,19 +43045,19 @@ static PyObject *__pyx_pf_9fastremap_230_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -42144,7 +43066,7 @@ static PyObject *__pyx_pf_9fastremap_230_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -42154,7 +43076,7 @@ static PyObject *__pyx_pf_9fastremap_230_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -42162,16 +43084,16 @@ static PyObject *__pyx_pf_9fastremap_230_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -42183,7 +43105,7 @@ static PyObject *__pyx_pf_9fastremap_230_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -42194,7 +43116,7 @@ static PyObject *__pyx_pf_9fastremap_230_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -42203,7 +43125,7 @@ static PyObject *__pyx_pf_9fastremap_230_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -42212,7 +43134,7 @@ static PyObject *__pyx_pf_9fastremap_230_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -42220,16 +43142,16 @@ static PyObject *__pyx_pf_9fastremap_230_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -42241,7 +43163,7 @@ static PyObject *__pyx_pf_9fastremap_230_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -42253,7 +43175,7 @@ static PyObject *__pyx_pf_9fastremap_230_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -42320,11 +43242,11 @@ static PyObject *__pyx_fuse_6_3__pyx_pw_9fastremap_233_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -42337,14 +43259,14 @@ static PyObject *__pyx_fuse_6_3__pyx_pw_9fastremap_233_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_232_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -42389,29 +43311,29 @@ static PyObject *__pyx_pf_9fastremap_232_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -42421,7 +43343,7 @@ static PyObject *__pyx_pf_9fastremap_232_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -42429,13 +43351,13 @@ static PyObject *__pyx_pf_9fastremap_232_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -42444,19 +43366,19 @@ static PyObject *__pyx_pf_9fastremap_232_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -42465,7 +43387,7 @@ static PyObject *__pyx_pf_9fastremap_232_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -42475,7 +43397,7 @@ static PyObject *__pyx_pf_9fastremap_232_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -42483,16 +43405,16 @@ static PyObject *__pyx_pf_9fastremap_232_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -42504,7 +43426,7 @@ static PyObject *__pyx_pf_9fastremap_232_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -42515,7 +43437,7 @@ static PyObject *__pyx_pf_9fastremap_232_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -42524,7 +43446,7 @@ static PyObject *__pyx_pf_9fastremap_232_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -42533,7 +43455,7 @@ static PyObject *__pyx_pf_9fastremap_232_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -42541,16 +43463,16 @@ static PyObject *__pyx_pf_9fastremap_232_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -42562,7 +43484,7 @@ static PyObject *__pyx_pf_9fastremap_232_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -42574,7 +43496,7 @@ static PyObject *__pyx_pf_9fastremap_232_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -42641,11 +43563,11 @@ static PyObject *__pyx_fuse_6_4__pyx_pw_9fastremap_235_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -42658,14 +43580,14 @@ static PyObject *__pyx_fuse_6_4__pyx_pw_9fastremap_235_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_234_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -42710,29 +43632,29 @@ static PyObject *__pyx_pf_9fastremap_234_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -42742,7 +43664,7 @@ static PyObject *__pyx_pf_9fastremap_234_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -42750,13 +43672,13 @@ static PyObject *__pyx_pf_9fastremap_234_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -42765,19 +43687,19 @@ static PyObject *__pyx_pf_9fastremap_234_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -42786,7 +43708,7 @@ static PyObject *__pyx_pf_9fastremap_234_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -42796,7 +43718,7 @@ static PyObject *__pyx_pf_9fastremap_234_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -42804,16 +43726,16 @@ static PyObject *__pyx_pf_9fastremap_234_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -42825,7 +43747,7 @@ static PyObject *__pyx_pf_9fastremap_234_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -42836,7 +43758,7 @@ static PyObject *__pyx_pf_9fastremap_234_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -42845,7 +43767,7 @@ static PyObject *__pyx_pf_9fastremap_234_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -42854,7 +43776,7 @@ static PyObject *__pyx_pf_9fastremap_234_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -42862,16 +43784,16 @@ static PyObject *__pyx_pf_9fastremap_234_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -42883,7 +43805,7 @@ static PyObject *__pyx_pf_9fastremap_234_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -42895,7 +43817,7 @@ static PyObject *__pyx_pf_9fastremap_234_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -42962,11 +43884,11 @@ static PyObject *__pyx_fuse_6_5__pyx_pw_9fastremap_237_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -42979,14 +43901,14 @@ static PyObject *__pyx_fuse_6_5__pyx_pw_9fastremap_237_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_236_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -43031,29 +43953,29 @@ static PyObject *__pyx_pf_9fastremap_236_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -43063,7 +43985,7 @@ static PyObject *__pyx_pf_9fastremap_236_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -43071,13 +43993,13 @@ static PyObject *__pyx_pf_9fastremap_236_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -43086,19 +44008,19 @@ static PyObject *__pyx_pf_9fastremap_236_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -43107,7 +44029,7 @@ static PyObject *__pyx_pf_9fastremap_236_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -43117,7 +44039,7 @@ static PyObject *__pyx_pf_9fastremap_236_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -43125,16 +44047,16 @@ static PyObject *__pyx_pf_9fastremap_236_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -43146,7 +44068,7 @@ static PyObject *__pyx_pf_9fastremap_236_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -43157,7 +44079,7 @@ static PyObject *__pyx_pf_9fastremap_236_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -43166,7 +44088,7 @@ static PyObject *__pyx_pf_9fastremap_236_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -43175,7 +44097,7 @@ static PyObject *__pyx_pf_9fastremap_236_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -43183,16 +44105,16 @@ static PyObject *__pyx_pf_9fastremap_236_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -43204,7 +44126,7 @@ static PyObject *__pyx_pf_9fastremap_236_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -43216,7 +44138,7 @@ static PyObject *__pyx_pf_9fastremap_236_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -43283,11 +44205,11 @@ static PyObject *__pyx_fuse_6_6__pyx_pw_9fastremap_239_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -43300,14 +44222,14 @@ static PyObject *__pyx_fuse_6_6__pyx_pw_9fastremap_239_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_238_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -43352,29 +44274,29 @@ static PyObject *__pyx_pf_9fastremap_238_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -43384,7 +44306,7 @@ static PyObject *__pyx_pf_9fastremap_238_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -43392,13 +44314,13 @@ static PyObject *__pyx_pf_9fastremap_238_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -43407,19 +44329,19 @@ static PyObject *__pyx_pf_9fastremap_238_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -43428,7 +44350,7 @@ static PyObject *__pyx_pf_9fastremap_238_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -43438,7 +44360,7 @@ static PyObject *__pyx_pf_9fastremap_238_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -43446,16 +44368,16 @@ static PyObject *__pyx_pf_9fastremap_238_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -43467,7 +44389,7 @@ static PyObject *__pyx_pf_9fastremap_238_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -43478,7 +44400,7 @@ static PyObject *__pyx_pf_9fastremap_238_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -43487,7 +44409,7 @@ static PyObject *__pyx_pf_9fastremap_238_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -43496,7 +44418,7 @@ static PyObject *__pyx_pf_9fastremap_238_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -43504,16 +44426,16 @@ static PyObject *__pyx_pf_9fastremap_238_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -43525,7 +44447,7 @@ static PyObject *__pyx_pf_9fastremap_238_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -43537,7 +44459,7 @@ static PyObject *__pyx_pf_9fastremap_238_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -43604,11 +44526,11 @@ static PyObject *__pyx_fuse_6_7__pyx_pw_9fastremap_241_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -43621,14 +44543,14 @@ static PyObject *__pyx_fuse_6_7__pyx_pw_9fastremap_241_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_240_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -43673,29 +44595,29 @@ static PyObject *__pyx_pf_9fastremap_240_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -43705,7 +44627,7 @@ static PyObject *__pyx_pf_9fastremap_240_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -43713,13 +44635,13 @@ static PyObject *__pyx_pf_9fastremap_240_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -43728,19 +44650,19 @@ static PyObject *__pyx_pf_9fastremap_240_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -43749,7 +44671,7 @@ static PyObject *__pyx_pf_9fastremap_240_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -43759,7 +44681,7 @@ static PyObject *__pyx_pf_9fastremap_240_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -43767,16 +44689,16 @@ static PyObject *__pyx_pf_9fastremap_240_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -43788,7 +44710,7 @@ static PyObject *__pyx_pf_9fastremap_240_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -43799,7 +44721,7 @@ static PyObject *__pyx_pf_9fastremap_240_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -43808,7 +44730,7 @@ static PyObject *__pyx_pf_9fastremap_240_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -43817,7 +44739,7 @@ static PyObject *__pyx_pf_9fastremap_240_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -43825,16 +44747,16 @@ static PyObject *__pyx_pf_9fastremap_240_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -43846,7 +44768,7 @@ static PyObject *__pyx_pf_9fastremap_240_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -43858,7 +44780,7 @@ static PyObject *__pyx_pf_9fastremap_240_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -43925,11 +44847,11 @@ static PyObject *__pyx_fuse_7_0__pyx_pw_9fastremap_243_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -43942,14 +44864,14 @@ static PyObject *__pyx_fuse_7_0__pyx_pw_9fastremap_243_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_242_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -43994,29 +44916,29 @@ static PyObject *__pyx_pf_9fastremap_242_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -44026,7 +44948,7 @@ static PyObject *__pyx_pf_9fastremap_242_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -44034,13 +44956,13 @@ static PyObject *__pyx_pf_9fastremap_242_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -44049,19 +44971,19 @@ static PyObject *__pyx_pf_9fastremap_242_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -44070,7 +44992,7 @@ static PyObject *__pyx_pf_9fastremap_242_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -44080,7 +45002,7 @@ static PyObject *__pyx_pf_9fastremap_242_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -44088,16 +45010,16 @@ static PyObject *__pyx_pf_9fastremap_242_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -44109,7 +45031,7 @@ static PyObject *__pyx_pf_9fastremap_242_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -44120,7 +45042,7 @@ static PyObject *__pyx_pf_9fastremap_242_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -44129,7 +45051,7 @@ static PyObject *__pyx_pf_9fastremap_242_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -44138,7 +45060,7 @@ static PyObject *__pyx_pf_9fastremap_242_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -44146,16 +45068,16 @@ static PyObject *__pyx_pf_9fastremap_242_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -44167,7 +45089,7 @@ static PyObject *__pyx_pf_9fastremap_242_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -44179,7 +45101,7 @@ static PyObject *__pyx_pf_9fastremap_242_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -44246,11 +45168,11 @@ static PyObject *__pyx_fuse_7_1__pyx_pw_9fastremap_245_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -44263,14 +45185,14 @@ static PyObject *__pyx_fuse_7_1__pyx_pw_9fastremap_245_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_244_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -44315,29 +45237,29 @@ static PyObject *__pyx_pf_9fastremap_244_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -44347,7 +45269,7 @@ static PyObject *__pyx_pf_9fastremap_244_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -44355,13 +45277,13 @@ static PyObject *__pyx_pf_9fastremap_244_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -44370,19 +45292,19 @@ static PyObject *__pyx_pf_9fastremap_244_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -44391,7 +45313,7 @@ static PyObject *__pyx_pf_9fastremap_244_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -44401,7 +45323,7 @@ static PyObject *__pyx_pf_9fastremap_244_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -44409,16 +45331,16 @@ static PyObject *__pyx_pf_9fastremap_244_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -44430,7 +45352,7 @@ static PyObject *__pyx_pf_9fastremap_244_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -44441,7 +45363,7 @@ static PyObject *__pyx_pf_9fastremap_244_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -44450,7 +45372,7 @@ static PyObject *__pyx_pf_9fastremap_244_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -44459,7 +45381,7 @@ static PyObject *__pyx_pf_9fastremap_244_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -44467,16 +45389,16 @@ static PyObject *__pyx_pf_9fastremap_244_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -44488,7 +45410,7 @@ static PyObject *__pyx_pf_9fastremap_244_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -44500,7 +45422,7 @@ static PyObject *__pyx_pf_9fastremap_244_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -44567,11 +45489,11 @@ static PyObject *__pyx_fuse_7_2__pyx_pw_9fastremap_247_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -44584,14 +45506,14 @@ static PyObject *__pyx_fuse_7_2__pyx_pw_9fastremap_247_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_246_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -44636,29 +45558,29 @@ static PyObject *__pyx_pf_9fastremap_246_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -44668,7 +45590,7 @@ static PyObject *__pyx_pf_9fastremap_246_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -44676,13 +45598,13 @@ static PyObject *__pyx_pf_9fastremap_246_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -44691,19 +45613,19 @@ static PyObject *__pyx_pf_9fastremap_246_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -44712,7 +45634,7 @@ static PyObject *__pyx_pf_9fastremap_246_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -44722,7 +45644,7 @@ static PyObject *__pyx_pf_9fastremap_246_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -44730,16 +45652,16 @@ static PyObject *__pyx_pf_9fastremap_246_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -44751,7 +45673,7 @@ static PyObject *__pyx_pf_9fastremap_246_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -44762,7 +45684,7 @@ static PyObject *__pyx_pf_9fastremap_246_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -44771,7 +45693,7 @@ static PyObject *__pyx_pf_9fastremap_246_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -44780,7 +45702,7 @@ static PyObject *__pyx_pf_9fastremap_246_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -44788,16 +45710,16 @@ static PyObject *__pyx_pf_9fastremap_246_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -44809,7 +45731,7 @@ static PyObject *__pyx_pf_9fastremap_246_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -44821,7 +45743,7 @@ static PyObject *__pyx_pf_9fastremap_246_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -44888,11 +45810,11 @@ static PyObject *__pyx_fuse_7_3__pyx_pw_9fastremap_249_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -44905,14 +45827,14 @@ static PyObject *__pyx_fuse_7_3__pyx_pw_9fastremap_249_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_248_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -44957,29 +45879,29 @@ static PyObject *__pyx_pf_9fastremap_248_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -44989,7 +45911,7 @@ static PyObject *__pyx_pf_9fastremap_248_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -44997,13 +45919,13 @@ static PyObject *__pyx_pf_9fastremap_248_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -45012,19 +45934,19 @@ static PyObject *__pyx_pf_9fastremap_248_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -45033,7 +45955,7 @@ static PyObject *__pyx_pf_9fastremap_248_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -45043,7 +45965,7 @@ static PyObject *__pyx_pf_9fastremap_248_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -45051,16 +45973,16 @@ static PyObject *__pyx_pf_9fastremap_248_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -45072,7 +45994,7 @@ static PyObject *__pyx_pf_9fastremap_248_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -45083,7 +46005,7 @@ static PyObject *__pyx_pf_9fastremap_248_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -45092,7 +46014,7 @@ static PyObject *__pyx_pf_9fastremap_248_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -45101,7 +46023,7 @@ static PyObject *__pyx_pf_9fastremap_248_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -45109,16 +46031,16 @@ static PyObject *__pyx_pf_9fastremap_248_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -45130,7 +46052,7 @@ static PyObject *__pyx_pf_9fastremap_248_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -45142,7 +46064,7 @@ static PyObject *__pyx_pf_9fastremap_248_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -45209,11 +46131,11 @@ static PyObject *__pyx_fuse_7_4__pyx_pw_9fastremap_251_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -45226,14 +46148,14 @@ static PyObject *__pyx_fuse_7_4__pyx_pw_9fastremap_251_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_250_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -45278,29 +46200,29 @@ static PyObject *__pyx_pf_9fastremap_250_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -45310,7 +46232,7 @@ static PyObject *__pyx_pf_9fastremap_250_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -45318,13 +46240,13 @@ static PyObject *__pyx_pf_9fastremap_250_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -45333,19 +46255,19 @@ static PyObject *__pyx_pf_9fastremap_250_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -45354,7 +46276,7 @@ static PyObject *__pyx_pf_9fastremap_250_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -45364,7 +46286,7 @@ static PyObject *__pyx_pf_9fastremap_250_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -45372,16 +46294,16 @@ static PyObject *__pyx_pf_9fastremap_250_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -45393,7 +46315,7 @@ static PyObject *__pyx_pf_9fastremap_250_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -45404,7 +46326,7 @@ static PyObject *__pyx_pf_9fastremap_250_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -45413,7 +46335,7 @@ static PyObject *__pyx_pf_9fastremap_250_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -45422,7 +46344,7 @@ static PyObject *__pyx_pf_9fastremap_250_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -45430,16 +46352,16 @@ static PyObject *__pyx_pf_9fastremap_250_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -45451,7 +46373,7 @@ static PyObject *__pyx_pf_9fastremap_250_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -45463,7 +46385,7 @@ static PyObject *__pyx_pf_9fastremap_250_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -45530,11 +46452,11 @@ static PyObject *__pyx_fuse_7_5__pyx_pw_9fastremap_253_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -45547,14 +46469,14 @@ static PyObject *__pyx_fuse_7_5__pyx_pw_9fastremap_253_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_252_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -45599,29 +46521,29 @@ static PyObject *__pyx_pf_9fastremap_252_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -45631,7 +46553,7 @@ static PyObject *__pyx_pf_9fastremap_252_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -45639,13 +46561,13 @@ static PyObject *__pyx_pf_9fastremap_252_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -45654,19 +46576,19 @@ static PyObject *__pyx_pf_9fastremap_252_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -45675,7 +46597,7 @@ static PyObject *__pyx_pf_9fastremap_252_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -45685,7 +46607,7 @@ static PyObject *__pyx_pf_9fastremap_252_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -45693,16 +46615,16 @@ static PyObject *__pyx_pf_9fastremap_252_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -45714,7 +46636,7 @@ static PyObject *__pyx_pf_9fastremap_252_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -45725,7 +46647,7 @@ static PyObject *__pyx_pf_9fastremap_252_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -45734,7 +46656,7 @@ static PyObject *__pyx_pf_9fastremap_252_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -45743,7 +46665,7 @@ static PyObject *__pyx_pf_9fastremap_252_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -45751,16 +46673,16 @@ static PyObject *__pyx_pf_9fastremap_252_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -45772,7 +46694,7 @@ static PyObject *__pyx_pf_9fastremap_252_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -45784,7 +46706,7 @@ static PyObject *__pyx_pf_9fastremap_252_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -45851,11 +46773,11 @@ static PyObject *__pyx_fuse_7_6__pyx_pw_9fastremap_255_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -45868,14 +46790,14 @@ static PyObject *__pyx_fuse_7_6__pyx_pw_9fastremap_255_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_254_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -45920,29 +46842,29 @@ static PyObject *__pyx_pf_9fastremap_254_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -45952,7 +46874,7 @@ static PyObject *__pyx_pf_9fastremap_254_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -45960,13 +46882,13 @@ static PyObject *__pyx_pf_9fastremap_254_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -45975,19 +46897,19 @@ static PyObject *__pyx_pf_9fastremap_254_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -45996,7 +46918,7 @@ static PyObject *__pyx_pf_9fastremap_254_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -46006,7 +46928,7 @@ static PyObject *__pyx_pf_9fastremap_254_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -46014,16 +46936,16 @@ static PyObject *__pyx_pf_9fastremap_254_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -46035,7 +46957,7 @@ static PyObject *__pyx_pf_9fastremap_254_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -46046,7 +46968,7 @@ static PyObject *__pyx_pf_9fastremap_254_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -46055,7 +46977,7 @@ static PyObject *__pyx_pf_9fastremap_254_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -46064,7 +46986,7 @@ static PyObject *__pyx_pf_9fastremap_254_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -46072,16 +46994,16 @@ static PyObject *__pyx_pf_9fastremap_254_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -46093,7 +47015,7 @@ static PyObject *__pyx_pf_9fastremap_254_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -46105,7 +47027,7 @@ static PyObject *__pyx_pf_9fastremap_254_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -46172,11 +47094,11 @@ static PyObject *__pyx_fuse_7_7__pyx_pw_9fastremap_257_component_map(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, 1); __PYX_ERR(0, 458, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_map") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -46189,14 +47111,14 @@ static PyObject *__pyx_fuse_7_7__pyx_pw_9fastremap_257_component_map(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 456, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_256_component_map(__pyx_self, __pyx_v_component_labels, __pyx_v_parent_labels); /* function exit code */ @@ -46241,29 +47163,29 @@ static PyObject *__pyx_pf_9fastremap_256_component_map(CYTHON_UNUSED PyObject *_ __pyx_pybuffernd_parent_labels.rcbuffer = &__pyx_pybuffer_parent_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":460 + /* "fastremap.pyx":462 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels * ): * cdef size_t size = component_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_component_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -46273,7 +47195,7 @@ static PyObject *__pyx_pf_9fastremap_256_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":462 + /* "fastremap.pyx":464 * cdef size_t size = component_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -46281,13 +47203,13 @@ static PyObject *__pyx_pf_9fastremap_256_component_map(CYTHON_UNUSED PyObject *_ * cdef dict remap = {} */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":461 + /* "fastremap.pyx":463 * ): * cdef size_t size = component_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -46296,19 +47218,19 @@ static PyObject *__pyx_pf_9fastremap_256_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":464 + /* "fastremap.pyx":466 * return {} * * cdef dict remap = {} # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remap = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":465 + /* "fastremap.pyx":467 * * cdef dict remap = {} * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -46317,7 +47239,7 @@ static PyObject *__pyx_pf_9fastremap_256_component_map(CYTHON_UNUSED PyObject *_ */ __pyx_v_i = 0; - /* "fastremap.pyx":467 + /* "fastremap.pyx":469 * cdef size_t i = 0 * * cdef ALLINT last_label = component_labels[0] # <<<<<<<<<<<<<< @@ -46327,7 +47249,7 @@ static PyObject *__pyx_pf_9fastremap_256_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":468 + /* "fastremap.pyx":470 * * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] # <<<<<<<<<<<<<< @@ -46335,16 +47257,16 @@ static PyObject *__pyx_pf_9fastremap_256_component_map(CYTHON_UNUSED PyObject *_ * if last_label == component_labels[i]: */ __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":469 + /* "fastremap.pyx":471 * cdef ALLINT last_label = component_labels[0] * remap[component_labels[0]] = parent_labels[0] * for i in range(size): # <<<<<<<<<<<<<< @@ -46356,7 +47278,7 @@ static PyObject *__pyx_pf_9fastremap_256_component_map(CYTHON_UNUSED PyObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -46367,7 +47289,7 @@ static PyObject *__pyx_pf_9fastremap_256_component_map(CYTHON_UNUSED PyObject *_ __pyx_t_3 = ((__pyx_v_last_label == (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":471 + /* "fastremap.pyx":473 * for i in range(size): * if last_label == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -46376,7 +47298,7 @@ static PyObject *__pyx_pf_9fastremap_256_component_map(CYTHON_UNUSED PyObject *_ */ goto __pyx_L4_continue; - /* "fastremap.pyx":470 + /* "fastremap.pyx":472 * remap[component_labels[0]] = parent_labels[0] * for i in range(size): * if last_label == component_labels[i]: # <<<<<<<<<<<<<< @@ -46385,7 +47307,7 @@ static PyObject *__pyx_pf_9fastremap_256_component_map(CYTHON_UNUSED PyObject *_ */ } - /* "fastremap.pyx":472 + /* "fastremap.pyx":474 * if last_label == component_labels[i]: * continue * remap[component_labels[i]] = parent_labels[i] # <<<<<<<<<<<<<< @@ -46393,16 +47315,16 @@ static PyObject *__pyx_pf_9fastremap_256_component_map(CYTHON_UNUSED PyObject *_ * */ __pyx_t_8 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_parent_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_v_i; - __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_remap, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":473 + /* "fastremap.pyx":475 * continue * remap[component_labels[i]] = parent_labels[i] * last_label = component_labels[i] # <<<<<<<<<<<<<< @@ -46414,7 +47336,7 @@ static PyObject *__pyx_pf_9fastremap_256_component_map(CYTHON_UNUSED PyObject *_ __pyx_L4_continue:; } - /* "fastremap.pyx":475 + /* "fastremap.pyx":477 * last_label = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -46426,7 +47348,7 @@ static PyObject *__pyx_pf_9fastremap_256_component_map(CYTHON_UNUSED PyObject *_ __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< @@ -46458,7 +47380,7 @@ static PyObject *__pyx_pf_9fastremap_256_component_map(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "fastremap.pyx":477 +/* "fastremap.pyx":479 * return remap * * def inverse_component_map(parent_labels, component_labels): # <<<<<<<<<<<<<< @@ -46502,11 +47424,11 @@ static PyObject *__pyx_pw_9fastremap_25inverse_component_map(PyObject *__pyx_sel case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 477, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 479, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "inverse_component_map") < 0)) __PYX_ERR(0, 477, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "inverse_component_map") < 0)) __PYX_ERR(0, 479, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -46519,7 +47441,7 @@ static PyObject *__pyx_pw_9fastremap_25inverse_component_map(PyObject *__pyx_sel } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 477, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 479, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -46552,33 +47474,33 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj __Pyx_INCREF(__pyx_v_parent_labels); __Pyx_INCREF(__pyx_v_component_labels); - /* "fastremap.pyx":490 + /* "fastremap.pyx":492 * Returns: { $PARENT_LABEL: [ $COMPONENT_LABELS, ... ] } * """ * if not isinstance(component_labels, np.ndarray): # <<<<<<<<<<<<<< * component_labels = np.array(component_labels) * if not isinstance(parent_labels, np.ndarray): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 490, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = PyObject_IsInstance(__pyx_v_component_labels, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 490, __pyx_L1_error) + __pyx_t_3 = PyObject_IsInstance(__pyx_v_component_labels, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":491 + /* "fastremap.pyx":493 * """ * if not isinstance(component_labels, np.ndarray): * component_labels = np.array(component_labels) # <<<<<<<<<<<<<< * if not isinstance(parent_labels, np.ndarray): * parent_labels = np.array(parent_labels) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 491, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -46593,13 +47515,13 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_v_component_labels) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_component_labels); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 491, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_component_labels, __pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":490 + /* "fastremap.pyx":492 * Returns: { $PARENT_LABEL: [ $COMPONENT_LABELS, ... ] } * """ * if not isinstance(component_labels, np.ndarray): # <<<<<<<<<<<<<< @@ -46608,33 +47530,33 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj */ } - /* "fastremap.pyx":492 + /* "fastremap.pyx":494 * if not isinstance(component_labels, np.ndarray): * component_labels = np.array(component_labels) * if not isinstance(parent_labels, np.ndarray): # <<<<<<<<<<<<<< * parent_labels = np.array(parent_labels) * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 492, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = PyObject_IsInstance(__pyx_v_parent_labels, __pyx_t_5); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 492, __pyx_L1_error) + __pyx_t_4 = PyObject_IsInstance(__pyx_v_parent_labels, __pyx_t_5); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":493 + /* "fastremap.pyx":495 * component_labels = np.array(component_labels) * if not isinstance(parent_labels, np.ndarray): * parent_labels = np.array(parent_labels) # <<<<<<<<<<<<<< * * if component_labels.size == 0: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -46649,13 +47571,13 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj } __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_parent_labels) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_parent_labels); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 493, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_parent_labels, __pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":492 + /* "fastremap.pyx":494 * if not isinstance(component_labels, np.ndarray): * component_labels = np.array(component_labels) * if not isinstance(parent_labels, np.ndarray): # <<<<<<<<<<<<<< @@ -46664,23 +47586,23 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj */ } - /* "fastremap.pyx":495 + /* "fastremap.pyx":497 * parent_labels = np.array(parent_labels) * * if component_labels.size == 0: # <<<<<<<<<<<<<< * return {} * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_component_labels, __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_component_labels, __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_5, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_5, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "fastremap.pyx":496 + /* "fastremap.pyx":498 * * if component_labels.size == 0: * return {} # <<<<<<<<<<<<<< @@ -46688,13 +47610,13 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj * if component_labels.shape != parent_labels.shape: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":495 + /* "fastremap.pyx":497 * parent_labels = np.array(parent_labels) * * if component_labels.size == 0: # <<<<<<<<<<<<<< @@ -46703,44 +47625,44 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj */ } - /* "fastremap.pyx":498 + /* "fastremap.pyx":500 * return {} * * if component_labels.shape != parent_labels.shape: # <<<<<<<<<<<<<< * raise ValueError("The size of the inputs must match: {} vs {}".format( * component_labels.shape, parent_labels.shape */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_component_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_component_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 498, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 498, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_3)) { - /* "fastremap.pyx":499 + /* "fastremap.pyx":501 * * if component_labels.shape != parent_labels.shape: * raise ValueError("The size of the inputs must match: {} vs {}".format( # <<<<<<<<<<<<<< * component_labels.shape, parent_labels.shape * )) */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_The_size_of_the_inputs_must_matc, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_The_size_of_the_inputs_must_matc, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - /* "fastremap.pyx":500 + /* "fastremap.pyx":502 * if component_labels.shape != parent_labels.shape: * raise ValueError("The size of the inputs must match: {} vs {}".format( * component_labels.shape, parent_labels.shape # <<<<<<<<<<<<<< * )) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_component_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_component_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -46757,7 +47679,7 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_6}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -46767,7 +47689,7 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_6}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -46775,7 +47697,7 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -46786,27 +47708,27 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":499 + /* "fastremap.pyx":501 * * if component_labels.shape != parent_labels.shape: * raise ValueError("The size of the inputs must match: {} vs {}".format( # <<<<<<<<<<<<<< * component_labels.shape, parent_labels.shape * )) */ - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 499, __pyx_L1_error) + __PYX_ERR(0, 501, __pyx_L1_error) - /* "fastremap.pyx":498 + /* "fastremap.pyx":500 * return {} * * if component_labels.shape != parent_labels.shape: # <<<<<<<<<<<<<< @@ -46815,30 +47737,30 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj */ } - /* "fastremap.pyx":503 + /* "fastremap.pyx":505 * )) * * shape = component_labels.shape # <<<<<<<<<<<<<< * * component_labels = reshape(component_labels, (component_labels.size,)) */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_component_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 503, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_component_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_shape = __pyx_t_5; __pyx_t_5 = 0; - /* "fastremap.pyx":505 + /* "fastremap.pyx":507 * shape = component_labels.shape * * component_labels = reshape(component_labels, (component_labels.size,)) # <<<<<<<<<<<<<< * parent_labels = reshape(parent_labels, (parent_labels.size,)) * return _inverse_component_map(parent_labels, component_labels) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_component_labels, __pyx_n_s_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 505, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_component_labels, __pyx_n_s_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 505, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); @@ -46858,7 +47780,7 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_component_labels, __pyx_t_6}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -46867,14 +47789,14 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_component_labels, __pyx_t_6}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_1 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); __pyx_t_9 = NULL; @@ -46885,7 +47807,7 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_8, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -46893,18 +47815,18 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj __Pyx_DECREF_SET(__pyx_v_component_labels, __pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":506 + /* "fastremap.pyx":508 * * component_labels = reshape(component_labels, (component_labels.size,)) * parent_labels = reshape(parent_labels, (parent_labels.size,)) # <<<<<<<<<<<<<< * return _inverse_component_map(parent_labels, component_labels) * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 506, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent_labels, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 506, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent_labels, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 506, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); @@ -46924,7 +47846,7 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_parent_labels, __pyx_t_6}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 506, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -46933,14 +47855,14 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_parent_labels, __pyx_t_6}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 506, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 506, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); __pyx_t_1 = NULL; @@ -46951,7 +47873,7 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 506, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -46959,7 +47881,7 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj __Pyx_DECREF_SET(__pyx_v_parent_labels, __pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":507 + /* "fastremap.pyx":509 * component_labels = reshape(component_labels, (component_labels.size,)) * parent_labels = reshape(parent_labels, (parent_labels.size,)) * return _inverse_component_map(parent_labels, component_labels) # <<<<<<<<<<<<<< @@ -46967,7 +47889,7 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_inverse_component_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_inverse_component_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = NULL; __pyx_t_8 = 0; @@ -46984,7 +47906,7 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_parent_labels, __pyx_v_component_labels}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_5); } else @@ -46992,13 +47914,13 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_parent_labels, __pyx_v_component_labels}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = NULL; @@ -47009,7 +47931,7 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj __Pyx_INCREF(__pyx_v_component_labels); __Pyx_GIVEREF(__pyx_v_component_labels); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_v_component_labels); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -47018,7 +47940,7 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj __pyx_t_5 = 0; goto __pyx_L0; - /* "fastremap.pyx":477 + /* "fastremap.pyx":479 * return remap * * def inverse_component_map(parent_labels, component_labels): # <<<<<<<<<<<<<< @@ -47045,7 +47967,7 @@ static PyObject *__pyx_pf_9fastremap_24inverse_component_map(CYTHON_UNUSED PyObj return __pyx_r; } -/* "fastremap.pyx":512 +/* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -47094,23 +48016,23 @@ static PyObject *__pyx_pw_9fastremap_27_inverse_component_map(PyObject *__pyx_se case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 514, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 514, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -47127,7 +48049,7 @@ static PyObject *__pyx_pw_9fastremap_27_inverse_component_map(PyObject *__pyx_se } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -47189,7 +48111,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_inverse_component_map", 0); __Pyx_INCREF(__pyx_v_kwargs); - __pyx_t_1 = PyList_New(1 * 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = PyList_New(1 * 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < 2; __pyx_temp++) { @@ -47207,7 +48129,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 514, __pyx_L1_error) __pyx_t_3 = ((!__pyx_t_4) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; @@ -47215,7 +48137,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_kwargs, Py_None); } - __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -47230,14 +48152,14 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_v____pyx_int64_t_is_signed = (!((((int64_t)-1L) > 0) != 0)); if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 512, __pyx_L1_error) + __PYX_ERR(0, 514, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 514, __pyx_L1_error) __pyx_t_2 = ((0 < __pyx_t_5) != 0); if (__pyx_t_2) { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 512, __pyx_L1_error) + __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_t_1 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0); __Pyx_INCREF(__pyx_t_1); @@ -47254,18 +48176,18 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 512, __pyx_L1_error) + __PYX_ERR(0, 514, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_parent_labels, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_parent_labels, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 514, __pyx_L1_error) __pyx_t_3 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_3; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 512, __pyx_L1_error) + __PYX_ERR(0, 514, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_parent_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_parent_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -47274,12 +48196,12 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 512, __pyx_L1_error) + __PYX_ERR(0, 514, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 512, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 514, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_2); __Pyx_GIVEREF(__pyx_int_2); @@ -47290,15 +48212,15 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 512, __pyx_L1_error) + __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_L6:; while (1) { @@ -47308,7 +48230,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -47317,14 +48239,14 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -47346,14 +48268,14 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = (__pyx_v_dtype != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_itemsize = __pyx_t_5; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_kind = __pyx_t_7; __pyx_v_dtype_signed = (__pyx_v_kind == 'i'); @@ -47366,9 +48288,9 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -47380,7 +48302,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = __pyx_t_2; __pyx_L16_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint16_t)) == __pyx_v_itemsize) != 0); @@ -47389,9 +48311,9 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = __pyx_t_2; goto __pyx_L20_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -47403,7 +48325,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = __pyx_t_2; __pyx_L20_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint32_t)) == __pyx_v_itemsize) != 0); @@ -47412,9 +48334,9 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = __pyx_t_2; goto __pyx_L24_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -47426,7 +48348,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = __pyx_t_2; __pyx_L24_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint64_t)) == __pyx_v_itemsize) != 0); @@ -47435,9 +48357,9 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = __pyx_t_2; goto __pyx_L28_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -47449,7 +48371,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = __pyx_t_2; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int8_t)) == __pyx_v_itemsize) != 0); @@ -47458,9 +48380,9 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = __pyx_t_2; goto __pyx_L32_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -47472,7 +48394,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = __pyx_t_2; __pyx_L32_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int16_t)) == __pyx_v_itemsize) != 0); @@ -47481,9 +48403,9 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = __pyx_t_2; goto __pyx_L36_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -47495,7 +48417,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = __pyx_t_2; __pyx_L36_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int32_t)) == __pyx_v_itemsize) != 0); @@ -47504,9 +48426,9 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = __pyx_t_2; goto __pyx_L40_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -47518,7 +48440,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = __pyx_t_2; __pyx_L40_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int64_t)) == __pyx_v_itemsize) != 0); @@ -47527,9 +48449,9 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = __pyx_t_2; goto __pyx_L44_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -47541,7 +48463,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = __pyx_t_2; __pyx_L44_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -47570,7 +48492,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -47592,7 +48514,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -47614,7 +48536,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -47636,7 +48558,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -47658,7 +48580,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -47680,7 +48602,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -47702,7 +48624,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -47724,27 +48646,27 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); } } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L10_break; } __pyx_L10_break:; if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 512, __pyx_L1_error) + __PYX_ERR(0, 514, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 514, __pyx_L1_error) __pyx_t_3 = ((1 < __pyx_t_5) != 0); if (__pyx_t_3) { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 512, __pyx_L1_error) + __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_t_6 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 1); __Pyx_INCREF(__pyx_t_6); @@ -47761,18 +48683,18 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 512, __pyx_L1_error) + __PYX_ERR(0, 514, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_component_labels, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_component_labels, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 514, __pyx_L1_error) __pyx_t_2 = (__pyx_t_4 != 0); __pyx_t_3 = __pyx_t_2; __pyx_L80_bool_binop_done:; if (__pyx_t_3) { if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 512, __pyx_L1_error) + __PYX_ERR(0, 514, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_component_labels); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_component_labels); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_arg, __pyx_t_6); __pyx_t_6 = 0; @@ -47781,12 +48703,12 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 512, __pyx_L1_error) + __PYX_ERR(0, 514, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 512, __pyx_L1_error) - __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 514, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_2); __Pyx_GIVEREF(__pyx_int_2); @@ -47797,15 +48719,15 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 512, __pyx_L1_error) + __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_L79:; while (1) { @@ -47815,7 +48737,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_dtype, __pyx_t_1); __pyx_t_1 = 0; @@ -47824,14 +48746,14 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_arg_base, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_dtype, __pyx_t_1); __pyx_t_1 = 0; @@ -47853,14 +48775,14 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_3 = (__pyx_v_dtype != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_itemsize = __pyx_t_5; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_1); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_1); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_kind = __pyx_t_7; __pyx_v_dtype_signed = (__pyx_v_kind == 'i'); @@ -47873,9 +48795,9 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = __pyx_t_3; goto __pyx_L89_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_3) { @@ -47887,7 +48809,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = __pyx_t_3; __pyx_L89_bool_binop_done:; if (__pyx_t_2) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L83_break; } __pyx_t_3 = (((sizeof(uint16_t)) == __pyx_v_itemsize) != 0); @@ -47896,9 +48818,9 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = __pyx_t_3; goto __pyx_L93_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_3) { @@ -47910,7 +48832,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = __pyx_t_3; __pyx_L93_bool_binop_done:; if (__pyx_t_2) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L83_break; } __pyx_t_3 = (((sizeof(uint32_t)) == __pyx_v_itemsize) != 0); @@ -47919,9 +48841,9 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = __pyx_t_3; goto __pyx_L97_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_3) { @@ -47933,7 +48855,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = __pyx_t_3; __pyx_L97_bool_binop_done:; if (__pyx_t_2) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L83_break; } __pyx_t_3 = (((sizeof(uint64_t)) == __pyx_v_itemsize) != 0); @@ -47942,9 +48864,9 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = __pyx_t_3; goto __pyx_L101_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_3) { @@ -47956,7 +48878,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = __pyx_t_3; __pyx_L101_bool_binop_done:; if (__pyx_t_2) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L83_break; } __pyx_t_3 = (((sizeof(int8_t)) == __pyx_v_itemsize) != 0); @@ -47965,9 +48887,9 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = __pyx_t_3; goto __pyx_L105_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_3) { @@ -47979,7 +48901,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = __pyx_t_3; __pyx_L105_bool_binop_done:; if (__pyx_t_2) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L83_break; } __pyx_t_3 = (((sizeof(int16_t)) == __pyx_v_itemsize) != 0); @@ -47988,9 +48910,9 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = __pyx_t_3; goto __pyx_L109_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_3) { @@ -48002,7 +48924,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = __pyx_t_3; __pyx_L109_bool_binop_done:; if (__pyx_t_2) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L83_break; } __pyx_t_3 = (((sizeof(int32_t)) == __pyx_v_itemsize) != 0); @@ -48011,9 +48933,9 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = __pyx_t_3; goto __pyx_L113_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_3) { @@ -48025,7 +48947,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = __pyx_t_3; __pyx_L113_bool_binop_done:; if (__pyx_t_2) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L83_break; } __pyx_t_3 = (((sizeof(int64_t)) == __pyx_v_itemsize) != 0); @@ -48034,9 +48956,9 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = __pyx_t_3; goto __pyx_L117_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_3) { @@ -48048,7 +48970,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = __pyx_t_3; __pyx_L117_bool_binop_done:; if (__pyx_t_2) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L83_break; } break; @@ -48077,7 +48999,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = (__pyx_v_memslice.memview != 0); if (__pyx_t_2) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L83_break; } /*else*/ { @@ -48099,7 +49021,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = (__pyx_v_memslice.memview != 0); if (__pyx_t_2) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L83_break; } /*else*/ { @@ -48121,7 +49043,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = (__pyx_v_memslice.memview != 0); if (__pyx_t_2) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L83_break; } /*else*/ { @@ -48143,7 +49065,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = (__pyx_v_memslice.memview != 0); if (__pyx_t_2) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L83_break; } /*else*/ { @@ -48165,7 +49087,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = (__pyx_v_memslice.memview != 0); if (__pyx_t_2) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L83_break; } /*else*/ { @@ -48187,7 +49109,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = (__pyx_v_memslice.memview != 0); if (__pyx_t_2) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L83_break; } /*else*/ { @@ -48209,7 +49131,7 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = (__pyx_v_memslice.memview != 0); if (__pyx_t_2) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L83_break; } /*else*/ { @@ -48231,27 +49153,27 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = (__pyx_v_memslice.memview != 0); if (__pyx_t_2) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L83_break; } /*else*/ { PyErr_Clear(); } } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) goto __pyx_L83_break; } __pyx_L83_break:; - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_candidates = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = 0; if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 512, __pyx_L1_error) + __PYX_ERR(0, 514, __pyx_L1_error) } - __pyx_t_6 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_6 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_6; @@ -48259,12 +49181,12 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb while (1) { __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_5, &__pyx_t_6, NULL, NULL, __pyx_t_10); if (unlikely(__pyx_t_11 == 0)) break; - if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_6); __pyx_t_6 = 0; __pyx_v_match_found = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { @@ -48278,10 +49200,10 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb } __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, __pyx_kp_s__2) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__2); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -48296,12 +49218,12 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb } __pyx_t_6 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_12, __pyx_kp_s__3) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__3); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_src_sig, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 514, __pyx_L1_error) __pyx_t_16 = __pyx_t_15; for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; @@ -48312,11 +49234,11 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_t_2 = (__pyx_v_dst_type != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_13 = PyObject_RichCompare(__pyx_t_6, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_6, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_3) { __pyx_v_match_found = 1; @@ -48332,35 +49254,35 @@ static PyObject *__pyx_pf_9fastremap_26_inverse_component_map(CYTHON_UNUSED PyOb __pyx_L155_break:; __pyx_t_3 = (__pyx_v_match_found != 0); if (__pyx_t_3) { - __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 514, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (PyList_GET_SIZE(__pyx_v_candidates) != 0); __pyx_t_2 = ((!__pyx_t_3) != 0); if (__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 512, __pyx_L1_error) + __PYX_ERR(0, 514, __pyx_L1_error) } - __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 514, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_9 > 1) != 0); if (__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 512, __pyx_L1_error) + __PYX_ERR(0, 514, __pyx_L1_error) } /*else*/ { __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 512, __pyx_L1_error) + __PYX_ERR(0, 514, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -48427,11 +49349,11 @@ static PyObject *__pyx_fuse_0_0__pyx_pw_9fastremap_261_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -48444,14 +49366,14 @@ static PyObject *__pyx_fuse_0_0__pyx_pw_9fastremap_261_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_260_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -48501,29 +49423,29 @@ static PyObject *__pyx_pf_9fastremap_260_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -48533,7 +49455,7 @@ static PyObject *__pyx_pf_9fastremap_260_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -48541,13 +49463,13 @@ static PyObject *__pyx_pf_9fastremap_260_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -48556,14 +49478,14 @@ static PyObject *__pyx_pf_9fastremap_260_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -48577,13 +49499,13 @@ static PyObject *__pyx_pf_9fastremap_260_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -48592,7 +49514,7 @@ static PyObject *__pyx_pf_9fastremap_260_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -48602,7 +49524,7 @@ static PyObject *__pyx_pf_9fastremap_260_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -48612,7 +49534,7 @@ static PyObject *__pyx_pf_9fastremap_260_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -48621,16 +49543,16 @@ static PyObject *__pyx_pf_9fastremap_260_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -48642,7 +49564,7 @@ static PyObject *__pyx_pf_9fastremap_260_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -48662,7 +49584,7 @@ static PyObject *__pyx_pf_9fastremap_260_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -48671,7 +49593,7 @@ static PyObject *__pyx_pf_9fastremap_260_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -48680,7 +49602,7 @@ static PyObject *__pyx_pf_9fastremap_260_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -48689,16 +49611,16 @@ static PyObject *__pyx_pf_9fastremap_260_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -48708,7 +49630,7 @@ static PyObject *__pyx_pf_9fastremap_260_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -48720,7 +49642,7 @@ static PyObject *__pyx_pf_9fastremap_260_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -48732,7 +49654,7 @@ static PyObject *__pyx_pf_9fastremap_260_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -48800,11 +49722,11 @@ static PyObject *__pyx_fuse_0_1__pyx_pw_9fastremap_263_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -48817,14 +49739,14 @@ static PyObject *__pyx_fuse_0_1__pyx_pw_9fastremap_263_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_262_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -48874,29 +49796,29 @@ static PyObject *__pyx_pf_9fastremap_262_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -48906,7 +49828,7 @@ static PyObject *__pyx_pf_9fastremap_262_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -48914,13 +49836,13 @@ static PyObject *__pyx_pf_9fastremap_262_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -48929,14 +49851,14 @@ static PyObject *__pyx_pf_9fastremap_262_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -48950,13 +49872,13 @@ static PyObject *__pyx_pf_9fastremap_262_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -48965,7 +49887,7 @@ static PyObject *__pyx_pf_9fastremap_262_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -48975,7 +49897,7 @@ static PyObject *__pyx_pf_9fastremap_262_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -48985,7 +49907,7 @@ static PyObject *__pyx_pf_9fastremap_262_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -48994,16 +49916,16 @@ static PyObject *__pyx_pf_9fastremap_262_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -49015,7 +49937,7 @@ static PyObject *__pyx_pf_9fastremap_262_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -49035,7 +49957,7 @@ static PyObject *__pyx_pf_9fastremap_262_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -49044,7 +49966,7 @@ static PyObject *__pyx_pf_9fastremap_262_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -49053,7 +49975,7 @@ static PyObject *__pyx_pf_9fastremap_262_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -49062,16 +49984,16 @@ static PyObject *__pyx_pf_9fastremap_262_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -49081,7 +50003,7 @@ static PyObject *__pyx_pf_9fastremap_262_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -49093,7 +50015,7 @@ static PyObject *__pyx_pf_9fastremap_262_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -49105,7 +50027,7 @@ static PyObject *__pyx_pf_9fastremap_262_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -49173,11 +50095,11 @@ static PyObject *__pyx_fuse_0_2__pyx_pw_9fastremap_265_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -49190,14 +50112,14 @@ static PyObject *__pyx_fuse_0_2__pyx_pw_9fastremap_265_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_264_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -49247,29 +50169,29 @@ static PyObject *__pyx_pf_9fastremap_264_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -49279,7 +50201,7 @@ static PyObject *__pyx_pf_9fastremap_264_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -49287,13 +50209,13 @@ static PyObject *__pyx_pf_9fastremap_264_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -49302,14 +50224,14 @@ static PyObject *__pyx_pf_9fastremap_264_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -49323,13 +50245,13 @@ static PyObject *__pyx_pf_9fastremap_264_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -49338,7 +50260,7 @@ static PyObject *__pyx_pf_9fastremap_264_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -49348,7 +50270,7 @@ static PyObject *__pyx_pf_9fastremap_264_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -49358,7 +50280,7 @@ static PyObject *__pyx_pf_9fastremap_264_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -49367,16 +50289,16 @@ static PyObject *__pyx_pf_9fastremap_264_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -49388,7 +50310,7 @@ static PyObject *__pyx_pf_9fastremap_264_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -49408,7 +50330,7 @@ static PyObject *__pyx_pf_9fastremap_264_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -49417,7 +50339,7 @@ static PyObject *__pyx_pf_9fastremap_264_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -49426,7 +50348,7 @@ static PyObject *__pyx_pf_9fastremap_264_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -49435,16 +50357,16 @@ static PyObject *__pyx_pf_9fastremap_264_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -49454,7 +50376,7 @@ static PyObject *__pyx_pf_9fastremap_264_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -49466,7 +50388,7 @@ static PyObject *__pyx_pf_9fastremap_264_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -49478,7 +50400,7 @@ static PyObject *__pyx_pf_9fastremap_264_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -49546,11 +50468,11 @@ static PyObject *__pyx_fuse_0_3__pyx_pw_9fastremap_267_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -49563,14 +50485,14 @@ static PyObject *__pyx_fuse_0_3__pyx_pw_9fastremap_267_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_266_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -49620,29 +50542,29 @@ static PyObject *__pyx_pf_9fastremap_266_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -49652,7 +50574,7 @@ static PyObject *__pyx_pf_9fastremap_266_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -49660,13 +50582,13 @@ static PyObject *__pyx_pf_9fastremap_266_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -49675,14 +50597,14 @@ static PyObject *__pyx_pf_9fastremap_266_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -49696,13 +50618,13 @@ static PyObject *__pyx_pf_9fastremap_266_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -49711,7 +50633,7 @@ static PyObject *__pyx_pf_9fastremap_266_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -49721,7 +50643,7 @@ static PyObject *__pyx_pf_9fastremap_266_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -49731,7 +50653,7 @@ static PyObject *__pyx_pf_9fastremap_266_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -49740,16 +50662,16 @@ static PyObject *__pyx_pf_9fastremap_266_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -49761,7 +50683,7 @@ static PyObject *__pyx_pf_9fastremap_266_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -49781,7 +50703,7 @@ static PyObject *__pyx_pf_9fastremap_266_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -49790,7 +50712,7 @@ static PyObject *__pyx_pf_9fastremap_266_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -49799,7 +50721,7 @@ static PyObject *__pyx_pf_9fastremap_266_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -49808,16 +50730,16 @@ static PyObject *__pyx_pf_9fastremap_266_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -49827,7 +50749,7 @@ static PyObject *__pyx_pf_9fastremap_266_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -49839,7 +50761,7 @@ static PyObject *__pyx_pf_9fastremap_266_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -49851,7 +50773,7 @@ static PyObject *__pyx_pf_9fastremap_266_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -49919,11 +50841,11 @@ static PyObject *__pyx_fuse_0_4__pyx_pw_9fastremap_269_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -49936,14 +50858,14 @@ static PyObject *__pyx_fuse_0_4__pyx_pw_9fastremap_269_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_268_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -49993,29 +50915,29 @@ static PyObject *__pyx_pf_9fastremap_268_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -50025,7 +50947,7 @@ static PyObject *__pyx_pf_9fastremap_268_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -50033,13 +50955,13 @@ static PyObject *__pyx_pf_9fastremap_268_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -50048,14 +50970,14 @@ static PyObject *__pyx_pf_9fastremap_268_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -50069,13 +50991,13 @@ static PyObject *__pyx_pf_9fastremap_268_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -50084,7 +51006,7 @@ static PyObject *__pyx_pf_9fastremap_268_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -50094,7 +51016,7 @@ static PyObject *__pyx_pf_9fastremap_268_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -50104,7 +51026,7 @@ static PyObject *__pyx_pf_9fastremap_268_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -50113,16 +51035,16 @@ static PyObject *__pyx_pf_9fastremap_268_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -50134,7 +51056,7 @@ static PyObject *__pyx_pf_9fastremap_268_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -50154,7 +51076,7 @@ static PyObject *__pyx_pf_9fastremap_268_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -50163,7 +51085,7 @@ static PyObject *__pyx_pf_9fastremap_268_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -50172,7 +51094,7 @@ static PyObject *__pyx_pf_9fastremap_268_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -50181,16 +51103,16 @@ static PyObject *__pyx_pf_9fastremap_268_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -50200,7 +51122,7 @@ static PyObject *__pyx_pf_9fastremap_268_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -50212,7 +51134,7 @@ static PyObject *__pyx_pf_9fastremap_268_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -50224,7 +51146,7 @@ static PyObject *__pyx_pf_9fastremap_268_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -50292,11 +51214,11 @@ static PyObject *__pyx_fuse_0_5__pyx_pw_9fastremap_271_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -50309,14 +51231,14 @@ static PyObject *__pyx_fuse_0_5__pyx_pw_9fastremap_271_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_270_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -50366,29 +51288,29 @@ static PyObject *__pyx_pf_9fastremap_270_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -50398,7 +51320,7 @@ static PyObject *__pyx_pf_9fastremap_270_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -50406,13 +51328,13 @@ static PyObject *__pyx_pf_9fastremap_270_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -50421,14 +51343,14 @@ static PyObject *__pyx_pf_9fastremap_270_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -50442,13 +51364,13 @@ static PyObject *__pyx_pf_9fastremap_270_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -50457,7 +51379,7 @@ static PyObject *__pyx_pf_9fastremap_270_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -50467,7 +51389,7 @@ static PyObject *__pyx_pf_9fastremap_270_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -50477,7 +51399,7 @@ static PyObject *__pyx_pf_9fastremap_270_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -50486,16 +51408,16 @@ static PyObject *__pyx_pf_9fastremap_270_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -50507,7 +51429,7 @@ static PyObject *__pyx_pf_9fastremap_270_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -50527,7 +51449,7 @@ static PyObject *__pyx_pf_9fastremap_270_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -50536,7 +51458,7 @@ static PyObject *__pyx_pf_9fastremap_270_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -50545,7 +51467,7 @@ static PyObject *__pyx_pf_9fastremap_270_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -50554,16 +51476,16 @@ static PyObject *__pyx_pf_9fastremap_270_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -50573,7 +51495,7 @@ static PyObject *__pyx_pf_9fastremap_270_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -50585,7 +51507,7 @@ static PyObject *__pyx_pf_9fastremap_270_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -50597,7 +51519,7 @@ static PyObject *__pyx_pf_9fastremap_270_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -50665,11 +51587,11 @@ static PyObject *__pyx_fuse_0_6__pyx_pw_9fastremap_273_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -50682,14 +51604,14 @@ static PyObject *__pyx_fuse_0_6__pyx_pw_9fastremap_273_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_272_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -50739,29 +51661,29 @@ static PyObject *__pyx_pf_9fastremap_272_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -50771,7 +51693,7 @@ static PyObject *__pyx_pf_9fastremap_272_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -50779,13 +51701,13 @@ static PyObject *__pyx_pf_9fastremap_272_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -50794,14 +51716,14 @@ static PyObject *__pyx_pf_9fastremap_272_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -50815,13 +51737,13 @@ static PyObject *__pyx_pf_9fastremap_272_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -50830,7 +51752,7 @@ static PyObject *__pyx_pf_9fastremap_272_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -50840,7 +51762,7 @@ static PyObject *__pyx_pf_9fastremap_272_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -50850,7 +51772,7 @@ static PyObject *__pyx_pf_9fastremap_272_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -50859,16 +51781,16 @@ static PyObject *__pyx_pf_9fastremap_272_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -50880,7 +51802,7 @@ static PyObject *__pyx_pf_9fastremap_272_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -50900,7 +51822,7 @@ static PyObject *__pyx_pf_9fastremap_272_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -50909,7 +51831,7 @@ static PyObject *__pyx_pf_9fastremap_272_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -50918,7 +51840,7 @@ static PyObject *__pyx_pf_9fastremap_272_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -50927,16 +51849,16 @@ static PyObject *__pyx_pf_9fastremap_272_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -50946,7 +51868,7 @@ static PyObject *__pyx_pf_9fastremap_272_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -50958,7 +51880,7 @@ static PyObject *__pyx_pf_9fastremap_272_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -50970,7 +51892,7 @@ static PyObject *__pyx_pf_9fastremap_272_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -51038,11 +51960,11 @@ static PyObject *__pyx_fuse_0_7__pyx_pw_9fastremap_275_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -51055,14 +51977,14 @@ static PyObject *__pyx_fuse_0_7__pyx_pw_9fastremap_275_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_274_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -51112,29 +52034,29 @@ static PyObject *__pyx_pf_9fastremap_274_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -51144,7 +52066,7 @@ static PyObject *__pyx_pf_9fastremap_274_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -51152,13 +52074,13 @@ static PyObject *__pyx_pf_9fastremap_274_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -51167,14 +52089,14 @@ static PyObject *__pyx_pf_9fastremap_274_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -51188,13 +52110,13 @@ static PyObject *__pyx_pf_9fastremap_274_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -51203,7 +52125,7 @@ static PyObject *__pyx_pf_9fastremap_274_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -51213,7 +52135,7 @@ static PyObject *__pyx_pf_9fastremap_274_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -51223,7 +52145,7 @@ static PyObject *__pyx_pf_9fastremap_274_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -51232,16 +52154,16 @@ static PyObject *__pyx_pf_9fastremap_274_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -51253,7 +52175,7 @@ static PyObject *__pyx_pf_9fastremap_274_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -51273,7 +52195,7 @@ static PyObject *__pyx_pf_9fastremap_274_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -51282,7 +52204,7 @@ static PyObject *__pyx_pf_9fastremap_274_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -51291,7 +52213,7 @@ static PyObject *__pyx_pf_9fastremap_274_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -51300,16 +52222,16 @@ static PyObject *__pyx_pf_9fastremap_274_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint8_t, 0, __Pyx_PyInt_From_uint8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -51319,7 +52241,7 @@ static PyObject *__pyx_pf_9fastremap_274_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -51331,7 +52253,7 @@ static PyObject *__pyx_pf_9fastremap_274_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -51343,7 +52265,7 @@ static PyObject *__pyx_pf_9fastremap_274_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -51411,11 +52333,11 @@ static PyObject *__pyx_fuse_1_0__pyx_pw_9fastremap_277_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -51428,14 +52350,14 @@ static PyObject *__pyx_fuse_1_0__pyx_pw_9fastremap_277_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_276_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -51485,29 +52407,29 @@ static PyObject *__pyx_pf_9fastremap_276_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -51517,7 +52439,7 @@ static PyObject *__pyx_pf_9fastremap_276_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -51525,13 +52447,13 @@ static PyObject *__pyx_pf_9fastremap_276_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -51540,14 +52462,14 @@ static PyObject *__pyx_pf_9fastremap_276_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -51561,13 +52483,13 @@ static PyObject *__pyx_pf_9fastremap_276_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -51576,7 +52498,7 @@ static PyObject *__pyx_pf_9fastremap_276_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -51586,7 +52508,7 @@ static PyObject *__pyx_pf_9fastremap_276_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -51596,7 +52518,7 @@ static PyObject *__pyx_pf_9fastremap_276_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -51605,16 +52527,16 @@ static PyObject *__pyx_pf_9fastremap_276_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -51626,7 +52548,7 @@ static PyObject *__pyx_pf_9fastremap_276_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -51646,7 +52568,7 @@ static PyObject *__pyx_pf_9fastremap_276_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -51655,7 +52577,7 @@ static PyObject *__pyx_pf_9fastremap_276_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -51664,7 +52586,7 @@ static PyObject *__pyx_pf_9fastremap_276_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -51673,16 +52595,16 @@ static PyObject *__pyx_pf_9fastremap_276_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -51692,7 +52614,7 @@ static PyObject *__pyx_pf_9fastremap_276_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -51704,7 +52626,7 @@ static PyObject *__pyx_pf_9fastremap_276_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -51716,7 +52638,7 @@ static PyObject *__pyx_pf_9fastremap_276_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -51784,11 +52706,11 @@ static PyObject *__pyx_fuse_1_1__pyx_pw_9fastremap_279_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -51801,14 +52723,14 @@ static PyObject *__pyx_fuse_1_1__pyx_pw_9fastremap_279_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_278_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -51858,29 +52780,29 @@ static PyObject *__pyx_pf_9fastremap_278_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -51890,7 +52812,7 @@ static PyObject *__pyx_pf_9fastremap_278_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -51898,13 +52820,13 @@ static PyObject *__pyx_pf_9fastremap_278_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -51913,14 +52835,14 @@ static PyObject *__pyx_pf_9fastremap_278_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -51934,13 +52856,13 @@ static PyObject *__pyx_pf_9fastremap_278_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -51949,7 +52871,7 @@ static PyObject *__pyx_pf_9fastremap_278_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -51959,7 +52881,7 @@ static PyObject *__pyx_pf_9fastremap_278_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -51969,7 +52891,7 @@ static PyObject *__pyx_pf_9fastremap_278_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -51978,16 +52900,16 @@ static PyObject *__pyx_pf_9fastremap_278_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -51999,7 +52921,7 @@ static PyObject *__pyx_pf_9fastremap_278_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -52019,7 +52941,7 @@ static PyObject *__pyx_pf_9fastremap_278_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -52028,7 +52950,7 @@ static PyObject *__pyx_pf_9fastremap_278_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -52037,7 +52959,7 @@ static PyObject *__pyx_pf_9fastremap_278_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -52046,16 +52968,16 @@ static PyObject *__pyx_pf_9fastremap_278_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -52065,7 +52987,7 @@ static PyObject *__pyx_pf_9fastremap_278_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -52077,7 +52999,7 @@ static PyObject *__pyx_pf_9fastremap_278_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -52089,7 +53011,7 @@ static PyObject *__pyx_pf_9fastremap_278_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -52157,11 +53079,11 @@ static PyObject *__pyx_fuse_1_2__pyx_pw_9fastremap_281_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -52174,14 +53096,14 @@ static PyObject *__pyx_fuse_1_2__pyx_pw_9fastremap_281_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_280_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -52231,29 +53153,29 @@ static PyObject *__pyx_pf_9fastremap_280_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -52263,7 +53185,7 @@ static PyObject *__pyx_pf_9fastremap_280_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -52271,13 +53193,13 @@ static PyObject *__pyx_pf_9fastremap_280_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -52286,14 +53208,14 @@ static PyObject *__pyx_pf_9fastremap_280_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -52307,13 +53229,13 @@ static PyObject *__pyx_pf_9fastremap_280_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -52322,7 +53244,7 @@ static PyObject *__pyx_pf_9fastremap_280_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -52332,7 +53254,7 @@ static PyObject *__pyx_pf_9fastremap_280_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -52342,7 +53264,7 @@ static PyObject *__pyx_pf_9fastremap_280_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -52351,16 +53273,16 @@ static PyObject *__pyx_pf_9fastremap_280_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -52372,7 +53294,7 @@ static PyObject *__pyx_pf_9fastremap_280_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -52392,7 +53314,7 @@ static PyObject *__pyx_pf_9fastremap_280_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -52401,7 +53323,7 @@ static PyObject *__pyx_pf_9fastremap_280_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -52410,7 +53332,7 @@ static PyObject *__pyx_pf_9fastremap_280_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -52419,16 +53341,16 @@ static PyObject *__pyx_pf_9fastremap_280_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -52438,7 +53360,7 @@ static PyObject *__pyx_pf_9fastremap_280_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -52450,7 +53372,7 @@ static PyObject *__pyx_pf_9fastremap_280_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -52462,7 +53384,7 @@ static PyObject *__pyx_pf_9fastremap_280_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -52530,11 +53452,11 @@ static PyObject *__pyx_fuse_1_3__pyx_pw_9fastremap_283_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -52547,14 +53469,14 @@ static PyObject *__pyx_fuse_1_3__pyx_pw_9fastremap_283_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_282_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -52604,29 +53526,29 @@ static PyObject *__pyx_pf_9fastremap_282_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -52636,7 +53558,7 @@ static PyObject *__pyx_pf_9fastremap_282_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -52644,13 +53566,13 @@ static PyObject *__pyx_pf_9fastremap_282_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -52659,14 +53581,14 @@ static PyObject *__pyx_pf_9fastremap_282_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -52680,13 +53602,13 @@ static PyObject *__pyx_pf_9fastremap_282_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -52695,7 +53617,7 @@ static PyObject *__pyx_pf_9fastremap_282_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -52705,7 +53627,7 @@ static PyObject *__pyx_pf_9fastremap_282_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -52715,7 +53637,7 @@ static PyObject *__pyx_pf_9fastremap_282_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -52724,16 +53646,16 @@ static PyObject *__pyx_pf_9fastremap_282_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -52745,7 +53667,7 @@ static PyObject *__pyx_pf_9fastremap_282_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -52765,7 +53687,7 @@ static PyObject *__pyx_pf_9fastremap_282_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -52774,7 +53696,7 @@ static PyObject *__pyx_pf_9fastremap_282_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -52783,7 +53705,7 @@ static PyObject *__pyx_pf_9fastremap_282_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -52792,16 +53714,16 @@ static PyObject *__pyx_pf_9fastremap_282_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -52811,7 +53733,7 @@ static PyObject *__pyx_pf_9fastremap_282_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -52823,7 +53745,7 @@ static PyObject *__pyx_pf_9fastremap_282_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -52835,7 +53757,7 @@ static PyObject *__pyx_pf_9fastremap_282_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -52903,11 +53825,11 @@ static PyObject *__pyx_fuse_1_4__pyx_pw_9fastremap_285_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -52920,14 +53842,14 @@ static PyObject *__pyx_fuse_1_4__pyx_pw_9fastremap_285_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_284_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -52977,29 +53899,29 @@ static PyObject *__pyx_pf_9fastremap_284_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -53009,7 +53931,7 @@ static PyObject *__pyx_pf_9fastremap_284_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -53017,13 +53939,13 @@ static PyObject *__pyx_pf_9fastremap_284_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -53032,14 +53954,14 @@ static PyObject *__pyx_pf_9fastremap_284_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -53053,13 +53975,13 @@ static PyObject *__pyx_pf_9fastremap_284_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -53068,7 +53990,7 @@ static PyObject *__pyx_pf_9fastremap_284_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -53078,7 +54000,7 @@ static PyObject *__pyx_pf_9fastremap_284_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -53088,7 +54010,7 @@ static PyObject *__pyx_pf_9fastremap_284_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -53097,16 +54019,16 @@ static PyObject *__pyx_pf_9fastremap_284_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -53118,7 +54040,7 @@ static PyObject *__pyx_pf_9fastremap_284_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -53138,7 +54060,7 @@ static PyObject *__pyx_pf_9fastremap_284_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -53147,7 +54069,7 @@ static PyObject *__pyx_pf_9fastremap_284_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -53156,7 +54078,7 @@ static PyObject *__pyx_pf_9fastremap_284_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -53165,16 +54087,16 @@ static PyObject *__pyx_pf_9fastremap_284_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -53184,7 +54106,7 @@ static PyObject *__pyx_pf_9fastremap_284_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -53196,7 +54118,7 @@ static PyObject *__pyx_pf_9fastremap_284_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -53208,7 +54130,7 @@ static PyObject *__pyx_pf_9fastremap_284_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -53276,11 +54198,11 @@ static PyObject *__pyx_fuse_1_5__pyx_pw_9fastremap_287_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -53293,14 +54215,14 @@ static PyObject *__pyx_fuse_1_5__pyx_pw_9fastremap_287_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_286_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -53350,29 +54272,29 @@ static PyObject *__pyx_pf_9fastremap_286_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -53382,7 +54304,7 @@ static PyObject *__pyx_pf_9fastremap_286_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -53390,13 +54312,13 @@ static PyObject *__pyx_pf_9fastremap_286_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -53405,14 +54327,14 @@ static PyObject *__pyx_pf_9fastremap_286_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -53426,13 +54348,13 @@ static PyObject *__pyx_pf_9fastremap_286_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -53441,7 +54363,7 @@ static PyObject *__pyx_pf_9fastremap_286_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -53451,7 +54373,7 @@ static PyObject *__pyx_pf_9fastremap_286_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -53461,7 +54383,7 @@ static PyObject *__pyx_pf_9fastremap_286_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -53470,16 +54392,16 @@ static PyObject *__pyx_pf_9fastremap_286_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -53491,7 +54413,7 @@ static PyObject *__pyx_pf_9fastremap_286_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -53511,7 +54433,7 @@ static PyObject *__pyx_pf_9fastremap_286_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -53520,7 +54442,7 @@ static PyObject *__pyx_pf_9fastremap_286_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -53529,7 +54451,7 @@ static PyObject *__pyx_pf_9fastremap_286_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -53538,16 +54460,16 @@ static PyObject *__pyx_pf_9fastremap_286_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -53557,7 +54479,7 @@ static PyObject *__pyx_pf_9fastremap_286_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -53569,7 +54491,7 @@ static PyObject *__pyx_pf_9fastremap_286_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -53581,7 +54503,7 @@ static PyObject *__pyx_pf_9fastremap_286_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -53649,11 +54571,11 @@ static PyObject *__pyx_fuse_1_6__pyx_pw_9fastremap_289_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -53666,14 +54588,14 @@ static PyObject *__pyx_fuse_1_6__pyx_pw_9fastremap_289_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_288_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -53723,29 +54645,29 @@ static PyObject *__pyx_pf_9fastremap_288_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -53755,7 +54677,7 @@ static PyObject *__pyx_pf_9fastremap_288_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -53763,13 +54685,13 @@ static PyObject *__pyx_pf_9fastremap_288_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -53778,14 +54700,14 @@ static PyObject *__pyx_pf_9fastremap_288_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -53799,13 +54721,13 @@ static PyObject *__pyx_pf_9fastremap_288_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -53814,7 +54736,7 @@ static PyObject *__pyx_pf_9fastremap_288_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -53824,7 +54746,7 @@ static PyObject *__pyx_pf_9fastremap_288_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -53834,7 +54756,7 @@ static PyObject *__pyx_pf_9fastremap_288_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -53843,16 +54765,16 @@ static PyObject *__pyx_pf_9fastremap_288_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -53864,7 +54786,7 @@ static PyObject *__pyx_pf_9fastremap_288_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -53884,7 +54806,7 @@ static PyObject *__pyx_pf_9fastremap_288_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -53893,7 +54815,7 @@ static PyObject *__pyx_pf_9fastremap_288_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -53902,7 +54824,7 @@ static PyObject *__pyx_pf_9fastremap_288_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -53911,16 +54833,16 @@ static PyObject *__pyx_pf_9fastremap_288_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -53930,7 +54852,7 @@ static PyObject *__pyx_pf_9fastremap_288_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -53942,7 +54864,7 @@ static PyObject *__pyx_pf_9fastremap_288_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -53954,7 +54876,7 @@ static PyObject *__pyx_pf_9fastremap_288_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -54022,11 +54944,11 @@ static PyObject *__pyx_fuse_1_7__pyx_pw_9fastremap_291_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -54039,14 +54961,14 @@ static PyObject *__pyx_fuse_1_7__pyx_pw_9fastremap_291_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_290_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -54096,29 +55018,29 @@ static PyObject *__pyx_pf_9fastremap_290_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -54128,7 +55050,7 @@ static PyObject *__pyx_pf_9fastremap_290_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -54136,13 +55058,13 @@ static PyObject *__pyx_pf_9fastremap_290_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -54151,14 +55073,14 @@ static PyObject *__pyx_pf_9fastremap_290_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -54172,13 +55094,13 @@ static PyObject *__pyx_pf_9fastremap_290_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -54187,7 +55109,7 @@ static PyObject *__pyx_pf_9fastremap_290_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -54197,7 +55119,7 @@ static PyObject *__pyx_pf_9fastremap_290_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -54207,7 +55129,7 @@ static PyObject *__pyx_pf_9fastremap_290_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -54216,16 +55138,16 @@ static PyObject *__pyx_pf_9fastremap_290_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -54237,7 +55159,7 @@ static PyObject *__pyx_pf_9fastremap_290_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -54257,7 +55179,7 @@ static PyObject *__pyx_pf_9fastremap_290_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -54266,7 +55188,7 @@ static PyObject *__pyx_pf_9fastremap_290_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -54275,7 +55197,7 @@ static PyObject *__pyx_pf_9fastremap_290_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -54284,16 +55206,16 @@ static PyObject *__pyx_pf_9fastremap_290_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -54303,7 +55225,7 @@ static PyObject *__pyx_pf_9fastremap_290_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -54315,7 +55237,7 @@ static PyObject *__pyx_pf_9fastremap_290_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -54327,7 +55249,7 @@ static PyObject *__pyx_pf_9fastremap_290_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -54395,11 +55317,11 @@ static PyObject *__pyx_fuse_2_0__pyx_pw_9fastremap_293_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -54412,14 +55334,14 @@ static PyObject *__pyx_fuse_2_0__pyx_pw_9fastremap_293_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_292_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -54469,29 +55391,29 @@ static PyObject *__pyx_pf_9fastremap_292_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -54501,7 +55423,7 @@ static PyObject *__pyx_pf_9fastremap_292_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -54509,13 +55431,13 @@ static PyObject *__pyx_pf_9fastremap_292_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -54524,14 +55446,14 @@ static PyObject *__pyx_pf_9fastremap_292_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -54545,13 +55467,13 @@ static PyObject *__pyx_pf_9fastremap_292_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -54560,7 +55482,7 @@ static PyObject *__pyx_pf_9fastremap_292_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -54570,7 +55492,7 @@ static PyObject *__pyx_pf_9fastremap_292_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -54580,7 +55502,7 @@ static PyObject *__pyx_pf_9fastremap_292_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -54589,16 +55511,16 @@ static PyObject *__pyx_pf_9fastremap_292_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -54610,7 +55532,7 @@ static PyObject *__pyx_pf_9fastremap_292_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -54630,7 +55552,7 @@ static PyObject *__pyx_pf_9fastremap_292_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -54639,7 +55561,7 @@ static PyObject *__pyx_pf_9fastremap_292_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -54648,7 +55570,7 @@ static PyObject *__pyx_pf_9fastremap_292_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -54657,16 +55579,16 @@ static PyObject *__pyx_pf_9fastremap_292_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -54676,7 +55598,7 @@ static PyObject *__pyx_pf_9fastremap_292_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -54688,7 +55610,7 @@ static PyObject *__pyx_pf_9fastremap_292_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -54700,7 +55622,7 @@ static PyObject *__pyx_pf_9fastremap_292_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -54768,11 +55690,11 @@ static PyObject *__pyx_fuse_2_1__pyx_pw_9fastremap_295_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -54785,14 +55707,14 @@ static PyObject *__pyx_fuse_2_1__pyx_pw_9fastremap_295_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_294_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -54842,29 +55764,29 @@ static PyObject *__pyx_pf_9fastremap_294_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -54874,7 +55796,7 @@ static PyObject *__pyx_pf_9fastremap_294_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -54882,13 +55804,13 @@ static PyObject *__pyx_pf_9fastremap_294_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -54897,14 +55819,14 @@ static PyObject *__pyx_pf_9fastremap_294_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -54918,13 +55840,13 @@ static PyObject *__pyx_pf_9fastremap_294_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -54933,7 +55855,7 @@ static PyObject *__pyx_pf_9fastremap_294_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -54943,7 +55865,7 @@ static PyObject *__pyx_pf_9fastremap_294_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -54953,7 +55875,7 @@ static PyObject *__pyx_pf_9fastremap_294_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -54962,16 +55884,16 @@ static PyObject *__pyx_pf_9fastremap_294_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -54983,7 +55905,7 @@ static PyObject *__pyx_pf_9fastremap_294_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -55003,7 +55925,7 @@ static PyObject *__pyx_pf_9fastremap_294_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -55012,7 +55934,7 @@ static PyObject *__pyx_pf_9fastremap_294_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -55021,7 +55943,7 @@ static PyObject *__pyx_pf_9fastremap_294_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -55030,16 +55952,16 @@ static PyObject *__pyx_pf_9fastremap_294_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -55049,7 +55971,7 @@ static PyObject *__pyx_pf_9fastremap_294_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -55061,7 +55983,7 @@ static PyObject *__pyx_pf_9fastremap_294_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -55073,7 +55995,7 @@ static PyObject *__pyx_pf_9fastremap_294_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -55141,11 +56063,11 @@ static PyObject *__pyx_fuse_2_2__pyx_pw_9fastremap_297_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -55158,14 +56080,14 @@ static PyObject *__pyx_fuse_2_2__pyx_pw_9fastremap_297_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_296_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -55215,29 +56137,29 @@ static PyObject *__pyx_pf_9fastremap_296_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -55247,7 +56169,7 @@ static PyObject *__pyx_pf_9fastremap_296_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -55255,13 +56177,13 @@ static PyObject *__pyx_pf_9fastremap_296_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -55270,14 +56192,14 @@ static PyObject *__pyx_pf_9fastremap_296_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -55291,13 +56213,13 @@ static PyObject *__pyx_pf_9fastremap_296_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -55306,7 +56228,7 @@ static PyObject *__pyx_pf_9fastremap_296_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -55316,7 +56238,7 @@ static PyObject *__pyx_pf_9fastremap_296_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -55326,7 +56248,7 @@ static PyObject *__pyx_pf_9fastremap_296_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -55335,16 +56257,16 @@ static PyObject *__pyx_pf_9fastremap_296_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -55356,7 +56278,7 @@ static PyObject *__pyx_pf_9fastremap_296_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -55376,7 +56298,7 @@ static PyObject *__pyx_pf_9fastremap_296_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -55385,7 +56307,7 @@ static PyObject *__pyx_pf_9fastremap_296_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -55394,7 +56316,7 @@ static PyObject *__pyx_pf_9fastremap_296_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -55403,16 +56325,16 @@ static PyObject *__pyx_pf_9fastremap_296_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -55422,7 +56344,7 @@ static PyObject *__pyx_pf_9fastremap_296_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -55434,7 +56356,7 @@ static PyObject *__pyx_pf_9fastremap_296_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -55446,7 +56368,7 @@ static PyObject *__pyx_pf_9fastremap_296_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -55514,11 +56436,11 @@ static PyObject *__pyx_fuse_2_3__pyx_pw_9fastremap_299_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -55531,14 +56453,14 @@ static PyObject *__pyx_fuse_2_3__pyx_pw_9fastremap_299_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_298_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -55588,29 +56510,29 @@ static PyObject *__pyx_pf_9fastremap_298_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -55620,7 +56542,7 @@ static PyObject *__pyx_pf_9fastremap_298_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -55628,13 +56550,13 @@ static PyObject *__pyx_pf_9fastremap_298_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -55643,14 +56565,14 @@ static PyObject *__pyx_pf_9fastremap_298_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -55664,13 +56586,13 @@ static PyObject *__pyx_pf_9fastremap_298_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -55679,7 +56601,7 @@ static PyObject *__pyx_pf_9fastremap_298_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -55689,7 +56611,7 @@ static PyObject *__pyx_pf_9fastremap_298_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -55699,7 +56621,7 @@ static PyObject *__pyx_pf_9fastremap_298_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -55708,16 +56630,16 @@ static PyObject *__pyx_pf_9fastremap_298_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -55729,7 +56651,7 @@ static PyObject *__pyx_pf_9fastremap_298_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -55749,7 +56671,7 @@ static PyObject *__pyx_pf_9fastremap_298_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -55758,7 +56680,7 @@ static PyObject *__pyx_pf_9fastremap_298_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -55767,7 +56689,7 @@ static PyObject *__pyx_pf_9fastremap_298_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -55776,16 +56698,16 @@ static PyObject *__pyx_pf_9fastremap_298_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -55795,7 +56717,7 @@ static PyObject *__pyx_pf_9fastremap_298_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -55807,7 +56729,7 @@ static PyObject *__pyx_pf_9fastremap_298_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -55819,7 +56741,7 @@ static PyObject *__pyx_pf_9fastremap_298_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -55887,11 +56809,11 @@ static PyObject *__pyx_fuse_2_4__pyx_pw_9fastremap_301_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -55904,14 +56826,14 @@ static PyObject *__pyx_fuse_2_4__pyx_pw_9fastremap_301_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_300_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -55961,29 +56883,29 @@ static PyObject *__pyx_pf_9fastremap_300_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -55993,7 +56915,7 @@ static PyObject *__pyx_pf_9fastremap_300_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -56001,13 +56923,13 @@ static PyObject *__pyx_pf_9fastremap_300_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -56016,14 +56938,14 @@ static PyObject *__pyx_pf_9fastremap_300_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -56037,13 +56959,13 @@ static PyObject *__pyx_pf_9fastremap_300_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -56052,7 +56974,7 @@ static PyObject *__pyx_pf_9fastremap_300_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -56062,7 +56984,7 @@ static PyObject *__pyx_pf_9fastremap_300_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -56072,7 +56994,7 @@ static PyObject *__pyx_pf_9fastremap_300_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -56081,16 +57003,16 @@ static PyObject *__pyx_pf_9fastremap_300_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -56102,7 +57024,7 @@ static PyObject *__pyx_pf_9fastremap_300_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -56122,7 +57044,7 @@ static PyObject *__pyx_pf_9fastremap_300_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -56131,7 +57053,7 @@ static PyObject *__pyx_pf_9fastremap_300_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -56140,7 +57062,7 @@ static PyObject *__pyx_pf_9fastremap_300_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -56149,16 +57071,16 @@ static PyObject *__pyx_pf_9fastremap_300_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -56168,7 +57090,7 @@ static PyObject *__pyx_pf_9fastremap_300_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -56180,7 +57102,7 @@ static PyObject *__pyx_pf_9fastremap_300_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -56192,7 +57114,7 @@ static PyObject *__pyx_pf_9fastremap_300_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -56260,11 +57182,11 @@ static PyObject *__pyx_fuse_2_5__pyx_pw_9fastremap_303_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -56277,14 +57199,14 @@ static PyObject *__pyx_fuse_2_5__pyx_pw_9fastremap_303_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_302_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -56334,29 +57256,29 @@ static PyObject *__pyx_pf_9fastremap_302_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -56366,7 +57288,7 @@ static PyObject *__pyx_pf_9fastremap_302_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -56374,13 +57296,13 @@ static PyObject *__pyx_pf_9fastremap_302_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -56389,14 +57311,14 @@ static PyObject *__pyx_pf_9fastremap_302_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -56410,13 +57332,13 @@ static PyObject *__pyx_pf_9fastremap_302_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -56425,7 +57347,7 @@ static PyObject *__pyx_pf_9fastremap_302_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -56435,7 +57357,7 @@ static PyObject *__pyx_pf_9fastremap_302_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -56445,7 +57367,7 @@ static PyObject *__pyx_pf_9fastremap_302_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -56454,16 +57376,16 @@ static PyObject *__pyx_pf_9fastremap_302_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -56475,7 +57397,7 @@ static PyObject *__pyx_pf_9fastremap_302_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -56495,7 +57417,7 @@ static PyObject *__pyx_pf_9fastremap_302_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -56504,7 +57426,7 @@ static PyObject *__pyx_pf_9fastremap_302_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -56513,7 +57435,7 @@ static PyObject *__pyx_pf_9fastremap_302_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -56522,16 +57444,16 @@ static PyObject *__pyx_pf_9fastremap_302_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -56541,7 +57463,7 @@ static PyObject *__pyx_pf_9fastremap_302_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -56553,7 +57475,7 @@ static PyObject *__pyx_pf_9fastremap_302_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -56565,7 +57487,7 @@ static PyObject *__pyx_pf_9fastremap_302_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -56633,11 +57555,11 @@ static PyObject *__pyx_fuse_2_6__pyx_pw_9fastremap_305_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -56650,14 +57572,14 @@ static PyObject *__pyx_fuse_2_6__pyx_pw_9fastremap_305_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_304_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -56707,29 +57629,29 @@ static PyObject *__pyx_pf_9fastremap_304_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -56739,7 +57661,7 @@ static PyObject *__pyx_pf_9fastremap_304_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -56747,13 +57669,13 @@ static PyObject *__pyx_pf_9fastremap_304_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -56762,14 +57684,14 @@ static PyObject *__pyx_pf_9fastremap_304_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -56783,13 +57705,13 @@ static PyObject *__pyx_pf_9fastremap_304_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -56798,7 +57720,7 @@ static PyObject *__pyx_pf_9fastremap_304_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -56808,7 +57730,7 @@ static PyObject *__pyx_pf_9fastremap_304_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -56818,7 +57740,7 @@ static PyObject *__pyx_pf_9fastremap_304_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -56827,16 +57749,16 @@ static PyObject *__pyx_pf_9fastremap_304_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -56848,7 +57770,7 @@ static PyObject *__pyx_pf_9fastremap_304_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -56868,7 +57790,7 @@ static PyObject *__pyx_pf_9fastremap_304_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -56877,7 +57799,7 @@ static PyObject *__pyx_pf_9fastremap_304_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -56886,7 +57808,7 @@ static PyObject *__pyx_pf_9fastremap_304_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -56895,16 +57817,16 @@ static PyObject *__pyx_pf_9fastremap_304_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -56914,7 +57836,7 @@ static PyObject *__pyx_pf_9fastremap_304_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -56926,7 +57848,7 @@ static PyObject *__pyx_pf_9fastremap_304_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -56938,7 +57860,7 @@ static PyObject *__pyx_pf_9fastremap_304_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -57006,11 +57928,11 @@ static PyObject *__pyx_fuse_2_7__pyx_pw_9fastremap_307_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -57023,14 +57945,14 @@ static PyObject *__pyx_fuse_2_7__pyx_pw_9fastremap_307_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_306_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -57080,29 +58002,29 @@ static PyObject *__pyx_pf_9fastremap_306_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -57112,7 +58034,7 @@ static PyObject *__pyx_pf_9fastremap_306_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -57120,13 +58042,13 @@ static PyObject *__pyx_pf_9fastremap_306_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -57135,14 +58057,14 @@ static PyObject *__pyx_pf_9fastremap_306_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -57156,13 +58078,13 @@ static PyObject *__pyx_pf_9fastremap_306_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -57171,7 +58093,7 @@ static PyObject *__pyx_pf_9fastremap_306_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -57181,7 +58103,7 @@ static PyObject *__pyx_pf_9fastremap_306_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -57191,7 +58113,7 @@ static PyObject *__pyx_pf_9fastremap_306_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -57200,16 +58122,16 @@ static PyObject *__pyx_pf_9fastremap_306_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -57221,7 +58143,7 @@ static PyObject *__pyx_pf_9fastremap_306_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -57241,7 +58163,7 @@ static PyObject *__pyx_pf_9fastremap_306_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -57250,7 +58172,7 @@ static PyObject *__pyx_pf_9fastremap_306_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -57259,7 +58181,7 @@ static PyObject *__pyx_pf_9fastremap_306_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -57268,16 +58190,16 @@ static PyObject *__pyx_pf_9fastremap_306_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -57287,7 +58209,7 @@ static PyObject *__pyx_pf_9fastremap_306_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -57299,7 +58221,7 @@ static PyObject *__pyx_pf_9fastremap_306_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -57311,7 +58233,7 @@ static PyObject *__pyx_pf_9fastremap_306_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -57379,11 +58301,11 @@ static PyObject *__pyx_fuse_3_0__pyx_pw_9fastremap_309_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -57396,14 +58318,14 @@ static PyObject *__pyx_fuse_3_0__pyx_pw_9fastremap_309_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_308_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -57453,29 +58375,29 @@ static PyObject *__pyx_pf_9fastremap_308_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -57485,7 +58407,7 @@ static PyObject *__pyx_pf_9fastremap_308_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -57493,13 +58415,13 @@ static PyObject *__pyx_pf_9fastremap_308_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -57508,14 +58430,14 @@ static PyObject *__pyx_pf_9fastremap_308_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -57529,13 +58451,13 @@ static PyObject *__pyx_pf_9fastremap_308_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -57544,7 +58466,7 @@ static PyObject *__pyx_pf_9fastremap_308_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -57554,7 +58476,7 @@ static PyObject *__pyx_pf_9fastremap_308_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -57564,7 +58486,7 @@ static PyObject *__pyx_pf_9fastremap_308_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -57573,16 +58495,16 @@ static PyObject *__pyx_pf_9fastremap_308_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -57594,7 +58516,7 @@ static PyObject *__pyx_pf_9fastremap_308_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -57614,7 +58536,7 @@ static PyObject *__pyx_pf_9fastremap_308_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -57623,7 +58545,7 @@ static PyObject *__pyx_pf_9fastremap_308_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -57632,7 +58554,7 @@ static PyObject *__pyx_pf_9fastremap_308_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -57641,16 +58563,16 @@ static PyObject *__pyx_pf_9fastremap_308_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -57660,7 +58582,7 @@ static PyObject *__pyx_pf_9fastremap_308_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -57672,7 +58594,7 @@ static PyObject *__pyx_pf_9fastremap_308_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -57684,7 +58606,7 @@ static PyObject *__pyx_pf_9fastremap_308_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -57752,11 +58674,11 @@ static PyObject *__pyx_fuse_3_1__pyx_pw_9fastremap_311_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -57769,14 +58691,14 @@ static PyObject *__pyx_fuse_3_1__pyx_pw_9fastremap_311_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_310_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -57826,29 +58748,29 @@ static PyObject *__pyx_pf_9fastremap_310_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -57858,7 +58780,7 @@ static PyObject *__pyx_pf_9fastremap_310_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -57866,13 +58788,13 @@ static PyObject *__pyx_pf_9fastremap_310_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -57881,14 +58803,14 @@ static PyObject *__pyx_pf_9fastremap_310_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -57902,13 +58824,13 @@ static PyObject *__pyx_pf_9fastremap_310_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -57917,7 +58839,7 @@ static PyObject *__pyx_pf_9fastremap_310_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -57927,7 +58849,7 @@ static PyObject *__pyx_pf_9fastremap_310_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -57937,7 +58859,7 @@ static PyObject *__pyx_pf_9fastremap_310_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -57946,16 +58868,16 @@ static PyObject *__pyx_pf_9fastremap_310_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -57967,7 +58889,7 @@ static PyObject *__pyx_pf_9fastremap_310_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -57987,7 +58909,7 @@ static PyObject *__pyx_pf_9fastremap_310_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -57996,7 +58918,7 @@ static PyObject *__pyx_pf_9fastremap_310_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -58005,7 +58927,7 @@ static PyObject *__pyx_pf_9fastremap_310_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -58014,16 +58936,16 @@ static PyObject *__pyx_pf_9fastremap_310_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -58033,7 +58955,7 @@ static PyObject *__pyx_pf_9fastremap_310_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -58045,7 +58967,7 @@ static PyObject *__pyx_pf_9fastremap_310_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -58057,7 +58979,7 @@ static PyObject *__pyx_pf_9fastremap_310_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -58125,11 +59047,11 @@ static PyObject *__pyx_fuse_3_2__pyx_pw_9fastremap_313_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -58142,14 +59064,14 @@ static PyObject *__pyx_fuse_3_2__pyx_pw_9fastremap_313_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_312_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -58199,29 +59121,29 @@ static PyObject *__pyx_pf_9fastremap_312_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -58231,7 +59153,7 @@ static PyObject *__pyx_pf_9fastremap_312_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -58239,13 +59161,13 @@ static PyObject *__pyx_pf_9fastremap_312_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -58254,14 +59176,14 @@ static PyObject *__pyx_pf_9fastremap_312_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -58275,13 +59197,13 @@ static PyObject *__pyx_pf_9fastremap_312_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -58290,7 +59212,7 @@ static PyObject *__pyx_pf_9fastremap_312_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -58300,7 +59222,7 @@ static PyObject *__pyx_pf_9fastremap_312_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -58310,7 +59232,7 @@ static PyObject *__pyx_pf_9fastremap_312_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -58319,16 +59241,16 @@ static PyObject *__pyx_pf_9fastremap_312_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -58340,7 +59262,7 @@ static PyObject *__pyx_pf_9fastremap_312_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -58360,7 +59282,7 @@ static PyObject *__pyx_pf_9fastremap_312_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -58369,7 +59291,7 @@ static PyObject *__pyx_pf_9fastremap_312_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -58378,7 +59300,7 @@ static PyObject *__pyx_pf_9fastremap_312_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -58387,16 +59309,16 @@ static PyObject *__pyx_pf_9fastremap_312_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -58406,7 +59328,7 @@ static PyObject *__pyx_pf_9fastremap_312_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -58418,7 +59340,7 @@ static PyObject *__pyx_pf_9fastremap_312_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -58430,7 +59352,7 @@ static PyObject *__pyx_pf_9fastremap_312_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -58498,11 +59420,11 @@ static PyObject *__pyx_fuse_3_3__pyx_pw_9fastremap_315_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -58515,14 +59437,14 @@ static PyObject *__pyx_fuse_3_3__pyx_pw_9fastremap_315_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_314_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -58572,29 +59494,29 @@ static PyObject *__pyx_pf_9fastremap_314_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -58604,7 +59526,7 @@ static PyObject *__pyx_pf_9fastremap_314_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -58612,13 +59534,13 @@ static PyObject *__pyx_pf_9fastremap_314_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -58627,14 +59549,14 @@ static PyObject *__pyx_pf_9fastremap_314_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -58648,13 +59570,13 @@ static PyObject *__pyx_pf_9fastremap_314_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -58663,7 +59585,7 @@ static PyObject *__pyx_pf_9fastremap_314_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -58673,7 +59595,7 @@ static PyObject *__pyx_pf_9fastremap_314_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -58683,7 +59605,7 @@ static PyObject *__pyx_pf_9fastremap_314_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -58692,16 +59614,16 @@ static PyObject *__pyx_pf_9fastremap_314_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -58713,7 +59635,7 @@ static PyObject *__pyx_pf_9fastremap_314_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -58733,7 +59655,7 @@ static PyObject *__pyx_pf_9fastremap_314_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -58742,7 +59664,7 @@ static PyObject *__pyx_pf_9fastremap_314_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -58751,7 +59673,7 @@ static PyObject *__pyx_pf_9fastremap_314_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -58760,16 +59682,16 @@ static PyObject *__pyx_pf_9fastremap_314_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -58779,7 +59701,7 @@ static PyObject *__pyx_pf_9fastremap_314_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -58791,7 +59713,7 @@ static PyObject *__pyx_pf_9fastremap_314_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -58803,7 +59725,7 @@ static PyObject *__pyx_pf_9fastremap_314_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -58871,11 +59793,11 @@ static PyObject *__pyx_fuse_3_4__pyx_pw_9fastremap_317_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -58888,14 +59810,14 @@ static PyObject *__pyx_fuse_3_4__pyx_pw_9fastremap_317_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_316_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -58945,29 +59867,29 @@ static PyObject *__pyx_pf_9fastremap_316_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -58977,7 +59899,7 @@ static PyObject *__pyx_pf_9fastremap_316_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -58985,13 +59907,13 @@ static PyObject *__pyx_pf_9fastremap_316_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -59000,14 +59922,14 @@ static PyObject *__pyx_pf_9fastremap_316_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -59021,13 +59943,13 @@ static PyObject *__pyx_pf_9fastremap_316_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -59036,7 +59958,7 @@ static PyObject *__pyx_pf_9fastremap_316_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -59046,7 +59968,7 @@ static PyObject *__pyx_pf_9fastremap_316_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -59056,7 +59978,7 @@ static PyObject *__pyx_pf_9fastremap_316_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -59065,16 +59987,16 @@ static PyObject *__pyx_pf_9fastremap_316_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -59086,7 +60008,7 @@ static PyObject *__pyx_pf_9fastremap_316_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -59106,7 +60028,7 @@ static PyObject *__pyx_pf_9fastremap_316_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -59115,7 +60037,7 @@ static PyObject *__pyx_pf_9fastremap_316_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -59124,7 +60046,7 @@ static PyObject *__pyx_pf_9fastremap_316_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -59133,16 +60055,16 @@ static PyObject *__pyx_pf_9fastremap_316_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -59152,7 +60074,7 @@ static PyObject *__pyx_pf_9fastremap_316_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -59164,7 +60086,7 @@ static PyObject *__pyx_pf_9fastremap_316_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -59176,7 +60098,7 @@ static PyObject *__pyx_pf_9fastremap_316_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -59244,11 +60166,11 @@ static PyObject *__pyx_fuse_3_5__pyx_pw_9fastremap_319_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -59261,14 +60183,14 @@ static PyObject *__pyx_fuse_3_5__pyx_pw_9fastremap_319_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_318_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -59318,29 +60240,29 @@ static PyObject *__pyx_pf_9fastremap_318_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -59350,7 +60272,7 @@ static PyObject *__pyx_pf_9fastremap_318_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -59358,13 +60280,13 @@ static PyObject *__pyx_pf_9fastremap_318_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -59373,14 +60295,14 @@ static PyObject *__pyx_pf_9fastremap_318_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -59394,13 +60316,13 @@ static PyObject *__pyx_pf_9fastremap_318_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -59409,7 +60331,7 @@ static PyObject *__pyx_pf_9fastremap_318_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -59419,7 +60341,7 @@ static PyObject *__pyx_pf_9fastremap_318_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -59429,7 +60351,7 @@ static PyObject *__pyx_pf_9fastremap_318_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -59438,16 +60360,16 @@ static PyObject *__pyx_pf_9fastremap_318_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -59459,7 +60381,7 @@ static PyObject *__pyx_pf_9fastremap_318_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -59479,7 +60401,7 @@ static PyObject *__pyx_pf_9fastremap_318_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -59488,7 +60410,7 @@ static PyObject *__pyx_pf_9fastremap_318_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -59497,7 +60419,7 @@ static PyObject *__pyx_pf_9fastremap_318_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -59506,16 +60428,16 @@ static PyObject *__pyx_pf_9fastremap_318_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -59525,7 +60447,7 @@ static PyObject *__pyx_pf_9fastremap_318_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -59537,7 +60459,7 @@ static PyObject *__pyx_pf_9fastremap_318_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -59549,7 +60471,7 @@ static PyObject *__pyx_pf_9fastremap_318_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -59617,11 +60539,11 @@ static PyObject *__pyx_fuse_3_6__pyx_pw_9fastremap_321_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -59634,14 +60556,14 @@ static PyObject *__pyx_fuse_3_6__pyx_pw_9fastremap_321_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_320_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -59691,29 +60613,29 @@ static PyObject *__pyx_pf_9fastremap_320_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -59723,7 +60645,7 @@ static PyObject *__pyx_pf_9fastremap_320_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -59731,13 +60653,13 @@ static PyObject *__pyx_pf_9fastremap_320_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -59746,14 +60668,14 @@ static PyObject *__pyx_pf_9fastremap_320_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -59767,13 +60689,13 @@ static PyObject *__pyx_pf_9fastremap_320_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -59782,7 +60704,7 @@ static PyObject *__pyx_pf_9fastremap_320_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -59792,7 +60714,7 @@ static PyObject *__pyx_pf_9fastremap_320_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -59802,7 +60724,7 @@ static PyObject *__pyx_pf_9fastremap_320_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -59811,16 +60733,16 @@ static PyObject *__pyx_pf_9fastremap_320_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -59832,7 +60754,7 @@ static PyObject *__pyx_pf_9fastremap_320_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -59852,7 +60774,7 @@ static PyObject *__pyx_pf_9fastremap_320_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -59861,7 +60783,7 @@ static PyObject *__pyx_pf_9fastremap_320_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -59870,7 +60792,7 @@ static PyObject *__pyx_pf_9fastremap_320_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -59879,16 +60801,16 @@ static PyObject *__pyx_pf_9fastremap_320_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -59898,7 +60820,7 @@ static PyObject *__pyx_pf_9fastremap_320_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -59910,7 +60832,7 @@ static PyObject *__pyx_pf_9fastremap_320_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -59922,7 +60844,7 @@ static PyObject *__pyx_pf_9fastremap_320_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -59990,11 +60912,11 @@ static PyObject *__pyx_fuse_3_7__pyx_pw_9fastremap_323_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -60007,14 +60929,14 @@ static PyObject *__pyx_fuse_3_7__pyx_pw_9fastremap_323_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_322_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -60064,29 +60986,29 @@ static PyObject *__pyx_pf_9fastremap_322_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -60096,7 +61018,7 @@ static PyObject *__pyx_pf_9fastremap_322_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -60104,13 +61026,13 @@ static PyObject *__pyx_pf_9fastremap_322_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -60119,14 +61041,14 @@ static PyObject *__pyx_pf_9fastremap_322_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -60140,13 +61062,13 @@ static PyObject *__pyx_pf_9fastremap_322_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -60155,7 +61077,7 @@ static PyObject *__pyx_pf_9fastremap_322_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -60165,7 +61087,7 @@ static PyObject *__pyx_pf_9fastremap_322_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -60175,7 +61097,7 @@ static PyObject *__pyx_pf_9fastremap_322_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -60184,16 +61106,16 @@ static PyObject *__pyx_pf_9fastremap_322_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -60205,7 +61127,7 @@ static PyObject *__pyx_pf_9fastremap_322_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -60225,7 +61147,7 @@ static PyObject *__pyx_pf_9fastremap_322_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -60234,7 +61156,7 @@ static PyObject *__pyx_pf_9fastremap_322_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -60243,7 +61165,7 @@ static PyObject *__pyx_pf_9fastremap_322_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -60252,16 +61174,16 @@ static PyObject *__pyx_pf_9fastremap_322_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, uint64_t, 0, __Pyx_PyInt_From_uint64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -60271,7 +61193,7 @@ static PyObject *__pyx_pf_9fastremap_322_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -60283,7 +61205,7 @@ static PyObject *__pyx_pf_9fastremap_322_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -60295,7 +61217,7 @@ static PyObject *__pyx_pf_9fastremap_322_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -60363,11 +61285,11 @@ static PyObject *__pyx_fuse_4_0__pyx_pw_9fastremap_325_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -60380,14 +61302,14 @@ static PyObject *__pyx_fuse_4_0__pyx_pw_9fastremap_325_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_324_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -60437,29 +61359,29 @@ static PyObject *__pyx_pf_9fastremap_324_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -60469,7 +61391,7 @@ static PyObject *__pyx_pf_9fastremap_324_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -60477,13 +61399,13 @@ static PyObject *__pyx_pf_9fastremap_324_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -60492,14 +61414,14 @@ static PyObject *__pyx_pf_9fastremap_324_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -60513,13 +61435,13 @@ static PyObject *__pyx_pf_9fastremap_324_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -60528,7 +61450,7 @@ static PyObject *__pyx_pf_9fastremap_324_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -60538,7 +61460,7 @@ static PyObject *__pyx_pf_9fastremap_324_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -60548,7 +61470,7 @@ static PyObject *__pyx_pf_9fastremap_324_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -60557,16 +61479,16 @@ static PyObject *__pyx_pf_9fastremap_324_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -60578,7 +61500,7 @@ static PyObject *__pyx_pf_9fastremap_324_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -60598,7 +61520,7 @@ static PyObject *__pyx_pf_9fastremap_324_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -60607,7 +61529,7 @@ static PyObject *__pyx_pf_9fastremap_324_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -60616,7 +61538,7 @@ static PyObject *__pyx_pf_9fastremap_324_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -60625,16 +61547,16 @@ static PyObject *__pyx_pf_9fastremap_324_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -60644,7 +61566,7 @@ static PyObject *__pyx_pf_9fastremap_324_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -60656,7 +61578,7 @@ static PyObject *__pyx_pf_9fastremap_324_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -60668,7 +61590,7 @@ static PyObject *__pyx_pf_9fastremap_324_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -60736,11 +61658,11 @@ static PyObject *__pyx_fuse_4_1__pyx_pw_9fastremap_327_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -60753,14 +61675,14 @@ static PyObject *__pyx_fuse_4_1__pyx_pw_9fastremap_327_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_326_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -60810,29 +61732,29 @@ static PyObject *__pyx_pf_9fastremap_326_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -60842,7 +61764,7 @@ static PyObject *__pyx_pf_9fastremap_326_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -60850,13 +61772,13 @@ static PyObject *__pyx_pf_9fastremap_326_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -60865,14 +61787,14 @@ static PyObject *__pyx_pf_9fastremap_326_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -60886,13 +61808,13 @@ static PyObject *__pyx_pf_9fastremap_326_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -60901,7 +61823,7 @@ static PyObject *__pyx_pf_9fastremap_326_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -60911,7 +61833,7 @@ static PyObject *__pyx_pf_9fastremap_326_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -60921,7 +61843,7 @@ static PyObject *__pyx_pf_9fastremap_326_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -60930,16 +61852,16 @@ static PyObject *__pyx_pf_9fastremap_326_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -60951,7 +61873,7 @@ static PyObject *__pyx_pf_9fastremap_326_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -60971,7 +61893,7 @@ static PyObject *__pyx_pf_9fastremap_326_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -60980,7 +61902,7 @@ static PyObject *__pyx_pf_9fastremap_326_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -60989,7 +61911,7 @@ static PyObject *__pyx_pf_9fastremap_326_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -60998,16 +61920,16 @@ static PyObject *__pyx_pf_9fastremap_326_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -61017,7 +61939,7 @@ static PyObject *__pyx_pf_9fastremap_326_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -61029,7 +61951,7 @@ static PyObject *__pyx_pf_9fastremap_326_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -61041,7 +61963,7 @@ static PyObject *__pyx_pf_9fastremap_326_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -61109,11 +62031,11 @@ static PyObject *__pyx_fuse_4_2__pyx_pw_9fastremap_329_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -61126,14 +62048,14 @@ static PyObject *__pyx_fuse_4_2__pyx_pw_9fastremap_329_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_328_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -61183,29 +62105,29 @@ static PyObject *__pyx_pf_9fastremap_328_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -61215,7 +62137,7 @@ static PyObject *__pyx_pf_9fastremap_328_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -61223,13 +62145,13 @@ static PyObject *__pyx_pf_9fastremap_328_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -61238,14 +62160,14 @@ static PyObject *__pyx_pf_9fastremap_328_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -61259,13 +62181,13 @@ static PyObject *__pyx_pf_9fastremap_328_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -61274,7 +62196,7 @@ static PyObject *__pyx_pf_9fastremap_328_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -61284,7 +62206,7 @@ static PyObject *__pyx_pf_9fastremap_328_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -61294,7 +62216,7 @@ static PyObject *__pyx_pf_9fastremap_328_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -61303,16 +62225,16 @@ static PyObject *__pyx_pf_9fastremap_328_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -61324,7 +62246,7 @@ static PyObject *__pyx_pf_9fastremap_328_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -61344,7 +62266,7 @@ static PyObject *__pyx_pf_9fastremap_328_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -61353,7 +62275,7 @@ static PyObject *__pyx_pf_9fastremap_328_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -61362,7 +62284,7 @@ static PyObject *__pyx_pf_9fastremap_328_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -61371,16 +62293,16 @@ static PyObject *__pyx_pf_9fastremap_328_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -61390,7 +62312,7 @@ static PyObject *__pyx_pf_9fastremap_328_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -61402,7 +62324,7 @@ static PyObject *__pyx_pf_9fastremap_328_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -61414,7 +62336,7 @@ static PyObject *__pyx_pf_9fastremap_328_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -61482,11 +62404,11 @@ static PyObject *__pyx_fuse_4_3__pyx_pw_9fastremap_331_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -61499,14 +62421,14 @@ static PyObject *__pyx_fuse_4_3__pyx_pw_9fastremap_331_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_330_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -61556,29 +62478,29 @@ static PyObject *__pyx_pf_9fastremap_330_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -61588,7 +62510,7 @@ static PyObject *__pyx_pf_9fastremap_330_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -61596,13 +62518,13 @@ static PyObject *__pyx_pf_9fastremap_330_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -61611,14 +62533,14 @@ static PyObject *__pyx_pf_9fastremap_330_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -61632,13 +62554,13 @@ static PyObject *__pyx_pf_9fastremap_330_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -61647,7 +62569,7 @@ static PyObject *__pyx_pf_9fastremap_330_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -61657,7 +62579,7 @@ static PyObject *__pyx_pf_9fastremap_330_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -61667,7 +62589,7 @@ static PyObject *__pyx_pf_9fastremap_330_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -61676,16 +62598,16 @@ static PyObject *__pyx_pf_9fastremap_330_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -61697,7 +62619,7 @@ static PyObject *__pyx_pf_9fastremap_330_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -61717,7 +62639,7 @@ static PyObject *__pyx_pf_9fastremap_330_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -61726,7 +62648,7 @@ static PyObject *__pyx_pf_9fastremap_330_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -61735,7 +62657,7 @@ static PyObject *__pyx_pf_9fastremap_330_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -61744,16 +62666,16 @@ static PyObject *__pyx_pf_9fastremap_330_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -61763,7 +62685,7 @@ static PyObject *__pyx_pf_9fastremap_330_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -61775,7 +62697,7 @@ static PyObject *__pyx_pf_9fastremap_330_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -61787,7 +62709,7 @@ static PyObject *__pyx_pf_9fastremap_330_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -61855,11 +62777,11 @@ static PyObject *__pyx_fuse_4_4__pyx_pw_9fastremap_333_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -61872,14 +62794,14 @@ static PyObject *__pyx_fuse_4_4__pyx_pw_9fastremap_333_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_332_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -61929,29 +62851,29 @@ static PyObject *__pyx_pf_9fastremap_332_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -61961,7 +62883,7 @@ static PyObject *__pyx_pf_9fastremap_332_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -61969,13 +62891,13 @@ static PyObject *__pyx_pf_9fastremap_332_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -61984,14 +62906,14 @@ static PyObject *__pyx_pf_9fastremap_332_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -62005,13 +62927,13 @@ static PyObject *__pyx_pf_9fastremap_332_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -62020,7 +62942,7 @@ static PyObject *__pyx_pf_9fastremap_332_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -62030,7 +62952,7 @@ static PyObject *__pyx_pf_9fastremap_332_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -62040,7 +62962,7 @@ static PyObject *__pyx_pf_9fastremap_332_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -62049,16 +62971,16 @@ static PyObject *__pyx_pf_9fastremap_332_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -62070,7 +62992,7 @@ static PyObject *__pyx_pf_9fastremap_332_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -62090,7 +63012,7 @@ static PyObject *__pyx_pf_9fastremap_332_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -62099,7 +63021,7 @@ static PyObject *__pyx_pf_9fastremap_332_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -62108,7 +63030,7 @@ static PyObject *__pyx_pf_9fastremap_332_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -62117,16 +63039,16 @@ static PyObject *__pyx_pf_9fastremap_332_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -62136,7 +63058,7 @@ static PyObject *__pyx_pf_9fastremap_332_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -62148,7 +63070,7 @@ static PyObject *__pyx_pf_9fastremap_332_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -62160,7 +63082,7 @@ static PyObject *__pyx_pf_9fastremap_332_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -62228,11 +63150,11 @@ static PyObject *__pyx_fuse_4_5__pyx_pw_9fastremap_335_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -62245,14 +63167,14 @@ static PyObject *__pyx_fuse_4_5__pyx_pw_9fastremap_335_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_334_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -62302,29 +63224,29 @@ static PyObject *__pyx_pf_9fastremap_334_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -62334,7 +63256,7 @@ static PyObject *__pyx_pf_9fastremap_334_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -62342,13 +63264,13 @@ static PyObject *__pyx_pf_9fastremap_334_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -62357,14 +63279,14 @@ static PyObject *__pyx_pf_9fastremap_334_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -62378,13 +63300,13 @@ static PyObject *__pyx_pf_9fastremap_334_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -62393,7 +63315,7 @@ static PyObject *__pyx_pf_9fastremap_334_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -62403,7 +63325,7 @@ static PyObject *__pyx_pf_9fastremap_334_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -62413,7 +63335,7 @@ static PyObject *__pyx_pf_9fastremap_334_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -62422,16 +63344,16 @@ static PyObject *__pyx_pf_9fastremap_334_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -62443,7 +63365,7 @@ static PyObject *__pyx_pf_9fastremap_334_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -62463,7 +63385,7 @@ static PyObject *__pyx_pf_9fastremap_334_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -62472,7 +63394,7 @@ static PyObject *__pyx_pf_9fastremap_334_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -62481,7 +63403,7 @@ static PyObject *__pyx_pf_9fastremap_334_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -62490,16 +63412,16 @@ static PyObject *__pyx_pf_9fastremap_334_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -62509,7 +63431,7 @@ static PyObject *__pyx_pf_9fastremap_334_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -62521,7 +63443,7 @@ static PyObject *__pyx_pf_9fastremap_334_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -62533,7 +63455,7 @@ static PyObject *__pyx_pf_9fastremap_334_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -62601,11 +63523,11 @@ static PyObject *__pyx_fuse_4_6__pyx_pw_9fastremap_337_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -62618,14 +63540,14 @@ static PyObject *__pyx_fuse_4_6__pyx_pw_9fastremap_337_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_336_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -62675,29 +63597,29 @@ static PyObject *__pyx_pf_9fastremap_336_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -62707,7 +63629,7 @@ static PyObject *__pyx_pf_9fastremap_336_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -62715,13 +63637,13 @@ static PyObject *__pyx_pf_9fastremap_336_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -62730,14 +63652,14 @@ static PyObject *__pyx_pf_9fastremap_336_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -62751,13 +63673,13 @@ static PyObject *__pyx_pf_9fastremap_336_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -62766,7 +63688,7 @@ static PyObject *__pyx_pf_9fastremap_336_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -62776,7 +63698,7 @@ static PyObject *__pyx_pf_9fastremap_336_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -62786,7 +63708,7 @@ static PyObject *__pyx_pf_9fastremap_336_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -62795,16 +63717,16 @@ static PyObject *__pyx_pf_9fastremap_336_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -62816,7 +63738,7 @@ static PyObject *__pyx_pf_9fastremap_336_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -62836,7 +63758,7 @@ static PyObject *__pyx_pf_9fastremap_336_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -62845,7 +63767,7 @@ static PyObject *__pyx_pf_9fastremap_336_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -62854,7 +63776,7 @@ static PyObject *__pyx_pf_9fastremap_336_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -62863,16 +63785,16 @@ static PyObject *__pyx_pf_9fastremap_336_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -62882,7 +63804,7 @@ static PyObject *__pyx_pf_9fastremap_336_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -62894,7 +63816,7 @@ static PyObject *__pyx_pf_9fastremap_336_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -62906,7 +63828,7 @@ static PyObject *__pyx_pf_9fastremap_336_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -62974,11 +63896,11 @@ static PyObject *__pyx_fuse_4_7__pyx_pw_9fastremap_339_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -62991,14 +63913,14 @@ static PyObject *__pyx_fuse_4_7__pyx_pw_9fastremap_339_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_338_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -63048,29 +63970,29 @@ static PyObject *__pyx_pf_9fastremap_338_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -63080,7 +64002,7 @@ static PyObject *__pyx_pf_9fastremap_338_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -63088,13 +64010,13 @@ static PyObject *__pyx_pf_9fastremap_338_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -63103,14 +64025,14 @@ static PyObject *__pyx_pf_9fastremap_338_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -63124,13 +64046,13 @@ static PyObject *__pyx_pf_9fastremap_338_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -63139,7 +64061,7 @@ static PyObject *__pyx_pf_9fastremap_338_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -63149,7 +64071,7 @@ static PyObject *__pyx_pf_9fastremap_338_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -63159,7 +64081,7 @@ static PyObject *__pyx_pf_9fastremap_338_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -63168,16 +64090,16 @@ static PyObject *__pyx_pf_9fastremap_338_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -63189,7 +64111,7 @@ static PyObject *__pyx_pf_9fastremap_338_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -63209,7 +64131,7 @@ static PyObject *__pyx_pf_9fastremap_338_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -63218,7 +64140,7 @@ static PyObject *__pyx_pf_9fastremap_338_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -63227,7 +64149,7 @@ static PyObject *__pyx_pf_9fastremap_338_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -63236,16 +64158,16 @@ static PyObject *__pyx_pf_9fastremap_338_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -63255,7 +64177,7 @@ static PyObject *__pyx_pf_9fastremap_338_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -63267,7 +64189,7 @@ static PyObject *__pyx_pf_9fastremap_338_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -63279,7 +64201,7 @@ static PyObject *__pyx_pf_9fastremap_338_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -63347,11 +64269,11 @@ static PyObject *__pyx_fuse_5_0__pyx_pw_9fastremap_341_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -63364,14 +64286,14 @@ static PyObject *__pyx_fuse_5_0__pyx_pw_9fastremap_341_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_340_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -63421,29 +64343,29 @@ static PyObject *__pyx_pf_9fastremap_340_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -63453,7 +64375,7 @@ static PyObject *__pyx_pf_9fastremap_340_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -63461,13 +64383,13 @@ static PyObject *__pyx_pf_9fastremap_340_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -63476,14 +64398,14 @@ static PyObject *__pyx_pf_9fastremap_340_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -63497,13 +64419,13 @@ static PyObject *__pyx_pf_9fastremap_340_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -63512,7 +64434,7 @@ static PyObject *__pyx_pf_9fastremap_340_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -63522,7 +64444,7 @@ static PyObject *__pyx_pf_9fastremap_340_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -63532,7 +64454,7 @@ static PyObject *__pyx_pf_9fastremap_340_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -63541,16 +64463,16 @@ static PyObject *__pyx_pf_9fastremap_340_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -63562,7 +64484,7 @@ static PyObject *__pyx_pf_9fastremap_340_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -63582,7 +64504,7 @@ static PyObject *__pyx_pf_9fastremap_340_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -63591,7 +64513,7 @@ static PyObject *__pyx_pf_9fastremap_340_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -63600,7 +64522,7 @@ static PyObject *__pyx_pf_9fastremap_340_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -63609,16 +64531,16 @@ static PyObject *__pyx_pf_9fastremap_340_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -63628,7 +64550,7 @@ static PyObject *__pyx_pf_9fastremap_340_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -63640,7 +64562,7 @@ static PyObject *__pyx_pf_9fastremap_340_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -63652,7 +64574,7 @@ static PyObject *__pyx_pf_9fastremap_340_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -63720,11 +64642,11 @@ static PyObject *__pyx_fuse_5_1__pyx_pw_9fastremap_343_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -63737,14 +64659,14 @@ static PyObject *__pyx_fuse_5_1__pyx_pw_9fastremap_343_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_342_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -63794,29 +64716,29 @@ static PyObject *__pyx_pf_9fastremap_342_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -63826,7 +64748,7 @@ static PyObject *__pyx_pf_9fastremap_342_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -63834,13 +64756,13 @@ static PyObject *__pyx_pf_9fastremap_342_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -63849,14 +64771,14 @@ static PyObject *__pyx_pf_9fastremap_342_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -63870,13 +64792,13 @@ static PyObject *__pyx_pf_9fastremap_342_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -63885,7 +64807,7 @@ static PyObject *__pyx_pf_9fastremap_342_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -63895,7 +64817,7 @@ static PyObject *__pyx_pf_9fastremap_342_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -63905,7 +64827,7 @@ static PyObject *__pyx_pf_9fastremap_342_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -63914,16 +64836,16 @@ static PyObject *__pyx_pf_9fastremap_342_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -63935,7 +64857,7 @@ static PyObject *__pyx_pf_9fastremap_342_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -63955,7 +64877,7 @@ static PyObject *__pyx_pf_9fastremap_342_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -63964,7 +64886,7 @@ static PyObject *__pyx_pf_9fastremap_342_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -63973,7 +64895,7 @@ static PyObject *__pyx_pf_9fastremap_342_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -63982,16 +64904,16 @@ static PyObject *__pyx_pf_9fastremap_342_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -64001,7 +64923,7 @@ static PyObject *__pyx_pf_9fastremap_342_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -64013,7 +64935,7 @@ static PyObject *__pyx_pf_9fastremap_342_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -64025,7 +64947,7 @@ static PyObject *__pyx_pf_9fastremap_342_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -64093,11 +65015,11 @@ static PyObject *__pyx_fuse_5_2__pyx_pw_9fastremap_345_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -64110,14 +65032,14 @@ static PyObject *__pyx_fuse_5_2__pyx_pw_9fastremap_345_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_344_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -64167,29 +65089,29 @@ static PyObject *__pyx_pf_9fastremap_344_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -64199,7 +65121,7 @@ static PyObject *__pyx_pf_9fastremap_344_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -64207,13 +65129,13 @@ static PyObject *__pyx_pf_9fastremap_344_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -64222,14 +65144,14 @@ static PyObject *__pyx_pf_9fastremap_344_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -64243,13 +65165,13 @@ static PyObject *__pyx_pf_9fastremap_344_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -64258,7 +65180,7 @@ static PyObject *__pyx_pf_9fastremap_344_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -64268,7 +65190,7 @@ static PyObject *__pyx_pf_9fastremap_344_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -64278,7 +65200,7 @@ static PyObject *__pyx_pf_9fastremap_344_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -64287,16 +65209,16 @@ static PyObject *__pyx_pf_9fastremap_344_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -64308,7 +65230,7 @@ static PyObject *__pyx_pf_9fastremap_344_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -64328,7 +65250,7 @@ static PyObject *__pyx_pf_9fastremap_344_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -64337,7 +65259,7 @@ static PyObject *__pyx_pf_9fastremap_344_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -64346,7 +65268,7 @@ static PyObject *__pyx_pf_9fastremap_344_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -64355,16 +65277,16 @@ static PyObject *__pyx_pf_9fastremap_344_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -64374,7 +65296,7 @@ static PyObject *__pyx_pf_9fastremap_344_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -64386,7 +65308,7 @@ static PyObject *__pyx_pf_9fastremap_344_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -64398,7 +65320,7 @@ static PyObject *__pyx_pf_9fastremap_344_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -64466,11 +65388,11 @@ static PyObject *__pyx_fuse_5_3__pyx_pw_9fastremap_347_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -64483,14 +65405,14 @@ static PyObject *__pyx_fuse_5_3__pyx_pw_9fastremap_347_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_346_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -64540,29 +65462,29 @@ static PyObject *__pyx_pf_9fastremap_346_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -64572,7 +65494,7 @@ static PyObject *__pyx_pf_9fastremap_346_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -64580,13 +65502,13 @@ static PyObject *__pyx_pf_9fastremap_346_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -64595,14 +65517,14 @@ static PyObject *__pyx_pf_9fastremap_346_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -64616,13 +65538,13 @@ static PyObject *__pyx_pf_9fastremap_346_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -64631,7 +65553,7 @@ static PyObject *__pyx_pf_9fastremap_346_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -64641,7 +65563,7 @@ static PyObject *__pyx_pf_9fastremap_346_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -64651,7 +65573,7 @@ static PyObject *__pyx_pf_9fastremap_346_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -64660,16 +65582,16 @@ static PyObject *__pyx_pf_9fastremap_346_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -64681,7 +65603,7 @@ static PyObject *__pyx_pf_9fastremap_346_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -64701,7 +65623,7 @@ static PyObject *__pyx_pf_9fastremap_346_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -64710,7 +65632,7 @@ static PyObject *__pyx_pf_9fastremap_346_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -64719,7 +65641,7 @@ static PyObject *__pyx_pf_9fastremap_346_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -64728,16 +65650,16 @@ static PyObject *__pyx_pf_9fastremap_346_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -64747,7 +65669,7 @@ static PyObject *__pyx_pf_9fastremap_346_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -64759,7 +65681,7 @@ static PyObject *__pyx_pf_9fastremap_346_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -64771,7 +65693,7 @@ static PyObject *__pyx_pf_9fastremap_346_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -64839,11 +65761,11 @@ static PyObject *__pyx_fuse_5_4__pyx_pw_9fastremap_349_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -64856,14 +65778,14 @@ static PyObject *__pyx_fuse_5_4__pyx_pw_9fastremap_349_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_348_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -64913,29 +65835,29 @@ static PyObject *__pyx_pf_9fastremap_348_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -64945,7 +65867,7 @@ static PyObject *__pyx_pf_9fastremap_348_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -64953,13 +65875,13 @@ static PyObject *__pyx_pf_9fastremap_348_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -64968,14 +65890,14 @@ static PyObject *__pyx_pf_9fastremap_348_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -64989,13 +65911,13 @@ static PyObject *__pyx_pf_9fastremap_348_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -65004,7 +65926,7 @@ static PyObject *__pyx_pf_9fastremap_348_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -65014,7 +65936,7 @@ static PyObject *__pyx_pf_9fastremap_348_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -65024,7 +65946,7 @@ static PyObject *__pyx_pf_9fastremap_348_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -65033,16 +65955,16 @@ static PyObject *__pyx_pf_9fastremap_348_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -65054,7 +65976,7 @@ static PyObject *__pyx_pf_9fastremap_348_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -65074,7 +65996,7 @@ static PyObject *__pyx_pf_9fastremap_348_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -65083,7 +66005,7 @@ static PyObject *__pyx_pf_9fastremap_348_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -65092,7 +66014,7 @@ static PyObject *__pyx_pf_9fastremap_348_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -65101,16 +66023,16 @@ static PyObject *__pyx_pf_9fastremap_348_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -65120,7 +66042,7 @@ static PyObject *__pyx_pf_9fastremap_348_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -65132,7 +66054,7 @@ static PyObject *__pyx_pf_9fastremap_348_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -65144,7 +66066,7 @@ static PyObject *__pyx_pf_9fastremap_348_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -65212,11 +66134,11 @@ static PyObject *__pyx_fuse_5_5__pyx_pw_9fastremap_351_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -65229,14 +66151,14 @@ static PyObject *__pyx_fuse_5_5__pyx_pw_9fastremap_351_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_350_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -65286,29 +66208,29 @@ static PyObject *__pyx_pf_9fastremap_350_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -65318,7 +66240,7 @@ static PyObject *__pyx_pf_9fastremap_350_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -65326,13 +66248,13 @@ static PyObject *__pyx_pf_9fastremap_350_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -65341,14 +66263,14 @@ static PyObject *__pyx_pf_9fastremap_350_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -65362,13 +66284,13 @@ static PyObject *__pyx_pf_9fastremap_350_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -65377,7 +66299,7 @@ static PyObject *__pyx_pf_9fastremap_350_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -65387,7 +66309,7 @@ static PyObject *__pyx_pf_9fastremap_350_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -65397,7 +66319,7 @@ static PyObject *__pyx_pf_9fastremap_350_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -65406,16 +66328,16 @@ static PyObject *__pyx_pf_9fastremap_350_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -65427,7 +66349,7 @@ static PyObject *__pyx_pf_9fastremap_350_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -65447,7 +66369,7 @@ static PyObject *__pyx_pf_9fastremap_350_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -65456,7 +66378,7 @@ static PyObject *__pyx_pf_9fastremap_350_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -65465,7 +66387,7 @@ static PyObject *__pyx_pf_9fastremap_350_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -65474,16 +66396,16 @@ static PyObject *__pyx_pf_9fastremap_350_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -65493,7 +66415,7 @@ static PyObject *__pyx_pf_9fastremap_350_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -65505,7 +66427,7 @@ static PyObject *__pyx_pf_9fastremap_350_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -65517,7 +66439,7 @@ static PyObject *__pyx_pf_9fastremap_350_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -65585,11 +66507,11 @@ static PyObject *__pyx_fuse_5_6__pyx_pw_9fastremap_353_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -65602,14 +66524,14 @@ static PyObject *__pyx_fuse_5_6__pyx_pw_9fastremap_353_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_352_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -65659,29 +66581,29 @@ static PyObject *__pyx_pf_9fastremap_352_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -65691,7 +66613,7 @@ static PyObject *__pyx_pf_9fastremap_352_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -65699,13 +66621,13 @@ static PyObject *__pyx_pf_9fastremap_352_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -65714,14 +66636,14 @@ static PyObject *__pyx_pf_9fastremap_352_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -65735,13 +66657,13 @@ static PyObject *__pyx_pf_9fastremap_352_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -65750,7 +66672,7 @@ static PyObject *__pyx_pf_9fastremap_352_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -65760,7 +66682,7 @@ static PyObject *__pyx_pf_9fastremap_352_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -65770,7 +66692,7 @@ static PyObject *__pyx_pf_9fastremap_352_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -65779,16 +66701,16 @@ static PyObject *__pyx_pf_9fastremap_352_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -65800,7 +66722,7 @@ static PyObject *__pyx_pf_9fastremap_352_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -65820,7 +66742,7 @@ static PyObject *__pyx_pf_9fastremap_352_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -65829,7 +66751,7 @@ static PyObject *__pyx_pf_9fastremap_352_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -65838,7 +66760,7 @@ static PyObject *__pyx_pf_9fastremap_352_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -65847,16 +66769,16 @@ static PyObject *__pyx_pf_9fastremap_352_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -65866,7 +66788,7 @@ static PyObject *__pyx_pf_9fastremap_352_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -65878,7 +66800,7 @@ static PyObject *__pyx_pf_9fastremap_352_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -65890,7 +66812,7 @@ static PyObject *__pyx_pf_9fastremap_352_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -65958,11 +66880,11 @@ static PyObject *__pyx_fuse_5_7__pyx_pw_9fastremap_355_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -65975,14 +66897,14 @@ static PyObject *__pyx_fuse_5_7__pyx_pw_9fastremap_355_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_354_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -66032,29 +66954,29 @@ static PyObject *__pyx_pf_9fastremap_354_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -66064,7 +66986,7 @@ static PyObject *__pyx_pf_9fastremap_354_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -66072,13 +66994,13 @@ static PyObject *__pyx_pf_9fastremap_354_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -66087,14 +67009,14 @@ static PyObject *__pyx_pf_9fastremap_354_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -66108,13 +67030,13 @@ static PyObject *__pyx_pf_9fastremap_354_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -66123,7 +67045,7 @@ static PyObject *__pyx_pf_9fastremap_354_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -66133,7 +67055,7 @@ static PyObject *__pyx_pf_9fastremap_354_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -66143,7 +67065,7 @@ static PyObject *__pyx_pf_9fastremap_354_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -66152,16 +67074,16 @@ static PyObject *__pyx_pf_9fastremap_354_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -66173,7 +67095,7 @@ static PyObject *__pyx_pf_9fastremap_354_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -66193,7 +67115,7 @@ static PyObject *__pyx_pf_9fastremap_354_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -66202,7 +67124,7 @@ static PyObject *__pyx_pf_9fastremap_354_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -66211,7 +67133,7 @@ static PyObject *__pyx_pf_9fastremap_354_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -66220,16 +67142,16 @@ static PyObject *__pyx_pf_9fastremap_354_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int16_t, 1, __Pyx_PyInt_From_int16_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -66239,7 +67161,7 @@ static PyObject *__pyx_pf_9fastremap_354_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -66251,7 +67173,7 @@ static PyObject *__pyx_pf_9fastremap_354_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -66263,7 +67185,7 @@ static PyObject *__pyx_pf_9fastremap_354_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -66331,11 +67253,11 @@ static PyObject *__pyx_fuse_6_0__pyx_pw_9fastremap_357_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -66348,14 +67270,14 @@ static PyObject *__pyx_fuse_6_0__pyx_pw_9fastremap_357_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_356_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -66405,29 +67327,29 @@ static PyObject *__pyx_pf_9fastremap_356_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -66437,7 +67359,7 @@ static PyObject *__pyx_pf_9fastremap_356_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -66445,13 +67367,13 @@ static PyObject *__pyx_pf_9fastremap_356_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -66460,14 +67382,14 @@ static PyObject *__pyx_pf_9fastremap_356_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -66481,13 +67403,13 @@ static PyObject *__pyx_pf_9fastremap_356_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -66496,7 +67418,7 @@ static PyObject *__pyx_pf_9fastremap_356_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -66506,7 +67428,7 @@ static PyObject *__pyx_pf_9fastremap_356_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -66516,7 +67438,7 @@ static PyObject *__pyx_pf_9fastremap_356_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -66525,16 +67447,16 @@ static PyObject *__pyx_pf_9fastremap_356_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -66546,7 +67468,7 @@ static PyObject *__pyx_pf_9fastremap_356_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -66566,7 +67488,7 @@ static PyObject *__pyx_pf_9fastremap_356_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -66575,7 +67497,7 @@ static PyObject *__pyx_pf_9fastremap_356_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -66584,7 +67506,7 @@ static PyObject *__pyx_pf_9fastremap_356_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -66593,16 +67515,16 @@ static PyObject *__pyx_pf_9fastremap_356_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -66612,7 +67534,7 @@ static PyObject *__pyx_pf_9fastremap_356_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -66624,7 +67546,7 @@ static PyObject *__pyx_pf_9fastremap_356_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -66636,7 +67558,7 @@ static PyObject *__pyx_pf_9fastremap_356_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -66704,11 +67626,11 @@ static PyObject *__pyx_fuse_6_1__pyx_pw_9fastremap_359_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -66721,14 +67643,14 @@ static PyObject *__pyx_fuse_6_1__pyx_pw_9fastremap_359_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_358_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -66778,29 +67700,29 @@ static PyObject *__pyx_pf_9fastremap_358_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -66810,7 +67732,7 @@ static PyObject *__pyx_pf_9fastremap_358_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -66818,13 +67740,13 @@ static PyObject *__pyx_pf_9fastremap_358_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -66833,14 +67755,14 @@ static PyObject *__pyx_pf_9fastremap_358_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -66854,13 +67776,13 @@ static PyObject *__pyx_pf_9fastremap_358_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -66869,7 +67791,7 @@ static PyObject *__pyx_pf_9fastremap_358_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -66879,7 +67801,7 @@ static PyObject *__pyx_pf_9fastremap_358_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -66889,7 +67811,7 @@ static PyObject *__pyx_pf_9fastremap_358_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -66898,16 +67820,16 @@ static PyObject *__pyx_pf_9fastremap_358_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -66919,7 +67841,7 @@ static PyObject *__pyx_pf_9fastremap_358_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -66939,7 +67861,7 @@ static PyObject *__pyx_pf_9fastremap_358_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -66948,7 +67870,7 @@ static PyObject *__pyx_pf_9fastremap_358_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -66957,7 +67879,7 @@ static PyObject *__pyx_pf_9fastremap_358_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -66966,16 +67888,16 @@ static PyObject *__pyx_pf_9fastremap_358_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -66985,7 +67907,7 @@ static PyObject *__pyx_pf_9fastremap_358_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -66997,7 +67919,7 @@ static PyObject *__pyx_pf_9fastremap_358_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -67009,7 +67931,7 @@ static PyObject *__pyx_pf_9fastremap_358_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -67077,11 +67999,11 @@ static PyObject *__pyx_fuse_6_2__pyx_pw_9fastremap_361_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -67094,14 +68016,14 @@ static PyObject *__pyx_fuse_6_2__pyx_pw_9fastremap_361_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_360_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -67151,29 +68073,29 @@ static PyObject *__pyx_pf_9fastremap_360_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -67183,7 +68105,7 @@ static PyObject *__pyx_pf_9fastremap_360_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -67191,13 +68113,13 @@ static PyObject *__pyx_pf_9fastremap_360_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -67206,14 +68128,14 @@ static PyObject *__pyx_pf_9fastremap_360_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -67227,13 +68149,13 @@ static PyObject *__pyx_pf_9fastremap_360_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -67242,7 +68164,7 @@ static PyObject *__pyx_pf_9fastremap_360_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -67252,7 +68174,7 @@ static PyObject *__pyx_pf_9fastremap_360_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -67262,7 +68184,7 @@ static PyObject *__pyx_pf_9fastremap_360_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -67271,16 +68193,16 @@ static PyObject *__pyx_pf_9fastremap_360_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -67292,7 +68214,7 @@ static PyObject *__pyx_pf_9fastremap_360_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -67312,7 +68234,7 @@ static PyObject *__pyx_pf_9fastremap_360_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -67321,7 +68243,7 @@ static PyObject *__pyx_pf_9fastremap_360_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -67330,7 +68252,7 @@ static PyObject *__pyx_pf_9fastremap_360_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -67339,16 +68261,16 @@ static PyObject *__pyx_pf_9fastremap_360_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -67358,7 +68280,7 @@ static PyObject *__pyx_pf_9fastremap_360_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -67370,7 +68292,7 @@ static PyObject *__pyx_pf_9fastremap_360_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -67382,7 +68304,7 @@ static PyObject *__pyx_pf_9fastremap_360_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -67450,11 +68372,11 @@ static PyObject *__pyx_fuse_6_3__pyx_pw_9fastremap_363_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -67467,14 +68389,14 @@ static PyObject *__pyx_fuse_6_3__pyx_pw_9fastremap_363_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_362_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -67524,29 +68446,29 @@ static PyObject *__pyx_pf_9fastremap_362_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -67556,7 +68478,7 @@ static PyObject *__pyx_pf_9fastremap_362_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -67564,13 +68486,13 @@ static PyObject *__pyx_pf_9fastremap_362_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -67579,14 +68501,14 @@ static PyObject *__pyx_pf_9fastremap_362_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -67600,13 +68522,13 @@ static PyObject *__pyx_pf_9fastremap_362_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -67615,7 +68537,7 @@ static PyObject *__pyx_pf_9fastremap_362_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -67625,7 +68547,7 @@ static PyObject *__pyx_pf_9fastremap_362_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -67635,7 +68557,7 @@ static PyObject *__pyx_pf_9fastremap_362_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -67644,16 +68566,16 @@ static PyObject *__pyx_pf_9fastremap_362_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -67665,7 +68587,7 @@ static PyObject *__pyx_pf_9fastremap_362_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -67685,7 +68607,7 @@ static PyObject *__pyx_pf_9fastremap_362_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -67694,7 +68616,7 @@ static PyObject *__pyx_pf_9fastremap_362_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -67703,7 +68625,7 @@ static PyObject *__pyx_pf_9fastremap_362_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -67712,16 +68634,16 @@ static PyObject *__pyx_pf_9fastremap_362_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -67731,7 +68653,7 @@ static PyObject *__pyx_pf_9fastremap_362_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -67743,7 +68665,7 @@ static PyObject *__pyx_pf_9fastremap_362_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -67755,7 +68677,7 @@ static PyObject *__pyx_pf_9fastremap_362_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -67823,11 +68745,11 @@ static PyObject *__pyx_fuse_6_4__pyx_pw_9fastremap_365_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -67840,14 +68762,14 @@ static PyObject *__pyx_fuse_6_4__pyx_pw_9fastremap_365_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_364_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -67897,29 +68819,29 @@ static PyObject *__pyx_pf_9fastremap_364_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -67929,7 +68851,7 @@ static PyObject *__pyx_pf_9fastremap_364_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -67937,13 +68859,13 @@ static PyObject *__pyx_pf_9fastremap_364_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -67952,14 +68874,14 @@ static PyObject *__pyx_pf_9fastremap_364_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -67973,13 +68895,13 @@ static PyObject *__pyx_pf_9fastremap_364_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -67988,7 +68910,7 @@ static PyObject *__pyx_pf_9fastremap_364_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -67998,7 +68920,7 @@ static PyObject *__pyx_pf_9fastremap_364_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -68008,7 +68930,7 @@ static PyObject *__pyx_pf_9fastremap_364_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -68017,16 +68939,16 @@ static PyObject *__pyx_pf_9fastremap_364_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -68038,7 +68960,7 @@ static PyObject *__pyx_pf_9fastremap_364_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -68058,7 +68980,7 @@ static PyObject *__pyx_pf_9fastremap_364_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -68067,7 +68989,7 @@ static PyObject *__pyx_pf_9fastremap_364_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -68076,7 +68998,7 @@ static PyObject *__pyx_pf_9fastremap_364_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -68085,16 +69007,16 @@ static PyObject *__pyx_pf_9fastremap_364_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -68104,7 +69026,7 @@ static PyObject *__pyx_pf_9fastremap_364_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -68116,7 +69038,7 @@ static PyObject *__pyx_pf_9fastremap_364_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -68128,7 +69050,7 @@ static PyObject *__pyx_pf_9fastremap_364_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -68196,11 +69118,11 @@ static PyObject *__pyx_fuse_6_5__pyx_pw_9fastremap_367_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -68213,14 +69135,14 @@ static PyObject *__pyx_fuse_6_5__pyx_pw_9fastremap_367_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_366_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -68270,29 +69192,29 @@ static PyObject *__pyx_pf_9fastremap_366_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -68302,7 +69224,7 @@ static PyObject *__pyx_pf_9fastremap_366_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -68310,13 +69232,13 @@ static PyObject *__pyx_pf_9fastremap_366_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -68325,14 +69247,14 @@ static PyObject *__pyx_pf_9fastremap_366_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -68346,13 +69268,13 @@ static PyObject *__pyx_pf_9fastremap_366_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -68361,7 +69283,7 @@ static PyObject *__pyx_pf_9fastremap_366_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -68371,7 +69293,7 @@ static PyObject *__pyx_pf_9fastremap_366_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -68381,7 +69303,7 @@ static PyObject *__pyx_pf_9fastremap_366_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -68390,16 +69312,16 @@ static PyObject *__pyx_pf_9fastremap_366_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -68411,7 +69333,7 @@ static PyObject *__pyx_pf_9fastremap_366_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -68431,7 +69353,7 @@ static PyObject *__pyx_pf_9fastremap_366_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -68440,7 +69362,7 @@ static PyObject *__pyx_pf_9fastremap_366_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -68449,7 +69371,7 @@ static PyObject *__pyx_pf_9fastremap_366_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -68458,16 +69380,16 @@ static PyObject *__pyx_pf_9fastremap_366_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -68477,7 +69399,7 @@ static PyObject *__pyx_pf_9fastremap_366_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -68489,7 +69411,7 @@ static PyObject *__pyx_pf_9fastremap_366_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -68501,7 +69423,7 @@ static PyObject *__pyx_pf_9fastremap_366_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -68569,11 +69491,11 @@ static PyObject *__pyx_fuse_6_6__pyx_pw_9fastremap_369_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -68586,14 +69508,14 @@ static PyObject *__pyx_fuse_6_6__pyx_pw_9fastremap_369_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_368_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -68643,29 +69565,29 @@ static PyObject *__pyx_pf_9fastremap_368_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -68675,7 +69597,7 @@ static PyObject *__pyx_pf_9fastremap_368_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -68683,13 +69605,13 @@ static PyObject *__pyx_pf_9fastremap_368_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -68698,14 +69620,14 @@ static PyObject *__pyx_pf_9fastremap_368_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -68719,13 +69641,13 @@ static PyObject *__pyx_pf_9fastremap_368_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -68734,7 +69656,7 @@ static PyObject *__pyx_pf_9fastremap_368_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -68744,7 +69666,7 @@ static PyObject *__pyx_pf_9fastremap_368_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -68754,7 +69676,7 @@ static PyObject *__pyx_pf_9fastremap_368_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -68763,16 +69685,16 @@ static PyObject *__pyx_pf_9fastremap_368_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -68784,7 +69706,7 @@ static PyObject *__pyx_pf_9fastremap_368_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -68804,7 +69726,7 @@ static PyObject *__pyx_pf_9fastremap_368_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -68813,7 +69735,7 @@ static PyObject *__pyx_pf_9fastremap_368_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -68822,7 +69744,7 @@ static PyObject *__pyx_pf_9fastremap_368_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -68831,16 +69753,16 @@ static PyObject *__pyx_pf_9fastremap_368_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -68850,7 +69772,7 @@ static PyObject *__pyx_pf_9fastremap_368_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -68862,7 +69784,7 @@ static PyObject *__pyx_pf_9fastremap_368_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -68874,7 +69796,7 @@ static PyObject *__pyx_pf_9fastremap_368_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -68942,11 +69864,11 @@ static PyObject *__pyx_fuse_6_7__pyx_pw_9fastremap_371_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -68959,14 +69881,14 @@ static PyObject *__pyx_fuse_6_7__pyx_pw_9fastremap_371_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_370_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -69016,29 +69938,29 @@ static PyObject *__pyx_pf_9fastremap_370_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -69048,7 +69970,7 @@ static PyObject *__pyx_pf_9fastremap_370_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -69056,13 +69978,13 @@ static PyObject *__pyx_pf_9fastremap_370_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -69071,14 +69993,14 @@ static PyObject *__pyx_pf_9fastremap_370_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -69092,13 +70014,13 @@ static PyObject *__pyx_pf_9fastremap_370_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -69107,7 +70029,7 @@ static PyObject *__pyx_pf_9fastremap_370_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -69117,7 +70039,7 @@ static PyObject *__pyx_pf_9fastremap_370_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -69127,7 +70049,7 @@ static PyObject *__pyx_pf_9fastremap_370_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -69136,16 +70058,16 @@ static PyObject *__pyx_pf_9fastremap_370_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -69157,7 +70079,7 @@ static PyObject *__pyx_pf_9fastremap_370_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -69177,7 +70099,7 @@ static PyObject *__pyx_pf_9fastremap_370_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -69186,7 +70108,7 @@ static PyObject *__pyx_pf_9fastremap_370_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -69195,7 +70117,7 @@ static PyObject *__pyx_pf_9fastremap_370_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -69204,16 +70126,16 @@ static PyObject *__pyx_pf_9fastremap_370_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -69223,7 +70145,7 @@ static PyObject *__pyx_pf_9fastremap_370_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -69235,7 +70157,7 @@ static PyObject *__pyx_pf_9fastremap_370_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -69247,7 +70169,7 @@ static PyObject *__pyx_pf_9fastremap_370_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -69315,11 +70237,11 @@ static PyObject *__pyx_fuse_7_0__pyx_pw_9fastremap_373_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -69332,14 +70254,14 @@ static PyObject *__pyx_fuse_7_0__pyx_pw_9fastremap_373_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_372_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -69389,29 +70311,29 @@ static PyObject *__pyx_pf_9fastremap_372_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -69421,7 +70343,7 @@ static PyObject *__pyx_pf_9fastremap_372_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -69429,13 +70351,13 @@ static PyObject *__pyx_pf_9fastremap_372_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -69444,14 +70366,14 @@ static PyObject *__pyx_pf_9fastremap_372_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -69465,13 +70387,13 @@ static PyObject *__pyx_pf_9fastremap_372_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -69480,7 +70402,7 @@ static PyObject *__pyx_pf_9fastremap_372_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -69490,7 +70412,7 @@ static PyObject *__pyx_pf_9fastremap_372_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -69500,7 +70422,7 @@ static PyObject *__pyx_pf_9fastremap_372_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -69509,16 +70431,16 @@ static PyObject *__pyx_pf_9fastremap_372_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -69530,7 +70452,7 @@ static PyObject *__pyx_pf_9fastremap_372_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -69550,7 +70472,7 @@ static PyObject *__pyx_pf_9fastremap_372_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -69559,7 +70481,7 @@ static PyObject *__pyx_pf_9fastremap_372_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -69568,7 +70490,7 @@ static PyObject *__pyx_pf_9fastremap_372_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -69577,16 +70499,16 @@ static PyObject *__pyx_pf_9fastremap_372_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -69596,7 +70518,7 @@ static PyObject *__pyx_pf_9fastremap_372_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -69608,7 +70530,7 @@ static PyObject *__pyx_pf_9fastremap_372_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -69620,7 +70542,7 @@ static PyObject *__pyx_pf_9fastremap_372_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -69688,11 +70610,11 @@ static PyObject *__pyx_fuse_7_1__pyx_pw_9fastremap_375_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -69705,14 +70627,14 @@ static PyObject *__pyx_fuse_7_1__pyx_pw_9fastremap_375_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_374_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -69762,29 +70684,29 @@ static PyObject *__pyx_pf_9fastremap_374_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -69794,7 +70716,7 @@ static PyObject *__pyx_pf_9fastremap_374_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -69802,13 +70724,13 @@ static PyObject *__pyx_pf_9fastremap_374_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -69817,14 +70739,14 @@ static PyObject *__pyx_pf_9fastremap_374_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -69838,13 +70760,13 @@ static PyObject *__pyx_pf_9fastremap_374_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -69853,7 +70775,7 @@ static PyObject *__pyx_pf_9fastremap_374_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -69863,7 +70785,7 @@ static PyObject *__pyx_pf_9fastremap_374_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -69873,7 +70795,7 @@ static PyObject *__pyx_pf_9fastremap_374_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -69882,16 +70804,16 @@ static PyObject *__pyx_pf_9fastremap_374_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -69903,7 +70825,7 @@ static PyObject *__pyx_pf_9fastremap_374_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -69923,7 +70845,7 @@ static PyObject *__pyx_pf_9fastremap_374_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -69932,7 +70854,7 @@ static PyObject *__pyx_pf_9fastremap_374_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -69941,7 +70863,7 @@ static PyObject *__pyx_pf_9fastremap_374_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -69950,16 +70872,16 @@ static PyObject *__pyx_pf_9fastremap_374_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -69969,7 +70891,7 @@ static PyObject *__pyx_pf_9fastremap_374_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -69981,7 +70903,7 @@ static PyObject *__pyx_pf_9fastremap_374_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -69993,7 +70915,7 @@ static PyObject *__pyx_pf_9fastremap_374_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -70061,11 +70983,11 @@ static PyObject *__pyx_fuse_7_2__pyx_pw_9fastremap_377_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -70078,14 +71000,14 @@ static PyObject *__pyx_fuse_7_2__pyx_pw_9fastremap_377_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_376_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -70135,29 +71057,29 @@ static PyObject *__pyx_pf_9fastremap_376_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -70167,7 +71089,7 @@ static PyObject *__pyx_pf_9fastremap_376_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -70175,13 +71097,13 @@ static PyObject *__pyx_pf_9fastremap_376_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -70190,14 +71112,14 @@ static PyObject *__pyx_pf_9fastremap_376_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -70211,13 +71133,13 @@ static PyObject *__pyx_pf_9fastremap_376_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -70226,7 +71148,7 @@ static PyObject *__pyx_pf_9fastremap_376_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -70236,7 +71158,7 @@ static PyObject *__pyx_pf_9fastremap_376_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -70246,7 +71168,7 @@ static PyObject *__pyx_pf_9fastremap_376_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -70255,16 +71177,16 @@ static PyObject *__pyx_pf_9fastremap_376_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -70276,7 +71198,7 @@ static PyObject *__pyx_pf_9fastremap_376_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -70296,7 +71218,7 @@ static PyObject *__pyx_pf_9fastremap_376_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -70305,7 +71227,7 @@ static PyObject *__pyx_pf_9fastremap_376_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -70314,7 +71236,7 @@ static PyObject *__pyx_pf_9fastremap_376_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -70323,16 +71245,16 @@ static PyObject *__pyx_pf_9fastremap_376_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -70342,7 +71264,7 @@ static PyObject *__pyx_pf_9fastremap_376_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -70354,7 +71276,7 @@ static PyObject *__pyx_pf_9fastremap_376_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -70366,7 +71288,7 @@ static PyObject *__pyx_pf_9fastremap_376_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -70434,11 +71356,11 @@ static PyObject *__pyx_fuse_7_3__pyx_pw_9fastremap_379_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -70451,14 +71373,14 @@ static PyObject *__pyx_fuse_7_3__pyx_pw_9fastremap_379_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_378_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -70508,29 +71430,29 @@ static PyObject *__pyx_pf_9fastremap_378_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -70540,7 +71462,7 @@ static PyObject *__pyx_pf_9fastremap_378_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -70548,13 +71470,13 @@ static PyObject *__pyx_pf_9fastremap_378_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -70563,14 +71485,14 @@ static PyObject *__pyx_pf_9fastremap_378_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -70584,13 +71506,13 @@ static PyObject *__pyx_pf_9fastremap_378_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -70599,7 +71521,7 @@ static PyObject *__pyx_pf_9fastremap_378_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -70609,7 +71531,7 @@ static PyObject *__pyx_pf_9fastremap_378_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -70619,7 +71541,7 @@ static PyObject *__pyx_pf_9fastremap_378_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -70628,16 +71550,16 @@ static PyObject *__pyx_pf_9fastremap_378_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -70649,7 +71571,7 @@ static PyObject *__pyx_pf_9fastremap_378_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -70669,7 +71591,7 @@ static PyObject *__pyx_pf_9fastremap_378_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -70678,7 +71600,7 @@ static PyObject *__pyx_pf_9fastremap_378_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -70687,7 +71609,7 @@ static PyObject *__pyx_pf_9fastremap_378_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -70696,16 +71618,16 @@ static PyObject *__pyx_pf_9fastremap_378_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -70715,7 +71637,7 @@ static PyObject *__pyx_pf_9fastremap_378_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -70727,7 +71649,7 @@ static PyObject *__pyx_pf_9fastremap_378_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -70739,7 +71661,7 @@ static PyObject *__pyx_pf_9fastremap_378_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -70807,11 +71729,11 @@ static PyObject *__pyx_fuse_7_4__pyx_pw_9fastremap_381_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -70824,14 +71746,14 @@ static PyObject *__pyx_fuse_7_4__pyx_pw_9fastremap_381_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_380_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -70881,29 +71803,29 @@ static PyObject *__pyx_pf_9fastremap_380_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -70913,7 +71835,7 @@ static PyObject *__pyx_pf_9fastremap_380_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -70921,13 +71843,13 @@ static PyObject *__pyx_pf_9fastremap_380_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -70936,14 +71858,14 @@ static PyObject *__pyx_pf_9fastremap_380_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -70957,13 +71879,13 @@ static PyObject *__pyx_pf_9fastremap_380_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -70972,7 +71894,7 @@ static PyObject *__pyx_pf_9fastremap_380_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -70982,7 +71904,7 @@ static PyObject *__pyx_pf_9fastremap_380_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -70992,7 +71914,7 @@ static PyObject *__pyx_pf_9fastremap_380_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -71001,16 +71923,16 @@ static PyObject *__pyx_pf_9fastremap_380_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -71022,7 +71944,7 @@ static PyObject *__pyx_pf_9fastremap_380_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -71042,7 +71964,7 @@ static PyObject *__pyx_pf_9fastremap_380_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -71051,7 +71973,7 @@ static PyObject *__pyx_pf_9fastremap_380_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -71060,7 +71982,7 @@ static PyObject *__pyx_pf_9fastremap_380_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -71069,16 +71991,16 @@ static PyObject *__pyx_pf_9fastremap_380_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -71088,7 +72010,7 @@ static PyObject *__pyx_pf_9fastremap_380_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -71100,7 +72022,7 @@ static PyObject *__pyx_pf_9fastremap_380_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -71112,7 +72034,7 @@ static PyObject *__pyx_pf_9fastremap_380_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -71180,11 +72102,11 @@ static PyObject *__pyx_fuse_7_5__pyx_pw_9fastremap_383_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -71197,14 +72119,14 @@ static PyObject *__pyx_fuse_7_5__pyx_pw_9fastremap_383_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_382_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -71254,29 +72176,29 @@ static PyObject *__pyx_pf_9fastremap_382_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -71286,7 +72208,7 @@ static PyObject *__pyx_pf_9fastremap_382_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -71294,13 +72216,13 @@ static PyObject *__pyx_pf_9fastremap_382_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -71309,14 +72231,14 @@ static PyObject *__pyx_pf_9fastremap_382_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -71330,13 +72252,13 @@ static PyObject *__pyx_pf_9fastremap_382_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -71345,7 +72267,7 @@ static PyObject *__pyx_pf_9fastremap_382_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -71355,7 +72277,7 @@ static PyObject *__pyx_pf_9fastremap_382_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -71365,7 +72287,7 @@ static PyObject *__pyx_pf_9fastremap_382_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -71374,16 +72296,16 @@ static PyObject *__pyx_pf_9fastremap_382_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -71395,7 +72317,7 @@ static PyObject *__pyx_pf_9fastremap_382_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -71415,7 +72337,7 @@ static PyObject *__pyx_pf_9fastremap_382_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -71424,7 +72346,7 @@ static PyObject *__pyx_pf_9fastremap_382_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -71433,7 +72355,7 @@ static PyObject *__pyx_pf_9fastremap_382_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -71442,16 +72364,16 @@ static PyObject *__pyx_pf_9fastremap_382_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -71461,7 +72383,7 @@ static PyObject *__pyx_pf_9fastremap_382_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -71473,7 +72395,7 @@ static PyObject *__pyx_pf_9fastremap_382_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -71485,7 +72407,7 @@ static PyObject *__pyx_pf_9fastremap_382_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -71553,11 +72475,11 @@ static PyObject *__pyx_fuse_7_6__pyx_pw_9fastremap_385_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -71570,14 +72492,14 @@ static PyObject *__pyx_fuse_7_6__pyx_pw_9fastremap_385_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_384_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -71627,29 +72549,29 @@ static PyObject *__pyx_pf_9fastremap_384_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -71659,7 +72581,7 @@ static PyObject *__pyx_pf_9fastremap_384_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -71667,13 +72589,13 @@ static PyObject *__pyx_pf_9fastremap_384_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -71682,14 +72604,14 @@ static PyObject *__pyx_pf_9fastremap_384_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -71703,13 +72625,13 @@ static PyObject *__pyx_pf_9fastremap_384_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -71718,7 +72640,7 @@ static PyObject *__pyx_pf_9fastremap_384_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -71728,7 +72650,7 @@ static PyObject *__pyx_pf_9fastremap_384_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -71738,7 +72660,7 @@ static PyObject *__pyx_pf_9fastremap_384_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -71747,16 +72669,16 @@ static PyObject *__pyx_pf_9fastremap_384_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -71768,7 +72690,7 @@ static PyObject *__pyx_pf_9fastremap_384_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -71788,7 +72710,7 @@ static PyObject *__pyx_pf_9fastremap_384_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -71797,7 +72719,7 @@ static PyObject *__pyx_pf_9fastremap_384_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -71806,7 +72728,7 @@ static PyObject *__pyx_pf_9fastremap_384_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -71815,16 +72737,16 @@ static PyObject *__pyx_pf_9fastremap_384_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -71834,7 +72756,7 @@ static PyObject *__pyx_pf_9fastremap_384_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -71846,7 +72768,7 @@ static PyObject *__pyx_pf_9fastremap_384_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -71858,7 +72780,7 @@ static PyObject *__pyx_pf_9fastremap_384_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -71926,11 +72848,11 @@ static PyObject *__pyx_fuse_7_7__pyx_pw_9fastremap_387_inverse_component_map(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_component_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, 1); __PYX_ERR(0, 514, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inverse_component_map") < 0)) __PYX_ERR(0, 514, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -71943,14 +72865,14 @@ static PyObject *__pyx_fuse_7_7__pyx_pw_9fastremap_387_inverse_component_map(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_inverse_component_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._inverse_component_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_labels), __pyx_ptype_5numpy_ndarray, 1, "parent_labels", 0))) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_component_labels), __pyx_ptype_5numpy_ndarray, 1, "component_labels", 0))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_386_inverse_component_map(__pyx_self, __pyx_v_parent_labels, __pyx_v_component_labels); /* function exit code */ @@ -72000,29 +72922,29 @@ static PyObject *__pyx_pf_9fastremap_386_inverse_component_map(CYTHON_UNUSED PyO __pyx_pybuffernd_component_labels.rcbuffer = &__pyx_pybuffer_component_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_parent_labels.diminfo[0].strides = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_labels.diminfo[0].shape = __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_component_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_component_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) __PYX_ERR(0, 514, __pyx_L1_error) } __pyx_pybuffernd_component_labels.diminfo[0].strides = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_component_labels.diminfo[0].shape = __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":516 + /* "fastremap.pyx":518 * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels * ): * cdef size_t size = parent_labels.size # <<<<<<<<<<<<<< * if size == 0: * return {} */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -72032,7 +72954,7 @@ static PyObject *__pyx_pf_9fastremap_386_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_3 = ((__pyx_v_size == 0) != 0); if (__pyx_t_3) { - /* "fastremap.pyx":518 + /* "fastremap.pyx":520 * cdef size_t size = parent_labels.size * if size == 0: * return {} # <<<<<<<<<<<<<< @@ -72040,13 +72962,13 @@ static PyObject *__pyx_pf_9fastremap_386_inverse_component_map(CYTHON_UNUSED PyO * remap = defaultdict(list) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":517 + /* "fastremap.pyx":519 * ): * cdef size_t size = parent_labels.size * if size == 0: # <<<<<<<<<<<<<< @@ -72055,14 +72977,14 @@ static PyObject *__pyx_pf_9fastremap_386_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":520 + /* "fastremap.pyx":522 * return {} * * remap = defaultdict(list) # <<<<<<<<<<<<<< * cdef size_t i = 0 * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -72076,13 +72998,13 @@ static PyObject *__pyx_pf_9fastremap_386_inverse_component_map(CYTHON_UNUSED PyO } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)(&PyList_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyList_Type))); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_remap = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":521 + /* "fastremap.pyx":523 * * remap = defaultdict(list) * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -72091,7 +73013,7 @@ static PyObject *__pyx_pf_9fastremap_386_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_v_i = 0; - /* "fastremap.pyx":523 + /* "fastremap.pyx":525 * cdef size_t i = 0 * * cdef ALLINT last_label = parent_labels[0] # <<<<<<<<<<<<<< @@ -72101,7 +73023,7 @@ static PyObject *__pyx_pf_9fastremap_386_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":524 + /* "fastremap.pyx":526 * * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] # <<<<<<<<<<<<<< @@ -72111,7 +73033,7 @@ static PyObject *__pyx_pf_9fastremap_386_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_6 = 0; __pyx_v_last_component = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides)); - /* "fastremap.pyx":525 + /* "fastremap.pyx":527 * cdef ALLINT last_label = parent_labels[0] * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) # <<<<<<<<<<<<<< @@ -72120,16 +73042,16 @@ static PyObject *__pyx_pf_9fastremap_386_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_6 = 0; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":526 + /* "fastremap.pyx":528 * cdef ALLINT_2 last_component = component_labels[0] * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): # <<<<<<<<<<<<<< @@ -72141,7 +73063,7 @@ static PyObject *__pyx_pf_9fastremap_386_inverse_component_map(CYTHON_UNUSED PyO for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -72161,7 +73083,7 @@ static PyObject *__pyx_pf_9fastremap_386_inverse_component_map(CYTHON_UNUSED PyO __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "fastremap.pyx":528 + /* "fastremap.pyx":530 * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue # <<<<<<<<<<<<<< @@ -72170,7 +73092,7 @@ static PyObject *__pyx_pf_9fastremap_386_inverse_component_map(CYTHON_UNUSED PyO */ goto __pyx_L4_continue; - /* "fastremap.pyx":527 + /* "fastremap.pyx":529 * remap[parent_labels[0]].append(component_labels[0]) * for i in range(size): * if last_label == parent_labels[i] and last_component == component_labels[i]: # <<<<<<<<<<<<<< @@ -72179,7 +73101,7 @@ static PyObject *__pyx_pf_9fastremap_386_inverse_component_map(CYTHON_UNUSED PyO */ } - /* "fastremap.pyx":529 + /* "fastremap.pyx":531 * if last_label == parent_labels[i] and last_component == component_labels[i]: * continue * remap[parent_labels[i]].append(component_labels[i]) # <<<<<<<<<<<<<< @@ -72188,16 +73110,16 @@ static PyObject *__pyx_pf_9fastremap_386_inverse_component_map(CYTHON_UNUSED PyO */ __pyx_t_11 = __pyx_v_i; __pyx_t_7 = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_remap, __pyx_t_7, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __pyx_v_i; - __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_component_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_component_labels.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":530 + /* "fastremap.pyx":532 * continue * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] # <<<<<<<<<<<<<< @@ -72207,7 +73129,7 @@ static PyObject *__pyx_pf_9fastremap_386_inverse_component_map(CYTHON_UNUSED PyO __pyx_t_11 = __pyx_v_i; __pyx_v_last_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_parent_labels.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_parent_labels.diminfo[0].strides)); - /* "fastremap.pyx":531 + /* "fastremap.pyx":533 * remap[parent_labels[i]].append(component_labels[i]) * last_label = parent_labels[i] * last_component = component_labels[i] # <<<<<<<<<<<<<< @@ -72219,7 +73141,7 @@ static PyObject *__pyx_pf_9fastremap_386_inverse_component_map(CYTHON_UNUSED PyO __pyx_L4_continue:; } - /* "fastremap.pyx":533 + /* "fastremap.pyx":535 * last_component = component_labels[i] * * return remap # <<<<<<<<<<<<<< @@ -72231,7 +73153,7 @@ static PyObject *__pyx_pf_9fastremap_386_inverse_component_map(CYTHON_UNUSED PyO __pyx_r = __pyx_v_remap; goto __pyx_L0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< @@ -72264,7 +73186,7 @@ static PyObject *__pyx_pf_9fastremap_386_inverse_component_map(CYTHON_UNUSED PyO return __pyx_r; } -/* "fastremap.pyx":535 +/* "fastremap.pyx":537 * return remap * * def remap(arr, table, preserve_missing_labels=False, in_place=False): # <<<<<<<<<<<<<< @@ -72316,7 +73238,7 @@ static PyObject *__pyx_pw_9fastremap_29remap(PyObject *__pyx_self, PyObject *__p case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_table)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("remap", 0, 2, 4, 1); __PYX_ERR(0, 535, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap", 0, 2, 4, 1); __PYX_ERR(0, 537, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -72332,7 +73254,7 @@ static PyObject *__pyx_pw_9fastremap_29remap(PyObject *__pyx_self, PyObject *__p } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap") < 0)) __PYX_ERR(0, 535, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap") < 0)) __PYX_ERR(0, 537, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -72353,7 +73275,7 @@ static PyObject *__pyx_pw_9fastremap_29remap(PyObject *__pyx_self, PyObject *__p } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("remap", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 535, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 537, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.remap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -72373,8 +73295,8 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_min_label = NULL; PyObject *__pyx_v_max_label = NULL; PyObject *__pyx_v_fit_value = NULL; - PyObject *__pyx_8genexpr3__pyx_v_k = NULL; - PyObject *__pyx_8genexpr3__pyx_v_v = NULL; + PyObject *__pyx_9genexpr13__pyx_v_k = NULL; + PyObject *__pyx_9genexpr13__pyx_v_v = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -72395,28 +73317,28 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_RefNannySetupContext("remap", 0); __Pyx_INCREF(__pyx_v_arr); - /* "fastremap.pyx":553 + /* "fastremap.pyx":555 * Returns: remapped array * """ * if type(arr) == list: # <<<<<<<<<<<<<< * arr = np.array(arr) * */ - __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_arr)), ((PyObject *)(&PyList_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 553, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_arr)), ((PyObject *)(&PyList_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "fastremap.pyx":554 + /* "fastremap.pyx":556 * """ * if type(arr) == list: * arr = np.array(arr) # <<<<<<<<<<<<<< * * shape = arr.shape */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -72431,13 +73353,13 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_arr) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_arr); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":553 + /* "fastremap.pyx":555 * Returns: remapped array * """ * if type(arr) == list: # <<<<<<<<<<<<<< @@ -72446,35 +73368,35 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, */ } - /* "fastremap.pyx":556 + /* "fastremap.pyx":558 * arr = np.array(arr) * * shape = arr.shape # <<<<<<<<<<<<<< * * if arr.flags['F_CONTIGUOUS']: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_shape = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":558 + /* "fastremap.pyx":560 * shape = arr.shape * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * order = 'F' * else: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 558, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 558, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { - /* "fastremap.pyx":559 + /* "fastremap.pyx":561 * * if arr.flags['F_CONTIGUOUS']: * order = 'F' # <<<<<<<<<<<<<< @@ -72484,7 +73406,7 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_INCREF(__pyx_n_u_F); __pyx_v_order = __pyx_n_u_F; - /* "fastremap.pyx":558 + /* "fastremap.pyx":560 * shape = arr.shape * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -72494,7 +73416,7 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, goto __pyx_L4; } - /* "fastremap.pyx":561 + /* "fastremap.pyx":563 * order = 'F' * else: * order = 'C' # <<<<<<<<<<<<<< @@ -72507,37 +73429,37 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, } __pyx_L4:; - /* "fastremap.pyx":563 + /* "fastremap.pyx":565 * order = 'C' * * original_dtype = arr.dtype # <<<<<<<<<<<<<< * if len(table): * min_label, max_label = min(table.values()), max(table.values()) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 563, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_original_dtype = __pyx_t_4; __pyx_t_4 = 0; - /* "fastremap.pyx":564 + /* "fastremap.pyx":566 * * original_dtype = arr.dtype * if len(table): # <<<<<<<<<<<<<< * min_label, max_label = min(table.values()), max(table.values()) * fit_value = min_label if abs(min_label) > abs(max_label) else max_label */ - __pyx_t_5 = PyObject_Length(__pyx_v_table); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 564, __pyx_L1_error) + __pyx_t_5 = PyObject_Length(__pyx_v_table); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 566, __pyx_L1_error) __pyx_t_2 = (__pyx_t_5 != 0); if (__pyx_t_2) { - /* "fastremap.pyx":565 + /* "fastremap.pyx":567 * original_dtype = arr.dtype * if len(table): * min_label, max_label = min(table.values()), max(table.values()) # <<<<<<<<<<<<<< * fit_value = min_label if abs(min_label) > abs(max_label) else max_label * arr = refit(arr, fit_value, increase_only=True) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_table, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_table, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -72551,13 +73473,13 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, } __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 565, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_table, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 565, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_table, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -72571,10 +73493,10 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, } __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 565, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 565, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_min_label = __pyx_t_1; @@ -72582,21 +73504,21 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, __pyx_v_max_label = __pyx_t_3; __pyx_t_3 = 0; - /* "fastremap.pyx":566 + /* "fastremap.pyx":568 * if len(table): * min_label, max_label = min(table.values()), max(table.values()) * fit_value = min_label if abs(min_label) > abs(max_label) else max_label # <<<<<<<<<<<<<< * arr = refit(arr, fit_value, increase_only=True) * */ - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_v_min_label); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_v_min_label); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyNumber_Absolute(__pyx_v_max_label); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyNumber_Absolute(__pyx_v_max_label); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { __Pyx_INCREF(__pyx_v_min_label); @@ -72608,16 +73530,16 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, __pyx_v_fit_value = __pyx_t_3; __pyx_t_3 = 0; - /* "fastremap.pyx":567 + /* "fastremap.pyx":569 * min_label, max_label = min(table.values()), max(table.values()) * fit_value = min_label if abs(min_label) > abs(max_label) else max_label * arr = refit(arr, fit_value, increase_only=True) # <<<<<<<<<<<<<< * * if not in_place and original_dtype == arr.dtype: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_refit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 567, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_refit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 567, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); @@ -72625,10 +73547,10 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_INCREF(__pyx_v_fit_value); __Pyx_GIVEREF(__pyx_v_fit_value); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_fit_value); - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 567, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_increase_only, Py_True) < 0) __PYX_ERR(0, 567, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 567, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_increase_only, Py_True) < 0) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -72636,7 +73558,7 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":564 + /* "fastremap.pyx":566 * * original_dtype = arr.dtype * if len(table): # <<<<<<<<<<<<<< @@ -72645,51 +73567,51 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, */ } - /* "fastremap.pyx":569 + /* "fastremap.pyx":571 * arr = refit(arr, fit_value, increase_only=True) * * if not in_place and original_dtype == arr.dtype: # <<<<<<<<<<<<<< * arr = np.copy(arr, order=order) * */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_in_place); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_in_place); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 571, __pyx_L1_error) __pyx_t_8 = ((!__pyx_t_7) != 0); if (__pyx_t_8) { } else { __pyx_t_2 = __pyx_t_8; goto __pyx_L7_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_original_dtype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_original_dtype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __pyx_t_8; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { - /* "fastremap.pyx":570 + /* "fastremap.pyx":572 * * if not in_place and original_dtype == arr.dtype: * arr = np.copy(arr, order=order) # <<<<<<<<<<<<<< * * if all([ k == v for k,v in table.items() ]) and preserve_missing_labels: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_arr); - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_v_order) < 0) __PYX_ERR(0, 570, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_v_order) < 0) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -72697,7 +73619,7 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":569 + /* "fastremap.pyx":571 * arr = refit(arr, fit_value, increase_only=True) * * if not in_place and original_dtype == arr.dtype: # <<<<<<<<<<<<<< @@ -72706,7 +73628,7 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, */ } - /* "fastremap.pyx":572 + /* "fastremap.pyx":574 * arr = np.copy(arr, order=order) * * if all([ k == v for k,v in table.items() ]) and preserve_missing_labels: # <<<<<<<<<<<<<< @@ -72714,14 +73636,14 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, * */ { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L14_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 0; if (unlikely(__pyx_v_table == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 572, __pyx_L14_error) + __PYX_ERR(0, 574, __pyx_L14_error) } - __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_table, 0, __pyx_n_s_items, (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L14_error) + __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_table, 0, __pyx_n_s_items, (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 574, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_4; @@ -72729,43 +73651,43 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, while (1) { __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_9, &__pyx_t_5, &__pyx_t_4, &__pyx_t_1, NULL, __pyx_t_10); if (unlikely(__pyx_t_11 == 0)) break; - if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 572, __pyx_L14_error) + if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 574, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_k, __pyx_t_4); + __Pyx_XDECREF_SET(__pyx_9genexpr13__pyx_v_k, __pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_v, __pyx_t_1); + __Pyx_XDECREF_SET(__pyx_9genexpr13__pyx_v_v, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_8genexpr3__pyx_v_k, __pyx_8genexpr3__pyx_v_v, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L14_error) - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 572, __pyx_L14_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_9genexpr13__pyx_v_k, __pyx_9genexpr13__pyx_v_v, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L14_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 574, __pyx_L14_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_k); __pyx_8genexpr3__pyx_v_k = 0; - __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_v); __pyx_8genexpr3__pyx_v_v = 0; + __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_k); __pyx_9genexpr13__pyx_v_k = 0; + __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_v); __pyx_9genexpr13__pyx_v_v = 0; goto __pyx_L17_exit_scope; __pyx_L14_error:; - __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_k); __pyx_8genexpr3__pyx_v_k = 0; - __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_v); __pyx_8genexpr3__pyx_v_v = 0; + __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_k); __pyx_9genexpr13__pyx_v_k = 0; + __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_v); __pyx_9genexpr13__pyx_v_v = 0; goto __pyx_L1_error; __pyx_L17_exit_scope:; } /* exit inner scope */ - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_all, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_all, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_8) { } else { __pyx_t_2 = __pyx_t_8; goto __pyx_L10_bool_binop_done; } - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_preserve_missing_labels); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_preserve_missing_labels); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 574, __pyx_L1_error) __pyx_t_2 = __pyx_t_8; __pyx_L10_bool_binop_done:; if (__pyx_t_2) { - /* "fastremap.pyx":573 + /* "fastremap.pyx":575 * * if all([ k == v for k,v in table.items() ]) and preserve_missing_labels: * return arr # <<<<<<<<<<<<<< @@ -72777,7 +73699,7 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "fastremap.pyx":572 + /* "fastremap.pyx":574 * arr = np.copy(arr, order=order) * * if all([ k == v for k,v in table.items() ]) and preserve_missing_labels: # <<<<<<<<<<<<<< @@ -72786,18 +73708,18 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, */ } - /* "fastremap.pyx":575 + /* "fastremap.pyx":577 * return arr * * arr = reshape(arr, (arr.size,)) # <<<<<<<<<<<<<< * arr = _remap(arr, table, preserve_missing_labels) * return reshape(arr, shape, order=order) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 575, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -72817,7 +73739,7 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_arr, __pyx_t_4}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 575, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -72826,14 +73748,14 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_arr, __pyx_t_4}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 575, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_12 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 575, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); __pyx_t_1 = NULL; @@ -72844,7 +73766,7 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_10, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 575, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } @@ -72852,14 +73774,14 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":576 + /* "fastremap.pyx":578 * * arr = reshape(arr, (arr.size,)) * arr = _remap(arr, table, preserve_missing_labels) # <<<<<<<<<<<<<< * return reshape(arr, shape, order=order) * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_remap_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 576, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_remap_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_12 = NULL; __pyx_t_10 = 0; @@ -72876,7 +73798,7 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_12, __pyx_v_arr, __pyx_v_table, __pyx_v_preserve_missing_labels}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 576, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_6); } else @@ -72884,13 +73806,13 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_12, __pyx_v_arr, __pyx_v_table, __pyx_v_preserve_missing_labels}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 576, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif { - __pyx_t_4 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 576, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_12) { __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12); __pyx_t_12 = NULL; @@ -72904,7 +73826,7 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_INCREF(__pyx_v_preserve_missing_labels); __Pyx_GIVEREF(__pyx_v_preserve_missing_labels); PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_10, __pyx_v_preserve_missing_labels); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 576, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -72912,7 +73834,7 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":577 + /* "fastremap.pyx":579 * arr = reshape(arr, (arr.size,)) * arr = _remap(arr, table, preserve_missing_labels) * return reshape(arr, shape, order=order) # <<<<<<<<<<<<<< @@ -72920,9 +73842,9 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 577, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 577, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); @@ -72930,10 +73852,10 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_shape); - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 577, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_order, __pyx_v_order) < 0) __PYX_ERR(0, 577, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 577, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_order, __pyx_v_order) < 0) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -72942,7 +73864,7 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_12 = 0; goto __pyx_L0; - /* "fastremap.pyx":535 + /* "fastremap.pyx":537 * return remap * * def remap(arr, table, preserve_missing_labels=False, in_place=False): # <<<<<<<<<<<<<< @@ -72966,15 +73888,15 @@ static PyObject *__pyx_pf_9fastremap_28remap(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_XDECREF(__pyx_v_min_label); __Pyx_XDECREF(__pyx_v_max_label); __Pyx_XDECREF(__pyx_v_fit_value); - __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_k); - __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_v); + __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_k); + __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_v); __Pyx_XDECREF(__pyx_v_arr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "fastremap.pyx":582 +/* "fastremap.pyx":584 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): # <<<<<<<<<<<<<< @@ -73023,23 +73945,23 @@ static PyObject *__pyx_pw_9fastremap_31_remap(PyObject *__pyx_self, PyObject *__ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 584, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 582, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 584, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -73056,7 +73978,7 @@ static PyObject *__pyx_pw_9fastremap_31_remap(PyObject *__pyx_self, PyObject *__ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 584, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -73118,7 +74040,7 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_remap", 0); __Pyx_INCREF(__pyx_v_kwargs); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -73132,7 +74054,7 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 584, __pyx_L1_error) __pyx_t_3 = ((!__pyx_t_4) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; @@ -73140,7 +74062,7 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_kwargs, Py_None); } - __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -73155,14 +74077,14 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_v____pyx_int64_t_is_signed = (!((((int64_t)-1L) > 0) != 0)); if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 582, __pyx_L1_error) + __PYX_ERR(0, 584, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 584, __pyx_L1_error) __pyx_t_2 = ((0 < __pyx_t_5) != 0); if (__pyx_t_2) { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 582, __pyx_L1_error) + __PYX_ERR(0, 584, __pyx_L1_error) } __pyx_t_1 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0); __Pyx_INCREF(__pyx_t_1); @@ -73179,18 +74101,18 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 582, __pyx_L1_error) + __PYX_ERR(0, 584, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_arr, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_arr, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 584, __pyx_L1_error) __pyx_t_3 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_3; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 582, __pyx_L1_error) + __PYX_ERR(0, 584, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -73199,12 +74121,12 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 582, __pyx_L1_error) + __PYX_ERR(0, 584, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 582, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 584, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_3); __Pyx_GIVEREF(__pyx_int_3); @@ -73215,15 +74137,15 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 582, __pyx_L1_error) + __PYX_ERR(0, 584, __pyx_L1_error) } __pyx_L6:; while (1) { @@ -73233,7 +74155,7 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -73242,14 +74164,14 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -73271,14 +74193,14 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_2 = (__pyx_v_dtype != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_itemsize = __pyx_t_5; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_kind = __pyx_t_7; __pyx_v_dtype_signed = (__pyx_v_kind == 'i'); @@ -73291,9 +74213,9 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -73305,7 +74227,7 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = __pyx_t_2; __pyx_L16_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 584, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint16_t)) == __pyx_v_itemsize) != 0); @@ -73314,9 +74236,9 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = __pyx_t_2; goto __pyx_L20_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -73328,7 +74250,7 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = __pyx_t_2; __pyx_L20_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 584, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint32_t)) == __pyx_v_itemsize) != 0); @@ -73337,9 +74259,9 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = __pyx_t_2; goto __pyx_L24_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -73351,7 +74273,7 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = __pyx_t_2; __pyx_L24_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 584, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint64_t)) == __pyx_v_itemsize) != 0); @@ -73360,9 +74282,9 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = __pyx_t_2; goto __pyx_L28_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -73374,7 +74296,7 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = __pyx_t_2; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 584, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int8_t)) == __pyx_v_itemsize) != 0); @@ -73383,9 +74305,9 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = __pyx_t_2; goto __pyx_L32_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -73397,7 +74319,7 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = __pyx_t_2; __pyx_L32_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 584, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int16_t)) == __pyx_v_itemsize) != 0); @@ -73406,9 +74328,9 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = __pyx_t_2; goto __pyx_L36_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -73420,7 +74342,7 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = __pyx_t_2; __pyx_L36_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 584, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int32_t)) == __pyx_v_itemsize) != 0); @@ -73429,9 +74351,9 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = __pyx_t_2; goto __pyx_L40_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -73443,7 +74365,7 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = __pyx_t_2; __pyx_L40_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 584, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int64_t)) == __pyx_v_itemsize) != 0); @@ -73452,9 +74374,9 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = __pyx_t_2; goto __pyx_L44_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -73466,7 +74388,7 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = __pyx_t_2; __pyx_L44_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 584, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -73477,15 +74399,15 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = __pyx_t_2; goto __pyx_L48_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); __pyx_t_3 = __pyx_t_2; __pyx_L48_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 584, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(double)) == __pyx_v_itemsize) != 0); @@ -73494,15 +74416,15 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = __pyx_t_2; goto __pyx_L51_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); __pyx_t_3 = __pyx_t_2; __pyx_L51_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 584, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -73529,7 +74451,7 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 584, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -73551,7 +74473,7 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 584, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -73573,7 +74495,7 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 584, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -73595,7 +74517,7 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 584, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -73617,7 +74539,7 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 584, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -73639,7 +74561,7 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 584, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -73661,7 +74583,7 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 584, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -73683,7 +74605,7 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 584, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -73705,7 +74627,7 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 584, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -73727,27 +74649,27 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 584, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); } } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 584, __pyx_L1_error) goto __pyx_L10_break; } __pyx_L10_break:; - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_candidates = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = 0; if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 582, __pyx_L1_error) + __PYX_ERR(0, 584, __pyx_L1_error) } - __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_1; @@ -73755,12 +74677,12 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self while (1) { __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_9, &__pyx_t_5, &__pyx_t_1, NULL, NULL, __pyx_t_10); if (unlikely(__pyx_t_11 == 0)) break; - if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_1); __pyx_t_1 = 0; __pyx_v_match_found = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { @@ -73774,10 +74696,10 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self } __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, __pyx_kp_s__2) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__2); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -73792,12 +74714,12 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self } __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_12, __pyx_kp_s__3) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__3); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_src_sig, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 584, __pyx_L1_error) __pyx_t_16 = __pyx_t_15; for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; @@ -73808,11 +74730,11 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_v_dst_type != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_2) { __pyx_v_match_found = 1; @@ -73828,35 +74750,35 @@ static PyObject *__pyx_pf_9fastremap_30_remap(CYTHON_UNUSED PyObject *__pyx_self __pyx_L96_break:; __pyx_t_2 = (__pyx_v_match_found != 0); if (__pyx_t_2) { - __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 584, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_candidates) != 0); __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 582, __pyx_L1_error) + __PYX_ERR(0, 584, __pyx_L1_error) } - __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 584, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_9 > 1) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 582, __pyx_L1_error) + __PYX_ERR(0, 584, __pyx_L1_error) } /*else*/ { __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 582, __pyx_L1_error) + __PYX_ERR(0, 584, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; @@ -73926,17 +74848,17 @@ static PyObject *__pyx_fuse_0__pyx_pw_9fastremap_391_remap(PyObject *__pyx_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_table)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 1); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 1); __PYX_ERR(0, 584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_preserve_missing_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 2); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 2); __PYX_ERR(0, 584, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_remap") < 0)) __PYX_ERR(0, 582, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_remap") < 0)) __PYX_ERR(0, 584, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -73947,18 +74869,18 @@ static PyObject *__pyx_fuse_0__pyx_pw_9fastremap_391_remap(PyObject *__pyx_self, } __pyx_v_arr = ((PyArrayObject *)values[0]); __pyx_v_table = ((PyObject*)values[1]); - __pyx_v_preserve_missing_labels = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_preserve_missing_labels == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L3_error) + __pyx_v_preserve_missing_labels = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_preserve_missing_labels == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 584, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._remap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 582, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), (&PyDict_Type), 1, "table", 1))) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 584, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), (&PyDict_Type), 1, "table", 1))) __PYX_ERR(0, 584, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_390_remap(__pyx_self, __pyx_v_arr, __pyx_v_table, __pyx_v_preserve_missing_labels); /* function exit code */ @@ -73975,7 +74897,9 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel size_t __pyx_v_i; size_t __pyx_v_size; uint8_t __pyx_v_elem; - std::unordered_map __pyx_v_tbl; + uint8_t __pyx_v_before; + uint8_t __pyx_v_after; + ska::flat_hash_map __pyx_v_tbl; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; uint8_t __pyx_v_last_elem; @@ -73988,19 +74912,20 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel PyObject *__pyx_t_2 = NULL; size_t __pyx_t_3; int __pyx_t_4; - Py_ssize_t __pyx_t_5; + int __pyx_t_5; Py_ssize_t __pyx_t_6; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - uint8_t __pyx_t_11; - uint8_t __pyx_t_12; - Py_ssize_t __pyx_t_13; + PyObject *__pyx_t_7 = NULL; + uint8_t __pyx_t_8; + size_t __pyx_t_9; + size_t __pyx_t_10; + size_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; PyObject *__pyx_t_14 = NULL; - size_t __pyx_t_15; - size_t __pyx_t_16; - size_t __pyx_t_17; + int __pyx_t_15; + uint8_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + PyObject *__pyx_t_18 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -74011,23 +74936,23 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 584, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":583 + /* "fastremap.pyx":585 * @cython.nonecheck(False) * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): * cdef NUMBER[:] arrview = arr # <<<<<<<<<<<<<< * cdef size_t i = 0 * cdef size_t size = arr.size */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 583, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 585, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":584 + /* "fastremap.pyx":586 * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): * cdef NUMBER[:] arrview = arr * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -74036,20 +74961,20 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_i = 0; - /* "fastremap.pyx":585 + /* "fastremap.pyx":587 * cdef NUMBER[:] arrview = arr * cdef size_t i = 0 * cdef size_t size = arr.size # <<<<<<<<<<<<<< * cdef NUMBER elem = 0 * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_size = __pyx_t_3; - /* "fastremap.pyx":586 + /* "fastremap.pyx":588 * cdef size_t i = 0 * cdef size_t size = arr.size * cdef NUMBER elem = 0 # <<<<<<<<<<<<<< @@ -74058,7 +74983,7 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_elem = 0; - /* "fastremap.pyx":588 + /* "fastremap.pyx":590 * cdef NUMBER elem = 0 * * if size == 0: # <<<<<<<<<<<<<< @@ -74068,19 +74993,19 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_size == 0) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":589 + /* "fastremap.pyx":591 * * if size == 0: * return arr # <<<<<<<<<<<<<< * - * cdef unordered_map[NUMBER, NUMBER] tbl + * # fast path for remapping only a single label */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_arr)); __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":588 + /* "fastremap.pyx":590 * cdef NUMBER elem = 0 * * if size == 0: # <<<<<<<<<<<<<< @@ -74089,58 +75014,237 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":593 - * cdef unordered_map[NUMBER, NUMBER] tbl + /* "fastremap.pyx":595 + * # fast path for remapping only a single label + * # e.g. for masking something out + * cdef NUMBER before = 0 # <<<<<<<<<<<<<< + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: + */ + __pyx_v_before = 0; + + /* "fastremap.pyx":596 + * # e.g. for masking something out + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 # <<<<<<<<<<<<<< + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) + */ + __pyx_v_after = 0; + + /* "fastremap.pyx":597 + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: # <<<<<<<<<<<<<< + * before = next(iter(table.keys())) + * after = table[before] + */ + __pyx_t_5 = (__pyx_v_preserve_missing_labels != 0); + if (__pyx_t_5) { + } else { + __pyx_t_4 = __pyx_t_5; + goto __pyx_L5_bool_binop_done; + } + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 597, __pyx_L1_error) + } + __pyx_t_6 = PyDict_Size(__pyx_v_table); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_5 = ((__pyx_t_6 == 1) != 0); + __pyx_t_4 = __pyx_t_5; + __pyx_L5_bool_binop_done:; + if (__pyx_t_4) { + + /* "fastremap.pyx":598 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) # <<<<<<<<<<<<<< + * after = table[before] + * if before == after: + */ + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); + __PYX_ERR(0, 598, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyDict_Keys(__pyx_v_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_8 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_before = __pyx_t_8; + + /* "fastremap.pyx":599 + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) + * after = table[before] # <<<<<<<<<<<<<< + * if before == after: + * return arr + */ + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 599, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_before); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_table, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_t_7); if (unlikely((__pyx_t_8 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_after = __pyx_t_8; + + /* "fastremap.pyx":600 + * before = next(iter(table.keys())) + * after = table[before] + * if before == after: # <<<<<<<<<<<<<< + * return arr + * for i in range(size): + */ + __pyx_t_4 = ((__pyx_v_before == __pyx_v_after) != 0); + if (__pyx_t_4) { + + /* "fastremap.pyx":601 + * after = table[before] + * if before == after: + * return arr # <<<<<<<<<<<<<< + * for i in range(size): + * if arr[i] == before: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "fastremap.pyx":600 + * before = next(iter(table.keys())) + * after = table[before] + * if before == after: # <<<<<<<<<<<<<< + * return arr + * for i in range(size): + */ + } + + /* "fastremap.pyx":602 + * if before == after: + * return arr + * for i in range(size): # <<<<<<<<<<<<<< + * if arr[i] == before: + * arr[i] = after + */ + __pyx_t_3 = __pyx_v_size; + __pyx_t_9 = __pyx_t_3; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "fastremap.pyx":603 + * return arr + * for i in range(size): + * if arr[i] == before: # <<<<<<<<<<<<<< + * arr[i] = after + * return arr + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides)) == __pyx_v_before) != 0); + if (__pyx_t_4) { + + /* "fastremap.pyx":604 + * for i in range(size): + * if arr[i] == before: + * arr[i] = after # <<<<<<<<<<<<<< + * return arr + * + */ + __pyx_t_11 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides) = __pyx_v_after; + + /* "fastremap.pyx":603 + * return arr + * for i in range(size): + * if arr[i] == before: # <<<<<<<<<<<<<< + * arr[i] = after + * return arr + */ + } + } + + /* "fastremap.pyx":605 + * if arr[i] == before: + * arr[i] = after + * return arr # <<<<<<<<<<<<<< + * + * cdef flat_hash_map[NUMBER, NUMBER] tbl + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "fastremap.pyx":597 + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: # <<<<<<<<<<<<<< + * before = next(iter(table.keys())) + * after = table[before] + */ + } + + /* "fastremap.pyx":609 + * cdef flat_hash_map[NUMBER, NUMBER] tbl * * for k, v in table.items(): # <<<<<<<<<<<<<< * tbl[k] = v * */ - __pyx_t_5 = 0; + __pyx_t_6 = 0; if (unlikely(__pyx_v_table == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 593, __pyx_L1_error) + __PYX_ERR(0, 609, __pyx_L1_error) } - __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_table, 1, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_2); - __pyx_t_2 = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_table, 1, __pyx_n_s_items, (&__pyx_t_12), (&__pyx_t_13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; while (1) { - __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, &__pyx_t_8, &__pyx_t_9, NULL, __pyx_t_7); - if (unlikely(__pyx_t_10 == 0)) break; - if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_8); - __pyx_t_8 = 0; - __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_9); - __pyx_t_9 = 0; + __pyx_t_15 = __Pyx_dict_iter_next(__pyx_t_7, __pyx_t_12, &__pyx_t_6, &__pyx_t_2, &__pyx_t_14, NULL, __pyx_t_13); + if (unlikely(__pyx_t_15 == 0)) break; + if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_14); + __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_14); + __pyx_t_14 = 0; - /* "fastremap.pyx":594 + /* "fastremap.pyx":610 * * for k, v in table.items(): * tbl[k] = v # <<<<<<<<<<<<<< * * cdef NUMBER last_elem = arrview[0] */ - __pyx_t_11 = __Pyx_PyInt_As_uint8_t(__pyx_v_v); if (unlikely((__pyx_t_11 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyInt_As_uint8_t(__pyx_v_k); if (unlikely((__pyx_t_12 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L1_error) - (__pyx_v_tbl[__pyx_t_12]) = __pyx_t_11; + __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_v_v); if (unlikely((__pyx_t_8 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyInt_As_uint8_t(__pyx_v_k); if (unlikely((__pyx_t_16 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) + (__pyx_v_tbl[__pyx_t_16]) = __pyx_t_8; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "fastremap.pyx":596 + /* "fastremap.pyx":612 * tbl[k] = v * * cdef NUMBER last_elem = arrview[0] # <<<<<<<<<<<<<< * cdef NUMBER last_remap_id = 0 * */ - __pyx_t_13 = 0; - __pyx_v_last_elem = (*((uint8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_17 = 0; + __pyx_v_last_elem = (*((uint8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":597 + /* "fastremap.pyx":613 * * cdef NUMBER last_elem = arrview[0] * cdef NUMBER last_remap_id = 0 # <<<<<<<<<<<<<< @@ -74149,7 +75253,7 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_remap_id = 0; - /* "fastremap.pyx":599 + /* "fastremap.pyx":615 * cdef NUMBER last_remap_id = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -74164,7 +75268,7 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel #endif /*try:*/ { - /* "fastremap.pyx":600 + /* "fastremap.pyx":616 * * with nogil: * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -74174,7 +75278,7 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_last_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":601 + /* "fastremap.pyx":617 * with nogil: * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: # <<<<<<<<<<<<<< @@ -74184,7 +75288,7 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((!(__pyx_v_preserve_missing_labels != 0)) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":602 + /* "fastremap.pyx":618 * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: * raise KeyError("{} was not in the remap table.".format(last_elem)) # <<<<<<<<<<<<<< @@ -74196,44 +75300,44 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyInt_From_uint8_t(__pyx_v_last_elem); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_14); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_last_elem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) { + __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_14); + if (likely(__pyx_t_18)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); + __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); + __Pyx_DECREF_SET(__pyx_t_14, function); } } - __pyx_t_2 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = (__pyx_t_18) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_18, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_9, 0, 0, 0); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(0, 602, __pyx_L12_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_14, 0, 0, 0); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __PYX_ERR(0, 618, __pyx_L19_error) } /*finally:*/ { - __pyx_L12_error: { + __pyx_L19_error: { #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - goto __pyx_L7_error; + goto __pyx_L14_error; } } } - /* "fastremap.pyx":601 + /* "fastremap.pyx":617 * with nogil: * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: # <<<<<<<<<<<<<< @@ -74242,7 +75346,7 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":604 + /* "fastremap.pyx":620 * raise KeyError("{} was not in the remap table.".format(last_elem)) * else: * last_remap_id = last_elem # <<<<<<<<<<<<<< @@ -74253,17 +75357,17 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_v_last_remap_id = __pyx_v_last_elem; } - /* "fastremap.pyx":600 + /* "fastremap.pyx":616 * * with nogil: * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< * if not preserve_missing_labels: * raise KeyError("{} was not in the remap table.".format(last_elem)) */ - goto __pyx_L9; + goto __pyx_L16; } - /* "fastremap.pyx":606 + /* "fastremap.pyx":622 * last_remap_id = last_elem * else: * arrview[0] = tbl[last_elem] # <<<<<<<<<<<<<< @@ -74271,22 +75375,22 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel * */ /*else*/ { - __pyx_t_13 = 0; - *((uint8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_last_elem]); + __pyx_t_17 = 0; + *((uint8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_last_elem]); - /* "fastremap.pyx":607 + /* "fastremap.pyx":623 * else: * arrview[0] = tbl[last_elem] * last_remap_id = arrview[0] # <<<<<<<<<<<<<< * * for i in range(1, size): */ - __pyx_t_13 = 0; - __pyx_v_last_remap_id = (*((uint8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_17 = 0; + __pyx_v_last_remap_id = (*((uint8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); } - __pyx_L9:; + __pyx_L16:; - /* "fastremap.pyx":609 + /* "fastremap.pyx":625 * last_remap_id = arrview[0] * * for i in range(1, size): # <<<<<<<<<<<<<< @@ -74294,21 +75398,21 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel * */ __pyx_t_3 = __pyx_v_size; - __pyx_t_15 = __pyx_t_3; - for (__pyx_t_16 = 1; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { - __pyx_v_i = __pyx_t_16; + __pyx_t_9 = __pyx_t_3; + for (__pyx_t_10 = 1; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":610 + /* "fastremap.pyx":626 * * for i in range(1, size): * elem = arrview[i] # <<<<<<<<<<<<<< * * if elem == last_elem: */ - __pyx_t_17 = __pyx_v_i; - __pyx_v_elem = (*((uint8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_11 = __pyx_v_i; + __pyx_v_elem = (*((uint8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":612 + /* "fastremap.pyx":628 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -74318,26 +75422,26 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_elem == __pyx_v_last_elem) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":613 + /* "fastremap.pyx":629 * * if elem == last_elem: * arrview[i] = last_remap_id # <<<<<<<<<<<<<< * continue * */ - __pyx_t_17 = __pyx_v_i; - *((uint8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; + __pyx_t_11 = __pyx_v_i; + *((uint8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; - /* "fastremap.pyx":614 + /* "fastremap.pyx":630 * if elem == last_elem: * arrview[i] = last_remap_id * continue # <<<<<<<<<<<<<< * * if tbl.find(elem) == tbl.end(): */ - goto __pyx_L14_continue; + goto __pyx_L21_continue; - /* "fastremap.pyx":612 + /* "fastremap.pyx":628 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -74346,7 +75450,7 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":616 + /* "fastremap.pyx":632 * continue * * if tbl.find(elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -74356,7 +75460,7 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":617 + /* "fastremap.pyx":633 * * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: # <<<<<<<<<<<<<< @@ -74366,7 +75470,7 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = (__pyx_v_preserve_missing_labels != 0); if (__pyx_t_4) { - /* "fastremap.pyx":618 + /* "fastremap.pyx":634 * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: * last_elem = elem # <<<<<<<<<<<<<< @@ -74375,7 +75479,7 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":619 + /* "fastremap.pyx":635 * if preserve_missing_labels: * last_elem = elem * last_remap_id = elem # <<<<<<<<<<<<<< @@ -74384,16 +75488,16 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_remap_id = __pyx_v_elem; - /* "fastremap.pyx":620 + /* "fastremap.pyx":636 * last_elem = elem * last_remap_id = elem * continue # <<<<<<<<<<<<<< * else: * raise KeyError("{} was not in the remap table.".format(elem)) */ - goto __pyx_L14_continue; + goto __pyx_L21_continue; - /* "fastremap.pyx":617 + /* "fastremap.pyx":633 * * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: # <<<<<<<<<<<<<< @@ -74402,7 +75506,7 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":622 + /* "fastremap.pyx":638 * continue * else: * raise KeyError("{} was not in the remap table.".format(elem)) # <<<<<<<<<<<<<< @@ -74415,45 +75519,45 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L22_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_elem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyInt_From_uint8_t(__pyx_v_elem); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_14); + __pyx_t_18 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_18)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); + __Pyx_DECREF_SET(__pyx_t_7, function); } } - __pyx_t_9 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __pyx_t_14 = (__pyx_t_18) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_18, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 622, __pyx_L22_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(0, 638, __pyx_L29_error) } /*finally:*/ { - __pyx_L22_error: { + __pyx_L29_error: { #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - goto __pyx_L7_error; + goto __pyx_L14_error; } } } } - /* "fastremap.pyx":616 + /* "fastremap.pyx":632 * continue * * if tbl.find(elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -74462,7 +75566,7 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":624 + /* "fastremap.pyx":640 * raise KeyError("{} was not in the remap table.".format(elem)) * else: * arrview[i] = tbl[elem] # <<<<<<<<<<<<<< @@ -74470,11 +75574,11 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel * last_elem = elem */ /*else*/ { - __pyx_t_17 = __pyx_v_i; - *((uint8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_elem]); + __pyx_t_11 = __pyx_v_i; + *((uint8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_elem]); } - /* "fastremap.pyx":626 + /* "fastremap.pyx":642 * arrview[i] = tbl[elem] * * last_elem = elem # <<<<<<<<<<<<<< @@ -74483,20 +75587,20 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":627 + /* "fastremap.pyx":643 * * last_elem = elem * last_remap_id = arrview[i] # <<<<<<<<<<<<<< * * return arr */ - __pyx_t_17 = __pyx_v_i; - __pyx_v_last_remap_id = (*((uint8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); - __pyx_L14_continue:; + __pyx_t_11 = __pyx_v_i; + __pyx_v_last_remap_id = (*((uint8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ))); + __pyx_L21_continue:; } } - /* "fastremap.pyx":599 + /* "fastremap.pyx":615 * cdef NUMBER last_remap_id = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -74509,20 +75613,20 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif - goto __pyx_L8; + goto __pyx_L15; } - __pyx_L7_error: { + __pyx_L14_error: { #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L1_error; } - __pyx_L8:; + __pyx_L15:; } } - /* "fastremap.pyx":629 + /* "fastremap.pyx":645 * last_remap_id = arrview[i] * * return arr # <<<<<<<<<<<<<< @@ -74534,7 +75638,7 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":582 + /* "fastremap.pyx":584 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): # <<<<<<<<<<<<<< @@ -74546,9 +75650,9 @@ static PyObject *__pyx_pf_9fastremap_390_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_L1_error:; __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_18); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -74607,17 +75711,17 @@ static PyObject *__pyx_fuse_1__pyx_pw_9fastremap_393_remap(PyObject *__pyx_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_table)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 1); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 1); __PYX_ERR(0, 584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_preserve_missing_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 2); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 2); __PYX_ERR(0, 584, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_remap") < 0)) __PYX_ERR(0, 582, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_remap") < 0)) __PYX_ERR(0, 584, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -74628,18 +75732,18 @@ static PyObject *__pyx_fuse_1__pyx_pw_9fastremap_393_remap(PyObject *__pyx_self, } __pyx_v_arr = ((PyArrayObject *)values[0]); __pyx_v_table = ((PyObject*)values[1]); - __pyx_v_preserve_missing_labels = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_preserve_missing_labels == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L3_error) + __pyx_v_preserve_missing_labels = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_preserve_missing_labels == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 584, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._remap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 582, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), (&PyDict_Type), 1, "table", 1))) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 584, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), (&PyDict_Type), 1, "table", 1))) __PYX_ERR(0, 584, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_392_remap(__pyx_self, __pyx_v_arr, __pyx_v_table, __pyx_v_preserve_missing_labels); /* function exit code */ @@ -74656,7 +75760,9 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel size_t __pyx_v_i; size_t __pyx_v_size; uint16_t __pyx_v_elem; - std::unordered_map __pyx_v_tbl; + uint16_t __pyx_v_before; + uint16_t __pyx_v_after; + ska::flat_hash_map __pyx_v_tbl; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; uint16_t __pyx_v_last_elem; @@ -74669,19 +75775,20 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel PyObject *__pyx_t_2 = NULL; size_t __pyx_t_3; int __pyx_t_4; - Py_ssize_t __pyx_t_5; + int __pyx_t_5; Py_ssize_t __pyx_t_6; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - uint16_t __pyx_t_11; - uint16_t __pyx_t_12; - Py_ssize_t __pyx_t_13; + PyObject *__pyx_t_7 = NULL; + uint16_t __pyx_t_8; + size_t __pyx_t_9; + size_t __pyx_t_10; + size_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; PyObject *__pyx_t_14 = NULL; - size_t __pyx_t_15; - size_t __pyx_t_16; - size_t __pyx_t_17; + int __pyx_t_15; + uint16_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + PyObject *__pyx_t_18 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -74692,23 +75799,23 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 584, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":583 + /* "fastremap.pyx":585 * @cython.nonecheck(False) * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): * cdef NUMBER[:] arrview = arr # <<<<<<<<<<<<<< * cdef size_t i = 0 * cdef size_t size = arr.size */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 583, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 585, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":584 + /* "fastremap.pyx":586 * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): * cdef NUMBER[:] arrview = arr * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -74717,20 +75824,20 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_i = 0; - /* "fastremap.pyx":585 + /* "fastremap.pyx":587 * cdef NUMBER[:] arrview = arr * cdef size_t i = 0 * cdef size_t size = arr.size # <<<<<<<<<<<<<< * cdef NUMBER elem = 0 * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_size = __pyx_t_3; - /* "fastremap.pyx":586 + /* "fastremap.pyx":588 * cdef size_t i = 0 * cdef size_t size = arr.size * cdef NUMBER elem = 0 # <<<<<<<<<<<<<< @@ -74739,7 +75846,7 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_elem = 0; - /* "fastremap.pyx":588 + /* "fastremap.pyx":590 * cdef NUMBER elem = 0 * * if size == 0: # <<<<<<<<<<<<<< @@ -74749,19 +75856,19 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_size == 0) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":589 + /* "fastremap.pyx":591 * * if size == 0: * return arr # <<<<<<<<<<<<<< * - * cdef unordered_map[NUMBER, NUMBER] tbl + * # fast path for remapping only a single label */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_arr)); __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":588 + /* "fastremap.pyx":590 * cdef NUMBER elem = 0 * * if size == 0: # <<<<<<<<<<<<<< @@ -74770,58 +75877,237 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":593 - * cdef unordered_map[NUMBER, NUMBER] tbl + /* "fastremap.pyx":595 + * # fast path for remapping only a single label + * # e.g. for masking something out + * cdef NUMBER before = 0 # <<<<<<<<<<<<<< + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: + */ + __pyx_v_before = 0; + + /* "fastremap.pyx":596 + * # e.g. for masking something out + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 # <<<<<<<<<<<<<< + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) + */ + __pyx_v_after = 0; + + /* "fastremap.pyx":597 + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: # <<<<<<<<<<<<<< + * before = next(iter(table.keys())) + * after = table[before] + */ + __pyx_t_5 = (__pyx_v_preserve_missing_labels != 0); + if (__pyx_t_5) { + } else { + __pyx_t_4 = __pyx_t_5; + goto __pyx_L5_bool_binop_done; + } + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 597, __pyx_L1_error) + } + __pyx_t_6 = PyDict_Size(__pyx_v_table); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_5 = ((__pyx_t_6 == 1) != 0); + __pyx_t_4 = __pyx_t_5; + __pyx_L5_bool_binop_done:; + if (__pyx_t_4) { + + /* "fastremap.pyx":598 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) # <<<<<<<<<<<<<< + * after = table[before] + * if before == after: + */ + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); + __PYX_ERR(0, 598, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyDict_Keys(__pyx_v_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_8 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_before = __pyx_t_8; + + /* "fastremap.pyx":599 + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) + * after = table[before] # <<<<<<<<<<<<<< + * if before == after: + * return arr + */ + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 599, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyInt_From_uint16_t(__pyx_v_before); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_table, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = __Pyx_PyInt_As_uint16_t(__pyx_t_7); if (unlikely((__pyx_t_8 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_after = __pyx_t_8; + + /* "fastremap.pyx":600 + * before = next(iter(table.keys())) + * after = table[before] + * if before == after: # <<<<<<<<<<<<<< + * return arr + * for i in range(size): + */ + __pyx_t_4 = ((__pyx_v_before == __pyx_v_after) != 0); + if (__pyx_t_4) { + + /* "fastremap.pyx":601 + * after = table[before] + * if before == after: + * return arr # <<<<<<<<<<<<<< + * for i in range(size): + * if arr[i] == before: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "fastremap.pyx":600 + * before = next(iter(table.keys())) + * after = table[before] + * if before == after: # <<<<<<<<<<<<<< + * return arr + * for i in range(size): + */ + } + + /* "fastremap.pyx":602 + * if before == after: + * return arr + * for i in range(size): # <<<<<<<<<<<<<< + * if arr[i] == before: + * arr[i] = after + */ + __pyx_t_3 = __pyx_v_size; + __pyx_t_9 = __pyx_t_3; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "fastremap.pyx":603 + * return arr + * for i in range(size): + * if arr[i] == before: # <<<<<<<<<<<<<< + * arr[i] = after + * return arr + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides)) == __pyx_v_before) != 0); + if (__pyx_t_4) { + + /* "fastremap.pyx":604 + * for i in range(size): + * if arr[i] == before: + * arr[i] = after # <<<<<<<<<<<<<< + * return arr + * + */ + __pyx_t_11 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides) = __pyx_v_after; + + /* "fastremap.pyx":603 + * return arr + * for i in range(size): + * if arr[i] == before: # <<<<<<<<<<<<<< + * arr[i] = after + * return arr + */ + } + } + + /* "fastremap.pyx":605 + * if arr[i] == before: + * arr[i] = after + * return arr # <<<<<<<<<<<<<< + * + * cdef flat_hash_map[NUMBER, NUMBER] tbl + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "fastremap.pyx":597 + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: # <<<<<<<<<<<<<< + * before = next(iter(table.keys())) + * after = table[before] + */ + } + + /* "fastremap.pyx":609 + * cdef flat_hash_map[NUMBER, NUMBER] tbl * * for k, v in table.items(): # <<<<<<<<<<<<<< * tbl[k] = v * */ - __pyx_t_5 = 0; + __pyx_t_6 = 0; if (unlikely(__pyx_v_table == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 593, __pyx_L1_error) + __PYX_ERR(0, 609, __pyx_L1_error) } - __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_table, 1, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_2); - __pyx_t_2 = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_table, 1, __pyx_n_s_items, (&__pyx_t_12), (&__pyx_t_13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; while (1) { - __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, &__pyx_t_8, &__pyx_t_9, NULL, __pyx_t_7); - if (unlikely(__pyx_t_10 == 0)) break; - if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_8); - __pyx_t_8 = 0; - __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_9); - __pyx_t_9 = 0; + __pyx_t_15 = __Pyx_dict_iter_next(__pyx_t_7, __pyx_t_12, &__pyx_t_6, &__pyx_t_2, &__pyx_t_14, NULL, __pyx_t_13); + if (unlikely(__pyx_t_15 == 0)) break; + if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_14); + __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_14); + __pyx_t_14 = 0; - /* "fastremap.pyx":594 + /* "fastremap.pyx":610 * * for k, v in table.items(): * tbl[k] = v # <<<<<<<<<<<<<< * * cdef NUMBER last_elem = arrview[0] */ - __pyx_t_11 = __Pyx_PyInt_As_uint16_t(__pyx_v_v); if (unlikely((__pyx_t_11 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyInt_As_uint16_t(__pyx_v_k); if (unlikely((__pyx_t_12 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L1_error) - (__pyx_v_tbl[__pyx_t_12]) = __pyx_t_11; + __pyx_t_8 = __Pyx_PyInt_As_uint16_t(__pyx_v_v); if (unlikely((__pyx_t_8 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyInt_As_uint16_t(__pyx_v_k); if (unlikely((__pyx_t_16 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) + (__pyx_v_tbl[__pyx_t_16]) = __pyx_t_8; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "fastremap.pyx":596 + /* "fastremap.pyx":612 * tbl[k] = v * * cdef NUMBER last_elem = arrview[0] # <<<<<<<<<<<<<< * cdef NUMBER last_remap_id = 0 * */ - __pyx_t_13 = 0; - __pyx_v_last_elem = (*((uint16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_17 = 0; + __pyx_v_last_elem = (*((uint16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":597 + /* "fastremap.pyx":613 * * cdef NUMBER last_elem = arrview[0] * cdef NUMBER last_remap_id = 0 # <<<<<<<<<<<<<< @@ -74830,7 +76116,7 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_remap_id = 0; - /* "fastremap.pyx":599 + /* "fastremap.pyx":615 * cdef NUMBER last_remap_id = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -74845,7 +76131,7 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel #endif /*try:*/ { - /* "fastremap.pyx":600 + /* "fastremap.pyx":616 * * with nogil: * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -74855,7 +76141,7 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_last_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":601 + /* "fastremap.pyx":617 * with nogil: * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: # <<<<<<<<<<<<<< @@ -74865,7 +76151,7 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((!(__pyx_v_preserve_missing_labels != 0)) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":602 + /* "fastremap.pyx":618 * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: * raise KeyError("{} was not in the remap table.".format(last_elem)) # <<<<<<<<<<<<<< @@ -74877,44 +76163,44 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyInt_From_uint16_t(__pyx_v_last_elem); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_14); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_2 = __Pyx_PyInt_From_uint16_t(__pyx_v_last_elem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) { + __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_14); + if (likely(__pyx_t_18)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); + __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); + __Pyx_DECREF_SET(__pyx_t_14, function); } } - __pyx_t_2 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = (__pyx_t_18) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_18, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_9, 0, 0, 0); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(0, 602, __pyx_L12_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_14, 0, 0, 0); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __PYX_ERR(0, 618, __pyx_L19_error) } /*finally:*/ { - __pyx_L12_error: { + __pyx_L19_error: { #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - goto __pyx_L7_error; + goto __pyx_L14_error; } } } - /* "fastremap.pyx":601 + /* "fastremap.pyx":617 * with nogil: * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: # <<<<<<<<<<<<<< @@ -74923,7 +76209,7 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":604 + /* "fastremap.pyx":620 * raise KeyError("{} was not in the remap table.".format(last_elem)) * else: * last_remap_id = last_elem # <<<<<<<<<<<<<< @@ -74934,17 +76220,17 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_v_last_remap_id = __pyx_v_last_elem; } - /* "fastremap.pyx":600 + /* "fastremap.pyx":616 * * with nogil: * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< * if not preserve_missing_labels: * raise KeyError("{} was not in the remap table.".format(last_elem)) */ - goto __pyx_L9; + goto __pyx_L16; } - /* "fastremap.pyx":606 + /* "fastremap.pyx":622 * last_remap_id = last_elem * else: * arrview[0] = tbl[last_elem] # <<<<<<<<<<<<<< @@ -74952,22 +76238,22 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel * */ /*else*/ { - __pyx_t_13 = 0; - *((uint16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_last_elem]); + __pyx_t_17 = 0; + *((uint16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_last_elem]); - /* "fastremap.pyx":607 + /* "fastremap.pyx":623 * else: * arrview[0] = tbl[last_elem] * last_remap_id = arrview[0] # <<<<<<<<<<<<<< * * for i in range(1, size): */ - __pyx_t_13 = 0; - __pyx_v_last_remap_id = (*((uint16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_17 = 0; + __pyx_v_last_remap_id = (*((uint16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); } - __pyx_L9:; + __pyx_L16:; - /* "fastremap.pyx":609 + /* "fastremap.pyx":625 * last_remap_id = arrview[0] * * for i in range(1, size): # <<<<<<<<<<<<<< @@ -74975,21 +76261,21 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel * */ __pyx_t_3 = __pyx_v_size; - __pyx_t_15 = __pyx_t_3; - for (__pyx_t_16 = 1; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { - __pyx_v_i = __pyx_t_16; + __pyx_t_9 = __pyx_t_3; + for (__pyx_t_10 = 1; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":610 + /* "fastremap.pyx":626 * * for i in range(1, size): * elem = arrview[i] # <<<<<<<<<<<<<< * * if elem == last_elem: */ - __pyx_t_17 = __pyx_v_i; - __pyx_v_elem = (*((uint16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_11 = __pyx_v_i; + __pyx_v_elem = (*((uint16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":612 + /* "fastremap.pyx":628 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -74999,26 +76285,26 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_elem == __pyx_v_last_elem) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":613 + /* "fastremap.pyx":629 * * if elem == last_elem: * arrview[i] = last_remap_id # <<<<<<<<<<<<<< * continue * */ - __pyx_t_17 = __pyx_v_i; - *((uint16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; + __pyx_t_11 = __pyx_v_i; + *((uint16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; - /* "fastremap.pyx":614 + /* "fastremap.pyx":630 * if elem == last_elem: * arrview[i] = last_remap_id * continue # <<<<<<<<<<<<<< * * if tbl.find(elem) == tbl.end(): */ - goto __pyx_L14_continue; + goto __pyx_L21_continue; - /* "fastremap.pyx":612 + /* "fastremap.pyx":628 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -75027,7 +76313,7 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":616 + /* "fastremap.pyx":632 * continue * * if tbl.find(elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -75037,7 +76323,7 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":617 + /* "fastremap.pyx":633 * * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: # <<<<<<<<<<<<<< @@ -75047,7 +76333,7 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = (__pyx_v_preserve_missing_labels != 0); if (__pyx_t_4) { - /* "fastremap.pyx":618 + /* "fastremap.pyx":634 * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: * last_elem = elem # <<<<<<<<<<<<<< @@ -75056,7 +76342,7 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":619 + /* "fastremap.pyx":635 * if preserve_missing_labels: * last_elem = elem * last_remap_id = elem # <<<<<<<<<<<<<< @@ -75065,16 +76351,16 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_remap_id = __pyx_v_elem; - /* "fastremap.pyx":620 + /* "fastremap.pyx":636 * last_elem = elem * last_remap_id = elem * continue # <<<<<<<<<<<<<< * else: * raise KeyError("{} was not in the remap table.".format(elem)) */ - goto __pyx_L14_continue; + goto __pyx_L21_continue; - /* "fastremap.pyx":617 + /* "fastremap.pyx":633 * * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: # <<<<<<<<<<<<<< @@ -75083,7 +76369,7 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":622 + /* "fastremap.pyx":638 * continue * else: * raise KeyError("{} was not in the remap table.".format(elem)) # <<<<<<<<<<<<<< @@ -75096,45 +76382,45 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L22_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PyInt_From_uint16_t(__pyx_v_elem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyInt_From_uint16_t(__pyx_v_elem); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_14); + __pyx_t_18 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_18)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); + __Pyx_DECREF_SET(__pyx_t_7, function); } } - __pyx_t_9 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __pyx_t_14 = (__pyx_t_18) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_18, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 622, __pyx_L22_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(0, 638, __pyx_L29_error) } /*finally:*/ { - __pyx_L22_error: { + __pyx_L29_error: { #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - goto __pyx_L7_error; + goto __pyx_L14_error; } } } } - /* "fastremap.pyx":616 + /* "fastremap.pyx":632 * continue * * if tbl.find(elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -75143,7 +76429,7 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":624 + /* "fastremap.pyx":640 * raise KeyError("{} was not in the remap table.".format(elem)) * else: * arrview[i] = tbl[elem] # <<<<<<<<<<<<<< @@ -75151,11 +76437,11 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel * last_elem = elem */ /*else*/ { - __pyx_t_17 = __pyx_v_i; - *((uint16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_elem]); + __pyx_t_11 = __pyx_v_i; + *((uint16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_elem]); } - /* "fastremap.pyx":626 + /* "fastremap.pyx":642 * arrview[i] = tbl[elem] * * last_elem = elem # <<<<<<<<<<<<<< @@ -75164,20 +76450,20 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":627 + /* "fastremap.pyx":643 * * last_elem = elem * last_remap_id = arrview[i] # <<<<<<<<<<<<<< * * return arr */ - __pyx_t_17 = __pyx_v_i; - __pyx_v_last_remap_id = (*((uint16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); - __pyx_L14_continue:; + __pyx_t_11 = __pyx_v_i; + __pyx_v_last_remap_id = (*((uint16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ))); + __pyx_L21_continue:; } } - /* "fastremap.pyx":599 + /* "fastremap.pyx":615 * cdef NUMBER last_remap_id = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -75190,20 +76476,20 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif - goto __pyx_L8; + goto __pyx_L15; } - __pyx_L7_error: { + __pyx_L14_error: { #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L1_error; } - __pyx_L8:; + __pyx_L15:; } } - /* "fastremap.pyx":629 + /* "fastremap.pyx":645 * last_remap_id = arrview[i] * * return arr # <<<<<<<<<<<<<< @@ -75215,7 +76501,7 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":582 + /* "fastremap.pyx":584 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): # <<<<<<<<<<<<<< @@ -75227,9 +76513,9 @@ static PyObject *__pyx_pf_9fastremap_392_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_L1_error:; __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_18); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -75288,17 +76574,17 @@ static PyObject *__pyx_fuse_2__pyx_pw_9fastremap_395_remap(PyObject *__pyx_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_table)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 1); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 1); __PYX_ERR(0, 584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_preserve_missing_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 2); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 2); __PYX_ERR(0, 584, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_remap") < 0)) __PYX_ERR(0, 582, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_remap") < 0)) __PYX_ERR(0, 584, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -75309,18 +76595,18 @@ static PyObject *__pyx_fuse_2__pyx_pw_9fastremap_395_remap(PyObject *__pyx_self, } __pyx_v_arr = ((PyArrayObject *)values[0]); __pyx_v_table = ((PyObject*)values[1]); - __pyx_v_preserve_missing_labels = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_preserve_missing_labels == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L3_error) + __pyx_v_preserve_missing_labels = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_preserve_missing_labels == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 584, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._remap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 582, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), (&PyDict_Type), 1, "table", 1))) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 584, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), (&PyDict_Type), 1, "table", 1))) __PYX_ERR(0, 584, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_394_remap(__pyx_self, __pyx_v_arr, __pyx_v_table, __pyx_v_preserve_missing_labels); /* function exit code */ @@ -75337,7 +76623,9 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel size_t __pyx_v_i; size_t __pyx_v_size; uint32_t __pyx_v_elem; - std::unordered_map __pyx_v_tbl; + uint32_t __pyx_v_before; + uint32_t __pyx_v_after; + ska::flat_hash_map __pyx_v_tbl; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; uint32_t __pyx_v_last_elem; @@ -75350,19 +76638,20 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel PyObject *__pyx_t_2 = NULL; size_t __pyx_t_3; int __pyx_t_4; - Py_ssize_t __pyx_t_5; + int __pyx_t_5; Py_ssize_t __pyx_t_6; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - uint32_t __pyx_t_11; - uint32_t __pyx_t_12; - Py_ssize_t __pyx_t_13; + PyObject *__pyx_t_7 = NULL; + uint32_t __pyx_t_8; + size_t __pyx_t_9; + size_t __pyx_t_10; + size_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; PyObject *__pyx_t_14 = NULL; - size_t __pyx_t_15; - size_t __pyx_t_16; - size_t __pyx_t_17; + int __pyx_t_15; + uint32_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + PyObject *__pyx_t_18 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -75373,23 +76662,23 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 584, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":583 + /* "fastremap.pyx":585 * @cython.nonecheck(False) * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): * cdef NUMBER[:] arrview = arr # <<<<<<<<<<<<<< * cdef size_t i = 0 * cdef size_t size = arr.size */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 583, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 585, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":584 + /* "fastremap.pyx":586 * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): * cdef NUMBER[:] arrview = arr * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -75398,20 +76687,20 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_i = 0; - /* "fastremap.pyx":585 + /* "fastremap.pyx":587 * cdef NUMBER[:] arrview = arr * cdef size_t i = 0 * cdef size_t size = arr.size # <<<<<<<<<<<<<< * cdef NUMBER elem = 0 * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_size = __pyx_t_3; - /* "fastremap.pyx":586 + /* "fastremap.pyx":588 * cdef size_t i = 0 * cdef size_t size = arr.size * cdef NUMBER elem = 0 # <<<<<<<<<<<<<< @@ -75420,7 +76709,7 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_elem = 0; - /* "fastremap.pyx":588 + /* "fastremap.pyx":590 * cdef NUMBER elem = 0 * * if size == 0: # <<<<<<<<<<<<<< @@ -75430,19 +76719,19 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_size == 0) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":589 + /* "fastremap.pyx":591 * * if size == 0: * return arr # <<<<<<<<<<<<<< * - * cdef unordered_map[NUMBER, NUMBER] tbl + * # fast path for remapping only a single label */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_arr)); __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":588 + /* "fastremap.pyx":590 * cdef NUMBER elem = 0 * * if size == 0: # <<<<<<<<<<<<<< @@ -75451,58 +76740,237 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":593 - * cdef unordered_map[NUMBER, NUMBER] tbl + /* "fastremap.pyx":595 + * # fast path for remapping only a single label + * # e.g. for masking something out + * cdef NUMBER before = 0 # <<<<<<<<<<<<<< + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: + */ + __pyx_v_before = 0; + + /* "fastremap.pyx":596 + * # e.g. for masking something out + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 # <<<<<<<<<<<<<< + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) + */ + __pyx_v_after = 0; + + /* "fastremap.pyx":597 + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: # <<<<<<<<<<<<<< + * before = next(iter(table.keys())) + * after = table[before] + */ + __pyx_t_5 = (__pyx_v_preserve_missing_labels != 0); + if (__pyx_t_5) { + } else { + __pyx_t_4 = __pyx_t_5; + goto __pyx_L5_bool_binop_done; + } + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 597, __pyx_L1_error) + } + __pyx_t_6 = PyDict_Size(__pyx_v_table); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_5 = ((__pyx_t_6 == 1) != 0); + __pyx_t_4 = __pyx_t_5; + __pyx_L5_bool_binop_done:; + if (__pyx_t_4) { + + /* "fastremap.pyx":598 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) # <<<<<<<<<<<<<< + * after = table[before] + * if before == after: + */ + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); + __PYX_ERR(0, 598, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyDict_Keys(__pyx_v_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_8 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_before = __pyx_t_8; + + /* "fastremap.pyx":599 + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) + * after = table[before] # <<<<<<<<<<<<<< + * if before == after: + * return arr + */ + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 599, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_before); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_table, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = __Pyx_PyInt_As_uint32_t(__pyx_t_7); if (unlikely((__pyx_t_8 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_after = __pyx_t_8; + + /* "fastremap.pyx":600 + * before = next(iter(table.keys())) + * after = table[before] + * if before == after: # <<<<<<<<<<<<<< + * return arr + * for i in range(size): + */ + __pyx_t_4 = ((__pyx_v_before == __pyx_v_after) != 0); + if (__pyx_t_4) { + + /* "fastremap.pyx":601 + * after = table[before] + * if before == after: + * return arr # <<<<<<<<<<<<<< + * for i in range(size): + * if arr[i] == before: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "fastremap.pyx":600 + * before = next(iter(table.keys())) + * after = table[before] + * if before == after: # <<<<<<<<<<<<<< + * return arr + * for i in range(size): + */ + } + + /* "fastremap.pyx":602 + * if before == after: + * return arr + * for i in range(size): # <<<<<<<<<<<<<< + * if arr[i] == before: + * arr[i] = after + */ + __pyx_t_3 = __pyx_v_size; + __pyx_t_9 = __pyx_t_3; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "fastremap.pyx":603 + * return arr + * for i in range(size): + * if arr[i] == before: # <<<<<<<<<<<<<< + * arr[i] = after + * return arr + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides)) == __pyx_v_before) != 0); + if (__pyx_t_4) { + + /* "fastremap.pyx":604 + * for i in range(size): + * if arr[i] == before: + * arr[i] = after # <<<<<<<<<<<<<< + * return arr + * + */ + __pyx_t_11 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides) = __pyx_v_after; + + /* "fastremap.pyx":603 + * return arr + * for i in range(size): + * if arr[i] == before: # <<<<<<<<<<<<<< + * arr[i] = after + * return arr + */ + } + } + + /* "fastremap.pyx":605 + * if arr[i] == before: + * arr[i] = after + * return arr # <<<<<<<<<<<<<< + * + * cdef flat_hash_map[NUMBER, NUMBER] tbl + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "fastremap.pyx":597 + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: # <<<<<<<<<<<<<< + * before = next(iter(table.keys())) + * after = table[before] + */ + } + + /* "fastremap.pyx":609 + * cdef flat_hash_map[NUMBER, NUMBER] tbl * * for k, v in table.items(): # <<<<<<<<<<<<<< * tbl[k] = v * */ - __pyx_t_5 = 0; + __pyx_t_6 = 0; if (unlikely(__pyx_v_table == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 593, __pyx_L1_error) + __PYX_ERR(0, 609, __pyx_L1_error) } - __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_table, 1, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_2); - __pyx_t_2 = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_table, 1, __pyx_n_s_items, (&__pyx_t_12), (&__pyx_t_13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; while (1) { - __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, &__pyx_t_8, &__pyx_t_9, NULL, __pyx_t_7); - if (unlikely(__pyx_t_10 == 0)) break; - if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_8); - __pyx_t_8 = 0; - __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_9); - __pyx_t_9 = 0; + __pyx_t_15 = __Pyx_dict_iter_next(__pyx_t_7, __pyx_t_12, &__pyx_t_6, &__pyx_t_2, &__pyx_t_14, NULL, __pyx_t_13); + if (unlikely(__pyx_t_15 == 0)) break; + if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_14); + __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_14); + __pyx_t_14 = 0; - /* "fastremap.pyx":594 + /* "fastremap.pyx":610 * * for k, v in table.items(): * tbl[k] = v # <<<<<<<<<<<<<< * * cdef NUMBER last_elem = arrview[0] */ - __pyx_t_11 = __Pyx_PyInt_As_uint32_t(__pyx_v_v); if (unlikely((__pyx_t_11 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyInt_As_uint32_t(__pyx_v_k); if (unlikely((__pyx_t_12 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L1_error) - (__pyx_v_tbl[__pyx_t_12]) = __pyx_t_11; + __pyx_t_8 = __Pyx_PyInt_As_uint32_t(__pyx_v_v); if (unlikely((__pyx_t_8 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyInt_As_uint32_t(__pyx_v_k); if (unlikely((__pyx_t_16 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) + (__pyx_v_tbl[__pyx_t_16]) = __pyx_t_8; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "fastremap.pyx":596 + /* "fastremap.pyx":612 * tbl[k] = v * * cdef NUMBER last_elem = arrview[0] # <<<<<<<<<<<<<< * cdef NUMBER last_remap_id = 0 * */ - __pyx_t_13 = 0; - __pyx_v_last_elem = (*((uint32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_17 = 0; + __pyx_v_last_elem = (*((uint32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":597 + /* "fastremap.pyx":613 * * cdef NUMBER last_elem = arrview[0] * cdef NUMBER last_remap_id = 0 # <<<<<<<<<<<<<< @@ -75511,7 +76979,7 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_remap_id = 0; - /* "fastremap.pyx":599 + /* "fastremap.pyx":615 * cdef NUMBER last_remap_id = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -75526,7 +76994,7 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel #endif /*try:*/ { - /* "fastremap.pyx":600 + /* "fastremap.pyx":616 * * with nogil: * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -75536,7 +77004,7 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_last_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":601 + /* "fastremap.pyx":617 * with nogil: * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: # <<<<<<<<<<<<<< @@ -75546,7 +77014,7 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((!(__pyx_v_preserve_missing_labels != 0)) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":602 + /* "fastremap.pyx":618 * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: * raise KeyError("{} was not in the remap table.".format(last_elem)) # <<<<<<<<<<<<<< @@ -75558,44 +77026,44 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyInt_From_uint32_t(__pyx_v_last_elem); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_14); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_last_elem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) { + __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_14); + if (likely(__pyx_t_18)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); + __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); + __Pyx_DECREF_SET(__pyx_t_14, function); } } - __pyx_t_2 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = (__pyx_t_18) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_18, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_9, 0, 0, 0); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(0, 602, __pyx_L12_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_14, 0, 0, 0); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __PYX_ERR(0, 618, __pyx_L19_error) } /*finally:*/ { - __pyx_L12_error: { + __pyx_L19_error: { #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - goto __pyx_L7_error; + goto __pyx_L14_error; } } } - /* "fastremap.pyx":601 + /* "fastremap.pyx":617 * with nogil: * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: # <<<<<<<<<<<<<< @@ -75604,7 +77072,7 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":604 + /* "fastremap.pyx":620 * raise KeyError("{} was not in the remap table.".format(last_elem)) * else: * last_remap_id = last_elem # <<<<<<<<<<<<<< @@ -75615,17 +77083,17 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_v_last_remap_id = __pyx_v_last_elem; } - /* "fastremap.pyx":600 + /* "fastremap.pyx":616 * * with nogil: * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< * if not preserve_missing_labels: * raise KeyError("{} was not in the remap table.".format(last_elem)) */ - goto __pyx_L9; + goto __pyx_L16; } - /* "fastremap.pyx":606 + /* "fastremap.pyx":622 * last_remap_id = last_elem * else: * arrview[0] = tbl[last_elem] # <<<<<<<<<<<<<< @@ -75633,22 +77101,22 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel * */ /*else*/ { - __pyx_t_13 = 0; - *((uint32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_last_elem]); + __pyx_t_17 = 0; + *((uint32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_last_elem]); - /* "fastremap.pyx":607 + /* "fastremap.pyx":623 * else: * arrview[0] = tbl[last_elem] * last_remap_id = arrview[0] # <<<<<<<<<<<<<< * * for i in range(1, size): */ - __pyx_t_13 = 0; - __pyx_v_last_remap_id = (*((uint32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_17 = 0; + __pyx_v_last_remap_id = (*((uint32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); } - __pyx_L9:; + __pyx_L16:; - /* "fastremap.pyx":609 + /* "fastremap.pyx":625 * last_remap_id = arrview[0] * * for i in range(1, size): # <<<<<<<<<<<<<< @@ -75656,21 +77124,21 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel * */ __pyx_t_3 = __pyx_v_size; - __pyx_t_15 = __pyx_t_3; - for (__pyx_t_16 = 1; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { - __pyx_v_i = __pyx_t_16; + __pyx_t_9 = __pyx_t_3; + for (__pyx_t_10 = 1; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":610 + /* "fastremap.pyx":626 * * for i in range(1, size): * elem = arrview[i] # <<<<<<<<<<<<<< * * if elem == last_elem: */ - __pyx_t_17 = __pyx_v_i; - __pyx_v_elem = (*((uint32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_11 = __pyx_v_i; + __pyx_v_elem = (*((uint32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":612 + /* "fastremap.pyx":628 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -75680,26 +77148,26 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_elem == __pyx_v_last_elem) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":613 + /* "fastremap.pyx":629 * * if elem == last_elem: * arrview[i] = last_remap_id # <<<<<<<<<<<<<< * continue * */ - __pyx_t_17 = __pyx_v_i; - *((uint32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; + __pyx_t_11 = __pyx_v_i; + *((uint32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; - /* "fastremap.pyx":614 + /* "fastremap.pyx":630 * if elem == last_elem: * arrview[i] = last_remap_id * continue # <<<<<<<<<<<<<< * * if tbl.find(elem) == tbl.end(): */ - goto __pyx_L14_continue; + goto __pyx_L21_continue; - /* "fastremap.pyx":612 + /* "fastremap.pyx":628 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -75708,7 +77176,7 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":616 + /* "fastremap.pyx":632 * continue * * if tbl.find(elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -75718,7 +77186,7 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":617 + /* "fastremap.pyx":633 * * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: # <<<<<<<<<<<<<< @@ -75728,7 +77196,7 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = (__pyx_v_preserve_missing_labels != 0); if (__pyx_t_4) { - /* "fastremap.pyx":618 + /* "fastremap.pyx":634 * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: * last_elem = elem # <<<<<<<<<<<<<< @@ -75737,7 +77205,7 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":619 + /* "fastremap.pyx":635 * if preserve_missing_labels: * last_elem = elem * last_remap_id = elem # <<<<<<<<<<<<<< @@ -75746,16 +77214,16 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_remap_id = __pyx_v_elem; - /* "fastremap.pyx":620 + /* "fastremap.pyx":636 * last_elem = elem * last_remap_id = elem * continue # <<<<<<<<<<<<<< * else: * raise KeyError("{} was not in the remap table.".format(elem)) */ - goto __pyx_L14_continue; + goto __pyx_L21_continue; - /* "fastremap.pyx":617 + /* "fastremap.pyx":633 * * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: # <<<<<<<<<<<<<< @@ -75764,7 +77232,7 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":622 + /* "fastremap.pyx":638 * continue * else: * raise KeyError("{} was not in the remap table.".format(elem)) # <<<<<<<<<<<<<< @@ -75777,45 +77245,45 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L22_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_elem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyInt_From_uint32_t(__pyx_v_elem); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_14); + __pyx_t_18 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_18)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); + __Pyx_DECREF_SET(__pyx_t_7, function); } } - __pyx_t_9 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __pyx_t_14 = (__pyx_t_18) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_18, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 622, __pyx_L22_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(0, 638, __pyx_L29_error) } /*finally:*/ { - __pyx_L22_error: { + __pyx_L29_error: { #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - goto __pyx_L7_error; + goto __pyx_L14_error; } } } } - /* "fastremap.pyx":616 + /* "fastremap.pyx":632 * continue * * if tbl.find(elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -75824,7 +77292,7 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":624 + /* "fastremap.pyx":640 * raise KeyError("{} was not in the remap table.".format(elem)) * else: * arrview[i] = tbl[elem] # <<<<<<<<<<<<<< @@ -75832,11 +77300,11 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel * last_elem = elem */ /*else*/ { - __pyx_t_17 = __pyx_v_i; - *((uint32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_elem]); + __pyx_t_11 = __pyx_v_i; + *((uint32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_elem]); } - /* "fastremap.pyx":626 + /* "fastremap.pyx":642 * arrview[i] = tbl[elem] * * last_elem = elem # <<<<<<<<<<<<<< @@ -75845,20 +77313,20 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":627 + /* "fastremap.pyx":643 * * last_elem = elem * last_remap_id = arrview[i] # <<<<<<<<<<<<<< * * return arr */ - __pyx_t_17 = __pyx_v_i; - __pyx_v_last_remap_id = (*((uint32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); - __pyx_L14_continue:; + __pyx_t_11 = __pyx_v_i; + __pyx_v_last_remap_id = (*((uint32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ))); + __pyx_L21_continue:; } } - /* "fastremap.pyx":599 + /* "fastremap.pyx":615 * cdef NUMBER last_remap_id = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -75871,20 +77339,20 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif - goto __pyx_L8; + goto __pyx_L15; } - __pyx_L7_error: { + __pyx_L14_error: { #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L1_error; } - __pyx_L8:; + __pyx_L15:; } } - /* "fastremap.pyx":629 + /* "fastremap.pyx":645 * last_remap_id = arrview[i] * * return arr # <<<<<<<<<<<<<< @@ -75896,7 +77364,7 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":582 + /* "fastremap.pyx":584 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): # <<<<<<<<<<<<<< @@ -75908,9 +77376,9 @@ static PyObject *__pyx_pf_9fastremap_394_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_L1_error:; __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_18); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -75969,17 +77437,17 @@ static PyObject *__pyx_fuse_3__pyx_pw_9fastremap_397_remap(PyObject *__pyx_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_table)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 1); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 1); __PYX_ERR(0, 584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_preserve_missing_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 2); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 2); __PYX_ERR(0, 584, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_remap") < 0)) __PYX_ERR(0, 582, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_remap") < 0)) __PYX_ERR(0, 584, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -75990,18 +77458,18 @@ static PyObject *__pyx_fuse_3__pyx_pw_9fastremap_397_remap(PyObject *__pyx_self, } __pyx_v_arr = ((PyArrayObject *)values[0]); __pyx_v_table = ((PyObject*)values[1]); - __pyx_v_preserve_missing_labels = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_preserve_missing_labels == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L3_error) + __pyx_v_preserve_missing_labels = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_preserve_missing_labels == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 584, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._remap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 582, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), (&PyDict_Type), 1, "table", 1))) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 584, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), (&PyDict_Type), 1, "table", 1))) __PYX_ERR(0, 584, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_396_remap(__pyx_self, __pyx_v_arr, __pyx_v_table, __pyx_v_preserve_missing_labels); /* function exit code */ @@ -76018,7 +77486,9 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel size_t __pyx_v_i; size_t __pyx_v_size; uint64_t __pyx_v_elem; - std::unordered_map __pyx_v_tbl; + uint64_t __pyx_v_before; + uint64_t __pyx_v_after; + ska::flat_hash_map __pyx_v_tbl; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; uint64_t __pyx_v_last_elem; @@ -76031,19 +77501,20 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel PyObject *__pyx_t_2 = NULL; size_t __pyx_t_3; int __pyx_t_4; - Py_ssize_t __pyx_t_5; + int __pyx_t_5; Py_ssize_t __pyx_t_6; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - uint64_t __pyx_t_11; - uint64_t __pyx_t_12; - Py_ssize_t __pyx_t_13; + PyObject *__pyx_t_7 = NULL; + uint64_t __pyx_t_8; + size_t __pyx_t_9; + size_t __pyx_t_10; + size_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; PyObject *__pyx_t_14 = NULL; - size_t __pyx_t_15; - size_t __pyx_t_16; - size_t __pyx_t_17; + int __pyx_t_15; + uint64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + PyObject *__pyx_t_18 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -76054,23 +77525,23 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 584, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":583 + /* "fastremap.pyx":585 * @cython.nonecheck(False) * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): * cdef NUMBER[:] arrview = arr # <<<<<<<<<<<<<< * cdef size_t i = 0 * cdef size_t size = arr.size */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 583, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 585, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":584 + /* "fastremap.pyx":586 * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): * cdef NUMBER[:] arrview = arr * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -76079,20 +77550,20 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_i = 0; - /* "fastremap.pyx":585 + /* "fastremap.pyx":587 * cdef NUMBER[:] arrview = arr * cdef size_t i = 0 * cdef size_t size = arr.size # <<<<<<<<<<<<<< * cdef NUMBER elem = 0 * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_size = __pyx_t_3; - /* "fastremap.pyx":586 + /* "fastremap.pyx":588 * cdef size_t i = 0 * cdef size_t size = arr.size * cdef NUMBER elem = 0 # <<<<<<<<<<<<<< @@ -76101,7 +77572,7 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_elem = 0; - /* "fastremap.pyx":588 + /* "fastremap.pyx":590 * cdef NUMBER elem = 0 * * if size == 0: # <<<<<<<<<<<<<< @@ -76111,19 +77582,19 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_size == 0) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":589 + /* "fastremap.pyx":591 * * if size == 0: * return arr # <<<<<<<<<<<<<< * - * cdef unordered_map[NUMBER, NUMBER] tbl + * # fast path for remapping only a single label */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_arr)); __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":588 + /* "fastremap.pyx":590 * cdef NUMBER elem = 0 * * if size == 0: # <<<<<<<<<<<<<< @@ -76132,58 +77603,237 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":593 - * cdef unordered_map[NUMBER, NUMBER] tbl + /* "fastremap.pyx":595 + * # fast path for remapping only a single label + * # e.g. for masking something out + * cdef NUMBER before = 0 # <<<<<<<<<<<<<< + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: + */ + __pyx_v_before = 0; + + /* "fastremap.pyx":596 + * # e.g. for masking something out + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 # <<<<<<<<<<<<<< + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) + */ + __pyx_v_after = 0; + + /* "fastremap.pyx":597 + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: # <<<<<<<<<<<<<< + * before = next(iter(table.keys())) + * after = table[before] + */ + __pyx_t_5 = (__pyx_v_preserve_missing_labels != 0); + if (__pyx_t_5) { + } else { + __pyx_t_4 = __pyx_t_5; + goto __pyx_L5_bool_binop_done; + } + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 597, __pyx_L1_error) + } + __pyx_t_6 = PyDict_Size(__pyx_v_table); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_5 = ((__pyx_t_6 == 1) != 0); + __pyx_t_4 = __pyx_t_5; + __pyx_L5_bool_binop_done:; + if (__pyx_t_4) { + + /* "fastremap.pyx":598 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) # <<<<<<<<<<<<<< + * after = table[before] + * if before == after: + */ + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); + __PYX_ERR(0, 598, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyDict_Keys(__pyx_v_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_As_uint64_t(__pyx_t_2); if (unlikely((__pyx_t_8 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_before = __pyx_t_8; + + /* "fastremap.pyx":599 + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) + * after = table[before] # <<<<<<<<<<<<<< + * if before == after: + * return arr + */ + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 599, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyInt_From_uint64_t(__pyx_v_before); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_table, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = __Pyx_PyInt_As_uint64_t(__pyx_t_7); if (unlikely((__pyx_t_8 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_after = __pyx_t_8; + + /* "fastremap.pyx":600 + * before = next(iter(table.keys())) + * after = table[before] + * if before == after: # <<<<<<<<<<<<<< + * return arr + * for i in range(size): + */ + __pyx_t_4 = ((__pyx_v_before == __pyx_v_after) != 0); + if (__pyx_t_4) { + + /* "fastremap.pyx":601 + * after = table[before] + * if before == after: + * return arr # <<<<<<<<<<<<<< + * for i in range(size): + * if arr[i] == before: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "fastremap.pyx":600 + * before = next(iter(table.keys())) + * after = table[before] + * if before == after: # <<<<<<<<<<<<<< + * return arr + * for i in range(size): + */ + } + + /* "fastremap.pyx":602 + * if before == after: + * return arr + * for i in range(size): # <<<<<<<<<<<<<< + * if arr[i] == before: + * arr[i] = after + */ + __pyx_t_3 = __pyx_v_size; + __pyx_t_9 = __pyx_t_3; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "fastremap.pyx":603 + * return arr + * for i in range(size): + * if arr[i] == before: # <<<<<<<<<<<<<< + * arr[i] = after + * return arr + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides)) == __pyx_v_before) != 0); + if (__pyx_t_4) { + + /* "fastremap.pyx":604 + * for i in range(size): + * if arr[i] == before: + * arr[i] = after # <<<<<<<<<<<<<< + * return arr + * + */ + __pyx_t_11 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides) = __pyx_v_after; + + /* "fastremap.pyx":603 + * return arr + * for i in range(size): + * if arr[i] == before: # <<<<<<<<<<<<<< + * arr[i] = after + * return arr + */ + } + } + + /* "fastremap.pyx":605 + * if arr[i] == before: + * arr[i] = after + * return arr # <<<<<<<<<<<<<< + * + * cdef flat_hash_map[NUMBER, NUMBER] tbl + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "fastremap.pyx":597 + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: # <<<<<<<<<<<<<< + * before = next(iter(table.keys())) + * after = table[before] + */ + } + + /* "fastremap.pyx":609 + * cdef flat_hash_map[NUMBER, NUMBER] tbl * * for k, v in table.items(): # <<<<<<<<<<<<<< * tbl[k] = v * */ - __pyx_t_5 = 0; + __pyx_t_6 = 0; if (unlikely(__pyx_v_table == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 593, __pyx_L1_error) + __PYX_ERR(0, 609, __pyx_L1_error) } - __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_table, 1, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_2); - __pyx_t_2 = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_table, 1, __pyx_n_s_items, (&__pyx_t_12), (&__pyx_t_13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; while (1) { - __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, &__pyx_t_8, &__pyx_t_9, NULL, __pyx_t_7); - if (unlikely(__pyx_t_10 == 0)) break; - if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_8); - __pyx_t_8 = 0; - __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_9); - __pyx_t_9 = 0; + __pyx_t_15 = __Pyx_dict_iter_next(__pyx_t_7, __pyx_t_12, &__pyx_t_6, &__pyx_t_2, &__pyx_t_14, NULL, __pyx_t_13); + if (unlikely(__pyx_t_15 == 0)) break; + if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_14); + __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_14); + __pyx_t_14 = 0; - /* "fastremap.pyx":594 + /* "fastremap.pyx":610 * * for k, v in table.items(): * tbl[k] = v # <<<<<<<<<<<<<< * * cdef NUMBER last_elem = arrview[0] */ - __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_v_v); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyInt_As_uint64_t(__pyx_v_k); if (unlikely((__pyx_t_12 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L1_error) - (__pyx_v_tbl[__pyx_t_12]) = __pyx_t_11; + __pyx_t_8 = __Pyx_PyInt_As_uint64_t(__pyx_v_v); if (unlikely((__pyx_t_8 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyInt_As_uint64_t(__pyx_v_k); if (unlikely((__pyx_t_16 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) + (__pyx_v_tbl[__pyx_t_16]) = __pyx_t_8; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "fastremap.pyx":596 + /* "fastremap.pyx":612 * tbl[k] = v * * cdef NUMBER last_elem = arrview[0] # <<<<<<<<<<<<<< * cdef NUMBER last_remap_id = 0 * */ - __pyx_t_13 = 0; - __pyx_v_last_elem = (*((uint64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_17 = 0; + __pyx_v_last_elem = (*((uint64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":597 + /* "fastremap.pyx":613 * * cdef NUMBER last_elem = arrview[0] * cdef NUMBER last_remap_id = 0 # <<<<<<<<<<<<<< @@ -76192,7 +77842,7 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_remap_id = 0; - /* "fastremap.pyx":599 + /* "fastremap.pyx":615 * cdef NUMBER last_remap_id = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -76207,7 +77857,7 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel #endif /*try:*/ { - /* "fastremap.pyx":600 + /* "fastremap.pyx":616 * * with nogil: * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -76217,7 +77867,7 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_last_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":601 + /* "fastremap.pyx":617 * with nogil: * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: # <<<<<<<<<<<<<< @@ -76227,7 +77877,7 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((!(__pyx_v_preserve_missing_labels != 0)) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":602 + /* "fastremap.pyx":618 * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: * raise KeyError("{} was not in the remap table.".format(last_elem)) # <<<<<<<<<<<<<< @@ -76239,44 +77889,44 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyInt_From_uint64_t(__pyx_v_last_elem); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_14); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_2 = __Pyx_PyInt_From_uint64_t(__pyx_v_last_elem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) { + __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_14); + if (likely(__pyx_t_18)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); + __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); + __Pyx_DECREF_SET(__pyx_t_14, function); } } - __pyx_t_2 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = (__pyx_t_18) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_18, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_9, 0, 0, 0); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(0, 602, __pyx_L12_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_14, 0, 0, 0); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __PYX_ERR(0, 618, __pyx_L19_error) } /*finally:*/ { - __pyx_L12_error: { + __pyx_L19_error: { #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - goto __pyx_L7_error; + goto __pyx_L14_error; } } } - /* "fastremap.pyx":601 + /* "fastremap.pyx":617 * with nogil: * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: # <<<<<<<<<<<<<< @@ -76285,7 +77935,7 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":604 + /* "fastremap.pyx":620 * raise KeyError("{} was not in the remap table.".format(last_elem)) * else: * last_remap_id = last_elem # <<<<<<<<<<<<<< @@ -76296,17 +77946,17 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_v_last_remap_id = __pyx_v_last_elem; } - /* "fastremap.pyx":600 + /* "fastremap.pyx":616 * * with nogil: * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< * if not preserve_missing_labels: * raise KeyError("{} was not in the remap table.".format(last_elem)) */ - goto __pyx_L9; + goto __pyx_L16; } - /* "fastremap.pyx":606 + /* "fastremap.pyx":622 * last_remap_id = last_elem * else: * arrview[0] = tbl[last_elem] # <<<<<<<<<<<<<< @@ -76314,22 +77964,22 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel * */ /*else*/ { - __pyx_t_13 = 0; - *((uint64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_last_elem]); + __pyx_t_17 = 0; + *((uint64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_last_elem]); - /* "fastremap.pyx":607 + /* "fastremap.pyx":623 * else: * arrview[0] = tbl[last_elem] * last_remap_id = arrview[0] # <<<<<<<<<<<<<< * * for i in range(1, size): */ - __pyx_t_13 = 0; - __pyx_v_last_remap_id = (*((uint64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_17 = 0; + __pyx_v_last_remap_id = (*((uint64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); } - __pyx_L9:; + __pyx_L16:; - /* "fastremap.pyx":609 + /* "fastremap.pyx":625 * last_remap_id = arrview[0] * * for i in range(1, size): # <<<<<<<<<<<<<< @@ -76337,21 +77987,21 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel * */ __pyx_t_3 = __pyx_v_size; - __pyx_t_15 = __pyx_t_3; - for (__pyx_t_16 = 1; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { - __pyx_v_i = __pyx_t_16; + __pyx_t_9 = __pyx_t_3; + for (__pyx_t_10 = 1; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":610 + /* "fastremap.pyx":626 * * for i in range(1, size): * elem = arrview[i] # <<<<<<<<<<<<<< * * if elem == last_elem: */ - __pyx_t_17 = __pyx_v_i; - __pyx_v_elem = (*((uint64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_11 = __pyx_v_i; + __pyx_v_elem = (*((uint64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":612 + /* "fastremap.pyx":628 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -76361,26 +78011,26 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_elem == __pyx_v_last_elem) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":613 + /* "fastremap.pyx":629 * * if elem == last_elem: * arrview[i] = last_remap_id # <<<<<<<<<<<<<< * continue * */ - __pyx_t_17 = __pyx_v_i; - *((uint64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; + __pyx_t_11 = __pyx_v_i; + *((uint64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; - /* "fastremap.pyx":614 + /* "fastremap.pyx":630 * if elem == last_elem: * arrview[i] = last_remap_id * continue # <<<<<<<<<<<<<< * * if tbl.find(elem) == tbl.end(): */ - goto __pyx_L14_continue; + goto __pyx_L21_continue; - /* "fastremap.pyx":612 + /* "fastremap.pyx":628 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -76389,7 +78039,7 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":616 + /* "fastremap.pyx":632 * continue * * if tbl.find(elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -76399,7 +78049,7 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":617 + /* "fastremap.pyx":633 * * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: # <<<<<<<<<<<<<< @@ -76409,7 +78059,7 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = (__pyx_v_preserve_missing_labels != 0); if (__pyx_t_4) { - /* "fastremap.pyx":618 + /* "fastremap.pyx":634 * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: * last_elem = elem # <<<<<<<<<<<<<< @@ -76418,7 +78068,7 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":619 + /* "fastremap.pyx":635 * if preserve_missing_labels: * last_elem = elem * last_remap_id = elem # <<<<<<<<<<<<<< @@ -76427,16 +78077,16 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_remap_id = __pyx_v_elem; - /* "fastremap.pyx":620 + /* "fastremap.pyx":636 * last_elem = elem * last_remap_id = elem * continue # <<<<<<<<<<<<<< * else: * raise KeyError("{} was not in the remap table.".format(elem)) */ - goto __pyx_L14_continue; + goto __pyx_L21_continue; - /* "fastremap.pyx":617 + /* "fastremap.pyx":633 * * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: # <<<<<<<<<<<<<< @@ -76445,7 +78095,7 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":622 + /* "fastremap.pyx":638 * continue * else: * raise KeyError("{} was not in the remap table.".format(elem)) # <<<<<<<<<<<<<< @@ -76458,45 +78108,45 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L22_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PyInt_From_uint64_t(__pyx_v_elem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyInt_From_uint64_t(__pyx_v_elem); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_14); + __pyx_t_18 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_18)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); + __Pyx_DECREF_SET(__pyx_t_7, function); } } - __pyx_t_9 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __pyx_t_14 = (__pyx_t_18) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_18, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 622, __pyx_L22_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(0, 638, __pyx_L29_error) } /*finally:*/ { - __pyx_L22_error: { + __pyx_L29_error: { #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - goto __pyx_L7_error; + goto __pyx_L14_error; } } } } - /* "fastremap.pyx":616 + /* "fastremap.pyx":632 * continue * * if tbl.find(elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -76505,7 +78155,7 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":624 + /* "fastremap.pyx":640 * raise KeyError("{} was not in the remap table.".format(elem)) * else: * arrview[i] = tbl[elem] # <<<<<<<<<<<<<< @@ -76513,11 +78163,11 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel * last_elem = elem */ /*else*/ { - __pyx_t_17 = __pyx_v_i; - *((uint64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_elem]); + __pyx_t_11 = __pyx_v_i; + *((uint64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_elem]); } - /* "fastremap.pyx":626 + /* "fastremap.pyx":642 * arrview[i] = tbl[elem] * * last_elem = elem # <<<<<<<<<<<<<< @@ -76526,20 +78176,20 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":627 + /* "fastremap.pyx":643 * * last_elem = elem * last_remap_id = arrview[i] # <<<<<<<<<<<<<< * * return arr */ - __pyx_t_17 = __pyx_v_i; - __pyx_v_last_remap_id = (*((uint64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); - __pyx_L14_continue:; + __pyx_t_11 = __pyx_v_i; + __pyx_v_last_remap_id = (*((uint64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ))); + __pyx_L21_continue:; } } - /* "fastremap.pyx":599 + /* "fastremap.pyx":615 * cdef NUMBER last_remap_id = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -76552,20 +78202,20 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif - goto __pyx_L8; + goto __pyx_L15; } - __pyx_L7_error: { + __pyx_L14_error: { #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L1_error; } - __pyx_L8:; + __pyx_L15:; } } - /* "fastremap.pyx":629 + /* "fastremap.pyx":645 * last_remap_id = arrview[i] * * return arr # <<<<<<<<<<<<<< @@ -76577,7 +78227,7 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":582 + /* "fastremap.pyx":584 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): # <<<<<<<<<<<<<< @@ -76589,9 +78239,9 @@ static PyObject *__pyx_pf_9fastremap_396_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_L1_error:; __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_18); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -76650,17 +78300,17 @@ static PyObject *__pyx_fuse_4__pyx_pw_9fastremap_399_remap(PyObject *__pyx_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_table)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 1); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 1); __PYX_ERR(0, 584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_preserve_missing_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 2); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 2); __PYX_ERR(0, 584, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_remap") < 0)) __PYX_ERR(0, 582, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_remap") < 0)) __PYX_ERR(0, 584, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -76671,18 +78321,18 @@ static PyObject *__pyx_fuse_4__pyx_pw_9fastremap_399_remap(PyObject *__pyx_self, } __pyx_v_arr = ((PyArrayObject *)values[0]); __pyx_v_table = ((PyObject*)values[1]); - __pyx_v_preserve_missing_labels = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_preserve_missing_labels == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L3_error) + __pyx_v_preserve_missing_labels = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_preserve_missing_labels == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 584, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._remap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 582, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), (&PyDict_Type), 1, "table", 1))) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 584, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), (&PyDict_Type), 1, "table", 1))) __PYX_ERR(0, 584, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_398_remap(__pyx_self, __pyx_v_arr, __pyx_v_table, __pyx_v_preserve_missing_labels); /* function exit code */ @@ -76699,7 +78349,9 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel size_t __pyx_v_i; size_t __pyx_v_size; int8_t __pyx_v_elem; - std::unordered_map __pyx_v_tbl; + int8_t __pyx_v_before; + int8_t __pyx_v_after; + ska::flat_hash_map __pyx_v_tbl; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; int8_t __pyx_v_last_elem; @@ -76712,19 +78364,20 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel PyObject *__pyx_t_2 = NULL; size_t __pyx_t_3; int __pyx_t_4; - Py_ssize_t __pyx_t_5; + int __pyx_t_5; Py_ssize_t __pyx_t_6; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - int8_t __pyx_t_11; - int8_t __pyx_t_12; - Py_ssize_t __pyx_t_13; + PyObject *__pyx_t_7 = NULL; + int8_t __pyx_t_8; + size_t __pyx_t_9; + size_t __pyx_t_10; + size_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; PyObject *__pyx_t_14 = NULL; - size_t __pyx_t_15; - size_t __pyx_t_16; - size_t __pyx_t_17; + int __pyx_t_15; + int8_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + PyObject *__pyx_t_18 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -76735,23 +78388,23 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 584, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":583 + /* "fastremap.pyx":585 * @cython.nonecheck(False) * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): * cdef NUMBER[:] arrview = arr # <<<<<<<<<<<<<< * cdef size_t i = 0 * cdef size_t size = arr.size */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 583, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 585, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":584 + /* "fastremap.pyx":586 * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): * cdef NUMBER[:] arrview = arr * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -76760,20 +78413,20 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_i = 0; - /* "fastremap.pyx":585 + /* "fastremap.pyx":587 * cdef NUMBER[:] arrview = arr * cdef size_t i = 0 * cdef size_t size = arr.size # <<<<<<<<<<<<<< * cdef NUMBER elem = 0 * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_size = __pyx_t_3; - /* "fastremap.pyx":586 + /* "fastremap.pyx":588 * cdef size_t i = 0 * cdef size_t size = arr.size * cdef NUMBER elem = 0 # <<<<<<<<<<<<<< @@ -76782,7 +78435,7 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_elem = 0; - /* "fastremap.pyx":588 + /* "fastremap.pyx":590 * cdef NUMBER elem = 0 * * if size == 0: # <<<<<<<<<<<<<< @@ -76792,19 +78445,19 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_size == 0) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":589 + /* "fastremap.pyx":591 * * if size == 0: * return arr # <<<<<<<<<<<<<< * - * cdef unordered_map[NUMBER, NUMBER] tbl + * # fast path for remapping only a single label */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_arr)); __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":588 + /* "fastremap.pyx":590 * cdef NUMBER elem = 0 * * if size == 0: # <<<<<<<<<<<<<< @@ -76813,58 +78466,237 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":593 - * cdef unordered_map[NUMBER, NUMBER] tbl + /* "fastremap.pyx":595 + * # fast path for remapping only a single label + * # e.g. for masking something out + * cdef NUMBER before = 0 # <<<<<<<<<<<<<< + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: + */ + __pyx_v_before = 0; + + /* "fastremap.pyx":596 + * # e.g. for masking something out + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 # <<<<<<<<<<<<<< + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) + */ + __pyx_v_after = 0; + + /* "fastremap.pyx":597 + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: # <<<<<<<<<<<<<< + * before = next(iter(table.keys())) + * after = table[before] + */ + __pyx_t_5 = (__pyx_v_preserve_missing_labels != 0); + if (__pyx_t_5) { + } else { + __pyx_t_4 = __pyx_t_5; + goto __pyx_L5_bool_binop_done; + } + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 597, __pyx_L1_error) + } + __pyx_t_6 = PyDict_Size(__pyx_v_table); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_5 = ((__pyx_t_6 == 1) != 0); + __pyx_t_4 = __pyx_t_5; + __pyx_L5_bool_binop_done:; + if (__pyx_t_4) { + + /* "fastremap.pyx":598 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) # <<<<<<<<<<<<<< + * after = table[before] + * if before == after: + */ + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); + __PYX_ERR(0, 598, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyDict_Keys(__pyx_v_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int8_t(__pyx_t_2); if (unlikely((__pyx_t_8 == ((int8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_before = __pyx_t_8; + + /* "fastremap.pyx":599 + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) + * after = table[before] # <<<<<<<<<<<<<< + * if before == after: + * return arr + */ + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 599, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyInt_From_int8_t(__pyx_v_before); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_table, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int8_t(__pyx_t_7); if (unlikely((__pyx_t_8 == ((int8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_after = __pyx_t_8; + + /* "fastremap.pyx":600 + * before = next(iter(table.keys())) + * after = table[before] + * if before == after: # <<<<<<<<<<<<<< + * return arr + * for i in range(size): + */ + __pyx_t_4 = ((__pyx_v_before == __pyx_v_after) != 0); + if (__pyx_t_4) { + + /* "fastremap.pyx":601 + * after = table[before] + * if before == after: + * return arr # <<<<<<<<<<<<<< + * for i in range(size): + * if arr[i] == before: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "fastremap.pyx":600 + * before = next(iter(table.keys())) + * after = table[before] + * if before == after: # <<<<<<<<<<<<<< + * return arr + * for i in range(size): + */ + } + + /* "fastremap.pyx":602 + * if before == after: + * return arr + * for i in range(size): # <<<<<<<<<<<<<< + * if arr[i] == before: + * arr[i] = after + */ + __pyx_t_3 = __pyx_v_size; + __pyx_t_9 = __pyx_t_3; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "fastremap.pyx":603 + * return arr + * for i in range(size): + * if arr[i] == before: # <<<<<<<<<<<<<< + * arr[i] = after + * return arr + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides)) == __pyx_v_before) != 0); + if (__pyx_t_4) { + + /* "fastremap.pyx":604 + * for i in range(size): + * if arr[i] == before: + * arr[i] = after # <<<<<<<<<<<<<< + * return arr + * + */ + __pyx_t_11 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides) = __pyx_v_after; + + /* "fastremap.pyx":603 + * return arr + * for i in range(size): + * if arr[i] == before: # <<<<<<<<<<<<<< + * arr[i] = after + * return arr + */ + } + } + + /* "fastremap.pyx":605 + * if arr[i] == before: + * arr[i] = after + * return arr # <<<<<<<<<<<<<< + * + * cdef flat_hash_map[NUMBER, NUMBER] tbl + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "fastremap.pyx":597 + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: # <<<<<<<<<<<<<< + * before = next(iter(table.keys())) + * after = table[before] + */ + } + + /* "fastremap.pyx":609 + * cdef flat_hash_map[NUMBER, NUMBER] tbl * * for k, v in table.items(): # <<<<<<<<<<<<<< * tbl[k] = v * */ - __pyx_t_5 = 0; + __pyx_t_6 = 0; if (unlikely(__pyx_v_table == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 593, __pyx_L1_error) + __PYX_ERR(0, 609, __pyx_L1_error) } - __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_table, 1, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_2); - __pyx_t_2 = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_table, 1, __pyx_n_s_items, (&__pyx_t_12), (&__pyx_t_13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; while (1) { - __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, &__pyx_t_8, &__pyx_t_9, NULL, __pyx_t_7); - if (unlikely(__pyx_t_10 == 0)) break; - if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_8); - __pyx_t_8 = 0; - __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_9); - __pyx_t_9 = 0; + __pyx_t_15 = __Pyx_dict_iter_next(__pyx_t_7, __pyx_t_12, &__pyx_t_6, &__pyx_t_2, &__pyx_t_14, NULL, __pyx_t_13); + if (unlikely(__pyx_t_15 == 0)) break; + if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_14); + __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_14); + __pyx_t_14 = 0; - /* "fastremap.pyx":594 + /* "fastremap.pyx":610 * * for k, v in table.items(): * tbl[k] = v # <<<<<<<<<<<<<< * * cdef NUMBER last_elem = arrview[0] */ - __pyx_t_11 = __Pyx_PyInt_As_int8_t(__pyx_v_v); if (unlikely((__pyx_t_11 == ((int8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyInt_As_int8_t(__pyx_v_k); if (unlikely((__pyx_t_12 == ((int8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L1_error) - (__pyx_v_tbl[__pyx_t_12]) = __pyx_t_11; + __pyx_t_8 = __Pyx_PyInt_As_int8_t(__pyx_v_v); if (unlikely((__pyx_t_8 == ((int8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyInt_As_int8_t(__pyx_v_k); if (unlikely((__pyx_t_16 == ((int8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) + (__pyx_v_tbl[__pyx_t_16]) = __pyx_t_8; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "fastremap.pyx":596 + /* "fastremap.pyx":612 * tbl[k] = v * * cdef NUMBER last_elem = arrview[0] # <<<<<<<<<<<<<< * cdef NUMBER last_remap_id = 0 * */ - __pyx_t_13 = 0; - __pyx_v_last_elem = (*((int8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_17 = 0; + __pyx_v_last_elem = (*((int8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":597 + /* "fastremap.pyx":613 * * cdef NUMBER last_elem = arrview[0] * cdef NUMBER last_remap_id = 0 # <<<<<<<<<<<<<< @@ -76873,7 +78705,7 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_remap_id = 0; - /* "fastremap.pyx":599 + /* "fastremap.pyx":615 * cdef NUMBER last_remap_id = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -76888,7 +78720,7 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel #endif /*try:*/ { - /* "fastremap.pyx":600 + /* "fastremap.pyx":616 * * with nogil: * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -76898,7 +78730,7 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_last_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":601 + /* "fastremap.pyx":617 * with nogil: * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: # <<<<<<<<<<<<<< @@ -76908,7 +78740,7 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((!(__pyx_v_preserve_missing_labels != 0)) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":602 + /* "fastremap.pyx":618 * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: * raise KeyError("{} was not in the remap table.".format(last_elem)) # <<<<<<<<<<<<<< @@ -76920,44 +78752,44 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyInt_From_int8_t(__pyx_v_last_elem); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_14); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_2 = __Pyx_PyInt_From_int8_t(__pyx_v_last_elem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) { + __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_14); + if (likely(__pyx_t_18)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); + __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); + __Pyx_DECREF_SET(__pyx_t_14, function); } } - __pyx_t_2 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = (__pyx_t_18) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_18, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_9, 0, 0, 0); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(0, 602, __pyx_L12_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_14, 0, 0, 0); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __PYX_ERR(0, 618, __pyx_L19_error) } /*finally:*/ { - __pyx_L12_error: { + __pyx_L19_error: { #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - goto __pyx_L7_error; + goto __pyx_L14_error; } } } - /* "fastremap.pyx":601 + /* "fastremap.pyx":617 * with nogil: * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: # <<<<<<<<<<<<<< @@ -76966,7 +78798,7 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":604 + /* "fastremap.pyx":620 * raise KeyError("{} was not in the remap table.".format(last_elem)) * else: * last_remap_id = last_elem # <<<<<<<<<<<<<< @@ -76977,17 +78809,17 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_v_last_remap_id = __pyx_v_last_elem; } - /* "fastremap.pyx":600 + /* "fastremap.pyx":616 * * with nogil: * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< * if not preserve_missing_labels: * raise KeyError("{} was not in the remap table.".format(last_elem)) */ - goto __pyx_L9; + goto __pyx_L16; } - /* "fastremap.pyx":606 + /* "fastremap.pyx":622 * last_remap_id = last_elem * else: * arrview[0] = tbl[last_elem] # <<<<<<<<<<<<<< @@ -76995,22 +78827,22 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel * */ /*else*/ { - __pyx_t_13 = 0; - *((int8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_last_elem]); + __pyx_t_17 = 0; + *((int8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_last_elem]); - /* "fastremap.pyx":607 + /* "fastremap.pyx":623 * else: * arrview[0] = tbl[last_elem] * last_remap_id = arrview[0] # <<<<<<<<<<<<<< * * for i in range(1, size): */ - __pyx_t_13 = 0; - __pyx_v_last_remap_id = (*((int8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_17 = 0; + __pyx_v_last_remap_id = (*((int8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); } - __pyx_L9:; + __pyx_L16:; - /* "fastremap.pyx":609 + /* "fastremap.pyx":625 * last_remap_id = arrview[0] * * for i in range(1, size): # <<<<<<<<<<<<<< @@ -77018,21 +78850,21 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel * */ __pyx_t_3 = __pyx_v_size; - __pyx_t_15 = __pyx_t_3; - for (__pyx_t_16 = 1; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { - __pyx_v_i = __pyx_t_16; + __pyx_t_9 = __pyx_t_3; + for (__pyx_t_10 = 1; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":610 + /* "fastremap.pyx":626 * * for i in range(1, size): * elem = arrview[i] # <<<<<<<<<<<<<< * * if elem == last_elem: */ - __pyx_t_17 = __pyx_v_i; - __pyx_v_elem = (*((int8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_11 = __pyx_v_i; + __pyx_v_elem = (*((int8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":612 + /* "fastremap.pyx":628 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -77042,26 +78874,26 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_elem == __pyx_v_last_elem) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":613 + /* "fastremap.pyx":629 * * if elem == last_elem: * arrview[i] = last_remap_id # <<<<<<<<<<<<<< * continue * */ - __pyx_t_17 = __pyx_v_i; - *((int8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; + __pyx_t_11 = __pyx_v_i; + *((int8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; - /* "fastremap.pyx":614 + /* "fastremap.pyx":630 * if elem == last_elem: * arrview[i] = last_remap_id * continue # <<<<<<<<<<<<<< * * if tbl.find(elem) == tbl.end(): */ - goto __pyx_L14_continue; + goto __pyx_L21_continue; - /* "fastremap.pyx":612 + /* "fastremap.pyx":628 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -77070,7 +78902,7 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":616 + /* "fastremap.pyx":632 * continue * * if tbl.find(elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -77080,7 +78912,7 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":617 + /* "fastremap.pyx":633 * * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: # <<<<<<<<<<<<<< @@ -77090,7 +78922,7 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = (__pyx_v_preserve_missing_labels != 0); if (__pyx_t_4) { - /* "fastremap.pyx":618 + /* "fastremap.pyx":634 * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: * last_elem = elem # <<<<<<<<<<<<<< @@ -77099,7 +78931,7 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":619 + /* "fastremap.pyx":635 * if preserve_missing_labels: * last_elem = elem * last_remap_id = elem # <<<<<<<<<<<<<< @@ -77108,16 +78940,16 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_remap_id = __pyx_v_elem; - /* "fastremap.pyx":620 + /* "fastremap.pyx":636 * last_elem = elem * last_remap_id = elem * continue # <<<<<<<<<<<<<< * else: * raise KeyError("{} was not in the remap table.".format(elem)) */ - goto __pyx_L14_continue; + goto __pyx_L21_continue; - /* "fastremap.pyx":617 + /* "fastremap.pyx":633 * * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: # <<<<<<<<<<<<<< @@ -77126,7 +78958,7 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":622 + /* "fastremap.pyx":638 * continue * else: * raise KeyError("{} was not in the remap table.".format(elem)) # <<<<<<<<<<<<<< @@ -77139,45 +78971,45 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L22_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PyInt_From_int8_t(__pyx_v_elem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyInt_From_int8_t(__pyx_v_elem); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_14); + __pyx_t_18 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_18)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); + __Pyx_DECREF_SET(__pyx_t_7, function); } } - __pyx_t_9 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __pyx_t_14 = (__pyx_t_18) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_18, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 622, __pyx_L22_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(0, 638, __pyx_L29_error) } /*finally:*/ { - __pyx_L22_error: { + __pyx_L29_error: { #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - goto __pyx_L7_error; + goto __pyx_L14_error; } } } } - /* "fastremap.pyx":616 + /* "fastremap.pyx":632 * continue * * if tbl.find(elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -77186,7 +79018,7 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":624 + /* "fastremap.pyx":640 * raise KeyError("{} was not in the remap table.".format(elem)) * else: * arrview[i] = tbl[elem] # <<<<<<<<<<<<<< @@ -77194,11 +79026,11 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel * last_elem = elem */ /*else*/ { - __pyx_t_17 = __pyx_v_i; - *((int8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_elem]); + __pyx_t_11 = __pyx_v_i; + *((int8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_elem]); } - /* "fastremap.pyx":626 + /* "fastremap.pyx":642 * arrview[i] = tbl[elem] * * last_elem = elem # <<<<<<<<<<<<<< @@ -77207,20 +79039,20 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":627 + /* "fastremap.pyx":643 * * last_elem = elem * last_remap_id = arrview[i] # <<<<<<<<<<<<<< * * return arr */ - __pyx_t_17 = __pyx_v_i; - __pyx_v_last_remap_id = (*((int8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); - __pyx_L14_continue:; + __pyx_t_11 = __pyx_v_i; + __pyx_v_last_remap_id = (*((int8_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ))); + __pyx_L21_continue:; } } - /* "fastremap.pyx":599 + /* "fastremap.pyx":615 * cdef NUMBER last_remap_id = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -77233,20 +79065,20 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif - goto __pyx_L8; + goto __pyx_L15; } - __pyx_L7_error: { + __pyx_L14_error: { #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L1_error; } - __pyx_L8:; + __pyx_L15:; } } - /* "fastremap.pyx":629 + /* "fastremap.pyx":645 * last_remap_id = arrview[i] * * return arr # <<<<<<<<<<<<<< @@ -77258,7 +79090,7 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":582 + /* "fastremap.pyx":584 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): # <<<<<<<<<<<<<< @@ -77270,9 +79102,9 @@ static PyObject *__pyx_pf_9fastremap_398_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_L1_error:; __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_18); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -77331,17 +79163,17 @@ static PyObject *__pyx_fuse_5__pyx_pw_9fastremap_401_remap(PyObject *__pyx_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_table)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 1); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 1); __PYX_ERR(0, 584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_preserve_missing_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 2); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 2); __PYX_ERR(0, 584, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_remap") < 0)) __PYX_ERR(0, 582, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_remap") < 0)) __PYX_ERR(0, 584, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -77352,18 +79184,18 @@ static PyObject *__pyx_fuse_5__pyx_pw_9fastremap_401_remap(PyObject *__pyx_self, } __pyx_v_arr = ((PyArrayObject *)values[0]); __pyx_v_table = ((PyObject*)values[1]); - __pyx_v_preserve_missing_labels = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_preserve_missing_labels == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L3_error) + __pyx_v_preserve_missing_labels = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_preserve_missing_labels == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 584, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._remap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 582, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), (&PyDict_Type), 1, "table", 1))) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 584, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), (&PyDict_Type), 1, "table", 1))) __PYX_ERR(0, 584, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_400_remap(__pyx_self, __pyx_v_arr, __pyx_v_table, __pyx_v_preserve_missing_labels); /* function exit code */ @@ -77380,7 +79212,9 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel size_t __pyx_v_i; size_t __pyx_v_size; int16_t __pyx_v_elem; - std::unordered_map __pyx_v_tbl; + int16_t __pyx_v_before; + int16_t __pyx_v_after; + ska::flat_hash_map __pyx_v_tbl; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; int16_t __pyx_v_last_elem; @@ -77393,19 +79227,20 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel PyObject *__pyx_t_2 = NULL; size_t __pyx_t_3; int __pyx_t_4; - Py_ssize_t __pyx_t_5; + int __pyx_t_5; Py_ssize_t __pyx_t_6; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - int16_t __pyx_t_11; - int16_t __pyx_t_12; - Py_ssize_t __pyx_t_13; + PyObject *__pyx_t_7 = NULL; + int16_t __pyx_t_8; + size_t __pyx_t_9; + size_t __pyx_t_10; + size_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; PyObject *__pyx_t_14 = NULL; - size_t __pyx_t_15; - size_t __pyx_t_16; - size_t __pyx_t_17; + int __pyx_t_15; + int16_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + PyObject *__pyx_t_18 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -77416,23 +79251,23 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 584, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":583 + /* "fastremap.pyx":585 * @cython.nonecheck(False) * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): * cdef NUMBER[:] arrview = arr # <<<<<<<<<<<<<< * cdef size_t i = 0 * cdef size_t size = arr.size */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 583, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 585, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":584 + /* "fastremap.pyx":586 * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): * cdef NUMBER[:] arrview = arr * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -77441,20 +79276,20 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_i = 0; - /* "fastremap.pyx":585 + /* "fastremap.pyx":587 * cdef NUMBER[:] arrview = arr * cdef size_t i = 0 * cdef size_t size = arr.size # <<<<<<<<<<<<<< * cdef NUMBER elem = 0 * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_size = __pyx_t_3; - /* "fastremap.pyx":586 + /* "fastremap.pyx":588 * cdef size_t i = 0 * cdef size_t size = arr.size * cdef NUMBER elem = 0 # <<<<<<<<<<<<<< @@ -77463,7 +79298,7 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_elem = 0; - /* "fastremap.pyx":588 + /* "fastremap.pyx":590 * cdef NUMBER elem = 0 * * if size == 0: # <<<<<<<<<<<<<< @@ -77473,19 +79308,19 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_size == 0) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":589 + /* "fastremap.pyx":591 * * if size == 0: * return arr # <<<<<<<<<<<<<< * - * cdef unordered_map[NUMBER, NUMBER] tbl + * # fast path for remapping only a single label */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_arr)); __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":588 + /* "fastremap.pyx":590 * cdef NUMBER elem = 0 * * if size == 0: # <<<<<<<<<<<<<< @@ -77494,58 +79329,237 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":593 - * cdef unordered_map[NUMBER, NUMBER] tbl + /* "fastremap.pyx":595 + * # fast path for remapping only a single label + * # e.g. for masking something out + * cdef NUMBER before = 0 # <<<<<<<<<<<<<< + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: + */ + __pyx_v_before = 0; + + /* "fastremap.pyx":596 + * # e.g. for masking something out + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 # <<<<<<<<<<<<<< + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) + */ + __pyx_v_after = 0; + + /* "fastremap.pyx":597 + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: # <<<<<<<<<<<<<< + * before = next(iter(table.keys())) + * after = table[before] + */ + __pyx_t_5 = (__pyx_v_preserve_missing_labels != 0); + if (__pyx_t_5) { + } else { + __pyx_t_4 = __pyx_t_5; + goto __pyx_L5_bool_binop_done; + } + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 597, __pyx_L1_error) + } + __pyx_t_6 = PyDict_Size(__pyx_v_table); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_5 = ((__pyx_t_6 == 1) != 0); + __pyx_t_4 = __pyx_t_5; + __pyx_L5_bool_binop_done:; + if (__pyx_t_4) { + + /* "fastremap.pyx":598 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) # <<<<<<<<<<<<<< + * after = table[before] + * if before == after: + */ + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); + __PYX_ERR(0, 598, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyDict_Keys(__pyx_v_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_8 == ((int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_before = __pyx_t_8; + + /* "fastremap.pyx":599 + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) + * after = table[before] # <<<<<<<<<<<<<< + * if before == after: + * return arr + */ + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 599, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyInt_From_int16_t(__pyx_v_before); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_table, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_7); if (unlikely((__pyx_t_8 == ((int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_after = __pyx_t_8; + + /* "fastremap.pyx":600 + * before = next(iter(table.keys())) + * after = table[before] + * if before == after: # <<<<<<<<<<<<<< + * return arr + * for i in range(size): + */ + __pyx_t_4 = ((__pyx_v_before == __pyx_v_after) != 0); + if (__pyx_t_4) { + + /* "fastremap.pyx":601 + * after = table[before] + * if before == after: + * return arr # <<<<<<<<<<<<<< + * for i in range(size): + * if arr[i] == before: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "fastremap.pyx":600 + * before = next(iter(table.keys())) + * after = table[before] + * if before == after: # <<<<<<<<<<<<<< + * return arr + * for i in range(size): + */ + } + + /* "fastremap.pyx":602 + * if before == after: + * return arr + * for i in range(size): # <<<<<<<<<<<<<< + * if arr[i] == before: + * arr[i] = after + */ + __pyx_t_3 = __pyx_v_size; + __pyx_t_9 = __pyx_t_3; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "fastremap.pyx":603 + * return arr + * for i in range(size): + * if arr[i] == before: # <<<<<<<<<<<<<< + * arr[i] = after + * return arr + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides)) == __pyx_v_before) != 0); + if (__pyx_t_4) { + + /* "fastremap.pyx":604 + * for i in range(size): + * if arr[i] == before: + * arr[i] = after # <<<<<<<<<<<<<< + * return arr + * + */ + __pyx_t_11 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides) = __pyx_v_after; + + /* "fastremap.pyx":603 + * return arr + * for i in range(size): + * if arr[i] == before: # <<<<<<<<<<<<<< + * arr[i] = after + * return arr + */ + } + } + + /* "fastremap.pyx":605 + * if arr[i] == before: + * arr[i] = after + * return arr # <<<<<<<<<<<<<< + * + * cdef flat_hash_map[NUMBER, NUMBER] tbl + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "fastremap.pyx":597 + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: # <<<<<<<<<<<<<< + * before = next(iter(table.keys())) + * after = table[before] + */ + } + + /* "fastremap.pyx":609 + * cdef flat_hash_map[NUMBER, NUMBER] tbl * * for k, v in table.items(): # <<<<<<<<<<<<<< * tbl[k] = v * */ - __pyx_t_5 = 0; + __pyx_t_6 = 0; if (unlikely(__pyx_v_table == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 593, __pyx_L1_error) + __PYX_ERR(0, 609, __pyx_L1_error) } - __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_table, 1, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_2); - __pyx_t_2 = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_table, 1, __pyx_n_s_items, (&__pyx_t_12), (&__pyx_t_13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; while (1) { - __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, &__pyx_t_8, &__pyx_t_9, NULL, __pyx_t_7); - if (unlikely(__pyx_t_10 == 0)) break; - if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_8); - __pyx_t_8 = 0; - __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_9); - __pyx_t_9 = 0; + __pyx_t_15 = __Pyx_dict_iter_next(__pyx_t_7, __pyx_t_12, &__pyx_t_6, &__pyx_t_2, &__pyx_t_14, NULL, __pyx_t_13); + if (unlikely(__pyx_t_15 == 0)) break; + if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_14); + __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_14); + __pyx_t_14 = 0; - /* "fastremap.pyx":594 + /* "fastremap.pyx":610 * * for k, v in table.items(): * tbl[k] = v # <<<<<<<<<<<<<< * * cdef NUMBER last_elem = arrview[0] */ - __pyx_t_11 = __Pyx_PyInt_As_int16_t(__pyx_v_v); if (unlikely((__pyx_t_11 == ((int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyInt_As_int16_t(__pyx_v_k); if (unlikely((__pyx_t_12 == ((int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L1_error) - (__pyx_v_tbl[__pyx_t_12]) = __pyx_t_11; + __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_v_v); if (unlikely((__pyx_t_8 == ((int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyInt_As_int16_t(__pyx_v_k); if (unlikely((__pyx_t_16 == ((int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) + (__pyx_v_tbl[__pyx_t_16]) = __pyx_t_8; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "fastremap.pyx":596 + /* "fastremap.pyx":612 * tbl[k] = v * * cdef NUMBER last_elem = arrview[0] # <<<<<<<<<<<<<< * cdef NUMBER last_remap_id = 0 * */ - __pyx_t_13 = 0; - __pyx_v_last_elem = (*((int16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_17 = 0; + __pyx_v_last_elem = (*((int16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":597 + /* "fastremap.pyx":613 * * cdef NUMBER last_elem = arrview[0] * cdef NUMBER last_remap_id = 0 # <<<<<<<<<<<<<< @@ -77554,7 +79568,7 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_remap_id = 0; - /* "fastremap.pyx":599 + /* "fastremap.pyx":615 * cdef NUMBER last_remap_id = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -77569,7 +79583,7 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel #endif /*try:*/ { - /* "fastremap.pyx":600 + /* "fastremap.pyx":616 * * with nogil: * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -77579,7 +79593,7 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_last_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":601 + /* "fastremap.pyx":617 * with nogil: * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: # <<<<<<<<<<<<<< @@ -77589,7 +79603,7 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((!(__pyx_v_preserve_missing_labels != 0)) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":602 + /* "fastremap.pyx":618 * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: * raise KeyError("{} was not in the remap table.".format(last_elem)) # <<<<<<<<<<<<<< @@ -77601,44 +79615,44 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyInt_From_int16_t(__pyx_v_last_elem); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_14); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_2 = __Pyx_PyInt_From_int16_t(__pyx_v_last_elem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) { + __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_14); + if (likely(__pyx_t_18)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); + __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); + __Pyx_DECREF_SET(__pyx_t_14, function); } } - __pyx_t_2 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = (__pyx_t_18) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_18, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_9, 0, 0, 0); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(0, 602, __pyx_L12_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_14, 0, 0, 0); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __PYX_ERR(0, 618, __pyx_L19_error) } /*finally:*/ { - __pyx_L12_error: { + __pyx_L19_error: { #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - goto __pyx_L7_error; + goto __pyx_L14_error; } } } - /* "fastremap.pyx":601 + /* "fastremap.pyx":617 * with nogil: * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: # <<<<<<<<<<<<<< @@ -77647,7 +79661,7 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":604 + /* "fastremap.pyx":620 * raise KeyError("{} was not in the remap table.".format(last_elem)) * else: * last_remap_id = last_elem # <<<<<<<<<<<<<< @@ -77658,17 +79672,17 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_v_last_remap_id = __pyx_v_last_elem; } - /* "fastremap.pyx":600 + /* "fastremap.pyx":616 * * with nogil: * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< * if not preserve_missing_labels: * raise KeyError("{} was not in the remap table.".format(last_elem)) */ - goto __pyx_L9; + goto __pyx_L16; } - /* "fastremap.pyx":606 + /* "fastremap.pyx":622 * last_remap_id = last_elem * else: * arrview[0] = tbl[last_elem] # <<<<<<<<<<<<<< @@ -77676,22 +79690,22 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel * */ /*else*/ { - __pyx_t_13 = 0; - *((int16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_last_elem]); + __pyx_t_17 = 0; + *((int16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_last_elem]); - /* "fastremap.pyx":607 + /* "fastremap.pyx":623 * else: * arrview[0] = tbl[last_elem] * last_remap_id = arrview[0] # <<<<<<<<<<<<<< * * for i in range(1, size): */ - __pyx_t_13 = 0; - __pyx_v_last_remap_id = (*((int16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_17 = 0; + __pyx_v_last_remap_id = (*((int16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); } - __pyx_L9:; + __pyx_L16:; - /* "fastremap.pyx":609 + /* "fastremap.pyx":625 * last_remap_id = arrview[0] * * for i in range(1, size): # <<<<<<<<<<<<<< @@ -77699,21 +79713,21 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel * */ __pyx_t_3 = __pyx_v_size; - __pyx_t_15 = __pyx_t_3; - for (__pyx_t_16 = 1; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { - __pyx_v_i = __pyx_t_16; + __pyx_t_9 = __pyx_t_3; + for (__pyx_t_10 = 1; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":610 + /* "fastremap.pyx":626 * * for i in range(1, size): * elem = arrview[i] # <<<<<<<<<<<<<< * * if elem == last_elem: */ - __pyx_t_17 = __pyx_v_i; - __pyx_v_elem = (*((int16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_11 = __pyx_v_i; + __pyx_v_elem = (*((int16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":612 + /* "fastremap.pyx":628 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -77723,26 +79737,26 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_elem == __pyx_v_last_elem) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":613 + /* "fastremap.pyx":629 * * if elem == last_elem: * arrview[i] = last_remap_id # <<<<<<<<<<<<<< * continue * */ - __pyx_t_17 = __pyx_v_i; - *((int16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; + __pyx_t_11 = __pyx_v_i; + *((int16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; - /* "fastremap.pyx":614 + /* "fastremap.pyx":630 * if elem == last_elem: * arrview[i] = last_remap_id * continue # <<<<<<<<<<<<<< * * if tbl.find(elem) == tbl.end(): */ - goto __pyx_L14_continue; + goto __pyx_L21_continue; - /* "fastremap.pyx":612 + /* "fastremap.pyx":628 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -77751,7 +79765,7 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":616 + /* "fastremap.pyx":632 * continue * * if tbl.find(elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -77761,7 +79775,7 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":617 + /* "fastremap.pyx":633 * * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: # <<<<<<<<<<<<<< @@ -77771,7 +79785,7 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = (__pyx_v_preserve_missing_labels != 0); if (__pyx_t_4) { - /* "fastremap.pyx":618 + /* "fastremap.pyx":634 * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: * last_elem = elem # <<<<<<<<<<<<<< @@ -77780,7 +79794,7 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":619 + /* "fastremap.pyx":635 * if preserve_missing_labels: * last_elem = elem * last_remap_id = elem # <<<<<<<<<<<<<< @@ -77789,16 +79803,16 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_remap_id = __pyx_v_elem; - /* "fastremap.pyx":620 + /* "fastremap.pyx":636 * last_elem = elem * last_remap_id = elem * continue # <<<<<<<<<<<<<< * else: * raise KeyError("{} was not in the remap table.".format(elem)) */ - goto __pyx_L14_continue; + goto __pyx_L21_continue; - /* "fastremap.pyx":617 + /* "fastremap.pyx":633 * * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: # <<<<<<<<<<<<<< @@ -77807,7 +79821,7 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":622 + /* "fastremap.pyx":638 * continue * else: * raise KeyError("{} was not in the remap table.".format(elem)) # <<<<<<<<<<<<<< @@ -77820,45 +79834,45 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L22_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PyInt_From_int16_t(__pyx_v_elem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyInt_From_int16_t(__pyx_v_elem); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_14); + __pyx_t_18 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_18)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); + __Pyx_DECREF_SET(__pyx_t_7, function); } } - __pyx_t_9 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __pyx_t_14 = (__pyx_t_18) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_18, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 622, __pyx_L22_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(0, 638, __pyx_L29_error) } /*finally:*/ { - __pyx_L22_error: { + __pyx_L29_error: { #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - goto __pyx_L7_error; + goto __pyx_L14_error; } } } } - /* "fastremap.pyx":616 + /* "fastremap.pyx":632 * continue * * if tbl.find(elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -77867,7 +79881,7 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":624 + /* "fastremap.pyx":640 * raise KeyError("{} was not in the remap table.".format(elem)) * else: * arrview[i] = tbl[elem] # <<<<<<<<<<<<<< @@ -77875,11 +79889,11 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel * last_elem = elem */ /*else*/ { - __pyx_t_17 = __pyx_v_i; - *((int16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_elem]); + __pyx_t_11 = __pyx_v_i; + *((int16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_elem]); } - /* "fastremap.pyx":626 + /* "fastremap.pyx":642 * arrview[i] = tbl[elem] * * last_elem = elem # <<<<<<<<<<<<<< @@ -77888,20 +79902,20 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":627 + /* "fastremap.pyx":643 * * last_elem = elem * last_remap_id = arrview[i] # <<<<<<<<<<<<<< * * return arr */ - __pyx_t_17 = __pyx_v_i; - __pyx_v_last_remap_id = (*((int16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); - __pyx_L14_continue:; + __pyx_t_11 = __pyx_v_i; + __pyx_v_last_remap_id = (*((int16_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ))); + __pyx_L21_continue:; } } - /* "fastremap.pyx":599 + /* "fastremap.pyx":615 * cdef NUMBER last_remap_id = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -77914,20 +79928,20 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif - goto __pyx_L8; + goto __pyx_L15; } - __pyx_L7_error: { + __pyx_L14_error: { #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L1_error; } - __pyx_L8:; + __pyx_L15:; } } - /* "fastremap.pyx":629 + /* "fastremap.pyx":645 * last_remap_id = arrview[i] * * return arr # <<<<<<<<<<<<<< @@ -77939,7 +79953,7 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":582 + /* "fastremap.pyx":584 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): # <<<<<<<<<<<<<< @@ -77951,9 +79965,9 @@ static PyObject *__pyx_pf_9fastremap_400_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_L1_error:; __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_18); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -78012,17 +80026,17 @@ static PyObject *__pyx_fuse_6__pyx_pw_9fastremap_403_remap(PyObject *__pyx_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_table)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 1); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 1); __PYX_ERR(0, 584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_preserve_missing_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 2); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 2); __PYX_ERR(0, 584, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_remap") < 0)) __PYX_ERR(0, 582, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_remap") < 0)) __PYX_ERR(0, 584, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -78033,18 +80047,18 @@ static PyObject *__pyx_fuse_6__pyx_pw_9fastremap_403_remap(PyObject *__pyx_self, } __pyx_v_arr = ((PyArrayObject *)values[0]); __pyx_v_table = ((PyObject*)values[1]); - __pyx_v_preserve_missing_labels = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_preserve_missing_labels == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L3_error) + __pyx_v_preserve_missing_labels = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_preserve_missing_labels == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 584, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._remap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 582, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), (&PyDict_Type), 1, "table", 1))) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 584, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), (&PyDict_Type), 1, "table", 1))) __PYX_ERR(0, 584, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_402_remap(__pyx_self, __pyx_v_arr, __pyx_v_table, __pyx_v_preserve_missing_labels); /* function exit code */ @@ -78061,7 +80075,9 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel size_t __pyx_v_i; size_t __pyx_v_size; int32_t __pyx_v_elem; - std::unordered_map __pyx_v_tbl; + int32_t __pyx_v_before; + int32_t __pyx_v_after; + ska::flat_hash_map __pyx_v_tbl; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; int32_t __pyx_v_last_elem; @@ -78074,19 +80090,20 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel PyObject *__pyx_t_2 = NULL; size_t __pyx_t_3; int __pyx_t_4; - Py_ssize_t __pyx_t_5; + int __pyx_t_5; Py_ssize_t __pyx_t_6; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - int32_t __pyx_t_11; - int32_t __pyx_t_12; - Py_ssize_t __pyx_t_13; + PyObject *__pyx_t_7 = NULL; + int32_t __pyx_t_8; + size_t __pyx_t_9; + size_t __pyx_t_10; + size_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; PyObject *__pyx_t_14 = NULL; - size_t __pyx_t_15; - size_t __pyx_t_16; - size_t __pyx_t_17; + int __pyx_t_15; + int32_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + PyObject *__pyx_t_18 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -78097,23 +80114,23 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 584, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":583 + /* "fastremap.pyx":585 * @cython.nonecheck(False) * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): * cdef NUMBER[:] arrview = arr # <<<<<<<<<<<<<< * cdef size_t i = 0 * cdef size_t size = arr.size */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 583, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 585, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":584 + /* "fastremap.pyx":586 * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): * cdef NUMBER[:] arrview = arr * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -78122,20 +80139,20 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_i = 0; - /* "fastremap.pyx":585 + /* "fastremap.pyx":587 * cdef NUMBER[:] arrview = arr * cdef size_t i = 0 * cdef size_t size = arr.size # <<<<<<<<<<<<<< * cdef NUMBER elem = 0 * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_size = __pyx_t_3; - /* "fastremap.pyx":586 + /* "fastremap.pyx":588 * cdef size_t i = 0 * cdef size_t size = arr.size * cdef NUMBER elem = 0 # <<<<<<<<<<<<<< @@ -78144,7 +80161,7 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_elem = 0; - /* "fastremap.pyx":588 + /* "fastremap.pyx":590 * cdef NUMBER elem = 0 * * if size == 0: # <<<<<<<<<<<<<< @@ -78154,19 +80171,19 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_size == 0) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":589 + /* "fastremap.pyx":591 * * if size == 0: * return arr # <<<<<<<<<<<<<< * - * cdef unordered_map[NUMBER, NUMBER] tbl + * # fast path for remapping only a single label */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_arr)); __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":588 + /* "fastremap.pyx":590 * cdef NUMBER elem = 0 * * if size == 0: # <<<<<<<<<<<<<< @@ -78175,58 +80192,237 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":593 - * cdef unordered_map[NUMBER, NUMBER] tbl + /* "fastremap.pyx":595 + * # fast path for remapping only a single label + * # e.g. for masking something out + * cdef NUMBER before = 0 # <<<<<<<<<<<<<< + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: + */ + __pyx_v_before = 0; + + /* "fastremap.pyx":596 + * # e.g. for masking something out + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 # <<<<<<<<<<<<<< + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) + */ + __pyx_v_after = 0; + + /* "fastremap.pyx":597 + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: # <<<<<<<<<<<<<< + * before = next(iter(table.keys())) + * after = table[before] + */ + __pyx_t_5 = (__pyx_v_preserve_missing_labels != 0); + if (__pyx_t_5) { + } else { + __pyx_t_4 = __pyx_t_5; + goto __pyx_L5_bool_binop_done; + } + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 597, __pyx_L1_error) + } + __pyx_t_6 = PyDict_Size(__pyx_v_table); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_5 = ((__pyx_t_6 == 1) != 0); + __pyx_t_4 = __pyx_t_5; + __pyx_L5_bool_binop_done:; + if (__pyx_t_4) { + + /* "fastremap.pyx":598 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) # <<<<<<<<<<<<<< + * after = table[before] + * if before == after: + */ + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); + __PYX_ERR(0, 598, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyDict_Keys(__pyx_v_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_t_2); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_before = __pyx_t_8; + + /* "fastremap.pyx":599 + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) + * after = table[before] # <<<<<<<<<<<<<< + * if before == after: + * return arr + */ + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 599, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_before); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_table, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_t_7); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_after = __pyx_t_8; + + /* "fastremap.pyx":600 + * before = next(iter(table.keys())) + * after = table[before] + * if before == after: # <<<<<<<<<<<<<< + * return arr + * for i in range(size): + */ + __pyx_t_4 = ((__pyx_v_before == __pyx_v_after) != 0); + if (__pyx_t_4) { + + /* "fastremap.pyx":601 + * after = table[before] + * if before == after: + * return arr # <<<<<<<<<<<<<< + * for i in range(size): + * if arr[i] == before: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "fastremap.pyx":600 + * before = next(iter(table.keys())) + * after = table[before] + * if before == after: # <<<<<<<<<<<<<< + * return arr + * for i in range(size): + */ + } + + /* "fastremap.pyx":602 + * if before == after: + * return arr + * for i in range(size): # <<<<<<<<<<<<<< + * if arr[i] == before: + * arr[i] = after + */ + __pyx_t_3 = __pyx_v_size; + __pyx_t_9 = __pyx_t_3; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "fastremap.pyx":603 + * return arr + * for i in range(size): + * if arr[i] == before: # <<<<<<<<<<<<<< + * arr[i] = after + * return arr + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides)) == __pyx_v_before) != 0); + if (__pyx_t_4) { + + /* "fastremap.pyx":604 + * for i in range(size): + * if arr[i] == before: + * arr[i] = after # <<<<<<<<<<<<<< + * return arr + * + */ + __pyx_t_11 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides) = __pyx_v_after; + + /* "fastremap.pyx":603 + * return arr + * for i in range(size): + * if arr[i] == before: # <<<<<<<<<<<<<< + * arr[i] = after + * return arr + */ + } + } + + /* "fastremap.pyx":605 + * if arr[i] == before: + * arr[i] = after + * return arr # <<<<<<<<<<<<<< + * + * cdef flat_hash_map[NUMBER, NUMBER] tbl + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "fastremap.pyx":597 + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: # <<<<<<<<<<<<<< + * before = next(iter(table.keys())) + * after = table[before] + */ + } + + /* "fastremap.pyx":609 + * cdef flat_hash_map[NUMBER, NUMBER] tbl * * for k, v in table.items(): # <<<<<<<<<<<<<< * tbl[k] = v * */ - __pyx_t_5 = 0; + __pyx_t_6 = 0; if (unlikely(__pyx_v_table == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 593, __pyx_L1_error) + __PYX_ERR(0, 609, __pyx_L1_error) } - __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_table, 1, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_2); - __pyx_t_2 = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_table, 1, __pyx_n_s_items, (&__pyx_t_12), (&__pyx_t_13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; while (1) { - __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, &__pyx_t_8, &__pyx_t_9, NULL, __pyx_t_7); - if (unlikely(__pyx_t_10 == 0)) break; - if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_8); - __pyx_t_8 = 0; - __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_9); - __pyx_t_9 = 0; + __pyx_t_15 = __Pyx_dict_iter_next(__pyx_t_7, __pyx_t_12, &__pyx_t_6, &__pyx_t_2, &__pyx_t_14, NULL, __pyx_t_13); + if (unlikely(__pyx_t_15 == 0)) break; + if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_14); + __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_14); + __pyx_t_14 = 0; - /* "fastremap.pyx":594 + /* "fastremap.pyx":610 * * for k, v in table.items(): * tbl[k] = v # <<<<<<<<<<<<<< * * cdef NUMBER last_elem = arrview[0] */ - __pyx_t_11 = __Pyx_PyInt_As_int32_t(__pyx_v_v); if (unlikely((__pyx_t_11 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyInt_As_int32_t(__pyx_v_k); if (unlikely((__pyx_t_12 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L1_error) - (__pyx_v_tbl[__pyx_t_12]) = __pyx_t_11; + __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_v_v); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyInt_As_int32_t(__pyx_v_k); if (unlikely((__pyx_t_16 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) + (__pyx_v_tbl[__pyx_t_16]) = __pyx_t_8; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "fastremap.pyx":596 + /* "fastremap.pyx":612 * tbl[k] = v * * cdef NUMBER last_elem = arrview[0] # <<<<<<<<<<<<<< * cdef NUMBER last_remap_id = 0 * */ - __pyx_t_13 = 0; - __pyx_v_last_elem = (*((int32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_17 = 0; + __pyx_v_last_elem = (*((int32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":597 + /* "fastremap.pyx":613 * * cdef NUMBER last_elem = arrview[0] * cdef NUMBER last_remap_id = 0 # <<<<<<<<<<<<<< @@ -78235,7 +80431,7 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_remap_id = 0; - /* "fastremap.pyx":599 + /* "fastremap.pyx":615 * cdef NUMBER last_remap_id = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -78250,7 +80446,7 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel #endif /*try:*/ { - /* "fastremap.pyx":600 + /* "fastremap.pyx":616 * * with nogil: * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -78260,7 +80456,7 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_last_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":601 + /* "fastremap.pyx":617 * with nogil: * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: # <<<<<<<<<<<<<< @@ -78270,7 +80466,7 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((!(__pyx_v_preserve_missing_labels != 0)) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":602 + /* "fastremap.pyx":618 * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: * raise KeyError("{} was not in the remap table.".format(last_elem)) # <<<<<<<<<<<<<< @@ -78282,44 +80478,44 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyInt_From_int32_t(__pyx_v_last_elem); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_14); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_last_elem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) { + __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_14); + if (likely(__pyx_t_18)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); + __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); + __Pyx_DECREF_SET(__pyx_t_14, function); } } - __pyx_t_2 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = (__pyx_t_18) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_18, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_9, 0, 0, 0); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(0, 602, __pyx_L12_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_14, 0, 0, 0); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __PYX_ERR(0, 618, __pyx_L19_error) } /*finally:*/ { - __pyx_L12_error: { + __pyx_L19_error: { #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - goto __pyx_L7_error; + goto __pyx_L14_error; } } } - /* "fastremap.pyx":601 + /* "fastremap.pyx":617 * with nogil: * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: # <<<<<<<<<<<<<< @@ -78328,7 +80524,7 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":604 + /* "fastremap.pyx":620 * raise KeyError("{} was not in the remap table.".format(last_elem)) * else: * last_remap_id = last_elem # <<<<<<<<<<<<<< @@ -78339,17 +80535,17 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_v_last_remap_id = __pyx_v_last_elem; } - /* "fastremap.pyx":600 + /* "fastremap.pyx":616 * * with nogil: * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< * if not preserve_missing_labels: * raise KeyError("{} was not in the remap table.".format(last_elem)) */ - goto __pyx_L9; + goto __pyx_L16; } - /* "fastremap.pyx":606 + /* "fastremap.pyx":622 * last_remap_id = last_elem * else: * arrview[0] = tbl[last_elem] # <<<<<<<<<<<<<< @@ -78357,22 +80553,22 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel * */ /*else*/ { - __pyx_t_13 = 0; - *((int32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_last_elem]); + __pyx_t_17 = 0; + *((int32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_last_elem]); - /* "fastremap.pyx":607 + /* "fastremap.pyx":623 * else: * arrview[0] = tbl[last_elem] * last_remap_id = arrview[0] # <<<<<<<<<<<<<< * * for i in range(1, size): */ - __pyx_t_13 = 0; - __pyx_v_last_remap_id = (*((int32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_17 = 0; + __pyx_v_last_remap_id = (*((int32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); } - __pyx_L9:; + __pyx_L16:; - /* "fastremap.pyx":609 + /* "fastremap.pyx":625 * last_remap_id = arrview[0] * * for i in range(1, size): # <<<<<<<<<<<<<< @@ -78380,21 +80576,21 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel * */ __pyx_t_3 = __pyx_v_size; - __pyx_t_15 = __pyx_t_3; - for (__pyx_t_16 = 1; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { - __pyx_v_i = __pyx_t_16; + __pyx_t_9 = __pyx_t_3; + for (__pyx_t_10 = 1; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":610 + /* "fastremap.pyx":626 * * for i in range(1, size): * elem = arrview[i] # <<<<<<<<<<<<<< * * if elem == last_elem: */ - __pyx_t_17 = __pyx_v_i; - __pyx_v_elem = (*((int32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_11 = __pyx_v_i; + __pyx_v_elem = (*((int32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":612 + /* "fastremap.pyx":628 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -78404,26 +80600,26 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_elem == __pyx_v_last_elem) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":613 + /* "fastremap.pyx":629 * * if elem == last_elem: * arrview[i] = last_remap_id # <<<<<<<<<<<<<< * continue * */ - __pyx_t_17 = __pyx_v_i; - *((int32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; + __pyx_t_11 = __pyx_v_i; + *((int32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; - /* "fastremap.pyx":614 + /* "fastremap.pyx":630 * if elem == last_elem: * arrview[i] = last_remap_id * continue # <<<<<<<<<<<<<< * * if tbl.find(elem) == tbl.end(): */ - goto __pyx_L14_continue; + goto __pyx_L21_continue; - /* "fastremap.pyx":612 + /* "fastremap.pyx":628 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -78432,7 +80628,7 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":616 + /* "fastremap.pyx":632 * continue * * if tbl.find(elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -78442,7 +80638,7 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":617 + /* "fastremap.pyx":633 * * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: # <<<<<<<<<<<<<< @@ -78452,7 +80648,7 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = (__pyx_v_preserve_missing_labels != 0); if (__pyx_t_4) { - /* "fastremap.pyx":618 + /* "fastremap.pyx":634 * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: * last_elem = elem # <<<<<<<<<<<<<< @@ -78461,7 +80657,7 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":619 + /* "fastremap.pyx":635 * if preserve_missing_labels: * last_elem = elem * last_remap_id = elem # <<<<<<<<<<<<<< @@ -78470,16 +80666,16 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_remap_id = __pyx_v_elem; - /* "fastremap.pyx":620 + /* "fastremap.pyx":636 * last_elem = elem * last_remap_id = elem * continue # <<<<<<<<<<<<<< * else: * raise KeyError("{} was not in the remap table.".format(elem)) */ - goto __pyx_L14_continue; + goto __pyx_L21_continue; - /* "fastremap.pyx":617 + /* "fastremap.pyx":633 * * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: # <<<<<<<<<<<<<< @@ -78488,7 +80684,7 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":622 + /* "fastremap.pyx":638 * continue * else: * raise KeyError("{} was not in the remap table.".format(elem)) # <<<<<<<<<<<<<< @@ -78501,45 +80697,45 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L22_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_elem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyInt_From_int32_t(__pyx_v_elem); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_14); + __pyx_t_18 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_18)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); + __Pyx_DECREF_SET(__pyx_t_7, function); } } - __pyx_t_9 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __pyx_t_14 = (__pyx_t_18) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_18, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 622, __pyx_L22_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(0, 638, __pyx_L29_error) } /*finally:*/ { - __pyx_L22_error: { + __pyx_L29_error: { #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - goto __pyx_L7_error; + goto __pyx_L14_error; } } } } - /* "fastremap.pyx":616 + /* "fastremap.pyx":632 * continue * * if tbl.find(elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -78548,7 +80744,7 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":624 + /* "fastremap.pyx":640 * raise KeyError("{} was not in the remap table.".format(elem)) * else: * arrview[i] = tbl[elem] # <<<<<<<<<<<<<< @@ -78556,11 +80752,11 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel * last_elem = elem */ /*else*/ { - __pyx_t_17 = __pyx_v_i; - *((int32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_elem]); + __pyx_t_11 = __pyx_v_i; + *((int32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_elem]); } - /* "fastremap.pyx":626 + /* "fastremap.pyx":642 * arrview[i] = tbl[elem] * * last_elem = elem # <<<<<<<<<<<<<< @@ -78569,20 +80765,20 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":627 + /* "fastremap.pyx":643 * * last_elem = elem * last_remap_id = arrview[i] # <<<<<<<<<<<<<< * * return arr */ - __pyx_t_17 = __pyx_v_i; - __pyx_v_last_remap_id = (*((int32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); - __pyx_L14_continue:; + __pyx_t_11 = __pyx_v_i; + __pyx_v_last_remap_id = (*((int32_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ))); + __pyx_L21_continue:; } } - /* "fastremap.pyx":599 + /* "fastremap.pyx":615 * cdef NUMBER last_remap_id = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -78595,20 +80791,20 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif - goto __pyx_L8; + goto __pyx_L15; } - __pyx_L7_error: { + __pyx_L14_error: { #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L1_error; } - __pyx_L8:; + __pyx_L15:; } } - /* "fastremap.pyx":629 + /* "fastremap.pyx":645 * last_remap_id = arrview[i] * * return arr # <<<<<<<<<<<<<< @@ -78620,7 +80816,7 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":582 + /* "fastremap.pyx":584 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): # <<<<<<<<<<<<<< @@ -78632,9 +80828,9 @@ static PyObject *__pyx_pf_9fastremap_402_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_L1_error:; __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_18); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -78693,17 +80889,17 @@ static PyObject *__pyx_fuse_7__pyx_pw_9fastremap_405_remap(PyObject *__pyx_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_table)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 1); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 1); __PYX_ERR(0, 584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_preserve_missing_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 2); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 2); __PYX_ERR(0, 584, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_remap") < 0)) __PYX_ERR(0, 582, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_remap") < 0)) __PYX_ERR(0, 584, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -78714,18 +80910,18 @@ static PyObject *__pyx_fuse_7__pyx_pw_9fastremap_405_remap(PyObject *__pyx_self, } __pyx_v_arr = ((PyArrayObject *)values[0]); __pyx_v_table = ((PyObject*)values[1]); - __pyx_v_preserve_missing_labels = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_preserve_missing_labels == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L3_error) + __pyx_v_preserve_missing_labels = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_preserve_missing_labels == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 584, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._remap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 582, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), (&PyDict_Type), 1, "table", 1))) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 584, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), (&PyDict_Type), 1, "table", 1))) __PYX_ERR(0, 584, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_404_remap(__pyx_self, __pyx_v_arr, __pyx_v_table, __pyx_v_preserve_missing_labels); /* function exit code */ @@ -78742,7 +80938,9 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel size_t __pyx_v_i; size_t __pyx_v_size; int64_t __pyx_v_elem; - std::unordered_map __pyx_v_tbl; + int64_t __pyx_v_before; + int64_t __pyx_v_after; + ska::flat_hash_map __pyx_v_tbl; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; int64_t __pyx_v_last_elem; @@ -78755,19 +80953,20 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel PyObject *__pyx_t_2 = NULL; size_t __pyx_t_3; int __pyx_t_4; - Py_ssize_t __pyx_t_5; + int __pyx_t_5; Py_ssize_t __pyx_t_6; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - int64_t __pyx_t_11; - int64_t __pyx_t_12; - Py_ssize_t __pyx_t_13; + PyObject *__pyx_t_7 = NULL; + int64_t __pyx_t_8; + size_t __pyx_t_9; + size_t __pyx_t_10; + size_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; PyObject *__pyx_t_14 = NULL; - size_t __pyx_t_15; - size_t __pyx_t_16; - size_t __pyx_t_17; + int __pyx_t_15; + int64_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + PyObject *__pyx_t_18 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -78778,23 +80977,23 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 584, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":583 + /* "fastremap.pyx":585 * @cython.nonecheck(False) * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): * cdef NUMBER[:] arrview = arr # <<<<<<<<<<<<<< * cdef size_t i = 0 * cdef size_t size = arr.size */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 583, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 585, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":584 + /* "fastremap.pyx":586 * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): * cdef NUMBER[:] arrview = arr * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -78803,20 +81002,20 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_i = 0; - /* "fastremap.pyx":585 + /* "fastremap.pyx":587 * cdef NUMBER[:] arrview = arr * cdef size_t i = 0 * cdef size_t size = arr.size # <<<<<<<<<<<<<< * cdef NUMBER elem = 0 * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_size = __pyx_t_3; - /* "fastremap.pyx":586 + /* "fastremap.pyx":588 * cdef size_t i = 0 * cdef size_t size = arr.size * cdef NUMBER elem = 0 # <<<<<<<<<<<<<< @@ -78825,7 +81024,7 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_elem = 0; - /* "fastremap.pyx":588 + /* "fastremap.pyx":590 * cdef NUMBER elem = 0 * * if size == 0: # <<<<<<<<<<<<<< @@ -78835,19 +81034,19 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_size == 0) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":589 + /* "fastremap.pyx":591 * * if size == 0: * return arr # <<<<<<<<<<<<<< * - * cdef unordered_map[NUMBER, NUMBER] tbl + * # fast path for remapping only a single label */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_arr)); __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":588 + /* "fastremap.pyx":590 * cdef NUMBER elem = 0 * * if size == 0: # <<<<<<<<<<<<<< @@ -78856,58 +81055,237 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":593 - * cdef unordered_map[NUMBER, NUMBER] tbl + /* "fastremap.pyx":595 + * # fast path for remapping only a single label + * # e.g. for masking something out + * cdef NUMBER before = 0 # <<<<<<<<<<<<<< + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: + */ + __pyx_v_before = 0; + + /* "fastremap.pyx":596 + * # e.g. for masking something out + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 # <<<<<<<<<<<<<< + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) + */ + __pyx_v_after = 0; + + /* "fastremap.pyx":597 + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: # <<<<<<<<<<<<<< + * before = next(iter(table.keys())) + * after = table[before] + */ + __pyx_t_5 = (__pyx_v_preserve_missing_labels != 0); + if (__pyx_t_5) { + } else { + __pyx_t_4 = __pyx_t_5; + goto __pyx_L5_bool_binop_done; + } + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 597, __pyx_L1_error) + } + __pyx_t_6 = PyDict_Size(__pyx_v_table); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_5 = ((__pyx_t_6 == 1) != 0); + __pyx_t_4 = __pyx_t_5; + __pyx_L5_bool_binop_done:; + if (__pyx_t_4) { + + /* "fastremap.pyx":598 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) # <<<<<<<<<<<<<< + * after = table[before] + * if before == after: + */ + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); + __PYX_ERR(0, 598, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyDict_Keys(__pyx_v_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_before = __pyx_t_8; + + /* "fastremap.pyx":599 + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) + * after = table[before] # <<<<<<<<<<<<<< + * if before == after: + * return arr + */ + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 599, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_before); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_table, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_t_7); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_after = __pyx_t_8; + + /* "fastremap.pyx":600 + * before = next(iter(table.keys())) + * after = table[before] + * if before == after: # <<<<<<<<<<<<<< + * return arr + * for i in range(size): + */ + __pyx_t_4 = ((__pyx_v_before == __pyx_v_after) != 0); + if (__pyx_t_4) { + + /* "fastremap.pyx":601 + * after = table[before] + * if before == after: + * return arr # <<<<<<<<<<<<<< + * for i in range(size): + * if arr[i] == before: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "fastremap.pyx":600 + * before = next(iter(table.keys())) + * after = table[before] + * if before == after: # <<<<<<<<<<<<<< + * return arr + * for i in range(size): + */ + } + + /* "fastremap.pyx":602 + * if before == after: + * return arr + * for i in range(size): # <<<<<<<<<<<<<< + * if arr[i] == before: + * arr[i] = after + */ + __pyx_t_3 = __pyx_v_size; + __pyx_t_9 = __pyx_t_3; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "fastremap.pyx":603 + * return arr + * for i in range(size): + * if arr[i] == before: # <<<<<<<<<<<<<< + * arr[i] = after + * return arr + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides)) == __pyx_v_before) != 0); + if (__pyx_t_4) { + + /* "fastremap.pyx":604 + * for i in range(size): + * if arr[i] == before: + * arr[i] = after # <<<<<<<<<<<<<< + * return arr + * + */ + __pyx_t_11 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides) = __pyx_v_after; + + /* "fastremap.pyx":603 + * return arr + * for i in range(size): + * if arr[i] == before: # <<<<<<<<<<<<<< + * arr[i] = after + * return arr + */ + } + } + + /* "fastremap.pyx":605 + * if arr[i] == before: + * arr[i] = after + * return arr # <<<<<<<<<<<<<< + * + * cdef flat_hash_map[NUMBER, NUMBER] tbl + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "fastremap.pyx":597 + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: # <<<<<<<<<<<<<< + * before = next(iter(table.keys())) + * after = table[before] + */ + } + + /* "fastremap.pyx":609 + * cdef flat_hash_map[NUMBER, NUMBER] tbl * * for k, v in table.items(): # <<<<<<<<<<<<<< * tbl[k] = v * */ - __pyx_t_5 = 0; + __pyx_t_6 = 0; if (unlikely(__pyx_v_table == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 593, __pyx_L1_error) + __PYX_ERR(0, 609, __pyx_L1_error) } - __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_table, 1, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_2); - __pyx_t_2 = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_table, 1, __pyx_n_s_items, (&__pyx_t_12), (&__pyx_t_13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; while (1) { - __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, &__pyx_t_8, &__pyx_t_9, NULL, __pyx_t_7); - if (unlikely(__pyx_t_10 == 0)) break; - if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_8); - __pyx_t_8 = 0; - __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_9); - __pyx_t_9 = 0; + __pyx_t_15 = __Pyx_dict_iter_next(__pyx_t_7, __pyx_t_12, &__pyx_t_6, &__pyx_t_2, &__pyx_t_14, NULL, __pyx_t_13); + if (unlikely(__pyx_t_15 == 0)) break; + if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_14); + __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_14); + __pyx_t_14 = 0; - /* "fastremap.pyx":594 + /* "fastremap.pyx":610 * * for k, v in table.items(): * tbl[k] = v # <<<<<<<<<<<<<< * * cdef NUMBER last_elem = arrview[0] */ - __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_v_v); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_v_k); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L1_error) - (__pyx_v_tbl[__pyx_t_12]) = __pyx_t_11; + __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_v_v); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyInt_As_int64_t(__pyx_v_k); if (unlikely((__pyx_t_16 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) + (__pyx_v_tbl[__pyx_t_16]) = __pyx_t_8; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "fastremap.pyx":596 + /* "fastremap.pyx":612 * tbl[k] = v * * cdef NUMBER last_elem = arrview[0] # <<<<<<<<<<<<<< * cdef NUMBER last_remap_id = 0 * */ - __pyx_t_13 = 0; - __pyx_v_last_elem = (*((int64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_17 = 0; + __pyx_v_last_elem = (*((int64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":597 + /* "fastremap.pyx":613 * * cdef NUMBER last_elem = arrview[0] * cdef NUMBER last_remap_id = 0 # <<<<<<<<<<<<<< @@ -78916,7 +81294,7 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_remap_id = 0; - /* "fastremap.pyx":599 + /* "fastremap.pyx":615 * cdef NUMBER last_remap_id = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -78931,7 +81309,7 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel #endif /*try:*/ { - /* "fastremap.pyx":600 + /* "fastremap.pyx":616 * * with nogil: * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -78941,7 +81319,7 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_last_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":601 + /* "fastremap.pyx":617 * with nogil: * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: # <<<<<<<<<<<<<< @@ -78951,7 +81329,7 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((!(__pyx_v_preserve_missing_labels != 0)) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":602 + /* "fastremap.pyx":618 * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: * raise KeyError("{} was not in the remap table.".format(last_elem)) # <<<<<<<<<<<<<< @@ -78963,44 +81341,44 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyInt_From_int64_t(__pyx_v_last_elem); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_14); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_last_elem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) { + __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_14); + if (likely(__pyx_t_18)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); + __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); + __Pyx_DECREF_SET(__pyx_t_14, function); } } - __pyx_t_2 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = (__pyx_t_18) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_18, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_9, 0, 0, 0); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(0, 602, __pyx_L12_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_14, 0, 0, 0); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __PYX_ERR(0, 618, __pyx_L19_error) } /*finally:*/ { - __pyx_L12_error: { + __pyx_L19_error: { #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - goto __pyx_L7_error; + goto __pyx_L14_error; } } } - /* "fastremap.pyx":601 + /* "fastremap.pyx":617 * with nogil: * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: # <<<<<<<<<<<<<< @@ -79009,7 +81387,7 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":604 + /* "fastremap.pyx":620 * raise KeyError("{} was not in the remap table.".format(last_elem)) * else: * last_remap_id = last_elem # <<<<<<<<<<<<<< @@ -79020,17 +81398,17 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_v_last_remap_id = __pyx_v_last_elem; } - /* "fastremap.pyx":600 + /* "fastremap.pyx":616 * * with nogil: * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< * if not preserve_missing_labels: * raise KeyError("{} was not in the remap table.".format(last_elem)) */ - goto __pyx_L9; + goto __pyx_L16; } - /* "fastremap.pyx":606 + /* "fastremap.pyx":622 * last_remap_id = last_elem * else: * arrview[0] = tbl[last_elem] # <<<<<<<<<<<<<< @@ -79038,22 +81416,22 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel * */ /*else*/ { - __pyx_t_13 = 0; - *((int64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_last_elem]); + __pyx_t_17 = 0; + *((int64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_last_elem]); - /* "fastremap.pyx":607 + /* "fastremap.pyx":623 * else: * arrview[0] = tbl[last_elem] * last_remap_id = arrview[0] # <<<<<<<<<<<<<< * * for i in range(1, size): */ - __pyx_t_13 = 0; - __pyx_v_last_remap_id = (*((int64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_17 = 0; + __pyx_v_last_remap_id = (*((int64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); } - __pyx_L9:; + __pyx_L16:; - /* "fastremap.pyx":609 + /* "fastremap.pyx":625 * last_remap_id = arrview[0] * * for i in range(1, size): # <<<<<<<<<<<<<< @@ -79061,21 +81439,21 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel * */ __pyx_t_3 = __pyx_v_size; - __pyx_t_15 = __pyx_t_3; - for (__pyx_t_16 = 1; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { - __pyx_v_i = __pyx_t_16; + __pyx_t_9 = __pyx_t_3; + for (__pyx_t_10 = 1; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":610 + /* "fastremap.pyx":626 * * for i in range(1, size): * elem = arrview[i] # <<<<<<<<<<<<<< * * if elem == last_elem: */ - __pyx_t_17 = __pyx_v_i; - __pyx_v_elem = (*((int64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_11 = __pyx_v_i; + __pyx_v_elem = (*((int64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":612 + /* "fastremap.pyx":628 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -79085,26 +81463,26 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_elem == __pyx_v_last_elem) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":613 + /* "fastremap.pyx":629 * * if elem == last_elem: * arrview[i] = last_remap_id # <<<<<<<<<<<<<< * continue * */ - __pyx_t_17 = __pyx_v_i; - *((int64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; + __pyx_t_11 = __pyx_v_i; + *((int64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; - /* "fastremap.pyx":614 + /* "fastremap.pyx":630 * if elem == last_elem: * arrview[i] = last_remap_id * continue # <<<<<<<<<<<<<< * * if tbl.find(elem) == tbl.end(): */ - goto __pyx_L14_continue; + goto __pyx_L21_continue; - /* "fastremap.pyx":612 + /* "fastremap.pyx":628 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -79113,7 +81491,7 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":616 + /* "fastremap.pyx":632 * continue * * if tbl.find(elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -79123,7 +81501,7 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":617 + /* "fastremap.pyx":633 * * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: # <<<<<<<<<<<<<< @@ -79133,7 +81511,7 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = (__pyx_v_preserve_missing_labels != 0); if (__pyx_t_4) { - /* "fastremap.pyx":618 + /* "fastremap.pyx":634 * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: * last_elem = elem # <<<<<<<<<<<<<< @@ -79142,7 +81520,7 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":619 + /* "fastremap.pyx":635 * if preserve_missing_labels: * last_elem = elem * last_remap_id = elem # <<<<<<<<<<<<<< @@ -79151,16 +81529,16 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_remap_id = __pyx_v_elem; - /* "fastremap.pyx":620 + /* "fastremap.pyx":636 * last_elem = elem * last_remap_id = elem * continue # <<<<<<<<<<<<<< * else: * raise KeyError("{} was not in the remap table.".format(elem)) */ - goto __pyx_L14_continue; + goto __pyx_L21_continue; - /* "fastremap.pyx":617 + /* "fastremap.pyx":633 * * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: # <<<<<<<<<<<<<< @@ -79169,7 +81547,7 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":622 + /* "fastremap.pyx":638 * continue * else: * raise KeyError("{} was not in the remap table.".format(elem)) # <<<<<<<<<<<<<< @@ -79182,45 +81560,45 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L22_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_elem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyInt_From_int64_t(__pyx_v_elem); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_14); + __pyx_t_18 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_18)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); + __Pyx_DECREF_SET(__pyx_t_7, function); } } - __pyx_t_9 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __pyx_t_14 = (__pyx_t_18) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_18, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 622, __pyx_L22_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(0, 638, __pyx_L29_error) } /*finally:*/ { - __pyx_L22_error: { + __pyx_L29_error: { #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - goto __pyx_L7_error; + goto __pyx_L14_error; } } } } - /* "fastremap.pyx":616 + /* "fastremap.pyx":632 * continue * * if tbl.find(elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -79229,7 +81607,7 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":624 + /* "fastremap.pyx":640 * raise KeyError("{} was not in the remap table.".format(elem)) * else: * arrview[i] = tbl[elem] # <<<<<<<<<<<<<< @@ -79237,11 +81615,11 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel * last_elem = elem */ /*else*/ { - __pyx_t_17 = __pyx_v_i; - *((int64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_elem]); + __pyx_t_11 = __pyx_v_i; + *((int64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_elem]); } - /* "fastremap.pyx":626 + /* "fastremap.pyx":642 * arrview[i] = tbl[elem] * * last_elem = elem # <<<<<<<<<<<<<< @@ -79250,20 +81628,20 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":627 + /* "fastremap.pyx":643 * * last_elem = elem * last_remap_id = arrview[i] # <<<<<<<<<<<<<< * * return arr */ - __pyx_t_17 = __pyx_v_i; - __pyx_v_last_remap_id = (*((int64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); - __pyx_L14_continue:; + __pyx_t_11 = __pyx_v_i; + __pyx_v_last_remap_id = (*((int64_t *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ))); + __pyx_L21_continue:; } } - /* "fastremap.pyx":599 + /* "fastremap.pyx":615 * cdef NUMBER last_remap_id = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -79276,20 +81654,20 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif - goto __pyx_L8; + goto __pyx_L15; } - __pyx_L7_error: { + __pyx_L14_error: { #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L1_error; } - __pyx_L8:; + __pyx_L15:; } } - /* "fastremap.pyx":629 + /* "fastremap.pyx":645 * last_remap_id = arrview[i] * * return arr # <<<<<<<<<<<<<< @@ -79301,7 +81679,7 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":582 + /* "fastremap.pyx":584 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): # <<<<<<<<<<<<<< @@ -79313,9 +81691,9 @@ static PyObject *__pyx_pf_9fastremap_404_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_L1_error:; __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_18); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -79374,17 +81752,17 @@ static PyObject *__pyx_fuse_8__pyx_pw_9fastremap_407_remap(PyObject *__pyx_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_table)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 1); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 1); __PYX_ERR(0, 584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_preserve_missing_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 2); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 2); __PYX_ERR(0, 584, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_remap") < 0)) __PYX_ERR(0, 582, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_remap") < 0)) __PYX_ERR(0, 584, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -79395,18 +81773,18 @@ static PyObject *__pyx_fuse_8__pyx_pw_9fastremap_407_remap(PyObject *__pyx_self, } __pyx_v_arr = ((PyArrayObject *)values[0]); __pyx_v_table = ((PyObject*)values[1]); - __pyx_v_preserve_missing_labels = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_preserve_missing_labels == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L3_error) + __pyx_v_preserve_missing_labels = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_preserve_missing_labels == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 584, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._remap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 582, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), (&PyDict_Type), 1, "table", 1))) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 584, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), (&PyDict_Type), 1, "table", 1))) __PYX_ERR(0, 584, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_406_remap(__pyx_self, __pyx_v_arr, __pyx_v_table, __pyx_v_preserve_missing_labels); /* function exit code */ @@ -79423,7 +81801,9 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel size_t __pyx_v_i; size_t __pyx_v_size; float __pyx_v_elem; - std::unordered_map __pyx_v_tbl; + float __pyx_v_before; + float __pyx_v_after; + ska::flat_hash_map __pyx_v_tbl; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; float __pyx_v_last_elem; @@ -79436,19 +81816,20 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel PyObject *__pyx_t_2 = NULL; size_t __pyx_t_3; int __pyx_t_4; - Py_ssize_t __pyx_t_5; + int __pyx_t_5; Py_ssize_t __pyx_t_6; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - float __pyx_t_11; - float __pyx_t_12; - Py_ssize_t __pyx_t_13; + PyObject *__pyx_t_7 = NULL; + float __pyx_t_8; + size_t __pyx_t_9; + size_t __pyx_t_10; + size_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; PyObject *__pyx_t_14 = NULL; - size_t __pyx_t_15; - size_t __pyx_t_16; - size_t __pyx_t_17; + int __pyx_t_15; + float __pyx_t_16; + Py_ssize_t __pyx_t_17; + PyObject *__pyx_t_18 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -79459,23 +81840,23 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 584, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":583 + /* "fastremap.pyx":585 * @cython.nonecheck(False) * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): * cdef NUMBER[:] arrview = arr # <<<<<<<<<<<<<< * cdef size_t i = 0 * cdef size_t size = arr.size */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 583, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 585, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":584 + /* "fastremap.pyx":586 * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): * cdef NUMBER[:] arrview = arr * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -79484,20 +81865,20 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_i = 0; - /* "fastremap.pyx":585 + /* "fastremap.pyx":587 * cdef NUMBER[:] arrview = arr * cdef size_t i = 0 * cdef size_t size = arr.size # <<<<<<<<<<<<<< * cdef NUMBER elem = 0 * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_size = __pyx_t_3; - /* "fastremap.pyx":586 + /* "fastremap.pyx":588 * cdef size_t i = 0 * cdef size_t size = arr.size * cdef NUMBER elem = 0 # <<<<<<<<<<<<<< @@ -79506,7 +81887,7 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_elem = 0.0; - /* "fastremap.pyx":588 + /* "fastremap.pyx":590 * cdef NUMBER elem = 0 * * if size == 0: # <<<<<<<<<<<<<< @@ -79516,19 +81897,19 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_size == 0) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":589 + /* "fastremap.pyx":591 * * if size == 0: * return arr # <<<<<<<<<<<<<< * - * cdef unordered_map[NUMBER, NUMBER] tbl + * # fast path for remapping only a single label */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_arr)); __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":588 + /* "fastremap.pyx":590 * cdef NUMBER elem = 0 * * if size == 0: # <<<<<<<<<<<<<< @@ -79537,58 +81918,237 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":593 - * cdef unordered_map[NUMBER, NUMBER] tbl + /* "fastremap.pyx":595 + * # fast path for remapping only a single label + * # e.g. for masking something out + * cdef NUMBER before = 0 # <<<<<<<<<<<<<< + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: + */ + __pyx_v_before = 0.0; + + /* "fastremap.pyx":596 + * # e.g. for masking something out + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 # <<<<<<<<<<<<<< + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) + */ + __pyx_v_after = 0.0; + + /* "fastremap.pyx":597 + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: # <<<<<<<<<<<<<< + * before = next(iter(table.keys())) + * after = table[before] + */ + __pyx_t_5 = (__pyx_v_preserve_missing_labels != 0); + if (__pyx_t_5) { + } else { + __pyx_t_4 = __pyx_t_5; + goto __pyx_L5_bool_binop_done; + } + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 597, __pyx_L1_error) + } + __pyx_t_6 = PyDict_Size(__pyx_v_table); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_5 = ((__pyx_t_6 == 1) != 0); + __pyx_t_4 = __pyx_t_5; + __pyx_L5_bool_binop_done:; + if (__pyx_t_4) { + + /* "fastremap.pyx":598 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) # <<<<<<<<<<<<<< + * after = table[before] + * if before == after: + */ + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); + __PYX_ERR(0, 598, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyDict_Keys(__pyx_v_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_before = __pyx_t_8; + + /* "fastremap.pyx":599 + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) + * after = table[before] # <<<<<<<<<<<<<< + * if before == after: + * return arr + */ + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 599, __pyx_L1_error) + } + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_before); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_table, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_after = __pyx_t_8; + + /* "fastremap.pyx":600 + * before = next(iter(table.keys())) + * after = table[before] + * if before == after: # <<<<<<<<<<<<<< + * return arr + * for i in range(size): + */ + __pyx_t_4 = ((__pyx_v_before == __pyx_v_after) != 0); + if (__pyx_t_4) { + + /* "fastremap.pyx":601 + * after = table[before] + * if before == after: + * return arr # <<<<<<<<<<<<<< + * for i in range(size): + * if arr[i] == before: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "fastremap.pyx":600 + * before = next(iter(table.keys())) + * after = table[before] + * if before == after: # <<<<<<<<<<<<<< + * return arr + * for i in range(size): + */ + } + + /* "fastremap.pyx":602 + * if before == after: + * return arr + * for i in range(size): # <<<<<<<<<<<<<< + * if arr[i] == before: + * arr[i] = after + */ + __pyx_t_3 = __pyx_v_size; + __pyx_t_9 = __pyx_t_3; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "fastremap.pyx":603 + * return arr + * for i in range(size): + * if arr[i] == before: # <<<<<<<<<<<<<< + * arr[i] = after + * return arr + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(float *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides)) == __pyx_v_before) != 0); + if (__pyx_t_4) { + + /* "fastremap.pyx":604 + * for i in range(size): + * if arr[i] == before: + * arr[i] = after # <<<<<<<<<<<<<< + * return arr + * + */ + __pyx_t_11 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(float *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides) = __pyx_v_after; + + /* "fastremap.pyx":603 + * return arr + * for i in range(size): + * if arr[i] == before: # <<<<<<<<<<<<<< + * arr[i] = after + * return arr + */ + } + } + + /* "fastremap.pyx":605 + * if arr[i] == before: + * arr[i] = after + * return arr # <<<<<<<<<<<<<< + * + * cdef flat_hash_map[NUMBER, NUMBER] tbl + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "fastremap.pyx":597 + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: # <<<<<<<<<<<<<< + * before = next(iter(table.keys())) + * after = table[before] + */ + } + + /* "fastremap.pyx":609 + * cdef flat_hash_map[NUMBER, NUMBER] tbl * * for k, v in table.items(): # <<<<<<<<<<<<<< * tbl[k] = v * */ - __pyx_t_5 = 0; + __pyx_t_6 = 0; if (unlikely(__pyx_v_table == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 593, __pyx_L1_error) + __PYX_ERR(0, 609, __pyx_L1_error) } - __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_table, 1, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_2); - __pyx_t_2 = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_table, 1, __pyx_n_s_items, (&__pyx_t_12), (&__pyx_t_13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; while (1) { - __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, &__pyx_t_8, &__pyx_t_9, NULL, __pyx_t_7); - if (unlikely(__pyx_t_10 == 0)) break; - if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_8); - __pyx_t_8 = 0; - __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_9); - __pyx_t_9 = 0; + __pyx_t_15 = __Pyx_dict_iter_next(__pyx_t_7, __pyx_t_12, &__pyx_t_6, &__pyx_t_2, &__pyx_t_14, NULL, __pyx_t_13); + if (unlikely(__pyx_t_15 == 0)) break; + if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_14); + __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_14); + __pyx_t_14 = 0; - /* "fastremap.pyx":594 + /* "fastremap.pyx":610 * * for k, v in table.items(): * tbl[k] = v # <<<<<<<<<<<<<< * * cdef NUMBER last_elem = arrview[0] */ - __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_v_v); if (unlikely((__pyx_t_11 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L1_error) - __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_v_k); if (unlikely((__pyx_t_12 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L1_error) - (__pyx_v_tbl[__pyx_t_12]) = __pyx_t_11; + __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_v_v); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_16 = __pyx_PyFloat_AsFloat(__pyx_v_k); if (unlikely((__pyx_t_16 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) + (__pyx_v_tbl[__pyx_t_16]) = __pyx_t_8; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "fastremap.pyx":596 + /* "fastremap.pyx":612 * tbl[k] = v * * cdef NUMBER last_elem = arrview[0] # <<<<<<<<<<<<<< * cdef NUMBER last_remap_id = 0 * */ - __pyx_t_13 = 0; - __pyx_v_last_elem = (*((float *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_17 = 0; + __pyx_v_last_elem = (*((float *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":597 + /* "fastremap.pyx":613 * * cdef NUMBER last_elem = arrview[0] * cdef NUMBER last_remap_id = 0 # <<<<<<<<<<<<<< @@ -79597,7 +82157,7 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_remap_id = 0.0; - /* "fastremap.pyx":599 + /* "fastremap.pyx":615 * cdef NUMBER last_remap_id = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -79612,7 +82172,7 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel #endif /*try:*/ { - /* "fastremap.pyx":600 + /* "fastremap.pyx":616 * * with nogil: * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -79622,7 +82182,7 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_last_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":601 + /* "fastremap.pyx":617 * with nogil: * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: # <<<<<<<<<<<<<< @@ -79632,7 +82192,7 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((!(__pyx_v_preserve_missing_labels != 0)) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":602 + /* "fastremap.pyx":618 * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: * raise KeyError("{} was not in the remap table.".format(last_elem)) # <<<<<<<<<<<<<< @@ -79644,44 +82204,44 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = PyFloat_FromDouble(__pyx_v_last_elem); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_14); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_last_elem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) { + __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_14); + if (likely(__pyx_t_18)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); + __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); + __Pyx_DECREF_SET(__pyx_t_14, function); } } - __pyx_t_2 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = (__pyx_t_18) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_18, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_9, 0, 0, 0); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(0, 602, __pyx_L12_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_14, 0, 0, 0); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __PYX_ERR(0, 618, __pyx_L19_error) } /*finally:*/ { - __pyx_L12_error: { + __pyx_L19_error: { #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - goto __pyx_L7_error; + goto __pyx_L14_error; } } } - /* "fastremap.pyx":601 + /* "fastremap.pyx":617 * with nogil: * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: # <<<<<<<<<<<<<< @@ -79690,7 +82250,7 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":604 + /* "fastremap.pyx":620 * raise KeyError("{} was not in the remap table.".format(last_elem)) * else: * last_remap_id = last_elem # <<<<<<<<<<<<<< @@ -79701,17 +82261,17 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_v_last_remap_id = __pyx_v_last_elem; } - /* "fastremap.pyx":600 + /* "fastremap.pyx":616 * * with nogil: * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< * if not preserve_missing_labels: * raise KeyError("{} was not in the remap table.".format(last_elem)) */ - goto __pyx_L9; + goto __pyx_L16; } - /* "fastremap.pyx":606 + /* "fastremap.pyx":622 * last_remap_id = last_elem * else: * arrview[0] = tbl[last_elem] # <<<<<<<<<<<<<< @@ -79719,22 +82279,22 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel * */ /*else*/ { - __pyx_t_13 = 0; - *((float *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_last_elem]); + __pyx_t_17 = 0; + *((float *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_last_elem]); - /* "fastremap.pyx":607 + /* "fastremap.pyx":623 * else: * arrview[0] = tbl[last_elem] * last_remap_id = arrview[0] # <<<<<<<<<<<<<< * * for i in range(1, size): */ - __pyx_t_13 = 0; - __pyx_v_last_remap_id = (*((float *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_17 = 0; + __pyx_v_last_remap_id = (*((float *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); } - __pyx_L9:; + __pyx_L16:; - /* "fastremap.pyx":609 + /* "fastremap.pyx":625 * last_remap_id = arrview[0] * * for i in range(1, size): # <<<<<<<<<<<<<< @@ -79742,21 +82302,21 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel * */ __pyx_t_3 = __pyx_v_size; - __pyx_t_15 = __pyx_t_3; - for (__pyx_t_16 = 1; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { - __pyx_v_i = __pyx_t_16; + __pyx_t_9 = __pyx_t_3; + for (__pyx_t_10 = 1; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":610 + /* "fastremap.pyx":626 * * for i in range(1, size): * elem = arrview[i] # <<<<<<<<<<<<<< * * if elem == last_elem: */ - __pyx_t_17 = __pyx_v_i; - __pyx_v_elem = (*((float *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_11 = __pyx_v_i; + __pyx_v_elem = (*((float *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":612 + /* "fastremap.pyx":628 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -79766,26 +82326,26 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_elem == __pyx_v_last_elem) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":613 + /* "fastremap.pyx":629 * * if elem == last_elem: * arrview[i] = last_remap_id # <<<<<<<<<<<<<< * continue * */ - __pyx_t_17 = __pyx_v_i; - *((float *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; + __pyx_t_11 = __pyx_v_i; + *((float *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; - /* "fastremap.pyx":614 + /* "fastremap.pyx":630 * if elem == last_elem: * arrview[i] = last_remap_id * continue # <<<<<<<<<<<<<< * * if tbl.find(elem) == tbl.end(): */ - goto __pyx_L14_continue; + goto __pyx_L21_continue; - /* "fastremap.pyx":612 + /* "fastremap.pyx":628 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -79794,7 +82354,7 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":616 + /* "fastremap.pyx":632 * continue * * if tbl.find(elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -79804,7 +82364,7 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":617 + /* "fastremap.pyx":633 * * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: # <<<<<<<<<<<<<< @@ -79814,7 +82374,7 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = (__pyx_v_preserve_missing_labels != 0); if (__pyx_t_4) { - /* "fastremap.pyx":618 + /* "fastremap.pyx":634 * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: * last_elem = elem # <<<<<<<<<<<<<< @@ -79823,7 +82383,7 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":619 + /* "fastremap.pyx":635 * if preserve_missing_labels: * last_elem = elem * last_remap_id = elem # <<<<<<<<<<<<<< @@ -79832,16 +82392,16 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_remap_id = __pyx_v_elem; - /* "fastremap.pyx":620 + /* "fastremap.pyx":636 * last_elem = elem * last_remap_id = elem * continue # <<<<<<<<<<<<<< * else: * raise KeyError("{} was not in the remap table.".format(elem)) */ - goto __pyx_L14_continue; + goto __pyx_L21_continue; - /* "fastremap.pyx":617 + /* "fastremap.pyx":633 * * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: # <<<<<<<<<<<<<< @@ -79850,7 +82410,7 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":622 + /* "fastremap.pyx":638 * continue * else: * raise KeyError("{} was not in the remap table.".format(elem)) # <<<<<<<<<<<<<< @@ -79863,45 +82423,45 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L22_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_elem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PyFloat_FromDouble(__pyx_v_elem); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_14); + __pyx_t_18 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_18)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); + __Pyx_DECREF_SET(__pyx_t_7, function); } } - __pyx_t_9 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __pyx_t_14 = (__pyx_t_18) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_18, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 622, __pyx_L22_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(0, 638, __pyx_L29_error) } /*finally:*/ { - __pyx_L22_error: { + __pyx_L29_error: { #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - goto __pyx_L7_error; + goto __pyx_L14_error; } } } } - /* "fastremap.pyx":616 + /* "fastremap.pyx":632 * continue * * if tbl.find(elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -79910,7 +82470,7 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":624 + /* "fastremap.pyx":640 * raise KeyError("{} was not in the remap table.".format(elem)) * else: * arrview[i] = tbl[elem] # <<<<<<<<<<<<<< @@ -79918,11 +82478,11 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel * last_elem = elem */ /*else*/ { - __pyx_t_17 = __pyx_v_i; - *((float *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_elem]); + __pyx_t_11 = __pyx_v_i; + *((float *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_elem]); } - /* "fastremap.pyx":626 + /* "fastremap.pyx":642 * arrview[i] = tbl[elem] * * last_elem = elem # <<<<<<<<<<<<<< @@ -79931,20 +82491,20 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":627 + /* "fastremap.pyx":643 * * last_elem = elem * last_remap_id = arrview[i] # <<<<<<<<<<<<<< * * return arr */ - __pyx_t_17 = __pyx_v_i; - __pyx_v_last_remap_id = (*((float *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); - __pyx_L14_continue:; + __pyx_t_11 = __pyx_v_i; + __pyx_v_last_remap_id = (*((float *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ))); + __pyx_L21_continue:; } } - /* "fastremap.pyx":599 + /* "fastremap.pyx":615 * cdef NUMBER last_remap_id = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -79957,20 +82517,20 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif - goto __pyx_L8; + goto __pyx_L15; } - __pyx_L7_error: { + __pyx_L14_error: { #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L1_error; } - __pyx_L8:; + __pyx_L15:; } } - /* "fastremap.pyx":629 + /* "fastremap.pyx":645 * last_remap_id = arrview[i] * * return arr # <<<<<<<<<<<<<< @@ -79982,7 +82542,7 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":582 + /* "fastremap.pyx":584 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): # <<<<<<<<<<<<<< @@ -79994,9 +82554,9 @@ static PyObject *__pyx_pf_9fastremap_406_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_L1_error:; __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_18); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -80055,17 +82615,17 @@ static PyObject *__pyx_fuse_9__pyx_pw_9fastremap_409_remap(PyObject *__pyx_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_table)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 1); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 1); __PYX_ERR(0, 584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_preserve_missing_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 2); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, 2); __PYX_ERR(0, 584, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_remap") < 0)) __PYX_ERR(0, 582, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_remap") < 0)) __PYX_ERR(0, 584, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -80076,18 +82636,18 @@ static PyObject *__pyx_fuse_9__pyx_pw_9fastremap_409_remap(PyObject *__pyx_self, } __pyx_v_arr = ((PyArrayObject *)values[0]); __pyx_v_table = ((PyObject*)values[1]); - __pyx_v_preserve_missing_labels = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_preserve_missing_labels == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L3_error) + __pyx_v_preserve_missing_labels = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_preserve_missing_labels == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 582, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_remap", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 584, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap._remap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 582, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), (&PyDict_Type), 1, "table", 1))) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 584, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), (&PyDict_Type), 1, "table", 1))) __PYX_ERR(0, 584, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_408_remap(__pyx_self, __pyx_v_arr, __pyx_v_table, __pyx_v_preserve_missing_labels); /* function exit code */ @@ -80104,7 +82664,9 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel size_t __pyx_v_i; size_t __pyx_v_size; double __pyx_v_elem; - std::unordered_map __pyx_v_tbl; + double __pyx_v_before; + double __pyx_v_after; + ska::flat_hash_map __pyx_v_tbl; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; double __pyx_v_last_elem; @@ -80117,19 +82679,20 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel PyObject *__pyx_t_2 = NULL; size_t __pyx_t_3; int __pyx_t_4; - Py_ssize_t __pyx_t_5; + int __pyx_t_5; Py_ssize_t __pyx_t_6; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - double __pyx_t_11; - double __pyx_t_12; - Py_ssize_t __pyx_t_13; + PyObject *__pyx_t_7 = NULL; + double __pyx_t_8; + size_t __pyx_t_9; + size_t __pyx_t_10; + size_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; PyObject *__pyx_t_14 = NULL; - size_t __pyx_t_15; - size_t __pyx_t_16; - size_t __pyx_t_17; + int __pyx_t_15; + double __pyx_t_16; + Py_ssize_t __pyx_t_17; + PyObject *__pyx_t_18 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -80140,23 +82703,23 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 584, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":583 + /* "fastremap.pyx":585 * @cython.nonecheck(False) * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): * cdef NUMBER[:] arrview = arr # <<<<<<<<<<<<<< * cdef size_t i = 0 * cdef size_t size = arr.size */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 583, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 585, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":584 + /* "fastremap.pyx":586 * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): * cdef NUMBER[:] arrview = arr * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -80165,20 +82728,20 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_i = 0; - /* "fastremap.pyx":585 + /* "fastremap.pyx":587 * cdef NUMBER[:] arrview = arr * cdef size_t i = 0 * cdef size_t size = arr.size # <<<<<<<<<<<<<< * cdef NUMBER elem = 0 * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_size = __pyx_t_3; - /* "fastremap.pyx":586 + /* "fastremap.pyx":588 * cdef size_t i = 0 * cdef size_t size = arr.size * cdef NUMBER elem = 0 # <<<<<<<<<<<<<< @@ -80187,7 +82750,7 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_elem = 0.0; - /* "fastremap.pyx":588 + /* "fastremap.pyx":590 * cdef NUMBER elem = 0 * * if size == 0: # <<<<<<<<<<<<<< @@ -80197,19 +82760,19 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_size == 0) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":589 + /* "fastremap.pyx":591 * * if size == 0: * return arr # <<<<<<<<<<<<<< * - * cdef unordered_map[NUMBER, NUMBER] tbl + * # fast path for remapping only a single label */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_arr)); __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":588 + /* "fastremap.pyx":590 * cdef NUMBER elem = 0 * * if size == 0: # <<<<<<<<<<<<<< @@ -80218,58 +82781,237 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":593 - * cdef unordered_map[NUMBER, NUMBER] tbl + /* "fastremap.pyx":595 + * # fast path for remapping only a single label + * # e.g. for masking something out + * cdef NUMBER before = 0 # <<<<<<<<<<<<<< + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: + */ + __pyx_v_before = 0.0; + + /* "fastremap.pyx":596 + * # e.g. for masking something out + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 # <<<<<<<<<<<<<< + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) + */ + __pyx_v_after = 0.0; + + /* "fastremap.pyx":597 + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: # <<<<<<<<<<<<<< + * before = next(iter(table.keys())) + * after = table[before] + */ + __pyx_t_5 = (__pyx_v_preserve_missing_labels != 0); + if (__pyx_t_5) { + } else { + __pyx_t_4 = __pyx_t_5; + goto __pyx_L5_bool_binop_done; + } + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 597, __pyx_L1_error) + } + __pyx_t_6 = PyDict_Size(__pyx_v_table); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_5 = ((__pyx_t_6 == 1) != 0); + __pyx_t_4 = __pyx_t_5; + __pyx_L5_bool_binop_done:; + if (__pyx_t_4) { + + /* "fastremap.pyx":598 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) # <<<<<<<<<<<<<< + * after = table[before] + * if before == after: + */ + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); + __PYX_ERR(0, 598, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyDict_Keys(__pyx_v_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_before = __pyx_t_8; + + /* "fastremap.pyx":599 + * if preserve_missing_labels and len(table) == 1: + * before = next(iter(table.keys())) + * after = table[before] # <<<<<<<<<<<<<< + * if before == after: + * return arr + */ + if (unlikely(__pyx_v_table == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 599, __pyx_L1_error) + } + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_before); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_table, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_after = __pyx_t_8; + + /* "fastremap.pyx":600 + * before = next(iter(table.keys())) + * after = table[before] + * if before == after: # <<<<<<<<<<<<<< + * return arr + * for i in range(size): + */ + __pyx_t_4 = ((__pyx_v_before == __pyx_v_after) != 0); + if (__pyx_t_4) { + + /* "fastremap.pyx":601 + * after = table[before] + * if before == after: + * return arr # <<<<<<<<<<<<<< + * for i in range(size): + * if arr[i] == before: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "fastremap.pyx":600 + * before = next(iter(table.keys())) + * after = table[before] + * if before == after: # <<<<<<<<<<<<<< + * return arr + * for i in range(size): + */ + } + + /* "fastremap.pyx":602 + * if before == after: + * return arr + * for i in range(size): # <<<<<<<<<<<<<< + * if arr[i] == before: + * arr[i] = after + */ + __pyx_t_3 = __pyx_v_size; + __pyx_t_9 = __pyx_t_3; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "fastremap.pyx":603 + * return arr + * for i in range(size): + * if arr[i] == before: # <<<<<<<<<<<<<< + * arr[i] = after + * return arr + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_4 = (((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides)) == __pyx_v_before) != 0); + if (__pyx_t_4) { + + /* "fastremap.pyx":604 + * for i in range(size): + * if arr[i] == before: + * arr[i] = after # <<<<<<<<<<<<<< + * return arr + * + */ + __pyx_t_11 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides) = __pyx_v_after; + + /* "fastremap.pyx":603 + * return arr + * for i in range(size): + * if arr[i] == before: # <<<<<<<<<<<<<< + * arr[i] = after + * return arr + */ + } + } + + /* "fastremap.pyx":605 + * if arr[i] == before: + * arr[i] = after + * return arr # <<<<<<<<<<<<<< + * + * cdef flat_hash_map[NUMBER, NUMBER] tbl + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); + __pyx_r = ((PyObject *)__pyx_v_arr); + goto __pyx_L0; + + /* "fastremap.pyx":597 + * cdef NUMBER before = 0 + * cdef NUMBER after = 0 + * if preserve_missing_labels and len(table) == 1: # <<<<<<<<<<<<<< + * before = next(iter(table.keys())) + * after = table[before] + */ + } + + /* "fastremap.pyx":609 + * cdef flat_hash_map[NUMBER, NUMBER] tbl * * for k, v in table.items(): # <<<<<<<<<<<<<< * tbl[k] = v * */ - __pyx_t_5 = 0; + __pyx_t_6 = 0; if (unlikely(__pyx_v_table == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 593, __pyx_L1_error) + __PYX_ERR(0, 609, __pyx_L1_error) } - __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_table, 1, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_2); - __pyx_t_2 = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_table, 1, __pyx_n_s_items, (&__pyx_t_12), (&__pyx_t_13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; while (1) { - __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, &__pyx_t_8, &__pyx_t_9, NULL, __pyx_t_7); - if (unlikely(__pyx_t_10 == 0)) break; - if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_8); - __pyx_t_8 = 0; - __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_9); - __pyx_t_9 = 0; + __pyx_t_15 = __Pyx_dict_iter_next(__pyx_t_7, __pyx_t_12, &__pyx_t_6, &__pyx_t_2, &__pyx_t_14, NULL, __pyx_t_13); + if (unlikely(__pyx_t_15 == 0)) break; + if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_14); + __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_14); + __pyx_t_14 = 0; - /* "fastremap.pyx":594 + /* "fastremap.pyx":610 * * for k, v in table.items(): * tbl[k] = v # <<<<<<<<<<<<<< * * cdef NUMBER last_elem = arrview[0] */ - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_v); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L1_error) - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_k); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L1_error) - (__pyx_v_tbl[__pyx_t_12]) = __pyx_t_11; + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_v); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_v_k); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L1_error) + (__pyx_v_tbl[__pyx_t_16]) = __pyx_t_8; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "fastremap.pyx":596 + /* "fastremap.pyx":612 * tbl[k] = v * * cdef NUMBER last_elem = arrview[0] # <<<<<<<<<<<<<< * cdef NUMBER last_remap_id = 0 * */ - __pyx_t_13 = 0; - __pyx_v_last_elem = (*((double *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_17 = 0; + __pyx_v_last_elem = (*((double *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":597 + /* "fastremap.pyx":613 * * cdef NUMBER last_elem = arrview[0] * cdef NUMBER last_remap_id = 0 # <<<<<<<<<<<<<< @@ -80278,7 +83020,7 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_remap_id = 0.0; - /* "fastremap.pyx":599 + /* "fastremap.pyx":615 * cdef NUMBER last_remap_id = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -80293,7 +83035,7 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel #endif /*try:*/ { - /* "fastremap.pyx":600 + /* "fastremap.pyx":616 * * with nogil: * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -80303,7 +83045,7 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_last_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":601 + /* "fastremap.pyx":617 * with nogil: * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: # <<<<<<<<<<<<<< @@ -80313,7 +83055,7 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((!(__pyx_v_preserve_missing_labels != 0)) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":602 + /* "fastremap.pyx":618 * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: * raise KeyError("{} was not in the remap table.".format(last_elem)) # <<<<<<<<<<<<<< @@ -80325,44 +83067,44 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = PyFloat_FromDouble(__pyx_v_last_elem); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_14); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_last_elem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) { + __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_14); + if (likely(__pyx_t_18)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); + __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); + __Pyx_DECREF_SET(__pyx_t_14, function); } } - __pyx_t_2 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 602, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = (__pyx_t_18) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_18, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_9, 0, 0, 0); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(0, 602, __pyx_L12_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 618, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_14, 0, 0, 0); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __PYX_ERR(0, 618, __pyx_L19_error) } /*finally:*/ { - __pyx_L12_error: { + __pyx_L19_error: { #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - goto __pyx_L7_error; + goto __pyx_L14_error; } } } - /* "fastremap.pyx":601 + /* "fastremap.pyx":617 * with nogil: * if tbl.find(last_elem) == tbl.end(): * if not preserve_missing_labels: # <<<<<<<<<<<<<< @@ -80371,7 +83113,7 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":604 + /* "fastremap.pyx":620 * raise KeyError("{} was not in the remap table.".format(last_elem)) * else: * last_remap_id = last_elem # <<<<<<<<<<<<<< @@ -80382,17 +83124,17 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_v_last_remap_id = __pyx_v_last_elem; } - /* "fastremap.pyx":600 + /* "fastremap.pyx":616 * * with nogil: * if tbl.find(last_elem) == tbl.end(): # <<<<<<<<<<<<<< * if not preserve_missing_labels: * raise KeyError("{} was not in the remap table.".format(last_elem)) */ - goto __pyx_L9; + goto __pyx_L16; } - /* "fastremap.pyx":606 + /* "fastremap.pyx":622 * last_remap_id = last_elem * else: * arrview[0] = tbl[last_elem] # <<<<<<<<<<<<<< @@ -80400,22 +83142,22 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel * */ /*else*/ { - __pyx_t_13 = 0; - *((double *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_last_elem]); + __pyx_t_17 = 0; + *((double *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_last_elem]); - /* "fastremap.pyx":607 + /* "fastremap.pyx":623 * else: * arrview[0] = tbl[last_elem] * last_remap_id = arrview[0] # <<<<<<<<<<<<<< * * for i in range(1, size): */ - __pyx_t_13 = 0; - __pyx_v_last_remap_id = (*((double *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_13 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_17 = 0; + __pyx_v_last_remap_id = (*((double *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); } - __pyx_L9:; + __pyx_L16:; - /* "fastremap.pyx":609 + /* "fastremap.pyx":625 * last_remap_id = arrview[0] * * for i in range(1, size): # <<<<<<<<<<<<<< @@ -80423,21 +83165,21 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel * */ __pyx_t_3 = __pyx_v_size; - __pyx_t_15 = __pyx_t_3; - for (__pyx_t_16 = 1; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { - __pyx_v_i = __pyx_t_16; + __pyx_t_9 = __pyx_t_3; + for (__pyx_t_10 = 1; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; - /* "fastremap.pyx":610 + /* "fastremap.pyx":626 * * for i in range(1, size): * elem = arrview[i] # <<<<<<<<<<<<<< * * if elem == last_elem: */ - __pyx_t_17 = __pyx_v_i; - __pyx_v_elem = (*((double *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); + __pyx_t_11 = __pyx_v_i; + __pyx_v_elem = (*((double *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ))); - /* "fastremap.pyx":612 + /* "fastremap.pyx":628 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -80447,26 +83189,26 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_elem == __pyx_v_last_elem) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":613 + /* "fastremap.pyx":629 * * if elem == last_elem: * arrview[i] = last_remap_id # <<<<<<<<<<<<<< * continue * */ - __pyx_t_17 = __pyx_v_i; - *((double *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; + __pyx_t_11 = __pyx_v_i; + *((double *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) )) = __pyx_v_last_remap_id; - /* "fastremap.pyx":614 + /* "fastremap.pyx":630 * if elem == last_elem: * arrview[i] = last_remap_id * continue # <<<<<<<<<<<<<< * * if tbl.find(elem) == tbl.end(): */ - goto __pyx_L14_continue; + goto __pyx_L21_continue; - /* "fastremap.pyx":612 + /* "fastremap.pyx":628 * elem = arrview[i] * * if elem == last_elem: # <<<<<<<<<<<<<< @@ -80475,7 +83217,7 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":616 + /* "fastremap.pyx":632 * continue * * if tbl.find(elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -80485,7 +83227,7 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = ((__pyx_v_tbl.find(__pyx_v_elem) == __pyx_v_tbl.end()) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":617 + /* "fastremap.pyx":633 * * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: # <<<<<<<<<<<<<< @@ -80495,7 +83237,7 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_t_4 = (__pyx_v_preserve_missing_labels != 0); if (__pyx_t_4) { - /* "fastremap.pyx":618 + /* "fastremap.pyx":634 * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: * last_elem = elem # <<<<<<<<<<<<<< @@ -80504,7 +83246,7 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":619 + /* "fastremap.pyx":635 * if preserve_missing_labels: * last_elem = elem * last_remap_id = elem # <<<<<<<<<<<<<< @@ -80513,16 +83255,16 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_remap_id = __pyx_v_elem; - /* "fastremap.pyx":620 + /* "fastremap.pyx":636 * last_elem = elem * last_remap_id = elem * continue # <<<<<<<<<<<<<< * else: * raise KeyError("{} was not in the remap table.".format(elem)) */ - goto __pyx_L14_continue; + goto __pyx_L21_continue; - /* "fastremap.pyx":617 + /* "fastremap.pyx":633 * * if tbl.find(elem) == tbl.end(): * if preserve_missing_labels: # <<<<<<<<<<<<<< @@ -80531,7 +83273,7 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":622 + /* "fastremap.pyx":638 * continue * else: * raise KeyError("{} was not in the remap table.".format(elem)) # <<<<<<<<<<<<<< @@ -80544,45 +83286,45 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif /*try:*/ { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L22_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_was_not_in_the_remap_table, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_elem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PyFloat_FromDouble(__pyx_v_elem); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_14); + __pyx_t_18 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_18)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); + __Pyx_DECREF_SET(__pyx_t_7, function); } } - __pyx_t_9 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __pyx_t_14 = (__pyx_t_18) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_18, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 622, __pyx_L22_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 638, __pyx_L29_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(0, 638, __pyx_L29_error) } /*finally:*/ { - __pyx_L22_error: { + __pyx_L29_error: { #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - goto __pyx_L7_error; + goto __pyx_L14_error; } } } } - /* "fastremap.pyx":616 + /* "fastremap.pyx":632 * continue * * if tbl.find(elem) == tbl.end(): # <<<<<<<<<<<<<< @@ -80591,7 +83333,7 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel */ } - /* "fastremap.pyx":624 + /* "fastremap.pyx":640 * raise KeyError("{} was not in the remap table.".format(elem)) * else: * arrview[i] = tbl[elem] # <<<<<<<<<<<<<< @@ -80599,11 +83341,11 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel * last_elem = elem */ /*else*/ { - __pyx_t_17 = __pyx_v_i; - *((double *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_elem]); + __pyx_t_11 = __pyx_v_i; + *((double *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) )) = (__pyx_v_tbl[__pyx_v_elem]); } - /* "fastremap.pyx":626 + /* "fastremap.pyx":642 * arrview[i] = tbl[elem] * * last_elem = elem # <<<<<<<<<<<<<< @@ -80612,20 +83354,20 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel */ __pyx_v_last_elem = __pyx_v_elem; - /* "fastremap.pyx":627 + /* "fastremap.pyx":643 * * last_elem = elem * last_remap_id = arrview[i] # <<<<<<<<<<<<<< * * return arr */ - __pyx_t_17 = __pyx_v_i; - __pyx_v_last_remap_id = (*((double *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_17 * __pyx_v_arrview.strides[0]) ))); - __pyx_L14_continue:; + __pyx_t_11 = __pyx_v_i; + __pyx_v_last_remap_id = (*((double *) ( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ))); + __pyx_L21_continue:; } } - /* "fastremap.pyx":599 + /* "fastremap.pyx":615 * cdef NUMBER last_remap_id = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -80638,20 +83380,20 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif - goto __pyx_L8; + goto __pyx_L15; } - __pyx_L7_error: { + __pyx_L14_error: { #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L1_error; } - __pyx_L8:; + __pyx_L15:; } } - /* "fastremap.pyx":629 + /* "fastremap.pyx":645 * last_remap_id = arrview[i] * * return arr # <<<<<<<<<<<<<< @@ -80663,7 +83405,7 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":582 + /* "fastremap.pyx":584 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): # <<<<<<<<<<<<<< @@ -80675,9 +83417,9 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel __pyx_L1_error:; __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_18); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -80698,7 +83440,7 @@ static PyObject *__pyx_pf_9fastremap_408_remap(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "fastremap.pyx":632 +/* "fastremap.pyx":648 * * @cython.boundscheck(False) * def remap_from_array(cnp.ndarray[UINT] arr, cnp.ndarray[UINT] vals): # <<<<<<<<<<<<<< @@ -80748,23 +83490,23 @@ static PyObject *__pyx_pw_9fastremap_33remap_from_array(PyObject *__pyx_self, Py case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 632, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 648, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 632, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 648, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 632, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 648, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 632, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 648, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -80781,7 +83523,7 @@ static PyObject *__pyx_pw_9fastremap_33remap_from_array(PyObject *__pyx_self, Py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 632, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 648, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -80839,7 +83581,7 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remap_from_array", 0); __Pyx_INCREF(__pyx_v_kwargs); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -80853,7 +83595,7 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 648, __pyx_L1_error) __pyx_t_3 = ((!__pyx_t_4) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; @@ -80861,7 +83603,7 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_kwargs, Py_None); } - __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -80872,14 +83614,14 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * __pyx_v____pyx_uint64_t_is_signed = (!((((uint64_t)-1L) > 0) != 0)); if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 632, __pyx_L1_error) + __PYX_ERR(0, 648, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 648, __pyx_L1_error) __pyx_t_2 = ((0 < __pyx_t_5) != 0); if (__pyx_t_2) { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 632, __pyx_L1_error) + __PYX_ERR(0, 648, __pyx_L1_error) } __pyx_t_1 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0); __Pyx_INCREF(__pyx_t_1); @@ -80896,18 +83638,18 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 632, __pyx_L1_error) + __PYX_ERR(0, 648, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_arr, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_arr, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 648, __pyx_L1_error) __pyx_t_3 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_3; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 632, __pyx_L1_error) + __PYX_ERR(0, 648, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -80916,12 +83658,12 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 632, __pyx_L1_error) + __PYX_ERR(0, 648, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 632, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 648, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_2); __Pyx_GIVEREF(__pyx_int_2); @@ -80932,15 +83674,15 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 632, __pyx_L1_error) + __PYX_ERR(0, 648, __pyx_L1_error) } __pyx_L6:; while (1) { @@ -80950,7 +83692,7 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -80959,14 +83701,14 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -80988,14 +83730,14 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * __pyx_t_2 = (__pyx_v_dtype != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_itemsize = __pyx_t_5; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_kind = __pyx_t_7; __pyx_v_dtype_signed = (__pyx_v_kind == 'i'); @@ -81008,9 +83750,9 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -81022,7 +83764,7 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_2; __pyx_L16_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 648, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint16_t)) == __pyx_v_itemsize) != 0); @@ -81031,9 +83773,9 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_2; goto __pyx_L20_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -81045,7 +83787,7 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_2; __pyx_L20_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 648, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint32_t)) == __pyx_v_itemsize) != 0); @@ -81054,9 +83796,9 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_2; goto __pyx_L24_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -81068,7 +83810,7 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_2; __pyx_L24_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 648, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint64_t)) == __pyx_v_itemsize) != 0); @@ -81077,9 +83819,9 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_2; goto __pyx_L28_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -81091,7 +83833,7 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_2; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 648, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -81120,7 +83862,7 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 648, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -81142,7 +83884,7 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 648, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -81164,7 +83906,7 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 648, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -81186,27 +83928,27 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 648, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); } } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 648, __pyx_L1_error) goto __pyx_L10_break; } __pyx_L10_break:; - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_candidates = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = 0; if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 632, __pyx_L1_error) + __PYX_ERR(0, 648, __pyx_L1_error) } - __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_1; @@ -81214,12 +83956,12 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * while (1) { __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_9, &__pyx_t_5, &__pyx_t_1, NULL, NULL, __pyx_t_10); if (unlikely(__pyx_t_11 == 0)) break; - if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_1); __pyx_t_1 = 0; __pyx_v_match_found = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { @@ -81233,10 +83975,10 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * } __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, __pyx_kp_s__2) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__2); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -81251,27 +83993,27 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * } __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_12, __pyx_kp_s__3) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__3); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_src_sig, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 648, __pyx_L1_error) __pyx_t_16 = __pyx_t_15; for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dest_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dest_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_v_dst_type != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_2) { __pyx_v_match_found = 1; @@ -81287,35 +84029,35 @@ static PyObject *__pyx_pf_9fastremap_32remap_from_array(CYTHON_UNUSED PyObject * __pyx_L50_break:; __pyx_t_2 = (__pyx_v_match_found != 0); if (__pyx_t_2) { - __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 648, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_candidates) != 0); __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 632, __pyx_L1_error) + __PYX_ERR(0, 648, __pyx_L1_error) } - __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 648, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_9 > 1) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 632, __pyx_L1_error) + __PYX_ERR(0, 648, __pyx_L1_error) } /*else*/ { __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 632, __pyx_L1_error) + __PYX_ERR(0, 648, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; @@ -81382,11 +84124,11 @@ static PyObject *__pyx_fuse_0__pyx_pw_9fastremap_413remap_from_array(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vals)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("remap_from_array", 1, 2, 2, 1); __PYX_ERR(0, 632, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array", 1, 2, 2, 1); __PYX_ERR(0, 648, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap_from_array") < 0)) __PYX_ERR(0, 632, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap_from_array") < 0)) __PYX_ERR(0, 648, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -81399,14 +84141,14 @@ static PyObject *__pyx_fuse_0__pyx_pw_9fastremap_413remap_from_array(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("remap_from_array", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 632, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 648, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.remap_from_array", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 632, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 648, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 648, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_412remap_from_array(__pyx_self, __pyx_v_arr, __pyx_v_vals); /* function exit code */ @@ -81455,40 +84197,40 @@ static PyObject *__pyx_pf_9fastremap_412remap_from_array(CYTHON_UNUSED PyObject __pyx_pybuffernd_vals.rcbuffer = &__pyx_pybuffer_vals; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 648, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 648, __pyx_L1_error) } __pyx_pybuffernd_vals.diminfo[0].strides = __pyx_pybuffernd_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vals.diminfo[0].shape = __pyx_pybuffernd_vals.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":636 + /* "fastremap.pyx":652 * remap_from_array(cnp.ndarray[UINT] arr, cnp.ndarray[UINT] vals) * """ * cdef UINT[:] valview = vals # <<<<<<<<<<<<<< * cdef UINT[:] arrview = arr * */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint8_t(((PyObject *)__pyx_v_vals), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint8_t(((PyObject *)__pyx_v_vals), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 652, __pyx_L1_error) __pyx_v_valview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":637 + /* "fastremap.pyx":653 * """ * cdef UINT[:] valview = vals * cdef UINT[:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t i = 0 */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 637, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 653, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":639 + /* "fastremap.pyx":655 * cdef UINT[:] arrview = arr * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -81497,36 +84239,36 @@ static PyObject *__pyx_pf_9fastremap_412remap_from_array(CYTHON_UNUSED PyObject */ __pyx_v_i = 0; - /* "fastremap.pyx":640 + /* "fastremap.pyx":656 * * cdef size_t i = 0 * cdef size_t size = arr.size # <<<<<<<<<<<<<< * cdef size_t maxkey = vals.size - 1 * cdef UINT elem */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 640, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_size = __pyx_t_3; - /* "fastremap.pyx":641 + /* "fastremap.pyx":657 * cdef size_t i = 0 * cdef size_t size = arr.size * cdef size_t maxkey = vals.size - 1 # <<<<<<<<<<<<<< * cdef UINT elem * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_maxkey = __pyx_t_3; - /* "fastremap.pyx":644 + /* "fastremap.pyx":660 * cdef UINT elem * * with nogil: # <<<<<<<<<<<<<< @@ -81541,7 +84283,7 @@ static PyObject *__pyx_pf_9fastremap_412remap_from_array(CYTHON_UNUSED PyObject #endif /*try:*/ { - /* "fastremap.pyx":645 + /* "fastremap.pyx":661 * * with nogil: * for i in range(size): # <<<<<<<<<<<<<< @@ -81553,7 +84295,7 @@ static PyObject *__pyx_pf_9fastremap_412remap_from_array(CYTHON_UNUSED PyObject for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "fastremap.pyx":646 + /* "fastremap.pyx":662 * with nogil: * for i in range(size): * elem = arr[i] # <<<<<<<<<<<<<< @@ -81563,7 +84305,7 @@ static PyObject *__pyx_pf_9fastremap_412remap_from_array(CYTHON_UNUSED PyObject __pyx_t_7 = __pyx_v_i; __pyx_v_elem = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_arr.diminfo[0].strides)); - /* "fastremap.pyx":647 + /* "fastremap.pyx":663 * for i in range(size): * elem = arr[i] * if elem < 0 or elem > maxkey: # <<<<<<<<<<<<<< @@ -81581,7 +84323,7 @@ static PyObject *__pyx_pf_9fastremap_412remap_from_array(CYTHON_UNUSED PyObject __pyx_L9_bool_binop_done:; if (__pyx_t_8) { - /* "fastremap.pyx":648 + /* "fastremap.pyx":664 * elem = arr[i] * if elem < 0 or elem > maxkey: * continue # <<<<<<<<<<<<<< @@ -81590,7 +84332,7 @@ static PyObject *__pyx_pf_9fastremap_412remap_from_array(CYTHON_UNUSED PyObject */ goto __pyx_L6_continue; - /* "fastremap.pyx":647 + /* "fastremap.pyx":663 * for i in range(size): * elem = arr[i] * if elem < 0 or elem > maxkey: # <<<<<<<<<<<<<< @@ -81599,7 +84341,7 @@ static PyObject *__pyx_pf_9fastremap_412remap_from_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":649 + /* "fastremap.pyx":665 * if elem < 0 or elem > maxkey: * continue * arrview[i] = vals[elem] # <<<<<<<<<<<<<< @@ -81613,7 +84355,7 @@ static PyObject *__pyx_pf_9fastremap_412remap_from_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":644 + /* "fastremap.pyx":660 * cdef UINT elem * * with nogil: # <<<<<<<<<<<<<< @@ -81632,7 +84374,7 @@ static PyObject *__pyx_pf_9fastremap_412remap_from_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":651 + /* "fastremap.pyx":667 * arrview[i] = vals[elem] * * return arr # <<<<<<<<<<<<<< @@ -81644,7 +84386,7 @@ static PyObject *__pyx_pf_9fastremap_412remap_from_array(CYTHON_UNUSED PyObject __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":632 + /* "fastremap.pyx":648 * * @cython.boundscheck(False) * def remap_from_array(cnp.ndarray[UINT] arr, cnp.ndarray[UINT] vals): # <<<<<<<<<<<<<< @@ -81713,11 +84455,11 @@ static PyObject *__pyx_fuse_1__pyx_pw_9fastremap_415remap_from_array(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vals)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("remap_from_array", 1, 2, 2, 1); __PYX_ERR(0, 632, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array", 1, 2, 2, 1); __PYX_ERR(0, 648, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap_from_array") < 0)) __PYX_ERR(0, 632, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap_from_array") < 0)) __PYX_ERR(0, 648, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -81730,14 +84472,14 @@ static PyObject *__pyx_fuse_1__pyx_pw_9fastremap_415remap_from_array(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("remap_from_array", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 632, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 648, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.remap_from_array", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 632, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 648, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 648, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_414remap_from_array(__pyx_self, __pyx_v_arr, __pyx_v_vals); /* function exit code */ @@ -81786,40 +84528,40 @@ static PyObject *__pyx_pf_9fastremap_414remap_from_array(CYTHON_UNUSED PyObject __pyx_pybuffernd_vals.rcbuffer = &__pyx_pybuffer_vals; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 648, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 648, __pyx_L1_error) } __pyx_pybuffernd_vals.diminfo[0].strides = __pyx_pybuffernd_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vals.diminfo[0].shape = __pyx_pybuffernd_vals.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":636 + /* "fastremap.pyx":652 * remap_from_array(cnp.ndarray[UINT] arr, cnp.ndarray[UINT] vals) * """ * cdef UINT[:] valview = vals # <<<<<<<<<<<<<< * cdef UINT[:] arrview = arr * */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint16_t(((PyObject *)__pyx_v_vals), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint16_t(((PyObject *)__pyx_v_vals), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 652, __pyx_L1_error) __pyx_v_valview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":637 + /* "fastremap.pyx":653 * """ * cdef UINT[:] valview = vals * cdef UINT[:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t i = 0 */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 637, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 653, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":639 + /* "fastremap.pyx":655 * cdef UINT[:] arrview = arr * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -81828,36 +84570,36 @@ static PyObject *__pyx_pf_9fastremap_414remap_from_array(CYTHON_UNUSED PyObject */ __pyx_v_i = 0; - /* "fastremap.pyx":640 + /* "fastremap.pyx":656 * * cdef size_t i = 0 * cdef size_t size = arr.size # <<<<<<<<<<<<<< * cdef size_t maxkey = vals.size - 1 * cdef UINT elem */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 640, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_size = __pyx_t_3; - /* "fastremap.pyx":641 + /* "fastremap.pyx":657 * cdef size_t i = 0 * cdef size_t size = arr.size * cdef size_t maxkey = vals.size - 1 # <<<<<<<<<<<<<< * cdef UINT elem * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_maxkey = __pyx_t_3; - /* "fastremap.pyx":644 + /* "fastremap.pyx":660 * cdef UINT elem * * with nogil: # <<<<<<<<<<<<<< @@ -81872,7 +84614,7 @@ static PyObject *__pyx_pf_9fastremap_414remap_from_array(CYTHON_UNUSED PyObject #endif /*try:*/ { - /* "fastremap.pyx":645 + /* "fastremap.pyx":661 * * with nogil: * for i in range(size): # <<<<<<<<<<<<<< @@ -81884,7 +84626,7 @@ static PyObject *__pyx_pf_9fastremap_414remap_from_array(CYTHON_UNUSED PyObject for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "fastremap.pyx":646 + /* "fastremap.pyx":662 * with nogil: * for i in range(size): * elem = arr[i] # <<<<<<<<<<<<<< @@ -81894,7 +84636,7 @@ static PyObject *__pyx_pf_9fastremap_414remap_from_array(CYTHON_UNUSED PyObject __pyx_t_7 = __pyx_v_i; __pyx_v_elem = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_arr.diminfo[0].strides)); - /* "fastremap.pyx":647 + /* "fastremap.pyx":663 * for i in range(size): * elem = arr[i] * if elem < 0 or elem > maxkey: # <<<<<<<<<<<<<< @@ -81912,7 +84654,7 @@ static PyObject *__pyx_pf_9fastremap_414remap_from_array(CYTHON_UNUSED PyObject __pyx_L9_bool_binop_done:; if (__pyx_t_8) { - /* "fastremap.pyx":648 + /* "fastremap.pyx":664 * elem = arr[i] * if elem < 0 or elem > maxkey: * continue # <<<<<<<<<<<<<< @@ -81921,7 +84663,7 @@ static PyObject *__pyx_pf_9fastremap_414remap_from_array(CYTHON_UNUSED PyObject */ goto __pyx_L6_continue; - /* "fastremap.pyx":647 + /* "fastremap.pyx":663 * for i in range(size): * elem = arr[i] * if elem < 0 or elem > maxkey: # <<<<<<<<<<<<<< @@ -81930,7 +84672,7 @@ static PyObject *__pyx_pf_9fastremap_414remap_from_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":649 + /* "fastremap.pyx":665 * if elem < 0 or elem > maxkey: * continue * arrview[i] = vals[elem] # <<<<<<<<<<<<<< @@ -81944,7 +84686,7 @@ static PyObject *__pyx_pf_9fastremap_414remap_from_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":644 + /* "fastremap.pyx":660 * cdef UINT elem * * with nogil: # <<<<<<<<<<<<<< @@ -81963,7 +84705,7 @@ static PyObject *__pyx_pf_9fastremap_414remap_from_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":651 + /* "fastremap.pyx":667 * arrview[i] = vals[elem] * * return arr # <<<<<<<<<<<<<< @@ -81975,7 +84717,7 @@ static PyObject *__pyx_pf_9fastremap_414remap_from_array(CYTHON_UNUSED PyObject __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":632 + /* "fastremap.pyx":648 * * @cython.boundscheck(False) * def remap_from_array(cnp.ndarray[UINT] arr, cnp.ndarray[UINT] vals): # <<<<<<<<<<<<<< @@ -82044,11 +84786,11 @@ static PyObject *__pyx_fuse_2__pyx_pw_9fastremap_417remap_from_array(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vals)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("remap_from_array", 1, 2, 2, 1); __PYX_ERR(0, 632, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array", 1, 2, 2, 1); __PYX_ERR(0, 648, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap_from_array") < 0)) __PYX_ERR(0, 632, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap_from_array") < 0)) __PYX_ERR(0, 648, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -82061,14 +84803,14 @@ static PyObject *__pyx_fuse_2__pyx_pw_9fastremap_417remap_from_array(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("remap_from_array", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 632, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 648, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.remap_from_array", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 632, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 648, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 648, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_416remap_from_array(__pyx_self, __pyx_v_arr, __pyx_v_vals); /* function exit code */ @@ -82117,40 +84859,40 @@ static PyObject *__pyx_pf_9fastremap_416remap_from_array(CYTHON_UNUSED PyObject __pyx_pybuffernd_vals.rcbuffer = &__pyx_pybuffer_vals; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 648, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 648, __pyx_L1_error) } __pyx_pybuffernd_vals.diminfo[0].strides = __pyx_pybuffernd_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vals.diminfo[0].shape = __pyx_pybuffernd_vals.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":636 + /* "fastremap.pyx":652 * remap_from_array(cnp.ndarray[UINT] arr, cnp.ndarray[UINT] vals) * """ * cdef UINT[:] valview = vals # <<<<<<<<<<<<<< * cdef UINT[:] arrview = arr * */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint32_t(((PyObject *)__pyx_v_vals), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint32_t(((PyObject *)__pyx_v_vals), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 652, __pyx_L1_error) __pyx_v_valview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":637 + /* "fastremap.pyx":653 * """ * cdef UINT[:] valview = vals * cdef UINT[:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t i = 0 */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 637, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 653, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":639 + /* "fastremap.pyx":655 * cdef UINT[:] arrview = arr * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -82159,36 +84901,36 @@ static PyObject *__pyx_pf_9fastremap_416remap_from_array(CYTHON_UNUSED PyObject */ __pyx_v_i = 0; - /* "fastremap.pyx":640 + /* "fastremap.pyx":656 * * cdef size_t i = 0 * cdef size_t size = arr.size # <<<<<<<<<<<<<< * cdef size_t maxkey = vals.size - 1 * cdef UINT elem */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 640, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_size = __pyx_t_3; - /* "fastremap.pyx":641 + /* "fastremap.pyx":657 * cdef size_t i = 0 * cdef size_t size = arr.size * cdef size_t maxkey = vals.size - 1 # <<<<<<<<<<<<<< * cdef UINT elem * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_maxkey = __pyx_t_3; - /* "fastremap.pyx":644 + /* "fastremap.pyx":660 * cdef UINT elem * * with nogil: # <<<<<<<<<<<<<< @@ -82203,7 +84945,7 @@ static PyObject *__pyx_pf_9fastremap_416remap_from_array(CYTHON_UNUSED PyObject #endif /*try:*/ { - /* "fastremap.pyx":645 + /* "fastremap.pyx":661 * * with nogil: * for i in range(size): # <<<<<<<<<<<<<< @@ -82215,7 +84957,7 @@ static PyObject *__pyx_pf_9fastremap_416remap_from_array(CYTHON_UNUSED PyObject for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "fastremap.pyx":646 + /* "fastremap.pyx":662 * with nogil: * for i in range(size): * elem = arr[i] # <<<<<<<<<<<<<< @@ -82225,7 +84967,7 @@ static PyObject *__pyx_pf_9fastremap_416remap_from_array(CYTHON_UNUSED PyObject __pyx_t_7 = __pyx_v_i; __pyx_v_elem = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_arr.diminfo[0].strides)); - /* "fastremap.pyx":647 + /* "fastremap.pyx":663 * for i in range(size): * elem = arr[i] * if elem < 0 or elem > maxkey: # <<<<<<<<<<<<<< @@ -82243,7 +84985,7 @@ static PyObject *__pyx_pf_9fastremap_416remap_from_array(CYTHON_UNUSED PyObject __pyx_L9_bool_binop_done:; if (__pyx_t_8) { - /* "fastremap.pyx":648 + /* "fastremap.pyx":664 * elem = arr[i] * if elem < 0 or elem > maxkey: * continue # <<<<<<<<<<<<<< @@ -82252,7 +84994,7 @@ static PyObject *__pyx_pf_9fastremap_416remap_from_array(CYTHON_UNUSED PyObject */ goto __pyx_L6_continue; - /* "fastremap.pyx":647 + /* "fastremap.pyx":663 * for i in range(size): * elem = arr[i] * if elem < 0 or elem > maxkey: # <<<<<<<<<<<<<< @@ -82261,7 +85003,7 @@ static PyObject *__pyx_pf_9fastremap_416remap_from_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":649 + /* "fastremap.pyx":665 * if elem < 0 or elem > maxkey: * continue * arrview[i] = vals[elem] # <<<<<<<<<<<<<< @@ -82275,7 +85017,7 @@ static PyObject *__pyx_pf_9fastremap_416remap_from_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":644 + /* "fastremap.pyx":660 * cdef UINT elem * * with nogil: # <<<<<<<<<<<<<< @@ -82294,7 +85036,7 @@ static PyObject *__pyx_pf_9fastremap_416remap_from_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":651 + /* "fastremap.pyx":667 * arrview[i] = vals[elem] * * return arr # <<<<<<<<<<<<<< @@ -82306,7 +85048,7 @@ static PyObject *__pyx_pf_9fastremap_416remap_from_array(CYTHON_UNUSED PyObject __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":632 + /* "fastremap.pyx":648 * * @cython.boundscheck(False) * def remap_from_array(cnp.ndarray[UINT] arr, cnp.ndarray[UINT] vals): # <<<<<<<<<<<<<< @@ -82375,11 +85117,11 @@ static PyObject *__pyx_fuse_3__pyx_pw_9fastremap_419remap_from_array(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vals)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("remap_from_array", 1, 2, 2, 1); __PYX_ERR(0, 632, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array", 1, 2, 2, 1); __PYX_ERR(0, 648, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap_from_array") < 0)) __PYX_ERR(0, 632, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap_from_array") < 0)) __PYX_ERR(0, 648, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -82392,14 +85134,14 @@ static PyObject *__pyx_fuse_3__pyx_pw_9fastremap_419remap_from_array(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("remap_from_array", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 632, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 648, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.remap_from_array", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 632, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 648, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 648, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_418remap_from_array(__pyx_self, __pyx_v_arr, __pyx_v_vals); /* function exit code */ @@ -82448,40 +85190,40 @@ static PyObject *__pyx_pf_9fastremap_418remap_from_array(CYTHON_UNUSED PyObject __pyx_pybuffernd_vals.rcbuffer = &__pyx_pybuffer_vals; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 648, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 648, __pyx_L1_error) } __pyx_pybuffernd_vals.diminfo[0].strides = __pyx_pybuffernd_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vals.diminfo[0].shape = __pyx_pybuffernd_vals.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":636 + /* "fastremap.pyx":652 * remap_from_array(cnp.ndarray[UINT] arr, cnp.ndarray[UINT] vals) * """ * cdef UINT[:] valview = vals # <<<<<<<<<<<<<< * cdef UINT[:] arrview = arr * */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint64_t(((PyObject *)__pyx_v_vals), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint64_t(((PyObject *)__pyx_v_vals), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 652, __pyx_L1_error) __pyx_v_valview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":637 + /* "fastremap.pyx":653 * """ * cdef UINT[:] valview = vals * cdef UINT[:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t i = 0 */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 637, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 653, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":639 + /* "fastremap.pyx":655 * cdef UINT[:] arrview = arr * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -82490,36 +85232,36 @@ static PyObject *__pyx_pf_9fastremap_418remap_from_array(CYTHON_UNUSED PyObject */ __pyx_v_i = 0; - /* "fastremap.pyx":640 + /* "fastremap.pyx":656 * * cdef size_t i = 0 * cdef size_t size = arr.size # <<<<<<<<<<<<<< * cdef size_t maxkey = vals.size - 1 * cdef UINT elem */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 640, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_size = __pyx_t_3; - /* "fastremap.pyx":641 + /* "fastremap.pyx":657 * cdef size_t i = 0 * cdef size_t size = arr.size * cdef size_t maxkey = vals.size - 1 # <<<<<<<<<<<<<< * cdef UINT elem * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_maxkey = __pyx_t_3; - /* "fastremap.pyx":644 + /* "fastremap.pyx":660 * cdef UINT elem * * with nogil: # <<<<<<<<<<<<<< @@ -82534,7 +85276,7 @@ static PyObject *__pyx_pf_9fastremap_418remap_from_array(CYTHON_UNUSED PyObject #endif /*try:*/ { - /* "fastremap.pyx":645 + /* "fastremap.pyx":661 * * with nogil: * for i in range(size): # <<<<<<<<<<<<<< @@ -82546,7 +85288,7 @@ static PyObject *__pyx_pf_9fastremap_418remap_from_array(CYTHON_UNUSED PyObject for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "fastremap.pyx":646 + /* "fastremap.pyx":662 * with nogil: * for i in range(size): * elem = arr[i] # <<<<<<<<<<<<<< @@ -82556,7 +85298,7 @@ static PyObject *__pyx_pf_9fastremap_418remap_from_array(CYTHON_UNUSED PyObject __pyx_t_7 = __pyx_v_i; __pyx_v_elem = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_arr.diminfo[0].strides)); - /* "fastremap.pyx":647 + /* "fastremap.pyx":663 * for i in range(size): * elem = arr[i] * if elem < 0 or elem > maxkey: # <<<<<<<<<<<<<< @@ -82574,7 +85316,7 @@ static PyObject *__pyx_pf_9fastremap_418remap_from_array(CYTHON_UNUSED PyObject __pyx_L9_bool_binop_done:; if (__pyx_t_8) { - /* "fastremap.pyx":648 + /* "fastremap.pyx":664 * elem = arr[i] * if elem < 0 or elem > maxkey: * continue # <<<<<<<<<<<<<< @@ -82583,7 +85325,7 @@ static PyObject *__pyx_pf_9fastremap_418remap_from_array(CYTHON_UNUSED PyObject */ goto __pyx_L6_continue; - /* "fastremap.pyx":647 + /* "fastremap.pyx":663 * for i in range(size): * elem = arr[i] * if elem < 0 or elem > maxkey: # <<<<<<<<<<<<<< @@ -82592,7 +85334,7 @@ static PyObject *__pyx_pf_9fastremap_418remap_from_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":649 + /* "fastremap.pyx":665 * if elem < 0 or elem > maxkey: * continue * arrview[i] = vals[elem] # <<<<<<<<<<<<<< @@ -82606,7 +85348,7 @@ static PyObject *__pyx_pf_9fastremap_418remap_from_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":644 + /* "fastremap.pyx":660 * cdef UINT elem * * with nogil: # <<<<<<<<<<<<<< @@ -82625,7 +85367,7 @@ static PyObject *__pyx_pf_9fastremap_418remap_from_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":651 + /* "fastremap.pyx":667 * arrview[i] = vals[elem] * * return arr # <<<<<<<<<<<<<< @@ -82637,7 +85379,7 @@ static PyObject *__pyx_pf_9fastremap_418remap_from_array(CYTHON_UNUSED PyObject __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":632 + /* "fastremap.pyx":648 * * @cython.boundscheck(False) * def remap_from_array(cnp.ndarray[UINT] arr, cnp.ndarray[UINT] vals): # <<<<<<<<<<<<<< @@ -82671,7 +85413,7 @@ static PyObject *__pyx_pf_9fastremap_418remap_from_array(CYTHON_UNUSED PyObject return __pyx_r; } -/* "fastremap.pyx":654 +/* "fastremap.pyx":670 * * @cython.boundscheck(False) * def remap_from_array_kv(cnp.ndarray[ALLINT] arr, cnp.ndarray[ALLINT] keys, cnp.ndarray[ALLINT] vals): # <<<<<<<<<<<<<< @@ -82721,23 +85463,23 @@ static PyObject *__pyx_pw_9fastremap_35remap_from_array_kv(PyObject *__pyx_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 670, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 670, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 670, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 654, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 670, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -82754,7 +85496,7 @@ static PyObject *__pyx_pw_9fastremap_35remap_from_array_kv(PyObject *__pyx_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 670, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -82816,7 +85558,7 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remap_from_array_kv", 0); __Pyx_INCREF(__pyx_v_kwargs); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -82830,7 +85572,7 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 670, __pyx_L1_error) __pyx_t_3 = ((!__pyx_t_4) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; @@ -82838,7 +85580,7 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_kwargs, Py_None); } - __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -82853,14 +85595,14 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_v____pyx_int64_t_is_signed = (!((((int64_t)-1L) > 0) != 0)); if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 654, __pyx_L1_error) + __PYX_ERR(0, 670, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 670, __pyx_L1_error) __pyx_t_2 = ((0 < __pyx_t_5) != 0); if (__pyx_t_2) { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 654, __pyx_L1_error) + __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_t_1 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0); __Pyx_INCREF(__pyx_t_1); @@ -82877,18 +85619,18 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 654, __pyx_L1_error) + __PYX_ERR(0, 670, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_arr, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_arr, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 670, __pyx_L1_error) __pyx_t_3 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_3; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 654, __pyx_L1_error) + __PYX_ERR(0, 670, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -82897,12 +85639,12 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 654, __pyx_L1_error) + __PYX_ERR(0, 670, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 654, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 670, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_3); __Pyx_GIVEREF(__pyx_int_3); @@ -82913,15 +85655,15 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 654, __pyx_L1_error) + __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_L6:; while (1) { @@ -82931,7 +85673,7 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -82940,14 +85682,14 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -82969,14 +85711,14 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_2 = (__pyx_v_dtype != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_itemsize = __pyx_t_5; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_kind = __pyx_t_7; __pyx_v_dtype_signed = (__pyx_v_kind == 'i'); @@ -82989,9 +85731,9 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_3 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -83003,7 +85745,7 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_3 = __pyx_t_2; __pyx_L16_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 670, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint16_t)) == __pyx_v_itemsize) != 0); @@ -83012,9 +85754,9 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_3 = __pyx_t_2; goto __pyx_L20_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -83026,7 +85768,7 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_3 = __pyx_t_2; __pyx_L20_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 670, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint32_t)) == __pyx_v_itemsize) != 0); @@ -83035,9 +85777,9 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_3 = __pyx_t_2; goto __pyx_L24_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -83049,7 +85791,7 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_3 = __pyx_t_2; __pyx_L24_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 670, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint64_t)) == __pyx_v_itemsize) != 0); @@ -83058,9 +85800,9 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_3 = __pyx_t_2; goto __pyx_L28_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -83072,7 +85814,7 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_3 = __pyx_t_2; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 670, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int8_t)) == __pyx_v_itemsize) != 0); @@ -83081,9 +85823,9 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_3 = __pyx_t_2; goto __pyx_L32_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -83095,7 +85837,7 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_3 = __pyx_t_2; __pyx_L32_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 670, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int16_t)) == __pyx_v_itemsize) != 0); @@ -83104,9 +85846,9 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_3 = __pyx_t_2; goto __pyx_L36_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -83118,7 +85860,7 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_3 = __pyx_t_2; __pyx_L36_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 670, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int32_t)) == __pyx_v_itemsize) != 0); @@ -83127,9 +85869,9 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_3 = __pyx_t_2; goto __pyx_L40_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -83141,7 +85883,7 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_3 = __pyx_t_2; __pyx_L40_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 670, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int64_t)) == __pyx_v_itemsize) != 0); @@ -83150,9 +85892,9 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_3 = __pyx_t_2; goto __pyx_L44_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -83164,7 +85906,7 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_3 = __pyx_t_2; __pyx_L44_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 670, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -83193,7 +85935,7 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 670, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -83215,7 +85957,7 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 670, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -83237,7 +85979,7 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 670, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -83259,7 +86001,7 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 670, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -83281,7 +86023,7 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 670, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -83303,7 +86045,7 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 670, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -83325,7 +86067,7 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 670, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -83347,27 +86089,27 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 670, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); } } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 670, __pyx_L1_error) goto __pyx_L10_break; } __pyx_L10_break:; - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_candidates = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = 0; if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 654, __pyx_L1_error) + __PYX_ERR(0, 670, __pyx_L1_error) } - __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_1; @@ -83375,12 +86117,12 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec while (1) { __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_9, &__pyx_t_5, &__pyx_t_1, NULL, NULL, __pyx_t_10); if (unlikely(__pyx_t_11 == 0)) break; - if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_1); __pyx_t_1 = 0; __pyx_v_match_found = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { @@ -83394,10 +86136,10 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec } __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, __pyx_kp_s__2) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__2); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -83412,27 +86154,27 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec } __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_12, __pyx_kp_s__3) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__3); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_src_sig, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 670, __pyx_L1_error) __pyx_t_16 = __pyx_t_15; for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dest_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dest_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_v_dst_type != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_2) { __pyx_v_match_found = 1; @@ -83448,35 +86190,35 @@ static PyObject *__pyx_pf_9fastremap_34remap_from_array_kv(CYTHON_UNUSED PyObjec __pyx_L82_break:; __pyx_t_2 = (__pyx_v_match_found != 0); if (__pyx_t_2) { - __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 670, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_candidates) != 0); __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 654, __pyx_L1_error) + __PYX_ERR(0, 670, __pyx_L1_error) } - __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 670, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_9 > 1) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 654, __pyx_L1_error) + __PYX_ERR(0, 670, __pyx_L1_error) } /*else*/ { __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 654, __pyx_L1_error) + __PYX_ERR(0, 670, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; @@ -83546,17 +86288,17 @@ static PyObject *__pyx_fuse_0__pyx_pw_9fastremap_423remap_from_array_kv(PyObject case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 1); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 1); __PYX_ERR(0, 670, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vals)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 2); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 2); __PYX_ERR(0, 670, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap_from_array_kv") < 0)) __PYX_ERR(0, 654, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap_from_array_kv") < 0)) __PYX_ERR(0, 670, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -83571,15 +86313,15 @@ static PyObject *__pyx_fuse_0__pyx_pw_9fastremap_423remap_from_array_kv(PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 670, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.remap_from_array_kv", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 654, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), __pyx_ptype_5numpy_ndarray, 1, "keys", 0))) __PYX_ERR(0, 654, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 670, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), __pyx_ptype_5numpy_ndarray, 1, "keys", 0))) __PYX_ERR(0, 670, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 670, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_422remap_from_array_kv(__pyx_self, __pyx_v_arr, __pyx_v_keys, __pyx_v_vals); /* function exit code */ @@ -83595,7 +86337,7 @@ static PyObject *__pyx_pf_9fastremap_422remap_from_array_kv(CYTHON_UNUSED PyObje CYTHON_UNUSED __Pyx_memviewslice __pyx_v_keyview = { 0, 0, { 0 }, { 0 }, { 0 } }; CYTHON_UNUSED __Pyx_memviewslice __pyx_v_valview = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; - std::unordered_map __pyx_v_remap_dict; + ska::flat_hash_map __pyx_v_remap_dict; size_t __pyx_v_i; size_t __pyx_v_size; uint8_t __pyx_v_elem; @@ -83635,58 +86377,58 @@ static PyObject *__pyx_pf_9fastremap_422remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_pybuffernd_vals.rcbuffer = &__pyx_pybuffer_vals; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_keys.rcbuffer->pybuffer, (PyObject*)__pyx_v_keys, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_keys.rcbuffer->pybuffer, (PyObject*)__pyx_v_keys, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_pybuffernd_keys.diminfo[0].strides = __pyx_pybuffernd_keys.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_keys.diminfo[0].shape = __pyx_pybuffernd_keys.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_pybuffernd_vals.diminfo[0].strides = __pyx_pybuffernd_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vals.diminfo[0].shape = __pyx_pybuffernd_vals.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":658 + /* "fastremap.pyx":674 * remap_from_array_kv(cnp.ndarray[ALLINT] arr, cnp.ndarray[ALLINT] keys, cnp.ndarray[ALLINT] vals) * """ * cdef ALLINT[:] keyview = keys # <<<<<<<<<<<<<< * cdef ALLINT[:] valview = vals * cdef ALLINT[:] arrview = arr */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint8_t(((PyObject *)__pyx_v_keys), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint8_t(((PyObject *)__pyx_v_keys), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 674, __pyx_L1_error) __pyx_v_keyview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":659 + /* "fastremap.pyx":675 * """ * cdef ALLINT[:] keyview = keys * cdef ALLINT[:] valview = vals # <<<<<<<<<<<<<< * cdef ALLINT[:] arrview = arr - * cdef unordered_map[ALLINT, ALLINT] remap_dict + * cdef flat_hash_map[ALLINT, ALLINT] remap_dict */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint8_t(((PyObject *)__pyx_v_vals), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint8_t(((PyObject *)__pyx_v_vals), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 675, __pyx_L1_error) __pyx_v_valview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":660 + /* "fastremap.pyx":676 * cdef ALLINT[:] keyview = keys * cdef ALLINT[:] valview = vals * cdef ALLINT[:] arrview = arr # <<<<<<<<<<<<<< - * cdef unordered_map[ALLINT, ALLINT] remap_dict + * cdef flat_hash_map[ALLINT, ALLINT] remap_dict * */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 660, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 676, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":663 - * cdef unordered_map[ALLINT, ALLINT] remap_dict + /* "fastremap.pyx":679 + * cdef flat_hash_map[ALLINT, ALLINT] remap_dict * * assert keys.size == vals.size # <<<<<<<<<<<<<< * @@ -83694,23 +86436,23 @@ static PyObject *__pyx_pf_9fastremap_422remap_from_array_kv(CYTHON_UNUSED PyObje */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(0, 663, __pyx_L1_error) + __PYX_ERR(0, 679, __pyx_L1_error) } } #endif - /* "fastremap.pyx":665 + /* "fastremap.pyx":681 * assert keys.size == vals.size * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -83719,20 +86461,20 @@ static PyObject *__pyx_pf_9fastremap_422remap_from_array_kv(CYTHON_UNUSED PyObje */ __pyx_v_i = 0; - /* "fastremap.pyx":666 + /* "fastremap.pyx":682 * * cdef size_t i = 0 * cdef size_t size = keys.size # <<<<<<<<<<<<<< * cdef ALLINT elem * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_size = __pyx_t_6; - /* "fastremap.pyx":669 + /* "fastremap.pyx":685 * cdef ALLINT elem * * with nogil: # <<<<<<<<<<<<<< @@ -83747,7 +86489,7 @@ static PyObject *__pyx_pf_9fastremap_422remap_from_array_kv(CYTHON_UNUSED PyObje #endif /*try:*/ { - /* "fastremap.pyx":670 + /* "fastremap.pyx":686 * * with nogil: * for i in range(size): # <<<<<<<<<<<<<< @@ -83759,7 +86501,7 @@ static PyObject *__pyx_pf_9fastremap_422remap_from_array_kv(CYTHON_UNUSED PyObje for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "fastremap.pyx":671 + /* "fastremap.pyx":687 * with nogil: * for i in range(size): * remap_dict[keys[i]] = vals[i] # <<<<<<<<<<<<<< @@ -83772,7 +86514,7 @@ static PyObject *__pyx_pf_9fastremap_422remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":669 + /* "fastremap.pyx":685 * cdef ALLINT elem * * with nogil: # <<<<<<<<<<<<<< @@ -83791,7 +86533,7 @@ static PyObject *__pyx_pf_9fastremap_422remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":673 + /* "fastremap.pyx":689 * remap_dict[keys[i]] = vals[i] * * i = 0 # <<<<<<<<<<<<<< @@ -83800,20 +86542,20 @@ static PyObject *__pyx_pf_9fastremap_422remap_from_array_kv(CYTHON_UNUSED PyObje */ __pyx_v_i = 0; - /* "fastremap.pyx":674 + /* "fastremap.pyx":690 * * i = 0 * size = arr.size # <<<<<<<<<<<<<< * * with nogil: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 674, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_size = __pyx_t_6; - /* "fastremap.pyx":676 + /* "fastremap.pyx":692 * size = arr.size * * with nogil: # <<<<<<<<<<<<<< @@ -83828,7 +86570,7 @@ static PyObject *__pyx_pf_9fastremap_422remap_from_array_kv(CYTHON_UNUSED PyObje #endif /*try:*/ { - /* "fastremap.pyx":677 + /* "fastremap.pyx":693 * * with nogil: * for i in range(size): # <<<<<<<<<<<<<< @@ -83840,7 +86582,7 @@ static PyObject *__pyx_pf_9fastremap_422remap_from_array_kv(CYTHON_UNUSED PyObje for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "fastremap.pyx":678 + /* "fastremap.pyx":694 * with nogil: * for i in range(size): * elem = arr[i] # <<<<<<<<<<<<<< @@ -83850,7 +86592,7 @@ static PyObject *__pyx_pf_9fastremap_422remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_t_9 = __pyx_v_i; __pyx_v_elem = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_arr.diminfo[0].strides)); - /* "fastremap.pyx":679 + /* "fastremap.pyx":695 * for i in range(size): * elem = arr[i] * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -83860,7 +86602,7 @@ static PyObject *__pyx_pf_9fastremap_422remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_t_5 = ((__pyx_v_remap_dict.find(__pyx_v_elem) == __pyx_v_remap_dict.end()) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":680 + /* "fastremap.pyx":696 * elem = arr[i] * if remap_dict.find(elem) == remap_dict.end(): * continue # <<<<<<<<<<<<<< @@ -83869,7 +86611,7 @@ static PyObject *__pyx_pf_9fastremap_422remap_from_array_kv(CYTHON_UNUSED PyObje */ goto __pyx_L11_continue; - /* "fastremap.pyx":679 + /* "fastremap.pyx":695 * for i in range(size): * elem = arr[i] * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -83878,7 +86620,7 @@ static PyObject *__pyx_pf_9fastremap_422remap_from_array_kv(CYTHON_UNUSED PyObje */ } - /* "fastremap.pyx":682 + /* "fastremap.pyx":698 * continue * else: * arrview[i] = remap_dict[elem] # <<<<<<<<<<<<<< @@ -83893,7 +86635,7 @@ static PyObject *__pyx_pf_9fastremap_422remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":676 + /* "fastremap.pyx":692 * size = arr.size * * with nogil: # <<<<<<<<<<<<<< @@ -83912,7 +86654,7 @@ static PyObject *__pyx_pf_9fastremap_422remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":684 + /* "fastremap.pyx":700 * arrview[i] = remap_dict[elem] * * return arr # <<<<<<<<<<<<<< @@ -83924,7 +86666,7 @@ static PyObject *__pyx_pf_9fastremap_422remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":654 + /* "fastremap.pyx":670 * * @cython.boundscheck(False) * def remap_from_array_kv(cnp.ndarray[ALLINT] arr, cnp.ndarray[ALLINT] keys, cnp.ndarray[ALLINT] vals): # <<<<<<<<<<<<<< @@ -84000,17 +86742,17 @@ static PyObject *__pyx_fuse_1__pyx_pw_9fastremap_425remap_from_array_kv(PyObject case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 1); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 1); __PYX_ERR(0, 670, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vals)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 2); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 2); __PYX_ERR(0, 670, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap_from_array_kv") < 0)) __PYX_ERR(0, 654, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap_from_array_kv") < 0)) __PYX_ERR(0, 670, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -84025,15 +86767,15 @@ static PyObject *__pyx_fuse_1__pyx_pw_9fastremap_425remap_from_array_kv(PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 670, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.remap_from_array_kv", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 654, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), __pyx_ptype_5numpy_ndarray, 1, "keys", 0))) __PYX_ERR(0, 654, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 670, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), __pyx_ptype_5numpy_ndarray, 1, "keys", 0))) __PYX_ERR(0, 670, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 670, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_424remap_from_array_kv(__pyx_self, __pyx_v_arr, __pyx_v_keys, __pyx_v_vals); /* function exit code */ @@ -84049,7 +86791,7 @@ static PyObject *__pyx_pf_9fastremap_424remap_from_array_kv(CYTHON_UNUSED PyObje CYTHON_UNUSED __Pyx_memviewslice __pyx_v_keyview = { 0, 0, { 0 }, { 0 }, { 0 } }; CYTHON_UNUSED __Pyx_memviewslice __pyx_v_valview = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; - std::unordered_map __pyx_v_remap_dict; + ska::flat_hash_map __pyx_v_remap_dict; size_t __pyx_v_i; size_t __pyx_v_size; uint16_t __pyx_v_elem; @@ -84089,58 +86831,58 @@ static PyObject *__pyx_pf_9fastremap_424remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_pybuffernd_vals.rcbuffer = &__pyx_pybuffer_vals; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_keys.rcbuffer->pybuffer, (PyObject*)__pyx_v_keys, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_keys.rcbuffer->pybuffer, (PyObject*)__pyx_v_keys, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_pybuffernd_keys.diminfo[0].strides = __pyx_pybuffernd_keys.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_keys.diminfo[0].shape = __pyx_pybuffernd_keys.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_pybuffernd_vals.diminfo[0].strides = __pyx_pybuffernd_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vals.diminfo[0].shape = __pyx_pybuffernd_vals.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":658 + /* "fastremap.pyx":674 * remap_from_array_kv(cnp.ndarray[ALLINT] arr, cnp.ndarray[ALLINT] keys, cnp.ndarray[ALLINT] vals) * """ * cdef ALLINT[:] keyview = keys # <<<<<<<<<<<<<< * cdef ALLINT[:] valview = vals * cdef ALLINT[:] arrview = arr */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint16_t(((PyObject *)__pyx_v_keys), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint16_t(((PyObject *)__pyx_v_keys), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 674, __pyx_L1_error) __pyx_v_keyview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":659 + /* "fastremap.pyx":675 * """ * cdef ALLINT[:] keyview = keys * cdef ALLINT[:] valview = vals # <<<<<<<<<<<<<< * cdef ALLINT[:] arrview = arr - * cdef unordered_map[ALLINT, ALLINT] remap_dict + * cdef flat_hash_map[ALLINT, ALLINT] remap_dict */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint16_t(((PyObject *)__pyx_v_vals), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint16_t(((PyObject *)__pyx_v_vals), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 675, __pyx_L1_error) __pyx_v_valview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":660 + /* "fastremap.pyx":676 * cdef ALLINT[:] keyview = keys * cdef ALLINT[:] valview = vals * cdef ALLINT[:] arrview = arr # <<<<<<<<<<<<<< - * cdef unordered_map[ALLINT, ALLINT] remap_dict + * cdef flat_hash_map[ALLINT, ALLINT] remap_dict * */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 660, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 676, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":663 - * cdef unordered_map[ALLINT, ALLINT] remap_dict + /* "fastremap.pyx":679 + * cdef flat_hash_map[ALLINT, ALLINT] remap_dict * * assert keys.size == vals.size # <<<<<<<<<<<<<< * @@ -84148,23 +86890,23 @@ static PyObject *__pyx_pf_9fastremap_424remap_from_array_kv(CYTHON_UNUSED PyObje */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(0, 663, __pyx_L1_error) + __PYX_ERR(0, 679, __pyx_L1_error) } } #endif - /* "fastremap.pyx":665 + /* "fastremap.pyx":681 * assert keys.size == vals.size * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -84173,20 +86915,20 @@ static PyObject *__pyx_pf_9fastremap_424remap_from_array_kv(CYTHON_UNUSED PyObje */ __pyx_v_i = 0; - /* "fastremap.pyx":666 + /* "fastremap.pyx":682 * * cdef size_t i = 0 * cdef size_t size = keys.size # <<<<<<<<<<<<<< * cdef ALLINT elem * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_size = __pyx_t_6; - /* "fastremap.pyx":669 + /* "fastremap.pyx":685 * cdef ALLINT elem * * with nogil: # <<<<<<<<<<<<<< @@ -84201,7 +86943,7 @@ static PyObject *__pyx_pf_9fastremap_424remap_from_array_kv(CYTHON_UNUSED PyObje #endif /*try:*/ { - /* "fastremap.pyx":670 + /* "fastremap.pyx":686 * * with nogil: * for i in range(size): # <<<<<<<<<<<<<< @@ -84213,7 +86955,7 @@ static PyObject *__pyx_pf_9fastremap_424remap_from_array_kv(CYTHON_UNUSED PyObje for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "fastremap.pyx":671 + /* "fastremap.pyx":687 * with nogil: * for i in range(size): * remap_dict[keys[i]] = vals[i] # <<<<<<<<<<<<<< @@ -84226,7 +86968,7 @@ static PyObject *__pyx_pf_9fastremap_424remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":669 + /* "fastremap.pyx":685 * cdef ALLINT elem * * with nogil: # <<<<<<<<<<<<<< @@ -84245,7 +86987,7 @@ static PyObject *__pyx_pf_9fastremap_424remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":673 + /* "fastremap.pyx":689 * remap_dict[keys[i]] = vals[i] * * i = 0 # <<<<<<<<<<<<<< @@ -84254,20 +86996,20 @@ static PyObject *__pyx_pf_9fastremap_424remap_from_array_kv(CYTHON_UNUSED PyObje */ __pyx_v_i = 0; - /* "fastremap.pyx":674 + /* "fastremap.pyx":690 * * i = 0 * size = arr.size # <<<<<<<<<<<<<< * * with nogil: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 674, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_size = __pyx_t_6; - /* "fastremap.pyx":676 + /* "fastremap.pyx":692 * size = arr.size * * with nogil: # <<<<<<<<<<<<<< @@ -84282,7 +87024,7 @@ static PyObject *__pyx_pf_9fastremap_424remap_from_array_kv(CYTHON_UNUSED PyObje #endif /*try:*/ { - /* "fastremap.pyx":677 + /* "fastremap.pyx":693 * * with nogil: * for i in range(size): # <<<<<<<<<<<<<< @@ -84294,7 +87036,7 @@ static PyObject *__pyx_pf_9fastremap_424remap_from_array_kv(CYTHON_UNUSED PyObje for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "fastremap.pyx":678 + /* "fastremap.pyx":694 * with nogil: * for i in range(size): * elem = arr[i] # <<<<<<<<<<<<<< @@ -84304,7 +87046,7 @@ static PyObject *__pyx_pf_9fastremap_424remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_t_9 = __pyx_v_i; __pyx_v_elem = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_arr.diminfo[0].strides)); - /* "fastremap.pyx":679 + /* "fastremap.pyx":695 * for i in range(size): * elem = arr[i] * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -84314,7 +87056,7 @@ static PyObject *__pyx_pf_9fastremap_424remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_t_5 = ((__pyx_v_remap_dict.find(__pyx_v_elem) == __pyx_v_remap_dict.end()) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":680 + /* "fastremap.pyx":696 * elem = arr[i] * if remap_dict.find(elem) == remap_dict.end(): * continue # <<<<<<<<<<<<<< @@ -84323,7 +87065,7 @@ static PyObject *__pyx_pf_9fastremap_424remap_from_array_kv(CYTHON_UNUSED PyObje */ goto __pyx_L11_continue; - /* "fastremap.pyx":679 + /* "fastremap.pyx":695 * for i in range(size): * elem = arr[i] * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -84332,7 +87074,7 @@ static PyObject *__pyx_pf_9fastremap_424remap_from_array_kv(CYTHON_UNUSED PyObje */ } - /* "fastremap.pyx":682 + /* "fastremap.pyx":698 * continue * else: * arrview[i] = remap_dict[elem] # <<<<<<<<<<<<<< @@ -84347,7 +87089,7 @@ static PyObject *__pyx_pf_9fastremap_424remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":676 + /* "fastremap.pyx":692 * size = arr.size * * with nogil: # <<<<<<<<<<<<<< @@ -84366,7 +87108,7 @@ static PyObject *__pyx_pf_9fastremap_424remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":684 + /* "fastremap.pyx":700 * arrview[i] = remap_dict[elem] * * return arr # <<<<<<<<<<<<<< @@ -84378,7 +87120,7 @@ static PyObject *__pyx_pf_9fastremap_424remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":654 + /* "fastremap.pyx":670 * * @cython.boundscheck(False) * def remap_from_array_kv(cnp.ndarray[ALLINT] arr, cnp.ndarray[ALLINT] keys, cnp.ndarray[ALLINT] vals): # <<<<<<<<<<<<<< @@ -84454,17 +87196,17 @@ static PyObject *__pyx_fuse_2__pyx_pw_9fastremap_427remap_from_array_kv(PyObject case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 1); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 1); __PYX_ERR(0, 670, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vals)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 2); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 2); __PYX_ERR(0, 670, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap_from_array_kv") < 0)) __PYX_ERR(0, 654, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap_from_array_kv") < 0)) __PYX_ERR(0, 670, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -84479,15 +87221,15 @@ static PyObject *__pyx_fuse_2__pyx_pw_9fastremap_427remap_from_array_kv(PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 670, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.remap_from_array_kv", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 654, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), __pyx_ptype_5numpy_ndarray, 1, "keys", 0))) __PYX_ERR(0, 654, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 670, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), __pyx_ptype_5numpy_ndarray, 1, "keys", 0))) __PYX_ERR(0, 670, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 670, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_426remap_from_array_kv(__pyx_self, __pyx_v_arr, __pyx_v_keys, __pyx_v_vals); /* function exit code */ @@ -84503,7 +87245,7 @@ static PyObject *__pyx_pf_9fastremap_426remap_from_array_kv(CYTHON_UNUSED PyObje CYTHON_UNUSED __Pyx_memviewslice __pyx_v_keyview = { 0, 0, { 0 }, { 0 }, { 0 } }; CYTHON_UNUSED __Pyx_memviewslice __pyx_v_valview = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; - std::unordered_map __pyx_v_remap_dict; + ska::flat_hash_map __pyx_v_remap_dict; size_t __pyx_v_i; size_t __pyx_v_size; uint32_t __pyx_v_elem; @@ -84543,58 +87285,58 @@ static PyObject *__pyx_pf_9fastremap_426remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_pybuffernd_vals.rcbuffer = &__pyx_pybuffer_vals; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_keys.rcbuffer->pybuffer, (PyObject*)__pyx_v_keys, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_keys.rcbuffer->pybuffer, (PyObject*)__pyx_v_keys, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_pybuffernd_keys.diminfo[0].strides = __pyx_pybuffernd_keys.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_keys.diminfo[0].shape = __pyx_pybuffernd_keys.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_pybuffernd_vals.diminfo[0].strides = __pyx_pybuffernd_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vals.diminfo[0].shape = __pyx_pybuffernd_vals.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":658 + /* "fastremap.pyx":674 * remap_from_array_kv(cnp.ndarray[ALLINT] arr, cnp.ndarray[ALLINT] keys, cnp.ndarray[ALLINT] vals) * """ * cdef ALLINT[:] keyview = keys # <<<<<<<<<<<<<< * cdef ALLINT[:] valview = vals * cdef ALLINT[:] arrview = arr */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint32_t(((PyObject *)__pyx_v_keys), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint32_t(((PyObject *)__pyx_v_keys), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 674, __pyx_L1_error) __pyx_v_keyview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":659 + /* "fastremap.pyx":675 * """ * cdef ALLINT[:] keyview = keys * cdef ALLINT[:] valview = vals # <<<<<<<<<<<<<< * cdef ALLINT[:] arrview = arr - * cdef unordered_map[ALLINT, ALLINT] remap_dict + * cdef flat_hash_map[ALLINT, ALLINT] remap_dict */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint32_t(((PyObject *)__pyx_v_vals), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint32_t(((PyObject *)__pyx_v_vals), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 675, __pyx_L1_error) __pyx_v_valview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":660 + /* "fastremap.pyx":676 * cdef ALLINT[:] keyview = keys * cdef ALLINT[:] valview = vals * cdef ALLINT[:] arrview = arr # <<<<<<<<<<<<<< - * cdef unordered_map[ALLINT, ALLINT] remap_dict + * cdef flat_hash_map[ALLINT, ALLINT] remap_dict * */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 660, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 676, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":663 - * cdef unordered_map[ALLINT, ALLINT] remap_dict + /* "fastremap.pyx":679 + * cdef flat_hash_map[ALLINT, ALLINT] remap_dict * * assert keys.size == vals.size # <<<<<<<<<<<<<< * @@ -84602,23 +87344,23 @@ static PyObject *__pyx_pf_9fastremap_426remap_from_array_kv(CYTHON_UNUSED PyObje */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(0, 663, __pyx_L1_error) + __PYX_ERR(0, 679, __pyx_L1_error) } } #endif - /* "fastremap.pyx":665 + /* "fastremap.pyx":681 * assert keys.size == vals.size * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -84627,20 +87369,20 @@ static PyObject *__pyx_pf_9fastremap_426remap_from_array_kv(CYTHON_UNUSED PyObje */ __pyx_v_i = 0; - /* "fastremap.pyx":666 + /* "fastremap.pyx":682 * * cdef size_t i = 0 * cdef size_t size = keys.size # <<<<<<<<<<<<<< * cdef ALLINT elem * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_size = __pyx_t_6; - /* "fastremap.pyx":669 + /* "fastremap.pyx":685 * cdef ALLINT elem * * with nogil: # <<<<<<<<<<<<<< @@ -84655,7 +87397,7 @@ static PyObject *__pyx_pf_9fastremap_426remap_from_array_kv(CYTHON_UNUSED PyObje #endif /*try:*/ { - /* "fastremap.pyx":670 + /* "fastremap.pyx":686 * * with nogil: * for i in range(size): # <<<<<<<<<<<<<< @@ -84667,7 +87409,7 @@ static PyObject *__pyx_pf_9fastremap_426remap_from_array_kv(CYTHON_UNUSED PyObje for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "fastremap.pyx":671 + /* "fastremap.pyx":687 * with nogil: * for i in range(size): * remap_dict[keys[i]] = vals[i] # <<<<<<<<<<<<<< @@ -84680,7 +87422,7 @@ static PyObject *__pyx_pf_9fastremap_426remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":669 + /* "fastremap.pyx":685 * cdef ALLINT elem * * with nogil: # <<<<<<<<<<<<<< @@ -84699,7 +87441,7 @@ static PyObject *__pyx_pf_9fastremap_426remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":673 + /* "fastremap.pyx":689 * remap_dict[keys[i]] = vals[i] * * i = 0 # <<<<<<<<<<<<<< @@ -84708,20 +87450,20 @@ static PyObject *__pyx_pf_9fastremap_426remap_from_array_kv(CYTHON_UNUSED PyObje */ __pyx_v_i = 0; - /* "fastremap.pyx":674 + /* "fastremap.pyx":690 * * i = 0 * size = arr.size # <<<<<<<<<<<<<< * * with nogil: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 674, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_size = __pyx_t_6; - /* "fastremap.pyx":676 + /* "fastremap.pyx":692 * size = arr.size * * with nogil: # <<<<<<<<<<<<<< @@ -84736,7 +87478,7 @@ static PyObject *__pyx_pf_9fastremap_426remap_from_array_kv(CYTHON_UNUSED PyObje #endif /*try:*/ { - /* "fastremap.pyx":677 + /* "fastremap.pyx":693 * * with nogil: * for i in range(size): # <<<<<<<<<<<<<< @@ -84748,7 +87490,7 @@ static PyObject *__pyx_pf_9fastremap_426remap_from_array_kv(CYTHON_UNUSED PyObje for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "fastremap.pyx":678 + /* "fastremap.pyx":694 * with nogil: * for i in range(size): * elem = arr[i] # <<<<<<<<<<<<<< @@ -84758,7 +87500,7 @@ static PyObject *__pyx_pf_9fastremap_426remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_t_9 = __pyx_v_i; __pyx_v_elem = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_arr.diminfo[0].strides)); - /* "fastremap.pyx":679 + /* "fastremap.pyx":695 * for i in range(size): * elem = arr[i] * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -84768,7 +87510,7 @@ static PyObject *__pyx_pf_9fastremap_426remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_t_5 = ((__pyx_v_remap_dict.find(__pyx_v_elem) == __pyx_v_remap_dict.end()) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":680 + /* "fastremap.pyx":696 * elem = arr[i] * if remap_dict.find(elem) == remap_dict.end(): * continue # <<<<<<<<<<<<<< @@ -84777,7 +87519,7 @@ static PyObject *__pyx_pf_9fastremap_426remap_from_array_kv(CYTHON_UNUSED PyObje */ goto __pyx_L11_continue; - /* "fastremap.pyx":679 + /* "fastremap.pyx":695 * for i in range(size): * elem = arr[i] * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -84786,7 +87528,7 @@ static PyObject *__pyx_pf_9fastremap_426remap_from_array_kv(CYTHON_UNUSED PyObje */ } - /* "fastremap.pyx":682 + /* "fastremap.pyx":698 * continue * else: * arrview[i] = remap_dict[elem] # <<<<<<<<<<<<<< @@ -84801,7 +87543,7 @@ static PyObject *__pyx_pf_9fastremap_426remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":676 + /* "fastremap.pyx":692 * size = arr.size * * with nogil: # <<<<<<<<<<<<<< @@ -84820,7 +87562,7 @@ static PyObject *__pyx_pf_9fastremap_426remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":684 + /* "fastremap.pyx":700 * arrview[i] = remap_dict[elem] * * return arr # <<<<<<<<<<<<<< @@ -84832,7 +87574,7 @@ static PyObject *__pyx_pf_9fastremap_426remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":654 + /* "fastremap.pyx":670 * * @cython.boundscheck(False) * def remap_from_array_kv(cnp.ndarray[ALLINT] arr, cnp.ndarray[ALLINT] keys, cnp.ndarray[ALLINT] vals): # <<<<<<<<<<<<<< @@ -84908,17 +87650,17 @@ static PyObject *__pyx_fuse_3__pyx_pw_9fastremap_429remap_from_array_kv(PyObject case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 1); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 1); __PYX_ERR(0, 670, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vals)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 2); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 2); __PYX_ERR(0, 670, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap_from_array_kv") < 0)) __PYX_ERR(0, 654, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap_from_array_kv") < 0)) __PYX_ERR(0, 670, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -84933,15 +87675,15 @@ static PyObject *__pyx_fuse_3__pyx_pw_9fastremap_429remap_from_array_kv(PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 670, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.remap_from_array_kv", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 654, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), __pyx_ptype_5numpy_ndarray, 1, "keys", 0))) __PYX_ERR(0, 654, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 670, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), __pyx_ptype_5numpy_ndarray, 1, "keys", 0))) __PYX_ERR(0, 670, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 670, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_428remap_from_array_kv(__pyx_self, __pyx_v_arr, __pyx_v_keys, __pyx_v_vals); /* function exit code */ @@ -84957,7 +87699,7 @@ static PyObject *__pyx_pf_9fastremap_428remap_from_array_kv(CYTHON_UNUSED PyObje CYTHON_UNUSED __Pyx_memviewslice __pyx_v_keyview = { 0, 0, { 0 }, { 0 }, { 0 } }; CYTHON_UNUSED __Pyx_memviewslice __pyx_v_valview = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; - std::unordered_map __pyx_v_remap_dict; + ska::flat_hash_map __pyx_v_remap_dict; size_t __pyx_v_i; size_t __pyx_v_size; uint64_t __pyx_v_elem; @@ -84997,58 +87739,58 @@ static PyObject *__pyx_pf_9fastremap_428remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_pybuffernd_vals.rcbuffer = &__pyx_pybuffer_vals; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_keys.rcbuffer->pybuffer, (PyObject*)__pyx_v_keys, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_keys.rcbuffer->pybuffer, (PyObject*)__pyx_v_keys, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_pybuffernd_keys.diminfo[0].strides = __pyx_pybuffernd_keys.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_keys.diminfo[0].shape = __pyx_pybuffernd_keys.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_pybuffernd_vals.diminfo[0].strides = __pyx_pybuffernd_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vals.diminfo[0].shape = __pyx_pybuffernd_vals.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":658 + /* "fastremap.pyx":674 * remap_from_array_kv(cnp.ndarray[ALLINT] arr, cnp.ndarray[ALLINT] keys, cnp.ndarray[ALLINT] vals) * """ * cdef ALLINT[:] keyview = keys # <<<<<<<<<<<<<< * cdef ALLINT[:] valview = vals * cdef ALLINT[:] arrview = arr */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint64_t(((PyObject *)__pyx_v_keys), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint64_t(((PyObject *)__pyx_v_keys), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 674, __pyx_L1_error) __pyx_v_keyview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":659 + /* "fastremap.pyx":675 * """ * cdef ALLINT[:] keyview = keys * cdef ALLINT[:] valview = vals # <<<<<<<<<<<<<< * cdef ALLINT[:] arrview = arr - * cdef unordered_map[ALLINT, ALLINT] remap_dict + * cdef flat_hash_map[ALLINT, ALLINT] remap_dict */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint64_t(((PyObject *)__pyx_v_vals), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint64_t(((PyObject *)__pyx_v_vals), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 675, __pyx_L1_error) __pyx_v_valview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":660 + /* "fastremap.pyx":676 * cdef ALLINT[:] keyview = keys * cdef ALLINT[:] valview = vals * cdef ALLINT[:] arrview = arr # <<<<<<<<<<<<<< - * cdef unordered_map[ALLINT, ALLINT] remap_dict + * cdef flat_hash_map[ALLINT, ALLINT] remap_dict * */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 660, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_uint64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 676, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":663 - * cdef unordered_map[ALLINT, ALLINT] remap_dict + /* "fastremap.pyx":679 + * cdef flat_hash_map[ALLINT, ALLINT] remap_dict * * assert keys.size == vals.size # <<<<<<<<<<<<<< * @@ -85056,23 +87798,23 @@ static PyObject *__pyx_pf_9fastremap_428remap_from_array_kv(CYTHON_UNUSED PyObje */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(0, 663, __pyx_L1_error) + __PYX_ERR(0, 679, __pyx_L1_error) } } #endif - /* "fastremap.pyx":665 + /* "fastremap.pyx":681 * assert keys.size == vals.size * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -85081,20 +87823,20 @@ static PyObject *__pyx_pf_9fastremap_428remap_from_array_kv(CYTHON_UNUSED PyObje */ __pyx_v_i = 0; - /* "fastremap.pyx":666 + /* "fastremap.pyx":682 * * cdef size_t i = 0 * cdef size_t size = keys.size # <<<<<<<<<<<<<< * cdef ALLINT elem * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_size = __pyx_t_6; - /* "fastremap.pyx":669 + /* "fastremap.pyx":685 * cdef ALLINT elem * * with nogil: # <<<<<<<<<<<<<< @@ -85109,7 +87851,7 @@ static PyObject *__pyx_pf_9fastremap_428remap_from_array_kv(CYTHON_UNUSED PyObje #endif /*try:*/ { - /* "fastremap.pyx":670 + /* "fastremap.pyx":686 * * with nogil: * for i in range(size): # <<<<<<<<<<<<<< @@ -85121,7 +87863,7 @@ static PyObject *__pyx_pf_9fastremap_428remap_from_array_kv(CYTHON_UNUSED PyObje for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "fastremap.pyx":671 + /* "fastremap.pyx":687 * with nogil: * for i in range(size): * remap_dict[keys[i]] = vals[i] # <<<<<<<<<<<<<< @@ -85134,7 +87876,7 @@ static PyObject *__pyx_pf_9fastremap_428remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":669 + /* "fastremap.pyx":685 * cdef ALLINT elem * * with nogil: # <<<<<<<<<<<<<< @@ -85153,7 +87895,7 @@ static PyObject *__pyx_pf_9fastremap_428remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":673 + /* "fastremap.pyx":689 * remap_dict[keys[i]] = vals[i] * * i = 0 # <<<<<<<<<<<<<< @@ -85162,20 +87904,20 @@ static PyObject *__pyx_pf_9fastremap_428remap_from_array_kv(CYTHON_UNUSED PyObje */ __pyx_v_i = 0; - /* "fastremap.pyx":674 + /* "fastremap.pyx":690 * * i = 0 * size = arr.size # <<<<<<<<<<<<<< * * with nogil: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 674, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_size = __pyx_t_6; - /* "fastremap.pyx":676 + /* "fastremap.pyx":692 * size = arr.size * * with nogil: # <<<<<<<<<<<<<< @@ -85190,7 +87932,7 @@ static PyObject *__pyx_pf_9fastremap_428remap_from_array_kv(CYTHON_UNUSED PyObje #endif /*try:*/ { - /* "fastremap.pyx":677 + /* "fastremap.pyx":693 * * with nogil: * for i in range(size): # <<<<<<<<<<<<<< @@ -85202,7 +87944,7 @@ static PyObject *__pyx_pf_9fastremap_428remap_from_array_kv(CYTHON_UNUSED PyObje for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "fastremap.pyx":678 + /* "fastremap.pyx":694 * with nogil: * for i in range(size): * elem = arr[i] # <<<<<<<<<<<<<< @@ -85212,7 +87954,7 @@ static PyObject *__pyx_pf_9fastremap_428remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_t_9 = __pyx_v_i; __pyx_v_elem = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_arr.diminfo[0].strides)); - /* "fastremap.pyx":679 + /* "fastremap.pyx":695 * for i in range(size): * elem = arr[i] * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -85222,7 +87964,7 @@ static PyObject *__pyx_pf_9fastremap_428remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_t_5 = ((__pyx_v_remap_dict.find(__pyx_v_elem) == __pyx_v_remap_dict.end()) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":680 + /* "fastremap.pyx":696 * elem = arr[i] * if remap_dict.find(elem) == remap_dict.end(): * continue # <<<<<<<<<<<<<< @@ -85231,7 +87973,7 @@ static PyObject *__pyx_pf_9fastremap_428remap_from_array_kv(CYTHON_UNUSED PyObje */ goto __pyx_L11_continue; - /* "fastremap.pyx":679 + /* "fastremap.pyx":695 * for i in range(size): * elem = arr[i] * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -85240,7 +87982,7 @@ static PyObject *__pyx_pf_9fastremap_428remap_from_array_kv(CYTHON_UNUSED PyObje */ } - /* "fastremap.pyx":682 + /* "fastremap.pyx":698 * continue * else: * arrview[i] = remap_dict[elem] # <<<<<<<<<<<<<< @@ -85255,7 +87997,7 @@ static PyObject *__pyx_pf_9fastremap_428remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":676 + /* "fastremap.pyx":692 * size = arr.size * * with nogil: # <<<<<<<<<<<<<< @@ -85274,7 +88016,7 @@ static PyObject *__pyx_pf_9fastremap_428remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":684 + /* "fastremap.pyx":700 * arrview[i] = remap_dict[elem] * * return arr # <<<<<<<<<<<<<< @@ -85286,7 +88028,7 @@ static PyObject *__pyx_pf_9fastremap_428remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":654 + /* "fastremap.pyx":670 * * @cython.boundscheck(False) * def remap_from_array_kv(cnp.ndarray[ALLINT] arr, cnp.ndarray[ALLINT] keys, cnp.ndarray[ALLINT] vals): # <<<<<<<<<<<<<< @@ -85362,17 +88104,17 @@ static PyObject *__pyx_fuse_4__pyx_pw_9fastremap_431remap_from_array_kv(PyObject case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 1); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 1); __PYX_ERR(0, 670, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vals)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 2); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 2); __PYX_ERR(0, 670, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap_from_array_kv") < 0)) __PYX_ERR(0, 654, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap_from_array_kv") < 0)) __PYX_ERR(0, 670, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -85387,15 +88129,15 @@ static PyObject *__pyx_fuse_4__pyx_pw_9fastremap_431remap_from_array_kv(PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 670, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.remap_from_array_kv", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 654, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), __pyx_ptype_5numpy_ndarray, 1, "keys", 0))) __PYX_ERR(0, 654, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 670, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), __pyx_ptype_5numpy_ndarray, 1, "keys", 0))) __PYX_ERR(0, 670, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 670, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_430remap_from_array_kv(__pyx_self, __pyx_v_arr, __pyx_v_keys, __pyx_v_vals); /* function exit code */ @@ -85411,7 +88153,7 @@ static PyObject *__pyx_pf_9fastremap_430remap_from_array_kv(CYTHON_UNUSED PyObje CYTHON_UNUSED __Pyx_memviewslice __pyx_v_keyview = { 0, 0, { 0 }, { 0 }, { 0 } }; CYTHON_UNUSED __Pyx_memviewslice __pyx_v_valview = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; - std::unordered_map __pyx_v_remap_dict; + ska::flat_hash_map __pyx_v_remap_dict; size_t __pyx_v_i; size_t __pyx_v_size; int8_t __pyx_v_elem; @@ -85451,58 +88193,58 @@ static PyObject *__pyx_pf_9fastremap_430remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_pybuffernd_vals.rcbuffer = &__pyx_pybuffer_vals; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_keys.rcbuffer->pybuffer, (PyObject*)__pyx_v_keys, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_keys.rcbuffer->pybuffer, (PyObject*)__pyx_v_keys, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_pybuffernd_keys.diminfo[0].strides = __pyx_pybuffernd_keys.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_keys.diminfo[0].shape = __pyx_pybuffernd_keys.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_pybuffernd_vals.diminfo[0].strides = __pyx_pybuffernd_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vals.diminfo[0].shape = __pyx_pybuffernd_vals.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":658 + /* "fastremap.pyx":674 * remap_from_array_kv(cnp.ndarray[ALLINT] arr, cnp.ndarray[ALLINT] keys, cnp.ndarray[ALLINT] vals) * """ * cdef ALLINT[:] keyview = keys # <<<<<<<<<<<<<< * cdef ALLINT[:] valview = vals * cdef ALLINT[:] arrview = arr */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int8_t(((PyObject *)__pyx_v_keys), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int8_t(((PyObject *)__pyx_v_keys), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 674, __pyx_L1_error) __pyx_v_keyview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":659 + /* "fastremap.pyx":675 * """ * cdef ALLINT[:] keyview = keys * cdef ALLINT[:] valview = vals # <<<<<<<<<<<<<< * cdef ALLINT[:] arrview = arr - * cdef unordered_map[ALLINT, ALLINT] remap_dict + * cdef flat_hash_map[ALLINT, ALLINT] remap_dict */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int8_t(((PyObject *)__pyx_v_vals), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int8_t(((PyObject *)__pyx_v_vals), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 675, __pyx_L1_error) __pyx_v_valview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":660 + /* "fastremap.pyx":676 * cdef ALLINT[:] keyview = keys * cdef ALLINT[:] valview = vals * cdef ALLINT[:] arrview = arr # <<<<<<<<<<<<<< - * cdef unordered_map[ALLINT, ALLINT] remap_dict + * cdef flat_hash_map[ALLINT, ALLINT] remap_dict * */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 660, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 676, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":663 - * cdef unordered_map[ALLINT, ALLINT] remap_dict + /* "fastremap.pyx":679 + * cdef flat_hash_map[ALLINT, ALLINT] remap_dict * * assert keys.size == vals.size # <<<<<<<<<<<<<< * @@ -85510,23 +88252,23 @@ static PyObject *__pyx_pf_9fastremap_430remap_from_array_kv(CYTHON_UNUSED PyObje */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(0, 663, __pyx_L1_error) + __PYX_ERR(0, 679, __pyx_L1_error) } } #endif - /* "fastremap.pyx":665 + /* "fastremap.pyx":681 * assert keys.size == vals.size * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -85535,20 +88277,20 @@ static PyObject *__pyx_pf_9fastremap_430remap_from_array_kv(CYTHON_UNUSED PyObje */ __pyx_v_i = 0; - /* "fastremap.pyx":666 + /* "fastremap.pyx":682 * * cdef size_t i = 0 * cdef size_t size = keys.size # <<<<<<<<<<<<<< * cdef ALLINT elem * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_size = __pyx_t_6; - /* "fastremap.pyx":669 + /* "fastremap.pyx":685 * cdef ALLINT elem * * with nogil: # <<<<<<<<<<<<<< @@ -85563,7 +88305,7 @@ static PyObject *__pyx_pf_9fastremap_430remap_from_array_kv(CYTHON_UNUSED PyObje #endif /*try:*/ { - /* "fastremap.pyx":670 + /* "fastremap.pyx":686 * * with nogil: * for i in range(size): # <<<<<<<<<<<<<< @@ -85575,7 +88317,7 @@ static PyObject *__pyx_pf_9fastremap_430remap_from_array_kv(CYTHON_UNUSED PyObje for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "fastremap.pyx":671 + /* "fastremap.pyx":687 * with nogil: * for i in range(size): * remap_dict[keys[i]] = vals[i] # <<<<<<<<<<<<<< @@ -85588,7 +88330,7 @@ static PyObject *__pyx_pf_9fastremap_430remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":669 + /* "fastremap.pyx":685 * cdef ALLINT elem * * with nogil: # <<<<<<<<<<<<<< @@ -85607,7 +88349,7 @@ static PyObject *__pyx_pf_9fastremap_430remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":673 + /* "fastremap.pyx":689 * remap_dict[keys[i]] = vals[i] * * i = 0 # <<<<<<<<<<<<<< @@ -85616,20 +88358,20 @@ static PyObject *__pyx_pf_9fastremap_430remap_from_array_kv(CYTHON_UNUSED PyObje */ __pyx_v_i = 0; - /* "fastremap.pyx":674 + /* "fastremap.pyx":690 * * i = 0 * size = arr.size # <<<<<<<<<<<<<< * * with nogil: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 674, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_size = __pyx_t_6; - /* "fastremap.pyx":676 + /* "fastremap.pyx":692 * size = arr.size * * with nogil: # <<<<<<<<<<<<<< @@ -85644,7 +88386,7 @@ static PyObject *__pyx_pf_9fastremap_430remap_from_array_kv(CYTHON_UNUSED PyObje #endif /*try:*/ { - /* "fastremap.pyx":677 + /* "fastremap.pyx":693 * * with nogil: * for i in range(size): # <<<<<<<<<<<<<< @@ -85656,7 +88398,7 @@ static PyObject *__pyx_pf_9fastremap_430remap_from_array_kv(CYTHON_UNUSED PyObje for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "fastremap.pyx":678 + /* "fastremap.pyx":694 * with nogil: * for i in range(size): * elem = arr[i] # <<<<<<<<<<<<<< @@ -85666,7 +88408,7 @@ static PyObject *__pyx_pf_9fastremap_430remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_t_9 = __pyx_v_i; __pyx_v_elem = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_arr.diminfo[0].strides)); - /* "fastremap.pyx":679 + /* "fastremap.pyx":695 * for i in range(size): * elem = arr[i] * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -85676,7 +88418,7 @@ static PyObject *__pyx_pf_9fastremap_430remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_t_5 = ((__pyx_v_remap_dict.find(__pyx_v_elem) == __pyx_v_remap_dict.end()) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":680 + /* "fastremap.pyx":696 * elem = arr[i] * if remap_dict.find(elem) == remap_dict.end(): * continue # <<<<<<<<<<<<<< @@ -85685,7 +88427,7 @@ static PyObject *__pyx_pf_9fastremap_430remap_from_array_kv(CYTHON_UNUSED PyObje */ goto __pyx_L11_continue; - /* "fastremap.pyx":679 + /* "fastremap.pyx":695 * for i in range(size): * elem = arr[i] * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -85694,7 +88436,7 @@ static PyObject *__pyx_pf_9fastremap_430remap_from_array_kv(CYTHON_UNUSED PyObje */ } - /* "fastremap.pyx":682 + /* "fastremap.pyx":698 * continue * else: * arrview[i] = remap_dict[elem] # <<<<<<<<<<<<<< @@ -85709,7 +88451,7 @@ static PyObject *__pyx_pf_9fastremap_430remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":676 + /* "fastremap.pyx":692 * size = arr.size * * with nogil: # <<<<<<<<<<<<<< @@ -85728,7 +88470,7 @@ static PyObject *__pyx_pf_9fastremap_430remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":684 + /* "fastremap.pyx":700 * arrview[i] = remap_dict[elem] * * return arr # <<<<<<<<<<<<<< @@ -85740,7 +88482,7 @@ static PyObject *__pyx_pf_9fastremap_430remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":654 + /* "fastremap.pyx":670 * * @cython.boundscheck(False) * def remap_from_array_kv(cnp.ndarray[ALLINT] arr, cnp.ndarray[ALLINT] keys, cnp.ndarray[ALLINT] vals): # <<<<<<<<<<<<<< @@ -85816,17 +88558,17 @@ static PyObject *__pyx_fuse_5__pyx_pw_9fastremap_433remap_from_array_kv(PyObject case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 1); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 1); __PYX_ERR(0, 670, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vals)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 2); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 2); __PYX_ERR(0, 670, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap_from_array_kv") < 0)) __PYX_ERR(0, 654, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap_from_array_kv") < 0)) __PYX_ERR(0, 670, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -85841,15 +88583,15 @@ static PyObject *__pyx_fuse_5__pyx_pw_9fastremap_433remap_from_array_kv(PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 670, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.remap_from_array_kv", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 654, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), __pyx_ptype_5numpy_ndarray, 1, "keys", 0))) __PYX_ERR(0, 654, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 670, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), __pyx_ptype_5numpy_ndarray, 1, "keys", 0))) __PYX_ERR(0, 670, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 670, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_432remap_from_array_kv(__pyx_self, __pyx_v_arr, __pyx_v_keys, __pyx_v_vals); /* function exit code */ @@ -85865,7 +88607,7 @@ static PyObject *__pyx_pf_9fastremap_432remap_from_array_kv(CYTHON_UNUSED PyObje CYTHON_UNUSED __Pyx_memviewslice __pyx_v_keyview = { 0, 0, { 0 }, { 0 }, { 0 } }; CYTHON_UNUSED __Pyx_memviewslice __pyx_v_valview = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; - std::unordered_map __pyx_v_remap_dict; + ska::flat_hash_map __pyx_v_remap_dict; size_t __pyx_v_i; size_t __pyx_v_size; int16_t __pyx_v_elem; @@ -85905,58 +88647,58 @@ static PyObject *__pyx_pf_9fastremap_432remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_pybuffernd_vals.rcbuffer = &__pyx_pybuffer_vals; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_keys.rcbuffer->pybuffer, (PyObject*)__pyx_v_keys, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_keys.rcbuffer->pybuffer, (PyObject*)__pyx_v_keys, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_pybuffernd_keys.diminfo[0].strides = __pyx_pybuffernd_keys.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_keys.diminfo[0].shape = __pyx_pybuffernd_keys.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_pybuffernd_vals.diminfo[0].strides = __pyx_pybuffernd_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vals.diminfo[0].shape = __pyx_pybuffernd_vals.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":658 + /* "fastremap.pyx":674 * remap_from_array_kv(cnp.ndarray[ALLINT] arr, cnp.ndarray[ALLINT] keys, cnp.ndarray[ALLINT] vals) * """ * cdef ALLINT[:] keyview = keys # <<<<<<<<<<<<<< * cdef ALLINT[:] valview = vals * cdef ALLINT[:] arrview = arr */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int16_t(((PyObject *)__pyx_v_keys), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int16_t(((PyObject *)__pyx_v_keys), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 674, __pyx_L1_error) __pyx_v_keyview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":659 + /* "fastremap.pyx":675 * """ * cdef ALLINT[:] keyview = keys * cdef ALLINT[:] valview = vals # <<<<<<<<<<<<<< * cdef ALLINT[:] arrview = arr - * cdef unordered_map[ALLINT, ALLINT] remap_dict + * cdef flat_hash_map[ALLINT, ALLINT] remap_dict */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int16_t(((PyObject *)__pyx_v_vals), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int16_t(((PyObject *)__pyx_v_vals), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 675, __pyx_L1_error) __pyx_v_valview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":660 + /* "fastremap.pyx":676 * cdef ALLINT[:] keyview = keys * cdef ALLINT[:] valview = vals * cdef ALLINT[:] arrview = arr # <<<<<<<<<<<<<< - * cdef unordered_map[ALLINT, ALLINT] remap_dict + * cdef flat_hash_map[ALLINT, ALLINT] remap_dict * */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 660, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 676, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":663 - * cdef unordered_map[ALLINT, ALLINT] remap_dict + /* "fastremap.pyx":679 + * cdef flat_hash_map[ALLINT, ALLINT] remap_dict * * assert keys.size == vals.size # <<<<<<<<<<<<<< * @@ -85964,23 +88706,23 @@ static PyObject *__pyx_pf_9fastremap_432remap_from_array_kv(CYTHON_UNUSED PyObje */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(0, 663, __pyx_L1_error) + __PYX_ERR(0, 679, __pyx_L1_error) } } #endif - /* "fastremap.pyx":665 + /* "fastremap.pyx":681 * assert keys.size == vals.size * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -85989,20 +88731,20 @@ static PyObject *__pyx_pf_9fastremap_432remap_from_array_kv(CYTHON_UNUSED PyObje */ __pyx_v_i = 0; - /* "fastremap.pyx":666 + /* "fastremap.pyx":682 * * cdef size_t i = 0 * cdef size_t size = keys.size # <<<<<<<<<<<<<< * cdef ALLINT elem * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_size = __pyx_t_6; - /* "fastremap.pyx":669 + /* "fastremap.pyx":685 * cdef ALLINT elem * * with nogil: # <<<<<<<<<<<<<< @@ -86017,7 +88759,7 @@ static PyObject *__pyx_pf_9fastremap_432remap_from_array_kv(CYTHON_UNUSED PyObje #endif /*try:*/ { - /* "fastremap.pyx":670 + /* "fastremap.pyx":686 * * with nogil: * for i in range(size): # <<<<<<<<<<<<<< @@ -86029,7 +88771,7 @@ static PyObject *__pyx_pf_9fastremap_432remap_from_array_kv(CYTHON_UNUSED PyObje for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "fastremap.pyx":671 + /* "fastremap.pyx":687 * with nogil: * for i in range(size): * remap_dict[keys[i]] = vals[i] # <<<<<<<<<<<<<< @@ -86042,7 +88784,7 @@ static PyObject *__pyx_pf_9fastremap_432remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":669 + /* "fastremap.pyx":685 * cdef ALLINT elem * * with nogil: # <<<<<<<<<<<<<< @@ -86061,7 +88803,7 @@ static PyObject *__pyx_pf_9fastremap_432remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":673 + /* "fastremap.pyx":689 * remap_dict[keys[i]] = vals[i] * * i = 0 # <<<<<<<<<<<<<< @@ -86070,20 +88812,20 @@ static PyObject *__pyx_pf_9fastremap_432remap_from_array_kv(CYTHON_UNUSED PyObje */ __pyx_v_i = 0; - /* "fastremap.pyx":674 + /* "fastremap.pyx":690 * * i = 0 * size = arr.size # <<<<<<<<<<<<<< * * with nogil: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 674, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_size = __pyx_t_6; - /* "fastremap.pyx":676 + /* "fastremap.pyx":692 * size = arr.size * * with nogil: # <<<<<<<<<<<<<< @@ -86098,7 +88840,7 @@ static PyObject *__pyx_pf_9fastremap_432remap_from_array_kv(CYTHON_UNUSED PyObje #endif /*try:*/ { - /* "fastremap.pyx":677 + /* "fastremap.pyx":693 * * with nogil: * for i in range(size): # <<<<<<<<<<<<<< @@ -86110,7 +88852,7 @@ static PyObject *__pyx_pf_9fastremap_432remap_from_array_kv(CYTHON_UNUSED PyObje for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "fastremap.pyx":678 + /* "fastremap.pyx":694 * with nogil: * for i in range(size): * elem = arr[i] # <<<<<<<<<<<<<< @@ -86120,7 +88862,7 @@ static PyObject *__pyx_pf_9fastremap_432remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_t_9 = __pyx_v_i; __pyx_v_elem = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_arr.diminfo[0].strides)); - /* "fastremap.pyx":679 + /* "fastremap.pyx":695 * for i in range(size): * elem = arr[i] * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -86130,7 +88872,7 @@ static PyObject *__pyx_pf_9fastremap_432remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_t_5 = ((__pyx_v_remap_dict.find(__pyx_v_elem) == __pyx_v_remap_dict.end()) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":680 + /* "fastremap.pyx":696 * elem = arr[i] * if remap_dict.find(elem) == remap_dict.end(): * continue # <<<<<<<<<<<<<< @@ -86139,7 +88881,7 @@ static PyObject *__pyx_pf_9fastremap_432remap_from_array_kv(CYTHON_UNUSED PyObje */ goto __pyx_L11_continue; - /* "fastremap.pyx":679 + /* "fastremap.pyx":695 * for i in range(size): * elem = arr[i] * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -86148,7 +88890,7 @@ static PyObject *__pyx_pf_9fastremap_432remap_from_array_kv(CYTHON_UNUSED PyObje */ } - /* "fastremap.pyx":682 + /* "fastremap.pyx":698 * continue * else: * arrview[i] = remap_dict[elem] # <<<<<<<<<<<<<< @@ -86163,7 +88905,7 @@ static PyObject *__pyx_pf_9fastremap_432remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":676 + /* "fastremap.pyx":692 * size = arr.size * * with nogil: # <<<<<<<<<<<<<< @@ -86182,7 +88924,7 @@ static PyObject *__pyx_pf_9fastremap_432remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":684 + /* "fastremap.pyx":700 * arrview[i] = remap_dict[elem] * * return arr # <<<<<<<<<<<<<< @@ -86194,7 +88936,7 @@ static PyObject *__pyx_pf_9fastremap_432remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":654 + /* "fastremap.pyx":670 * * @cython.boundscheck(False) * def remap_from_array_kv(cnp.ndarray[ALLINT] arr, cnp.ndarray[ALLINT] keys, cnp.ndarray[ALLINT] vals): # <<<<<<<<<<<<<< @@ -86270,17 +89012,17 @@ static PyObject *__pyx_fuse_6__pyx_pw_9fastremap_435remap_from_array_kv(PyObject case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 1); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 1); __PYX_ERR(0, 670, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vals)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 2); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 2); __PYX_ERR(0, 670, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap_from_array_kv") < 0)) __PYX_ERR(0, 654, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap_from_array_kv") < 0)) __PYX_ERR(0, 670, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -86295,15 +89037,15 @@ static PyObject *__pyx_fuse_6__pyx_pw_9fastremap_435remap_from_array_kv(PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 670, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.remap_from_array_kv", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 654, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), __pyx_ptype_5numpy_ndarray, 1, "keys", 0))) __PYX_ERR(0, 654, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 670, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), __pyx_ptype_5numpy_ndarray, 1, "keys", 0))) __PYX_ERR(0, 670, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 670, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_434remap_from_array_kv(__pyx_self, __pyx_v_arr, __pyx_v_keys, __pyx_v_vals); /* function exit code */ @@ -86319,7 +89061,7 @@ static PyObject *__pyx_pf_9fastremap_434remap_from_array_kv(CYTHON_UNUSED PyObje CYTHON_UNUSED __Pyx_memviewslice __pyx_v_keyview = { 0, 0, { 0 }, { 0 }, { 0 } }; CYTHON_UNUSED __Pyx_memviewslice __pyx_v_valview = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; - std::unordered_map __pyx_v_remap_dict; + ska::flat_hash_map __pyx_v_remap_dict; size_t __pyx_v_i; size_t __pyx_v_size; int32_t __pyx_v_elem; @@ -86359,58 +89101,58 @@ static PyObject *__pyx_pf_9fastremap_434remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_pybuffernd_vals.rcbuffer = &__pyx_pybuffer_vals; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_keys.rcbuffer->pybuffer, (PyObject*)__pyx_v_keys, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_keys.rcbuffer->pybuffer, (PyObject*)__pyx_v_keys, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_pybuffernd_keys.diminfo[0].strides = __pyx_pybuffernd_keys.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_keys.diminfo[0].shape = __pyx_pybuffernd_keys.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_pybuffernd_vals.diminfo[0].strides = __pyx_pybuffernd_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vals.diminfo[0].shape = __pyx_pybuffernd_vals.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":658 + /* "fastremap.pyx":674 * remap_from_array_kv(cnp.ndarray[ALLINT] arr, cnp.ndarray[ALLINT] keys, cnp.ndarray[ALLINT] vals) * """ * cdef ALLINT[:] keyview = keys # <<<<<<<<<<<<<< * cdef ALLINT[:] valview = vals * cdef ALLINT[:] arrview = arr */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int32_t(((PyObject *)__pyx_v_keys), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int32_t(((PyObject *)__pyx_v_keys), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 674, __pyx_L1_error) __pyx_v_keyview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":659 + /* "fastremap.pyx":675 * """ * cdef ALLINT[:] keyview = keys * cdef ALLINT[:] valview = vals # <<<<<<<<<<<<<< * cdef ALLINT[:] arrview = arr - * cdef unordered_map[ALLINT, ALLINT] remap_dict + * cdef flat_hash_map[ALLINT, ALLINT] remap_dict */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int32_t(((PyObject *)__pyx_v_vals), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int32_t(((PyObject *)__pyx_v_vals), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 675, __pyx_L1_error) __pyx_v_valview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":660 + /* "fastremap.pyx":676 * cdef ALLINT[:] keyview = keys * cdef ALLINT[:] valview = vals * cdef ALLINT[:] arrview = arr # <<<<<<<<<<<<<< - * cdef unordered_map[ALLINT, ALLINT] remap_dict + * cdef flat_hash_map[ALLINT, ALLINT] remap_dict * */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 660, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 676, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":663 - * cdef unordered_map[ALLINT, ALLINT] remap_dict + /* "fastremap.pyx":679 + * cdef flat_hash_map[ALLINT, ALLINT] remap_dict * * assert keys.size == vals.size # <<<<<<<<<<<<<< * @@ -86418,23 +89160,23 @@ static PyObject *__pyx_pf_9fastremap_434remap_from_array_kv(CYTHON_UNUSED PyObje */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(0, 663, __pyx_L1_error) + __PYX_ERR(0, 679, __pyx_L1_error) } } #endif - /* "fastremap.pyx":665 + /* "fastremap.pyx":681 * assert keys.size == vals.size * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -86443,20 +89185,20 @@ static PyObject *__pyx_pf_9fastremap_434remap_from_array_kv(CYTHON_UNUSED PyObje */ __pyx_v_i = 0; - /* "fastremap.pyx":666 + /* "fastremap.pyx":682 * * cdef size_t i = 0 * cdef size_t size = keys.size # <<<<<<<<<<<<<< * cdef ALLINT elem * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_size = __pyx_t_6; - /* "fastremap.pyx":669 + /* "fastremap.pyx":685 * cdef ALLINT elem * * with nogil: # <<<<<<<<<<<<<< @@ -86471,7 +89213,7 @@ static PyObject *__pyx_pf_9fastremap_434remap_from_array_kv(CYTHON_UNUSED PyObje #endif /*try:*/ { - /* "fastremap.pyx":670 + /* "fastremap.pyx":686 * * with nogil: * for i in range(size): # <<<<<<<<<<<<<< @@ -86483,7 +89225,7 @@ static PyObject *__pyx_pf_9fastremap_434remap_from_array_kv(CYTHON_UNUSED PyObje for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "fastremap.pyx":671 + /* "fastremap.pyx":687 * with nogil: * for i in range(size): * remap_dict[keys[i]] = vals[i] # <<<<<<<<<<<<<< @@ -86496,7 +89238,7 @@ static PyObject *__pyx_pf_9fastremap_434remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":669 + /* "fastremap.pyx":685 * cdef ALLINT elem * * with nogil: # <<<<<<<<<<<<<< @@ -86515,7 +89257,7 @@ static PyObject *__pyx_pf_9fastremap_434remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":673 + /* "fastremap.pyx":689 * remap_dict[keys[i]] = vals[i] * * i = 0 # <<<<<<<<<<<<<< @@ -86524,20 +89266,20 @@ static PyObject *__pyx_pf_9fastremap_434remap_from_array_kv(CYTHON_UNUSED PyObje */ __pyx_v_i = 0; - /* "fastremap.pyx":674 + /* "fastremap.pyx":690 * * i = 0 * size = arr.size # <<<<<<<<<<<<<< * * with nogil: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 674, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_size = __pyx_t_6; - /* "fastremap.pyx":676 + /* "fastremap.pyx":692 * size = arr.size * * with nogil: # <<<<<<<<<<<<<< @@ -86552,7 +89294,7 @@ static PyObject *__pyx_pf_9fastremap_434remap_from_array_kv(CYTHON_UNUSED PyObje #endif /*try:*/ { - /* "fastremap.pyx":677 + /* "fastremap.pyx":693 * * with nogil: * for i in range(size): # <<<<<<<<<<<<<< @@ -86564,7 +89306,7 @@ static PyObject *__pyx_pf_9fastremap_434remap_from_array_kv(CYTHON_UNUSED PyObje for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "fastremap.pyx":678 + /* "fastremap.pyx":694 * with nogil: * for i in range(size): * elem = arr[i] # <<<<<<<<<<<<<< @@ -86574,7 +89316,7 @@ static PyObject *__pyx_pf_9fastremap_434remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_t_9 = __pyx_v_i; __pyx_v_elem = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_arr.diminfo[0].strides)); - /* "fastremap.pyx":679 + /* "fastremap.pyx":695 * for i in range(size): * elem = arr[i] * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -86584,7 +89326,7 @@ static PyObject *__pyx_pf_9fastremap_434remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_t_5 = ((__pyx_v_remap_dict.find(__pyx_v_elem) == __pyx_v_remap_dict.end()) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":680 + /* "fastremap.pyx":696 * elem = arr[i] * if remap_dict.find(elem) == remap_dict.end(): * continue # <<<<<<<<<<<<<< @@ -86593,7 +89335,7 @@ static PyObject *__pyx_pf_9fastremap_434remap_from_array_kv(CYTHON_UNUSED PyObje */ goto __pyx_L11_continue; - /* "fastremap.pyx":679 + /* "fastremap.pyx":695 * for i in range(size): * elem = arr[i] * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -86602,7 +89344,7 @@ static PyObject *__pyx_pf_9fastremap_434remap_from_array_kv(CYTHON_UNUSED PyObje */ } - /* "fastremap.pyx":682 + /* "fastremap.pyx":698 * continue * else: * arrview[i] = remap_dict[elem] # <<<<<<<<<<<<<< @@ -86617,7 +89359,7 @@ static PyObject *__pyx_pf_9fastremap_434remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":676 + /* "fastremap.pyx":692 * size = arr.size * * with nogil: # <<<<<<<<<<<<<< @@ -86636,7 +89378,7 @@ static PyObject *__pyx_pf_9fastremap_434remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":684 + /* "fastremap.pyx":700 * arrview[i] = remap_dict[elem] * * return arr # <<<<<<<<<<<<<< @@ -86648,7 +89390,7 @@ static PyObject *__pyx_pf_9fastremap_434remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":654 + /* "fastremap.pyx":670 * * @cython.boundscheck(False) * def remap_from_array_kv(cnp.ndarray[ALLINT] arr, cnp.ndarray[ALLINT] keys, cnp.ndarray[ALLINT] vals): # <<<<<<<<<<<<<< @@ -86724,17 +89466,17 @@ static PyObject *__pyx_fuse_7__pyx_pw_9fastremap_437remap_from_array_kv(PyObject case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 1); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 1); __PYX_ERR(0, 670, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vals)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 2); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, 2); __PYX_ERR(0, 670, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap_from_array_kv") < 0)) __PYX_ERR(0, 654, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remap_from_array_kv") < 0)) __PYX_ERR(0, 670, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -86749,15 +89491,15 @@ static PyObject *__pyx_fuse_7__pyx_pw_9fastremap_437remap_from_array_kv(PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remap_from_array_kv", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 670, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.remap_from_array_kv", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 654, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), __pyx_ptype_5numpy_ndarray, 1, "keys", 0))) __PYX_ERR(0, 654, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 670, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), __pyx_ptype_5numpy_ndarray, 1, "keys", 0))) __PYX_ERR(0, 670, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) __PYX_ERR(0, 670, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_436remap_from_array_kv(__pyx_self, __pyx_v_arr, __pyx_v_keys, __pyx_v_vals); /* function exit code */ @@ -86773,7 +89515,7 @@ static PyObject *__pyx_pf_9fastremap_436remap_from_array_kv(CYTHON_UNUSED PyObje CYTHON_UNUSED __Pyx_memviewslice __pyx_v_keyview = { 0, 0, { 0 }, { 0 }, { 0 } }; CYTHON_UNUSED __Pyx_memviewslice __pyx_v_valview = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_arrview = { 0, 0, { 0 }, { 0 }, { 0 } }; - std::unordered_map __pyx_v_remap_dict; + ska::flat_hash_map __pyx_v_remap_dict; size_t __pyx_v_i; size_t __pyx_v_size; int64_t __pyx_v_elem; @@ -86813,58 +89555,58 @@ static PyObject *__pyx_pf_9fastremap_436remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_pybuffernd_vals.rcbuffer = &__pyx_pybuffer_vals; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_keys.rcbuffer->pybuffer, (PyObject*)__pyx_v_keys, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_keys.rcbuffer->pybuffer, (PyObject*)__pyx_v_keys, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_pybuffernd_keys.diminfo[0].strides = __pyx_pybuffernd_keys.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_keys.diminfo[0].shape = __pyx_pybuffernd_keys.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 670, __pyx_L1_error) } __pyx_pybuffernd_vals.diminfo[0].strides = __pyx_pybuffernd_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vals.diminfo[0].shape = __pyx_pybuffernd_vals.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":658 + /* "fastremap.pyx":674 * remap_from_array_kv(cnp.ndarray[ALLINT] arr, cnp.ndarray[ALLINT] keys, cnp.ndarray[ALLINT] vals) * """ * cdef ALLINT[:] keyview = keys # <<<<<<<<<<<<<< * cdef ALLINT[:] valview = vals * cdef ALLINT[:] arrview = arr */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int64_t(((PyObject *)__pyx_v_keys), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int64_t(((PyObject *)__pyx_v_keys), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 674, __pyx_L1_error) __pyx_v_keyview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":659 + /* "fastremap.pyx":675 * """ * cdef ALLINT[:] keyview = keys * cdef ALLINT[:] valview = vals # <<<<<<<<<<<<<< * cdef ALLINT[:] arrview = arr - * cdef unordered_map[ALLINT, ALLINT] remap_dict + * cdef flat_hash_map[ALLINT, ALLINT] remap_dict */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int64_t(((PyObject *)__pyx_v_vals), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int64_t(((PyObject *)__pyx_v_vals), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 675, __pyx_L1_error) __pyx_v_valview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":660 + /* "fastremap.pyx":676 * cdef ALLINT[:] keyview = keys * cdef ALLINT[:] valview = vals * cdef ALLINT[:] arrview = arr # <<<<<<<<<<<<<< - * cdef unordered_map[ALLINT, ALLINT] remap_dict + * cdef flat_hash_map[ALLINT, ALLINT] remap_dict * */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 660, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_int64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 676, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":663 - * cdef unordered_map[ALLINT, ALLINT] remap_dict + /* "fastremap.pyx":679 + * cdef flat_hash_map[ALLINT, ALLINT] remap_dict * * assert keys.size == vals.size # <<<<<<<<<<<<<< * @@ -86872,23 +89614,23 @@ static PyObject *__pyx_pf_9fastremap_436remap_from_array_kv(CYTHON_UNUSED PyObje */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vals), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(0, 663, __pyx_L1_error) + __PYX_ERR(0, 679, __pyx_L1_error) } } #endif - /* "fastremap.pyx":665 + /* "fastremap.pyx":681 * assert keys.size == vals.size * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -86897,20 +89639,20 @@ static PyObject *__pyx_pf_9fastremap_436remap_from_array_kv(CYTHON_UNUSED PyObje */ __pyx_v_i = 0; - /* "fastremap.pyx":666 + /* "fastremap.pyx":682 * * cdef size_t i = 0 * cdef size_t size = keys.size # <<<<<<<<<<<<<< * cdef ALLINT elem * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_keys), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_size = __pyx_t_6; - /* "fastremap.pyx":669 + /* "fastremap.pyx":685 * cdef ALLINT elem * * with nogil: # <<<<<<<<<<<<<< @@ -86925,7 +89667,7 @@ static PyObject *__pyx_pf_9fastremap_436remap_from_array_kv(CYTHON_UNUSED PyObje #endif /*try:*/ { - /* "fastremap.pyx":670 + /* "fastremap.pyx":686 * * with nogil: * for i in range(size): # <<<<<<<<<<<<<< @@ -86937,7 +89679,7 @@ static PyObject *__pyx_pf_9fastremap_436remap_from_array_kv(CYTHON_UNUSED PyObje for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "fastremap.pyx":671 + /* "fastremap.pyx":687 * with nogil: * for i in range(size): * remap_dict[keys[i]] = vals[i] # <<<<<<<<<<<<<< @@ -86950,7 +89692,7 @@ static PyObject *__pyx_pf_9fastremap_436remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":669 + /* "fastremap.pyx":685 * cdef ALLINT elem * * with nogil: # <<<<<<<<<<<<<< @@ -86969,7 +89711,7 @@ static PyObject *__pyx_pf_9fastremap_436remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":673 + /* "fastremap.pyx":689 * remap_dict[keys[i]] = vals[i] * * i = 0 # <<<<<<<<<<<<<< @@ -86978,20 +89720,20 @@ static PyObject *__pyx_pf_9fastremap_436remap_from_array_kv(CYTHON_UNUSED PyObje */ __pyx_v_i = 0; - /* "fastremap.pyx":674 + /* "fastremap.pyx":690 * * i = 0 * size = arr.size # <<<<<<<<<<<<<< * * with nogil: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 674, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_size = __pyx_t_6; - /* "fastremap.pyx":676 + /* "fastremap.pyx":692 * size = arr.size * * with nogil: # <<<<<<<<<<<<<< @@ -87006,7 +89748,7 @@ static PyObject *__pyx_pf_9fastremap_436remap_from_array_kv(CYTHON_UNUSED PyObje #endif /*try:*/ { - /* "fastremap.pyx":677 + /* "fastremap.pyx":693 * * with nogil: * for i in range(size): # <<<<<<<<<<<<<< @@ -87018,7 +89760,7 @@ static PyObject *__pyx_pf_9fastremap_436remap_from_array_kv(CYTHON_UNUSED PyObje for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "fastremap.pyx":678 + /* "fastremap.pyx":694 * with nogil: * for i in range(size): * elem = arr[i] # <<<<<<<<<<<<<< @@ -87028,7 +89770,7 @@ static PyObject *__pyx_pf_9fastremap_436remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_t_9 = __pyx_v_i; __pyx_v_elem = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_arr.diminfo[0].strides)); - /* "fastremap.pyx":679 + /* "fastremap.pyx":695 * for i in range(size): * elem = arr[i] * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -87038,7 +89780,7 @@ static PyObject *__pyx_pf_9fastremap_436remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_t_5 = ((__pyx_v_remap_dict.find(__pyx_v_elem) == __pyx_v_remap_dict.end()) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":680 + /* "fastremap.pyx":696 * elem = arr[i] * if remap_dict.find(elem) == remap_dict.end(): * continue # <<<<<<<<<<<<<< @@ -87047,7 +89789,7 @@ static PyObject *__pyx_pf_9fastremap_436remap_from_array_kv(CYTHON_UNUSED PyObje */ goto __pyx_L11_continue; - /* "fastremap.pyx":679 + /* "fastremap.pyx":695 * for i in range(size): * elem = arr[i] * if remap_dict.find(elem) == remap_dict.end(): # <<<<<<<<<<<<<< @@ -87056,7 +89798,7 @@ static PyObject *__pyx_pf_9fastremap_436remap_from_array_kv(CYTHON_UNUSED PyObje */ } - /* "fastremap.pyx":682 + /* "fastremap.pyx":698 * continue * else: * arrview[i] = remap_dict[elem] # <<<<<<<<<<<<<< @@ -87071,7 +89813,7 @@ static PyObject *__pyx_pf_9fastremap_436remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":676 + /* "fastremap.pyx":692 * size = arr.size * * with nogil: # <<<<<<<<<<<<<< @@ -87090,7 +89832,7 @@ static PyObject *__pyx_pf_9fastremap_436remap_from_array_kv(CYTHON_UNUSED PyObje } } - /* "fastremap.pyx":684 + /* "fastremap.pyx":700 * arrview[i] = remap_dict[elem] * * return arr # <<<<<<<<<<<<<< @@ -87102,7 +89844,7 @@ static PyObject *__pyx_pf_9fastremap_436remap_from_array_kv(CYTHON_UNUSED PyObje __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":654 + /* "fastremap.pyx":670 * * @cython.boundscheck(False) * def remap_from_array_kv(cnp.ndarray[ALLINT] arr, cnp.ndarray[ALLINT] keys, cnp.ndarray[ALLINT] vals): # <<<<<<<<<<<<<< @@ -87140,7 +89882,7 @@ static PyObject *__pyx_pf_9fastremap_436remap_from_array_kv(CYTHON_UNUSED PyObje return __pyx_r; } -/* "fastremap.pyx":686 +/* "fastremap.pyx":702 * return arr * * def pixel_pairs(labels): # <<<<<<<<<<<<<< @@ -87180,23 +89922,23 @@ static PyObject *__pyx_pf_9fastremap_36pixel_pairs(CYTHON_UNUSED PyObject *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pixel_pairs", 0); - /* "fastremap.pyx":693 + /* "fastremap.pyx":709 * more binary or more connectomics like. * """ * if labels.size == 0: # <<<<<<<<<<<<<< * return 0 * return _pixel_pairs(reshape(labels, (labels.size,))) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "fastremap.pyx":694 + /* "fastremap.pyx":710 * """ * if labels.size == 0: * return 0 # <<<<<<<<<<<<<< @@ -87208,7 +89950,7 @@ static PyObject *__pyx_pf_9fastremap_36pixel_pairs(CYTHON_UNUSED PyObject *__pyx __pyx_r = __pyx_int_0; goto __pyx_L0; - /* "fastremap.pyx":693 + /* "fastremap.pyx":709 * more binary or more connectomics like. * """ * if labels.size == 0: # <<<<<<<<<<<<<< @@ -87217,7 +89959,7 @@ static PyObject *__pyx_pf_9fastremap_36pixel_pairs(CYTHON_UNUSED PyObject *__pyx */ } - /* "fastremap.pyx":695 + /* "fastremap.pyx":711 * if labels.size == 0: * return 0 * return _pixel_pairs(reshape(labels, (labels.size,))) # <<<<<<<<<<<<<< @@ -87225,13 +89967,13 @@ static PyObject *__pyx_pf_9fastremap_36pixel_pairs(CYTHON_UNUSED PyObject *__pyx * def _pixel_pairs(cnp.ndarray[ALLINT, ndim=1] labels): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pixel_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pixel_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 695, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 695, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 695, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); @@ -87251,7 +89993,7 @@ static PyObject *__pyx_pf_9fastremap_36pixel_pairs(CYTHON_UNUSED PyObject *__pyx #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_labels, __pyx_t_7}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 695, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -87260,14 +90002,14 @@ static PyObject *__pyx_pf_9fastremap_36pixel_pairs(CYTHON_UNUSED PyObject *__pyx #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_labels, __pyx_t_7}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 695, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 695, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -87278,7 +90020,7 @@ static PyObject *__pyx_pf_9fastremap_36pixel_pairs(CYTHON_UNUSED PyObject *__pyx __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 695, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -87296,14 +90038,14 @@ static PyObject *__pyx_pf_9fastremap_36pixel_pairs(CYTHON_UNUSED PyObject *__pyx __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "fastremap.pyx":686 + /* "fastremap.pyx":702 * return arr * * def pixel_pairs(labels): # <<<<<<<<<<<<<< @@ -87328,7 +90070,7 @@ static PyObject *__pyx_pf_9fastremap_36pixel_pairs(CYTHON_UNUSED PyObject *__pyx return __pyx_r; } -/* "fastremap.pyx":697 +/* "fastremap.pyx":713 * return _pixel_pairs(reshape(labels, (labels.size,))) * * def _pixel_pairs(cnp.ndarray[ALLINT, ndim=1] labels): # <<<<<<<<<<<<<< @@ -87377,23 +90119,23 @@ static PyObject *__pyx_pw_9fastremap_39_pixel_pairs(PyObject *__pyx_self, PyObje case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 697, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 713, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 697, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 713, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 697, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 713, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 697, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 713, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -87410,7 +90152,7 @@ static PyObject *__pyx_pw_9fastremap_39_pixel_pairs(PyObject *__pyx_self, PyObje } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 697, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 713, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -87472,7 +90214,7 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_pixel_pairs", 0); __Pyx_INCREF(__pyx_v_kwargs); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -87486,7 +90228,7 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 713, __pyx_L1_error) __pyx_t_3 = ((!__pyx_t_4) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; @@ -87494,7 +90236,7 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_kwargs, Py_None); } - __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -87509,16 +90251,16 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_v____pyx_int64_t_is_signed = (!((((int64_t)-1L) > 0) != 0)); if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 697, __pyx_L1_error) + __PYX_ERR(0, 713, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 713, __pyx_L1_error) __pyx_t_2 = ((0 < __pyx_t_5) != 0); if (__pyx_t_2) { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 697, __pyx_L1_error) + __PYX_ERR(0, 713, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(((PyObject*)__pyx_v_args), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(((PyObject*)__pyx_v_args), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -87533,18 +90275,18 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 697, __pyx_L1_error) + __PYX_ERR(0, 713, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_labels, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_labels, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 713, __pyx_L1_error) __pyx_t_3 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_3; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 697, __pyx_L1_error) + __PYX_ERR(0, 713, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -87553,12 +90295,12 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 697, __pyx_L1_error) + __PYX_ERR(0, 713, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 697, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 713, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); @@ -87569,15 +90311,15 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 697, __pyx_L1_error) + __PYX_ERR(0, 713, __pyx_L1_error) } __pyx_L6:; while (1) { @@ -87587,7 +90329,7 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -87596,14 +90338,14 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -87625,14 +90367,14 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_2 = (__pyx_v_dtype != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_itemsize = __pyx_t_5; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_kind = __pyx_t_7; __pyx_v_dtype_signed = (__pyx_v_kind == 'i'); @@ -87645,9 +90387,9 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -87659,7 +90401,7 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; __pyx_L16_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 713, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint16_t)) == __pyx_v_itemsize) != 0); @@ -87668,9 +90410,9 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; goto __pyx_L20_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -87682,7 +90424,7 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; __pyx_L20_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 713, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint32_t)) == __pyx_v_itemsize) != 0); @@ -87691,9 +90433,9 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; goto __pyx_L24_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -87705,7 +90447,7 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; __pyx_L24_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 713, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint64_t)) == __pyx_v_itemsize) != 0); @@ -87714,9 +90456,9 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; goto __pyx_L28_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -87728,7 +90470,7 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 713, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int8_t)) == __pyx_v_itemsize) != 0); @@ -87737,9 +90479,9 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; goto __pyx_L32_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -87751,7 +90493,7 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; __pyx_L32_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 713, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int16_t)) == __pyx_v_itemsize) != 0); @@ -87760,9 +90502,9 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; goto __pyx_L36_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -87774,7 +90516,7 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; __pyx_L36_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 713, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int32_t)) == __pyx_v_itemsize) != 0); @@ -87783,9 +90525,9 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; goto __pyx_L40_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -87797,7 +90539,7 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; __pyx_L40_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 713, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int64_t)) == __pyx_v_itemsize) != 0); @@ -87806,9 +90548,9 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; goto __pyx_L44_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -87820,7 +90562,7 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_3 = __pyx_t_2; __pyx_L44_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 713, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -87849,7 +90591,7 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 713, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -87871,7 +90613,7 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 713, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -87893,7 +90635,7 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 713, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -87915,7 +90657,7 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 713, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -87937,7 +90679,7 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 713, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -87959,7 +90701,7 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 713, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -87981,7 +90723,7 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 713, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -88003,27 +90745,27 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 713, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); } } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 713, __pyx_L1_error) goto __pyx_L10_break; } __pyx_L10_break:; - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_candidates = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = 0; if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 697, __pyx_L1_error) + __PYX_ERR(0, 713, __pyx_L1_error) } - __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_1; @@ -88031,12 +90773,12 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py while (1) { __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_9, &__pyx_t_5, &__pyx_t_1, NULL, NULL, __pyx_t_10); if (unlikely(__pyx_t_11 == 0)) break; - if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_1); __pyx_t_1 = 0; __pyx_v_match_found = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { @@ -88050,10 +90792,10 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py } __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, __pyx_kp_s__2) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__2); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -88068,27 +90810,27 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py } __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_12, __pyx_kp_s__3) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__3); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_src_sig, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 713, __pyx_L1_error) __pyx_t_16 = __pyx_t_15; for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dest_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dest_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_v_dst_type != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_2) { __pyx_v_match_found = 1; @@ -88104,37 +90846,37 @@ static PyObject *__pyx_pf_9fastremap_38_pixel_pairs(CYTHON_UNUSED PyObject *__py __pyx_L82_break:; __pyx_t_2 = (__pyx_v_match_found != 0); if (__pyx_t_2) { - __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 713, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_candidates) != 0); __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 697, __pyx_L1_error) + __PYX_ERR(0, 713, __pyx_L1_error) } - __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 713, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_9 > 1) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 697, __pyx_L1_error) + __PYX_ERR(0, 713, __pyx_L1_error) } /*else*/ { __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 697, __pyx_L1_error) + __PYX_ERR(0, 713, __pyx_L1_error) } - __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_candidates, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_candidates, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_13 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), __pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), __pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_13; @@ -88177,7 +90919,7 @@ static PyObject *__pyx_fuse_0__pyx_pw_9fastremap_441_pixel_pairs(PyObject *__pyx PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_pixel_pairs (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 713, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_440_pixel_pairs(__pyx_self, ((PyArrayObject *)__pyx_v_labels)); /* function exit code */ @@ -88216,24 +90958,24 @@ static PyObject *__pyx_pf_9fastremap_440_pixel_pairs(CYTHON_UNUSED PyObject *__p __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 713, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":698 + /* "fastremap.pyx":714 * * def _pixel_pairs(cnp.ndarray[ALLINT, ndim=1] labels): * cdef size_t voxels = labels.size # <<<<<<<<<<<<<< * * cdef size_t pairs = 0 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_voxels = __pyx_t_2; - /* "fastremap.pyx":700 + /* "fastremap.pyx":716 * cdef size_t voxels = labels.size * * cdef size_t pairs = 0 # <<<<<<<<<<<<<< @@ -88242,7 +90984,7 @@ static PyObject *__pyx_pf_9fastremap_440_pixel_pairs(CYTHON_UNUSED PyObject *__p */ __pyx_v_pairs = 0; - /* "fastremap.pyx":701 + /* "fastremap.pyx":717 * * cdef size_t pairs = 0 * cdef ALLINT label = labels[0] # <<<<<<<<<<<<<< @@ -88257,11 +90999,11 @@ static PyObject *__pyx_pf_9fastremap_440_pixel_pairs(CYTHON_UNUSED PyObject *__p } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 701, __pyx_L1_error) + __PYX_ERR(0, 717, __pyx_L1_error) } __pyx_v_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_labels.diminfo[0].strides)); - /* "fastremap.pyx":703 + /* "fastremap.pyx":719 * cdef ALLINT label = labels[0] * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -88270,7 +91012,7 @@ static PyObject *__pyx_pf_9fastremap_440_pixel_pairs(CYTHON_UNUSED PyObject *__p */ __pyx_v_i = 0; - /* "fastremap.pyx":704 + /* "fastremap.pyx":720 * * cdef size_t i = 0 * for i in range(1, voxels): # <<<<<<<<<<<<<< @@ -88282,7 +91024,7 @@ static PyObject *__pyx_pf_9fastremap_440_pixel_pairs(CYTHON_UNUSED PyObject *__p for (__pyx_t_6 = 1; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "fastremap.pyx":705 + /* "fastremap.pyx":721 * cdef size_t i = 0 * for i in range(1, voxels): * if label == labels[i]: # <<<<<<<<<<<<<< @@ -88294,12 +91036,12 @@ static PyObject *__pyx_pf_9fastremap_440_pixel_pairs(CYTHON_UNUSED PyObject *__p if (unlikely(__pyx_t_7 >= (size_t)__pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 705, __pyx_L1_error) + __PYX_ERR(0, 721, __pyx_L1_error) } __pyx_t_8 = ((__pyx_v_label == (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_labels.diminfo[0].strides))) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":706 + /* "fastremap.pyx":722 * for i in range(1, voxels): * if label == labels[i]: * pairs += 1 # <<<<<<<<<<<<<< @@ -88308,7 +91050,7 @@ static PyObject *__pyx_pf_9fastremap_440_pixel_pairs(CYTHON_UNUSED PyObject *__p */ __pyx_v_pairs = (__pyx_v_pairs + 1); - /* "fastremap.pyx":705 + /* "fastremap.pyx":721 * cdef size_t i = 0 * for i in range(1, voxels): * if label == labels[i]: # <<<<<<<<<<<<<< @@ -88318,7 +91060,7 @@ static PyObject *__pyx_pf_9fastremap_440_pixel_pairs(CYTHON_UNUSED PyObject *__p goto __pyx_L5; } - /* "fastremap.pyx":708 + /* "fastremap.pyx":724 * pairs += 1 * else: * label = labels[i] # <<<<<<<<<<<<<< @@ -88331,14 +91073,14 @@ static PyObject *__pyx_pf_9fastremap_440_pixel_pairs(CYTHON_UNUSED PyObject *__p if (unlikely(__pyx_t_7 >= (size_t)__pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 708, __pyx_L1_error) + __PYX_ERR(0, 724, __pyx_L1_error) } __pyx_v_label = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_labels.diminfo[0].strides)); } __pyx_L5:; } - /* "fastremap.pyx":710 + /* "fastremap.pyx":726 * label = labels[i] * * return pairs # <<<<<<<<<<<<<< @@ -88346,13 +91088,13 @@ static PyObject *__pyx_pf_9fastremap_440_pixel_pairs(CYTHON_UNUSED PyObject *__p * def unique(labels, return_index=False, return_inverse=False, return_counts=False, axis=None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":697 + /* "fastremap.pyx":713 * return _pixel_pairs(reshape(labels, (labels.size,))) * * def _pixel_pairs(cnp.ndarray[ALLINT, ndim=1] labels): # <<<<<<<<<<<<<< @@ -88390,7 +91132,7 @@ static PyObject *__pyx_fuse_1__pyx_pw_9fastremap_443_pixel_pairs(PyObject *__pyx PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_pixel_pairs (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 713, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_442_pixel_pairs(__pyx_self, ((PyArrayObject *)__pyx_v_labels)); /* function exit code */ @@ -88429,24 +91171,24 @@ static PyObject *__pyx_pf_9fastremap_442_pixel_pairs(CYTHON_UNUSED PyObject *__p __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 713, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":698 + /* "fastremap.pyx":714 * * def _pixel_pairs(cnp.ndarray[ALLINT, ndim=1] labels): * cdef size_t voxels = labels.size # <<<<<<<<<<<<<< * * cdef size_t pairs = 0 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_voxels = __pyx_t_2; - /* "fastremap.pyx":700 + /* "fastremap.pyx":716 * cdef size_t voxels = labels.size * * cdef size_t pairs = 0 # <<<<<<<<<<<<<< @@ -88455,7 +91197,7 @@ static PyObject *__pyx_pf_9fastremap_442_pixel_pairs(CYTHON_UNUSED PyObject *__p */ __pyx_v_pairs = 0; - /* "fastremap.pyx":701 + /* "fastremap.pyx":717 * * cdef size_t pairs = 0 * cdef ALLINT label = labels[0] # <<<<<<<<<<<<<< @@ -88470,11 +91212,11 @@ static PyObject *__pyx_pf_9fastremap_442_pixel_pairs(CYTHON_UNUSED PyObject *__p } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 701, __pyx_L1_error) + __PYX_ERR(0, 717, __pyx_L1_error) } __pyx_v_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_labels.diminfo[0].strides)); - /* "fastremap.pyx":703 + /* "fastremap.pyx":719 * cdef ALLINT label = labels[0] * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -88483,7 +91225,7 @@ static PyObject *__pyx_pf_9fastremap_442_pixel_pairs(CYTHON_UNUSED PyObject *__p */ __pyx_v_i = 0; - /* "fastremap.pyx":704 + /* "fastremap.pyx":720 * * cdef size_t i = 0 * for i in range(1, voxels): # <<<<<<<<<<<<<< @@ -88495,7 +91237,7 @@ static PyObject *__pyx_pf_9fastremap_442_pixel_pairs(CYTHON_UNUSED PyObject *__p for (__pyx_t_6 = 1; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "fastremap.pyx":705 + /* "fastremap.pyx":721 * cdef size_t i = 0 * for i in range(1, voxels): * if label == labels[i]: # <<<<<<<<<<<<<< @@ -88507,12 +91249,12 @@ static PyObject *__pyx_pf_9fastremap_442_pixel_pairs(CYTHON_UNUSED PyObject *__p if (unlikely(__pyx_t_7 >= (size_t)__pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 705, __pyx_L1_error) + __PYX_ERR(0, 721, __pyx_L1_error) } __pyx_t_8 = ((__pyx_v_label == (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_labels.diminfo[0].strides))) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":706 + /* "fastremap.pyx":722 * for i in range(1, voxels): * if label == labels[i]: * pairs += 1 # <<<<<<<<<<<<<< @@ -88521,7 +91263,7 @@ static PyObject *__pyx_pf_9fastremap_442_pixel_pairs(CYTHON_UNUSED PyObject *__p */ __pyx_v_pairs = (__pyx_v_pairs + 1); - /* "fastremap.pyx":705 + /* "fastremap.pyx":721 * cdef size_t i = 0 * for i in range(1, voxels): * if label == labels[i]: # <<<<<<<<<<<<<< @@ -88531,7 +91273,7 @@ static PyObject *__pyx_pf_9fastremap_442_pixel_pairs(CYTHON_UNUSED PyObject *__p goto __pyx_L5; } - /* "fastremap.pyx":708 + /* "fastremap.pyx":724 * pairs += 1 * else: * label = labels[i] # <<<<<<<<<<<<<< @@ -88544,14 +91286,14 @@ static PyObject *__pyx_pf_9fastremap_442_pixel_pairs(CYTHON_UNUSED PyObject *__p if (unlikely(__pyx_t_7 >= (size_t)__pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 708, __pyx_L1_error) + __PYX_ERR(0, 724, __pyx_L1_error) } __pyx_v_label = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_labels.diminfo[0].strides)); } __pyx_L5:; } - /* "fastremap.pyx":710 + /* "fastremap.pyx":726 * label = labels[i] * * return pairs # <<<<<<<<<<<<<< @@ -88559,13 +91301,13 @@ static PyObject *__pyx_pf_9fastremap_442_pixel_pairs(CYTHON_UNUSED PyObject *__p * def unique(labels, return_index=False, return_inverse=False, return_counts=False, axis=None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":697 + /* "fastremap.pyx":713 * return _pixel_pairs(reshape(labels, (labels.size,))) * * def _pixel_pairs(cnp.ndarray[ALLINT, ndim=1] labels): # <<<<<<<<<<<<<< @@ -88603,7 +91345,7 @@ static PyObject *__pyx_fuse_2__pyx_pw_9fastremap_445_pixel_pairs(PyObject *__pyx PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_pixel_pairs (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 713, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_444_pixel_pairs(__pyx_self, ((PyArrayObject *)__pyx_v_labels)); /* function exit code */ @@ -88642,24 +91384,24 @@ static PyObject *__pyx_pf_9fastremap_444_pixel_pairs(CYTHON_UNUSED PyObject *__p __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 713, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":698 + /* "fastremap.pyx":714 * * def _pixel_pairs(cnp.ndarray[ALLINT, ndim=1] labels): * cdef size_t voxels = labels.size # <<<<<<<<<<<<<< * * cdef size_t pairs = 0 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_voxels = __pyx_t_2; - /* "fastremap.pyx":700 + /* "fastremap.pyx":716 * cdef size_t voxels = labels.size * * cdef size_t pairs = 0 # <<<<<<<<<<<<<< @@ -88668,7 +91410,7 @@ static PyObject *__pyx_pf_9fastremap_444_pixel_pairs(CYTHON_UNUSED PyObject *__p */ __pyx_v_pairs = 0; - /* "fastremap.pyx":701 + /* "fastremap.pyx":717 * * cdef size_t pairs = 0 * cdef ALLINT label = labels[0] # <<<<<<<<<<<<<< @@ -88683,11 +91425,11 @@ static PyObject *__pyx_pf_9fastremap_444_pixel_pairs(CYTHON_UNUSED PyObject *__p } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 701, __pyx_L1_error) + __PYX_ERR(0, 717, __pyx_L1_error) } __pyx_v_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_labels.diminfo[0].strides)); - /* "fastremap.pyx":703 + /* "fastremap.pyx":719 * cdef ALLINT label = labels[0] * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -88696,7 +91438,7 @@ static PyObject *__pyx_pf_9fastremap_444_pixel_pairs(CYTHON_UNUSED PyObject *__p */ __pyx_v_i = 0; - /* "fastremap.pyx":704 + /* "fastremap.pyx":720 * * cdef size_t i = 0 * for i in range(1, voxels): # <<<<<<<<<<<<<< @@ -88708,7 +91450,7 @@ static PyObject *__pyx_pf_9fastremap_444_pixel_pairs(CYTHON_UNUSED PyObject *__p for (__pyx_t_6 = 1; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "fastremap.pyx":705 + /* "fastremap.pyx":721 * cdef size_t i = 0 * for i in range(1, voxels): * if label == labels[i]: # <<<<<<<<<<<<<< @@ -88720,12 +91462,12 @@ static PyObject *__pyx_pf_9fastremap_444_pixel_pairs(CYTHON_UNUSED PyObject *__p if (unlikely(__pyx_t_7 >= (size_t)__pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 705, __pyx_L1_error) + __PYX_ERR(0, 721, __pyx_L1_error) } __pyx_t_8 = ((__pyx_v_label == (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_labels.diminfo[0].strides))) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":706 + /* "fastremap.pyx":722 * for i in range(1, voxels): * if label == labels[i]: * pairs += 1 # <<<<<<<<<<<<<< @@ -88734,7 +91476,7 @@ static PyObject *__pyx_pf_9fastremap_444_pixel_pairs(CYTHON_UNUSED PyObject *__p */ __pyx_v_pairs = (__pyx_v_pairs + 1); - /* "fastremap.pyx":705 + /* "fastremap.pyx":721 * cdef size_t i = 0 * for i in range(1, voxels): * if label == labels[i]: # <<<<<<<<<<<<<< @@ -88744,7 +91486,7 @@ static PyObject *__pyx_pf_9fastremap_444_pixel_pairs(CYTHON_UNUSED PyObject *__p goto __pyx_L5; } - /* "fastremap.pyx":708 + /* "fastremap.pyx":724 * pairs += 1 * else: * label = labels[i] # <<<<<<<<<<<<<< @@ -88757,14 +91499,14 @@ static PyObject *__pyx_pf_9fastremap_444_pixel_pairs(CYTHON_UNUSED PyObject *__p if (unlikely(__pyx_t_7 >= (size_t)__pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 708, __pyx_L1_error) + __PYX_ERR(0, 724, __pyx_L1_error) } __pyx_v_label = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_labels.diminfo[0].strides)); } __pyx_L5:; } - /* "fastremap.pyx":710 + /* "fastremap.pyx":726 * label = labels[i] * * return pairs # <<<<<<<<<<<<<< @@ -88772,13 +91514,13 @@ static PyObject *__pyx_pf_9fastremap_444_pixel_pairs(CYTHON_UNUSED PyObject *__p * def unique(labels, return_index=False, return_inverse=False, return_counts=False, axis=None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":697 + /* "fastremap.pyx":713 * return _pixel_pairs(reshape(labels, (labels.size,))) * * def _pixel_pairs(cnp.ndarray[ALLINT, ndim=1] labels): # <<<<<<<<<<<<<< @@ -88816,7 +91558,7 @@ static PyObject *__pyx_fuse_3__pyx_pw_9fastremap_447_pixel_pairs(PyObject *__pyx PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_pixel_pairs (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 713, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_446_pixel_pairs(__pyx_self, ((PyArrayObject *)__pyx_v_labels)); /* function exit code */ @@ -88855,24 +91597,24 @@ static PyObject *__pyx_pf_9fastremap_446_pixel_pairs(CYTHON_UNUSED PyObject *__p __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 713, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":698 + /* "fastremap.pyx":714 * * def _pixel_pairs(cnp.ndarray[ALLINT, ndim=1] labels): * cdef size_t voxels = labels.size # <<<<<<<<<<<<<< * * cdef size_t pairs = 0 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_voxels = __pyx_t_2; - /* "fastremap.pyx":700 + /* "fastremap.pyx":716 * cdef size_t voxels = labels.size * * cdef size_t pairs = 0 # <<<<<<<<<<<<<< @@ -88881,7 +91623,7 @@ static PyObject *__pyx_pf_9fastremap_446_pixel_pairs(CYTHON_UNUSED PyObject *__p */ __pyx_v_pairs = 0; - /* "fastremap.pyx":701 + /* "fastremap.pyx":717 * * cdef size_t pairs = 0 * cdef ALLINT label = labels[0] # <<<<<<<<<<<<<< @@ -88896,11 +91638,11 @@ static PyObject *__pyx_pf_9fastremap_446_pixel_pairs(CYTHON_UNUSED PyObject *__p } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 701, __pyx_L1_error) + __PYX_ERR(0, 717, __pyx_L1_error) } __pyx_v_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_labels.diminfo[0].strides)); - /* "fastremap.pyx":703 + /* "fastremap.pyx":719 * cdef ALLINT label = labels[0] * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -88909,7 +91651,7 @@ static PyObject *__pyx_pf_9fastremap_446_pixel_pairs(CYTHON_UNUSED PyObject *__p */ __pyx_v_i = 0; - /* "fastremap.pyx":704 + /* "fastremap.pyx":720 * * cdef size_t i = 0 * for i in range(1, voxels): # <<<<<<<<<<<<<< @@ -88921,7 +91663,7 @@ static PyObject *__pyx_pf_9fastremap_446_pixel_pairs(CYTHON_UNUSED PyObject *__p for (__pyx_t_6 = 1; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "fastremap.pyx":705 + /* "fastremap.pyx":721 * cdef size_t i = 0 * for i in range(1, voxels): * if label == labels[i]: # <<<<<<<<<<<<<< @@ -88933,12 +91675,12 @@ static PyObject *__pyx_pf_9fastremap_446_pixel_pairs(CYTHON_UNUSED PyObject *__p if (unlikely(__pyx_t_7 >= (size_t)__pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 705, __pyx_L1_error) + __PYX_ERR(0, 721, __pyx_L1_error) } __pyx_t_8 = ((__pyx_v_label == (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_labels.diminfo[0].strides))) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":706 + /* "fastremap.pyx":722 * for i in range(1, voxels): * if label == labels[i]: * pairs += 1 # <<<<<<<<<<<<<< @@ -88947,7 +91689,7 @@ static PyObject *__pyx_pf_9fastremap_446_pixel_pairs(CYTHON_UNUSED PyObject *__p */ __pyx_v_pairs = (__pyx_v_pairs + 1); - /* "fastremap.pyx":705 + /* "fastremap.pyx":721 * cdef size_t i = 0 * for i in range(1, voxels): * if label == labels[i]: # <<<<<<<<<<<<<< @@ -88957,7 +91699,7 @@ static PyObject *__pyx_pf_9fastremap_446_pixel_pairs(CYTHON_UNUSED PyObject *__p goto __pyx_L5; } - /* "fastremap.pyx":708 + /* "fastremap.pyx":724 * pairs += 1 * else: * label = labels[i] # <<<<<<<<<<<<<< @@ -88970,14 +91712,14 @@ static PyObject *__pyx_pf_9fastremap_446_pixel_pairs(CYTHON_UNUSED PyObject *__p if (unlikely(__pyx_t_7 >= (size_t)__pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 708, __pyx_L1_error) + __PYX_ERR(0, 724, __pyx_L1_error) } __pyx_v_label = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_labels.diminfo[0].strides)); } __pyx_L5:; } - /* "fastremap.pyx":710 + /* "fastremap.pyx":726 * label = labels[i] * * return pairs # <<<<<<<<<<<<<< @@ -88985,13 +91727,13 @@ static PyObject *__pyx_pf_9fastremap_446_pixel_pairs(CYTHON_UNUSED PyObject *__p * def unique(labels, return_index=False, return_inverse=False, return_counts=False, axis=None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":697 + /* "fastremap.pyx":713 * return _pixel_pairs(reshape(labels, (labels.size,))) * * def _pixel_pairs(cnp.ndarray[ALLINT, ndim=1] labels): # <<<<<<<<<<<<<< @@ -89029,7 +91771,7 @@ static PyObject *__pyx_fuse_4__pyx_pw_9fastremap_449_pixel_pairs(PyObject *__pyx PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_pixel_pairs (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 713, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_448_pixel_pairs(__pyx_self, ((PyArrayObject *)__pyx_v_labels)); /* function exit code */ @@ -89068,24 +91810,24 @@ static PyObject *__pyx_pf_9fastremap_448_pixel_pairs(CYTHON_UNUSED PyObject *__p __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 713, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":698 + /* "fastremap.pyx":714 * * def _pixel_pairs(cnp.ndarray[ALLINT, ndim=1] labels): * cdef size_t voxels = labels.size # <<<<<<<<<<<<<< * * cdef size_t pairs = 0 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_voxels = __pyx_t_2; - /* "fastremap.pyx":700 + /* "fastremap.pyx":716 * cdef size_t voxels = labels.size * * cdef size_t pairs = 0 # <<<<<<<<<<<<<< @@ -89094,7 +91836,7 @@ static PyObject *__pyx_pf_9fastremap_448_pixel_pairs(CYTHON_UNUSED PyObject *__p */ __pyx_v_pairs = 0; - /* "fastremap.pyx":701 + /* "fastremap.pyx":717 * * cdef size_t pairs = 0 * cdef ALLINT label = labels[0] # <<<<<<<<<<<<<< @@ -89109,11 +91851,11 @@ static PyObject *__pyx_pf_9fastremap_448_pixel_pairs(CYTHON_UNUSED PyObject *__p } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 701, __pyx_L1_error) + __PYX_ERR(0, 717, __pyx_L1_error) } __pyx_v_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_labels.diminfo[0].strides)); - /* "fastremap.pyx":703 + /* "fastremap.pyx":719 * cdef ALLINT label = labels[0] * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -89122,7 +91864,7 @@ static PyObject *__pyx_pf_9fastremap_448_pixel_pairs(CYTHON_UNUSED PyObject *__p */ __pyx_v_i = 0; - /* "fastremap.pyx":704 + /* "fastremap.pyx":720 * * cdef size_t i = 0 * for i in range(1, voxels): # <<<<<<<<<<<<<< @@ -89134,7 +91876,7 @@ static PyObject *__pyx_pf_9fastremap_448_pixel_pairs(CYTHON_UNUSED PyObject *__p for (__pyx_t_6 = 1; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "fastremap.pyx":705 + /* "fastremap.pyx":721 * cdef size_t i = 0 * for i in range(1, voxels): * if label == labels[i]: # <<<<<<<<<<<<<< @@ -89146,12 +91888,12 @@ static PyObject *__pyx_pf_9fastremap_448_pixel_pairs(CYTHON_UNUSED PyObject *__p if (unlikely(__pyx_t_7 >= (size_t)__pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 705, __pyx_L1_error) + __PYX_ERR(0, 721, __pyx_L1_error) } __pyx_t_8 = ((__pyx_v_label == (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_labels.diminfo[0].strides))) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":706 + /* "fastremap.pyx":722 * for i in range(1, voxels): * if label == labels[i]: * pairs += 1 # <<<<<<<<<<<<<< @@ -89160,7 +91902,7 @@ static PyObject *__pyx_pf_9fastremap_448_pixel_pairs(CYTHON_UNUSED PyObject *__p */ __pyx_v_pairs = (__pyx_v_pairs + 1); - /* "fastremap.pyx":705 + /* "fastremap.pyx":721 * cdef size_t i = 0 * for i in range(1, voxels): * if label == labels[i]: # <<<<<<<<<<<<<< @@ -89170,7 +91912,7 @@ static PyObject *__pyx_pf_9fastremap_448_pixel_pairs(CYTHON_UNUSED PyObject *__p goto __pyx_L5; } - /* "fastremap.pyx":708 + /* "fastremap.pyx":724 * pairs += 1 * else: * label = labels[i] # <<<<<<<<<<<<<< @@ -89183,14 +91925,14 @@ static PyObject *__pyx_pf_9fastremap_448_pixel_pairs(CYTHON_UNUSED PyObject *__p if (unlikely(__pyx_t_7 >= (size_t)__pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 708, __pyx_L1_error) + __PYX_ERR(0, 724, __pyx_L1_error) } __pyx_v_label = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_labels.diminfo[0].strides)); } __pyx_L5:; } - /* "fastremap.pyx":710 + /* "fastremap.pyx":726 * label = labels[i] * * return pairs # <<<<<<<<<<<<<< @@ -89198,13 +91940,13 @@ static PyObject *__pyx_pf_9fastremap_448_pixel_pairs(CYTHON_UNUSED PyObject *__p * def unique(labels, return_index=False, return_inverse=False, return_counts=False, axis=None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":697 + /* "fastremap.pyx":713 * return _pixel_pairs(reshape(labels, (labels.size,))) * * def _pixel_pairs(cnp.ndarray[ALLINT, ndim=1] labels): # <<<<<<<<<<<<<< @@ -89242,7 +91984,7 @@ static PyObject *__pyx_fuse_5__pyx_pw_9fastremap_451_pixel_pairs(PyObject *__pyx PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_pixel_pairs (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 713, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_450_pixel_pairs(__pyx_self, ((PyArrayObject *)__pyx_v_labels)); /* function exit code */ @@ -89281,24 +92023,24 @@ static PyObject *__pyx_pf_9fastremap_450_pixel_pairs(CYTHON_UNUSED PyObject *__p __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 713, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":698 + /* "fastremap.pyx":714 * * def _pixel_pairs(cnp.ndarray[ALLINT, ndim=1] labels): * cdef size_t voxels = labels.size # <<<<<<<<<<<<<< * * cdef size_t pairs = 0 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_voxels = __pyx_t_2; - /* "fastremap.pyx":700 + /* "fastremap.pyx":716 * cdef size_t voxels = labels.size * * cdef size_t pairs = 0 # <<<<<<<<<<<<<< @@ -89307,7 +92049,7 @@ static PyObject *__pyx_pf_9fastremap_450_pixel_pairs(CYTHON_UNUSED PyObject *__p */ __pyx_v_pairs = 0; - /* "fastremap.pyx":701 + /* "fastremap.pyx":717 * * cdef size_t pairs = 0 * cdef ALLINT label = labels[0] # <<<<<<<<<<<<<< @@ -89322,11 +92064,11 @@ static PyObject *__pyx_pf_9fastremap_450_pixel_pairs(CYTHON_UNUSED PyObject *__p } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 701, __pyx_L1_error) + __PYX_ERR(0, 717, __pyx_L1_error) } __pyx_v_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_labels.diminfo[0].strides)); - /* "fastremap.pyx":703 + /* "fastremap.pyx":719 * cdef ALLINT label = labels[0] * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -89335,7 +92077,7 @@ static PyObject *__pyx_pf_9fastremap_450_pixel_pairs(CYTHON_UNUSED PyObject *__p */ __pyx_v_i = 0; - /* "fastremap.pyx":704 + /* "fastremap.pyx":720 * * cdef size_t i = 0 * for i in range(1, voxels): # <<<<<<<<<<<<<< @@ -89347,7 +92089,7 @@ static PyObject *__pyx_pf_9fastremap_450_pixel_pairs(CYTHON_UNUSED PyObject *__p for (__pyx_t_6 = 1; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "fastremap.pyx":705 + /* "fastremap.pyx":721 * cdef size_t i = 0 * for i in range(1, voxels): * if label == labels[i]: # <<<<<<<<<<<<<< @@ -89359,12 +92101,12 @@ static PyObject *__pyx_pf_9fastremap_450_pixel_pairs(CYTHON_UNUSED PyObject *__p if (unlikely(__pyx_t_7 >= (size_t)__pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 705, __pyx_L1_error) + __PYX_ERR(0, 721, __pyx_L1_error) } __pyx_t_8 = ((__pyx_v_label == (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_labels.diminfo[0].strides))) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":706 + /* "fastremap.pyx":722 * for i in range(1, voxels): * if label == labels[i]: * pairs += 1 # <<<<<<<<<<<<<< @@ -89373,7 +92115,7 @@ static PyObject *__pyx_pf_9fastremap_450_pixel_pairs(CYTHON_UNUSED PyObject *__p */ __pyx_v_pairs = (__pyx_v_pairs + 1); - /* "fastremap.pyx":705 + /* "fastremap.pyx":721 * cdef size_t i = 0 * for i in range(1, voxels): * if label == labels[i]: # <<<<<<<<<<<<<< @@ -89383,7 +92125,7 @@ static PyObject *__pyx_pf_9fastremap_450_pixel_pairs(CYTHON_UNUSED PyObject *__p goto __pyx_L5; } - /* "fastremap.pyx":708 + /* "fastremap.pyx":724 * pairs += 1 * else: * label = labels[i] # <<<<<<<<<<<<<< @@ -89396,14 +92138,14 @@ static PyObject *__pyx_pf_9fastremap_450_pixel_pairs(CYTHON_UNUSED PyObject *__p if (unlikely(__pyx_t_7 >= (size_t)__pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 708, __pyx_L1_error) + __PYX_ERR(0, 724, __pyx_L1_error) } __pyx_v_label = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_labels.diminfo[0].strides)); } __pyx_L5:; } - /* "fastremap.pyx":710 + /* "fastremap.pyx":726 * label = labels[i] * * return pairs # <<<<<<<<<<<<<< @@ -89411,13 +92153,13 @@ static PyObject *__pyx_pf_9fastremap_450_pixel_pairs(CYTHON_UNUSED PyObject *__p * def unique(labels, return_index=False, return_inverse=False, return_counts=False, axis=None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":697 + /* "fastremap.pyx":713 * return _pixel_pairs(reshape(labels, (labels.size,))) * * def _pixel_pairs(cnp.ndarray[ALLINT, ndim=1] labels): # <<<<<<<<<<<<<< @@ -89455,7 +92197,7 @@ static PyObject *__pyx_fuse_6__pyx_pw_9fastremap_453_pixel_pairs(PyObject *__pyx PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_pixel_pairs (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 713, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_452_pixel_pairs(__pyx_self, ((PyArrayObject *)__pyx_v_labels)); /* function exit code */ @@ -89494,24 +92236,24 @@ static PyObject *__pyx_pf_9fastremap_452_pixel_pairs(CYTHON_UNUSED PyObject *__p __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 713, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":698 + /* "fastremap.pyx":714 * * def _pixel_pairs(cnp.ndarray[ALLINT, ndim=1] labels): * cdef size_t voxels = labels.size # <<<<<<<<<<<<<< * * cdef size_t pairs = 0 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_voxels = __pyx_t_2; - /* "fastremap.pyx":700 + /* "fastremap.pyx":716 * cdef size_t voxels = labels.size * * cdef size_t pairs = 0 # <<<<<<<<<<<<<< @@ -89520,7 +92262,7 @@ static PyObject *__pyx_pf_9fastremap_452_pixel_pairs(CYTHON_UNUSED PyObject *__p */ __pyx_v_pairs = 0; - /* "fastremap.pyx":701 + /* "fastremap.pyx":717 * * cdef size_t pairs = 0 * cdef ALLINT label = labels[0] # <<<<<<<<<<<<<< @@ -89535,11 +92277,11 @@ static PyObject *__pyx_pf_9fastremap_452_pixel_pairs(CYTHON_UNUSED PyObject *__p } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 701, __pyx_L1_error) + __PYX_ERR(0, 717, __pyx_L1_error) } __pyx_v_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_labels.diminfo[0].strides)); - /* "fastremap.pyx":703 + /* "fastremap.pyx":719 * cdef ALLINT label = labels[0] * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -89548,7 +92290,7 @@ static PyObject *__pyx_pf_9fastremap_452_pixel_pairs(CYTHON_UNUSED PyObject *__p */ __pyx_v_i = 0; - /* "fastremap.pyx":704 + /* "fastremap.pyx":720 * * cdef size_t i = 0 * for i in range(1, voxels): # <<<<<<<<<<<<<< @@ -89560,7 +92302,7 @@ static PyObject *__pyx_pf_9fastremap_452_pixel_pairs(CYTHON_UNUSED PyObject *__p for (__pyx_t_6 = 1; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "fastremap.pyx":705 + /* "fastremap.pyx":721 * cdef size_t i = 0 * for i in range(1, voxels): * if label == labels[i]: # <<<<<<<<<<<<<< @@ -89572,12 +92314,12 @@ static PyObject *__pyx_pf_9fastremap_452_pixel_pairs(CYTHON_UNUSED PyObject *__p if (unlikely(__pyx_t_7 >= (size_t)__pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 705, __pyx_L1_error) + __PYX_ERR(0, 721, __pyx_L1_error) } __pyx_t_8 = ((__pyx_v_label == (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_labels.diminfo[0].strides))) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":706 + /* "fastremap.pyx":722 * for i in range(1, voxels): * if label == labels[i]: * pairs += 1 # <<<<<<<<<<<<<< @@ -89586,7 +92328,7 @@ static PyObject *__pyx_pf_9fastremap_452_pixel_pairs(CYTHON_UNUSED PyObject *__p */ __pyx_v_pairs = (__pyx_v_pairs + 1); - /* "fastremap.pyx":705 + /* "fastremap.pyx":721 * cdef size_t i = 0 * for i in range(1, voxels): * if label == labels[i]: # <<<<<<<<<<<<<< @@ -89596,7 +92338,7 @@ static PyObject *__pyx_pf_9fastremap_452_pixel_pairs(CYTHON_UNUSED PyObject *__p goto __pyx_L5; } - /* "fastremap.pyx":708 + /* "fastremap.pyx":724 * pairs += 1 * else: * label = labels[i] # <<<<<<<<<<<<<< @@ -89609,14 +92351,14 @@ static PyObject *__pyx_pf_9fastremap_452_pixel_pairs(CYTHON_UNUSED PyObject *__p if (unlikely(__pyx_t_7 >= (size_t)__pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 708, __pyx_L1_error) + __PYX_ERR(0, 724, __pyx_L1_error) } __pyx_v_label = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_labels.diminfo[0].strides)); } __pyx_L5:; } - /* "fastremap.pyx":710 + /* "fastremap.pyx":726 * label = labels[i] * * return pairs # <<<<<<<<<<<<<< @@ -89624,13 +92366,13 @@ static PyObject *__pyx_pf_9fastremap_452_pixel_pairs(CYTHON_UNUSED PyObject *__p * def unique(labels, return_index=False, return_inverse=False, return_counts=False, axis=None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":697 + /* "fastremap.pyx":713 * return _pixel_pairs(reshape(labels, (labels.size,))) * * def _pixel_pairs(cnp.ndarray[ALLINT, ndim=1] labels): # <<<<<<<<<<<<<< @@ -89668,7 +92410,7 @@ static PyObject *__pyx_fuse_7__pyx_pw_9fastremap_455_pixel_pairs(PyObject *__pyx PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_pixel_pairs (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 713, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_454_pixel_pairs(__pyx_self, ((PyArrayObject *)__pyx_v_labels)); /* function exit code */ @@ -89707,24 +92449,24 @@ static PyObject *__pyx_pf_9fastremap_454_pixel_pairs(CYTHON_UNUSED PyObject *__p __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 713, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":698 + /* "fastremap.pyx":714 * * def _pixel_pairs(cnp.ndarray[ALLINT, ndim=1] labels): * cdef size_t voxels = labels.size # <<<<<<<<<<<<<< * * cdef size_t pairs = 0 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_voxels = __pyx_t_2; - /* "fastremap.pyx":700 + /* "fastremap.pyx":716 * cdef size_t voxels = labels.size * * cdef size_t pairs = 0 # <<<<<<<<<<<<<< @@ -89733,7 +92475,7 @@ static PyObject *__pyx_pf_9fastremap_454_pixel_pairs(CYTHON_UNUSED PyObject *__p */ __pyx_v_pairs = 0; - /* "fastremap.pyx":701 + /* "fastremap.pyx":717 * * cdef size_t pairs = 0 * cdef ALLINT label = labels[0] # <<<<<<<<<<<<<< @@ -89748,11 +92490,11 @@ static PyObject *__pyx_pf_9fastremap_454_pixel_pairs(CYTHON_UNUSED PyObject *__p } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 701, __pyx_L1_error) + __PYX_ERR(0, 717, __pyx_L1_error) } __pyx_v_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_labels.diminfo[0].strides)); - /* "fastremap.pyx":703 + /* "fastremap.pyx":719 * cdef ALLINT label = labels[0] * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -89761,7 +92503,7 @@ static PyObject *__pyx_pf_9fastremap_454_pixel_pairs(CYTHON_UNUSED PyObject *__p */ __pyx_v_i = 0; - /* "fastremap.pyx":704 + /* "fastremap.pyx":720 * * cdef size_t i = 0 * for i in range(1, voxels): # <<<<<<<<<<<<<< @@ -89773,7 +92515,7 @@ static PyObject *__pyx_pf_9fastremap_454_pixel_pairs(CYTHON_UNUSED PyObject *__p for (__pyx_t_6 = 1; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "fastremap.pyx":705 + /* "fastremap.pyx":721 * cdef size_t i = 0 * for i in range(1, voxels): * if label == labels[i]: # <<<<<<<<<<<<<< @@ -89785,12 +92527,12 @@ static PyObject *__pyx_pf_9fastremap_454_pixel_pairs(CYTHON_UNUSED PyObject *__p if (unlikely(__pyx_t_7 >= (size_t)__pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 705, __pyx_L1_error) + __PYX_ERR(0, 721, __pyx_L1_error) } __pyx_t_8 = ((__pyx_v_label == (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_labels.diminfo[0].strides))) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":706 + /* "fastremap.pyx":722 * for i in range(1, voxels): * if label == labels[i]: * pairs += 1 # <<<<<<<<<<<<<< @@ -89799,7 +92541,7 @@ static PyObject *__pyx_pf_9fastremap_454_pixel_pairs(CYTHON_UNUSED PyObject *__p */ __pyx_v_pairs = (__pyx_v_pairs + 1); - /* "fastremap.pyx":705 + /* "fastremap.pyx":721 * cdef size_t i = 0 * for i in range(1, voxels): * if label == labels[i]: # <<<<<<<<<<<<<< @@ -89809,7 +92551,7 @@ static PyObject *__pyx_pf_9fastremap_454_pixel_pairs(CYTHON_UNUSED PyObject *__p goto __pyx_L5; } - /* "fastremap.pyx":708 + /* "fastremap.pyx":724 * pairs += 1 * else: * label = labels[i] # <<<<<<<<<<<<<< @@ -89822,14 +92564,14 @@ static PyObject *__pyx_pf_9fastremap_454_pixel_pairs(CYTHON_UNUSED PyObject *__p if (unlikely(__pyx_t_7 >= (size_t)__pyx_pybuffernd_labels.diminfo[0].shape)) __pyx_t_4 = 0; if (unlikely(__pyx_t_4 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_4); - __PYX_ERR(0, 708, __pyx_L1_error) + __PYX_ERR(0, 724, __pyx_L1_error) } __pyx_v_label = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_labels.diminfo[0].strides)); } __pyx_L5:; } - /* "fastremap.pyx":710 + /* "fastremap.pyx":726 * label = labels[i] * * return pairs # <<<<<<<<<<<<<< @@ -89837,13 +92579,13 @@ static PyObject *__pyx_pf_9fastremap_454_pixel_pairs(CYTHON_UNUSED PyObject *__p * def unique(labels, return_index=False, return_inverse=False, return_counts=False, axis=None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":697 + /* "fastremap.pyx":713 * return _pixel_pairs(reshape(labels, (labels.size,))) * * def _pixel_pairs(cnp.ndarray[ALLINT, ndim=1] labels): # <<<<<<<<<<<<<< @@ -89871,7 +92613,7 @@ static PyObject *__pyx_pf_9fastremap_454_pixel_pairs(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "fastremap.pyx":712 +/* "fastremap.pyx":728 * return pairs * * def unique(labels, return_index=False, return_inverse=False, return_counts=False, axis=None): # <<<<<<<<<<<<<< @@ -89950,7 +92692,7 @@ static PyObject *__pyx_pw_9fastremap_41unique(PyObject *__pyx_self, PyObject *__ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unique") < 0)) __PYX_ERR(0, 712, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unique") < 0)) __PYX_ERR(0, 728, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -89975,7 +92717,7 @@ static PyObject *__pyx_pw_9fastremap_41unique(PyObject *__pyx_self, PyObject *__ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("unique", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 712, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("unique", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 728, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.unique", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -89988,7 +92730,7 @@ static PyObject *__pyx_pw_9fastremap_41unique(PyObject *__pyx_self, PyObject *__ return __pyx_r; } -/* "fastremap.pyx":754 +/* "fastremap.pyx":770 * min_label, max_label = (0, 0) * * def c_order_index(index): # <<<<<<<<<<<<<< @@ -90030,17 +92772,17 @@ static PyObject *__pyx_pf_9fastremap_6unique_c_order_index(PyObject *__pyx_self, __pyx_outer_scope = (struct __pyx_obj_9fastremap___pyx_scope_struct__unique *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "fastremap.pyx":755 + /* "fastremap.pyx":771 * * def c_order_index(index): * if len(shape) > 1 and fortran_order: # <<<<<<<<<<<<<< * return np.ravel_multi_index( * np.unravel_index(index, shape, order='F'), */ - if (unlikely(!__pyx_cur_scope->__pyx_v_shape)) { __Pyx_RaiseClosureNameError("shape"); __PYX_ERR(0, 755, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_v_shape)) { __Pyx_RaiseClosureNameError("shape"); __PYX_ERR(0, 771, __pyx_L1_error) } __pyx_t_2 = __pyx_cur_scope->__pyx_v_shape; __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 755, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 771, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = ((__pyx_t_3 > 1) != 0); if (__pyx_t_4) { @@ -90048,13 +92790,13 @@ static PyObject *__pyx_pf_9fastremap_6unique_c_order_index(PyObject *__pyx_self, __pyx_t_1 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } - if (unlikely(!__pyx_cur_scope->__pyx_v_fortran_order)) { __Pyx_RaiseClosureNameError("fortran_order"); __PYX_ERR(0, 755, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_fortran_order); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 755, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_fortran_order)) { __Pyx_RaiseClosureNameError("fortran_order"); __PYX_ERR(0, 771, __pyx_L1_error) } + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_fortran_order); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 771, __pyx_L1_error) __pyx_t_1 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "fastremap.pyx":756 + /* "fastremap.pyx":772 * def c_order_index(index): * if len(shape) > 1 and fortran_order: * return np.ravel_multi_index( # <<<<<<<<<<<<<< @@ -90062,26 +92804,26 @@ static PyObject *__pyx_pf_9fastremap_6unique_c_order_index(PyObject *__pyx_self, * shape, order='C' */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ravel_multi_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 756, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ravel_multi_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":757 + /* "fastremap.pyx":773 * if len(shape) > 1 and fortran_order: * return np.ravel_multi_index( * np.unravel_index(index, shape, order='F'), # <<<<<<<<<<<<<< * shape, order='C' * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 757, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_unravel_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_unravel_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_shape)) { __Pyx_RaiseClosureNameError("shape"); __PYX_ERR(0, 757, __pyx_L1_error) } - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 757, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_shape)) { __Pyx_RaiseClosureNameError("shape"); __PYX_ERR(0, 773, __pyx_L1_error) } + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_index); __Pyx_GIVEREF(__pyx_v_index); @@ -90089,32 +92831,32 @@ static PyObject *__pyx_pf_9fastremap_6unique_c_order_index(PyObject *__pyx_self, __Pyx_INCREF(__pyx_cur_scope->__pyx_v_shape); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_cur_scope->__pyx_v_shape); - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 757, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 757, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 773, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "fastremap.pyx":758 + /* "fastremap.pyx":774 * return np.ravel_multi_index( * np.unravel_index(index, shape, order='F'), * shape, order='C' # <<<<<<<<<<<<<< * ) * return index */ - if (unlikely(!__pyx_cur_scope->__pyx_v_shape)) { __Pyx_RaiseClosureNameError("shape"); __PYX_ERR(0, 758, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_v_shape)) { __Pyx_RaiseClosureNameError("shape"); __PYX_ERR(0, 774, __pyx_L1_error) } - /* "fastremap.pyx":756 + /* "fastremap.pyx":772 * def c_order_index(index): * if len(shape) > 1 and fortran_order: * return np.ravel_multi_index( # <<<<<<<<<<<<<< * np.unravel_index(index, shape, order='F'), * shape, order='C' */ - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 756, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); @@ -90123,25 +92865,25 @@ static PyObject *__pyx_pf_9fastremap_6unique_c_order_index(PyObject *__pyx_self, PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_cur_scope->__pyx_v_shape); __pyx_t_8 = 0; - /* "fastremap.pyx":758 + /* "fastremap.pyx":774 * return np.ravel_multi_index( * np.unravel_index(index, shape, order='F'), * shape, order='C' # <<<<<<<<<<<<<< * ) * return index */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 758, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_order, __pyx_n_u_C) < 0) __PYX_ERR(0, 758, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_order, __pyx_n_u_C) < 0) __PYX_ERR(0, 774, __pyx_L1_error) - /* "fastremap.pyx":756 + /* "fastremap.pyx":772 * def c_order_index(index): * if len(shape) > 1 and fortran_order: * return np.ravel_multi_index( # <<<<<<<<<<<<<< * np.unravel_index(index, shape, order='F'), * shape, order='C' */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -90150,7 +92892,7 @@ static PyObject *__pyx_pf_9fastremap_6unique_c_order_index(PyObject *__pyx_self, __pyx_t_2 = 0; goto __pyx_L0; - /* "fastremap.pyx":755 + /* "fastremap.pyx":771 * * def c_order_index(index): * if len(shape) > 1 and fortran_order: # <<<<<<<<<<<<<< @@ -90159,7 +92901,7 @@ static PyObject *__pyx_pf_9fastremap_6unique_c_order_index(PyObject *__pyx_self, */ } - /* "fastremap.pyx":760 + /* "fastremap.pyx":776 * shape, order='C' * ) * return index # <<<<<<<<<<<<<< @@ -90171,7 +92913,7 @@ static PyObject *__pyx_pf_9fastremap_6unique_c_order_index(PyObject *__pyx_self, __pyx_r = __pyx_v_index; goto __pyx_L0; - /* "fastremap.pyx":754 + /* "fastremap.pyx":770 * min_label, max_label = (0, 0) * * def c_order_index(index): # <<<<<<<<<<<<<< @@ -90194,7 +92936,7 @@ static PyObject *__pyx_pf_9fastremap_6unique_c_order_index(PyObject *__pyx_self, return __pyx_r; } -/* "fastremap.pyx":712 +/* "fastremap.pyx":728 * return pairs * * def unique(labels, return_index=False, return_inverse=False, return_counts=False, axis=None): # <<<<<<<<<<<<<< @@ -90240,29 +92982,29 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_9fastremap___pyx_scope_struct__unique *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 712, __pyx_L1_error) + __PYX_ERR(0, 728, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __Pyx_INCREF(__pyx_v_labels); - /* "fastremap.pyx":726 + /* "fastremap.pyx":742 * return unique_labels * """ * if not np.issubdtype(labels.dtype, np.integer): # <<<<<<<<<<<<<< * raise TypeError("fastremap.unique only supports integer types.") * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_issubdtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_issubdtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 726, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_integer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_integer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -90280,7 +93022,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_t_5}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 742, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -90290,7 +93032,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_t_5}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 742, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -90298,7 +93040,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self } else #endif { - __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -90309,30 +93051,30 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 742, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = ((!__pyx_t_8) != 0); if (unlikely(__pyx_t_9)) { - /* "fastremap.pyx":727 + /* "fastremap.pyx":743 * """ * if not np.issubdtype(labels.dtype, np.integer): * raise TypeError("fastremap.unique only supports integer types.") # <<<<<<<<<<<<<< * * # These flags are currently unsupported so call uncle and */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 727, __pyx_L1_error) + __PYX_ERR(0, 743, __pyx_L1_error) - /* "fastremap.pyx":726 + /* "fastremap.pyx":742 * return unique_labels * """ * if not np.issubdtype(labels.dtype, np.integer): # <<<<<<<<<<<<<< @@ -90341,14 +93083,14 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self */ } - /* "fastremap.pyx":731 + /* "fastremap.pyx":747 * # These flags are currently unsupported so call uncle and * # use the standard implementation instead. * if return_inverse or (axis is not None): # <<<<<<<<<<<<<< * return np.unique( * labels, */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_inverse); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 731, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_inverse); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 747, __pyx_L1_error) if (!__pyx_t_8) { } else { __pyx_t_9 = __pyx_t_8; @@ -90360,7 +93102,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __pyx_L5_bool_binop_done:; if (__pyx_t_9) { - /* "fastremap.pyx":732 + /* "fastremap.pyx":748 * # use the standard implementation instead. * if return_inverse or (axis is not None): * return np.unique( # <<<<<<<<<<<<<< @@ -90368,71 +93110,71 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self * return_index=return_index, */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 732, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_unique); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 732, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_unique); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":733 + /* "fastremap.pyx":749 * if return_inverse or (axis is not None): * return np.unique( * labels, # <<<<<<<<<<<<<< * return_index=return_index, * return_inverse=return_inverse, */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 732, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_labels); __Pyx_GIVEREF(__pyx_v_labels); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_labels); - /* "fastremap.pyx":734 + /* "fastremap.pyx":750 * return np.unique( * labels, * return_index=return_index, # <<<<<<<<<<<<<< * return_inverse=return_inverse, * return_counts=return_counts, */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 734, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return_index, __pyx_v_return_index) < 0) __PYX_ERR(0, 734, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return_index, __pyx_v_return_index) < 0) __PYX_ERR(0, 750, __pyx_L1_error) - /* "fastremap.pyx":735 + /* "fastremap.pyx":751 * labels, * return_index=return_index, * return_inverse=return_inverse, # <<<<<<<<<<<<<< * return_counts=return_counts, * axis=axis */ - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return_inverse, __pyx_v_return_inverse) < 0) __PYX_ERR(0, 734, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return_inverse, __pyx_v_return_inverse) < 0) __PYX_ERR(0, 750, __pyx_L1_error) - /* "fastremap.pyx":736 + /* "fastremap.pyx":752 * return_index=return_index, * return_inverse=return_inverse, * return_counts=return_counts, # <<<<<<<<<<<<<< * axis=axis * ) */ - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return_counts, __pyx_v_return_counts) < 0) __PYX_ERR(0, 734, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return_counts, __pyx_v_return_counts) < 0) __PYX_ERR(0, 750, __pyx_L1_error) - /* "fastremap.pyx":737 + /* "fastremap.pyx":753 * return_inverse=return_inverse, * return_counts=return_counts, * axis=axis # <<<<<<<<<<<<<< * ) * */ - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_axis, __pyx_v_axis) < 0) __PYX_ERR(0, 734, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_axis, __pyx_v_axis) < 0) __PYX_ERR(0, 750, __pyx_L1_error) - /* "fastremap.pyx":732 + /* "fastremap.pyx":748 * # use the standard implementation instead. * if return_inverse or (axis is not None): * return np.unique( # <<<<<<<<<<<<<< * labels, * return_index=return_index, */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 732, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -90441,7 +93183,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_5 = 0; goto __pyx_L0; - /* "fastremap.pyx":731 + /* "fastremap.pyx":747 * # These flags are currently unsupported so call uncle and * # use the standard implementation instead. * if return_inverse or (axis is not None): # <<<<<<<<<<<<<< @@ -90450,49 +93192,49 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self */ } - /* "fastremap.pyx":740 + /* "fastremap.pyx":756 * ) * * cdef size_t voxels = labels.size # <<<<<<<<<<<<<< * * shape = labels.shape */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 740, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 756, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_11 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 740, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_11 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 756, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_voxels = __pyx_t_11; - /* "fastremap.pyx":742 + /* "fastremap.pyx":758 * cdef size_t voxels = labels.size * * shape = labels.shape # <<<<<<<<<<<<<< * fortran_order = labels.flags['F_CONTIGUOUS'] * labels_orig = labels */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 742, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_v_shape = __pyx_t_5; __pyx_t_5 = 0; - /* "fastremap.pyx":743 + /* "fastremap.pyx":759 * * shape = labels.shape * fortran_order = labels.flags['F_CONTIGUOUS'] # <<<<<<<<<<<<<< * labels_orig = labels * labels = reshape(labels, (voxels,)) */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_flags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 743, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_flags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 743, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_v_fortran_order = __pyx_t_7; __pyx_t_7 = 0; - /* "fastremap.pyx":744 + /* "fastremap.pyx":760 * shape = labels.shape * fortran_order = labels.flags['F_CONTIGUOUS'] * labels_orig = labels # <<<<<<<<<<<<<< @@ -90502,18 +93244,18 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __Pyx_INCREF(__pyx_v_labels); __pyx_v_labels_orig = __pyx_v_labels; - /* "fastremap.pyx":745 + /* "fastremap.pyx":761 * fortran_order = labels.flags['F_CONTIGUOUS'] * labels_orig = labels * labels = reshape(labels, (voxels,)) # <<<<<<<<<<<<<< * * cdef int64_t max_label */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 745, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 745, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 745, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); @@ -90533,7 +93275,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_labels, __pyx_t_3}; - __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 745, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -90542,14 +93284,14 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_labels, __pyx_t_3}; - __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 745, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_2 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 745, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = NULL; @@ -90560,7 +93302,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_6, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 745, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -90568,7 +93310,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __Pyx_DECREF_SET(__pyx_v_labels, __pyx_t_7); __pyx_t_7 = 0; - /* "fastremap.pyx":749 + /* "fastremap.pyx":765 * cdef int64_t max_label * cdef int64_t min_label * if voxels > 0: # <<<<<<<<<<<<<< @@ -90578,14 +93320,14 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_9 = ((__pyx_v_voxels > 0) != 0); if (__pyx_t_9) { - /* "fastremap.pyx":750 + /* "fastremap.pyx":766 * cdef int64_t min_label * if voxels > 0: * min_label, max_label = minmax(labels) # <<<<<<<<<<<<<< * else: * min_label, max_label = (0, 0) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_minmax_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 750, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_minmax_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -90599,7 +93341,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self } __pyx_t_7 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_v_labels) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_labels); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 750, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) { @@ -90608,7 +93350,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 750, __pyx_L1_error) + __PYX_ERR(0, 766, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -90621,15 +93363,15 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 750, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 750, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { Py_ssize_t index = -1; - __pyx_t_3 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 750, __pyx_L1_error) + __pyx_t_3 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_12 = Py_TYPE(__pyx_t_3)->tp_iternext; @@ -90637,7 +93379,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_2 = __pyx_t_12(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_3), 2) < 0) __PYX_ERR(0, 750, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_3), 2) < 0) __PYX_ERR(0, 766, __pyx_L1_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L9_unpacking_done; @@ -90645,17 +93387,17 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 750, __pyx_L1_error) + __PYX_ERR(0, 766, __pyx_L1_error) __pyx_L9_unpacking_done:; } - __pyx_t_13 = __Pyx_PyInt_As_int64_t(__pyx_t_5); if (unlikely((__pyx_t_13 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 750, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyInt_As_int64_t(__pyx_t_5); if (unlikely((__pyx_t_13 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_14 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_14 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 750, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_14 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_min_label = __pyx_t_13; __pyx_v_max_label = __pyx_t_14; - /* "fastremap.pyx":749 + /* "fastremap.pyx":765 * cdef int64_t max_label * cdef int64_t min_label * if voxels > 0: # <<<<<<<<<<<<<< @@ -90665,7 +93407,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L7; } - /* "fastremap.pyx":752 + /* "fastremap.pyx":768 * min_label, max_label = minmax(labels) * else: * min_label, max_label = (0, 0) # <<<<<<<<<<<<<< @@ -90680,19 +93422,19 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L7:; - /* "fastremap.pyx":754 + /* "fastremap.pyx":770 * min_label, max_label = (0, 0) * * def c_order_index(index): # <<<<<<<<<<<<<< * if len(shape) > 1 and fortran_order: * return np.ravel_multi_index( */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9fastremap_6unique_1c_order_index, 0, __pyx_n_s_unique_locals_c_order_index, ((PyObject*)__pyx_cur_scope), __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 754, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9fastremap_6unique_1c_order_index, 0, __pyx_n_s_unique_locals_c_order_index, ((PyObject*)__pyx_cur_scope), __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 770, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_c_order_index = __pyx_t_7; __pyx_t_7 = 0; - /* "fastremap.pyx":762 + /* "fastremap.pyx":778 * return index * * if voxels == 0: # <<<<<<<<<<<<<< @@ -90702,32 +93444,32 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_9 = ((__pyx_v_voxels == 0) != 0); if (__pyx_t_9) { - /* "fastremap.pyx":763 + /* "fastremap.pyx":779 * * if voxels == 0: * uniq = np.array([], dtype=labels.dtype) # <<<<<<<<<<<<<< * counts = np.array([], dtype=np.uint32) * index = np.array([], dtype=np.uint64) */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 763, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 763, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -90735,35 +93477,35 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __pyx_v_uniq = __pyx_t_3; __pyx_t_3 = 0; - /* "fastremap.pyx":764 + /* "fastremap.pyx":780 * if voxels == 0: * uniq = np.array([], dtype=labels.dtype) * counts = np.array([], dtype=np.uint32) # <<<<<<<<<<<<<< * index = np.array([], dtype=np.uint64) * elif min_label >= 0 and max_label < voxels: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 764, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 764, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 764, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 764, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 764, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 764, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -90771,35 +93513,35 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __pyx_v_counts = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":765 + /* "fastremap.pyx":781 * uniq = np.array([], dtype=labels.dtype) * counts = np.array([], dtype=np.uint32) * index = np.array([], dtype=np.uint64) # <<<<<<<<<<<<<< * elif min_label >= 0 and max_label < voxels: * uniq, index, counts = unique_via_array(labels, max_label, return_index=return_index) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 765, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 765, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 765, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 765, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -90807,7 +93549,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __pyx_v_index = __pyx_t_2; __pyx_t_2 = 0; - /* "fastremap.pyx":762 + /* "fastremap.pyx":778 * return index * * if voxels == 0: # <<<<<<<<<<<<<< @@ -90817,7 +93559,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L10; } - /* "fastremap.pyx":766 + /* "fastremap.pyx":782 * counts = np.array([], dtype=np.uint32) * index = np.array([], dtype=np.uint64) * elif min_label >= 0 and max_label < voxels: # <<<<<<<<<<<<<< @@ -90835,18 +93577,18 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __pyx_L11_bool_binop_done:; if (__pyx_t_9) { - /* "fastremap.pyx":767 + /* "fastremap.pyx":783 * index = np.array([], dtype=np.uint64) * elif min_label >= 0 and max_label < voxels: * uniq, index, counts = unique_via_array(labels, max_label, return_index=return_index) # <<<<<<<<<<<<<< * elif (max_label - min_label) <= voxels: * uniq, index, counts = unique_via_shifted_array(labels, min_label, max_label, return_index=return_index) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_unique_via_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_unique_via_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_max_label); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 767, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_max_label); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 767, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_labels); __Pyx_GIVEREF(__pyx_v_labels); @@ -90854,10 +93596,10 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 767, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_return_index, __pyx_v_return_index) < 0) __PYX_ERR(0, 767, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 767, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_return_index, __pyx_v_return_index) < 0) __PYX_ERR(0, 783, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -90868,7 +93610,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 767, __pyx_L1_error) + __PYX_ERR(0, 783, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -90884,17 +93626,17 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 767, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 767, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 767, __pyx_L1_error) + __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = Py_TYPE(__pyx_t_7)->tp_iternext; @@ -90904,7 +93646,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_2 = __pyx_t_12(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L13_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_7), 3) < 0) __PYX_ERR(0, 767, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_7), 3) < 0) __PYX_ERR(0, 783, __pyx_L1_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L14_unpacking_done; @@ -90912,7 +93654,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 767, __pyx_L1_error) + __PYX_ERR(0, 783, __pyx_L1_error) __pyx_L14_unpacking_done:; } __pyx_v_uniq = __pyx_t_1; @@ -90922,7 +93664,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __pyx_v_counts = __pyx_t_2; __pyx_t_2 = 0; - /* "fastremap.pyx":766 + /* "fastremap.pyx":782 * counts = np.array([], dtype=np.uint32) * index = np.array([], dtype=np.uint64) * elif min_label >= 0 and max_label < voxels: # <<<<<<<<<<<<<< @@ -90932,7 +93674,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L10; } - /* "fastremap.pyx":768 + /* "fastremap.pyx":784 * elif min_label >= 0 and max_label < voxels: * uniq, index, counts = unique_via_array(labels, max_label, return_index=return_index) * elif (max_label - min_label) <= voxels: # <<<<<<<<<<<<<< @@ -90942,20 +93684,20 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_9 = (((__pyx_v_max_label - __pyx_v_min_label) <= ((int64_t)__pyx_v_voxels)) != 0); if (__pyx_t_9) { - /* "fastremap.pyx":769 + /* "fastremap.pyx":785 * uniq, index, counts = unique_via_array(labels, max_label, return_index=return_index) * elif (max_label - min_label) <= voxels: * uniq, index, counts = unique_via_shifted_array(labels, min_label, max_label, return_index=return_index) # <<<<<<<<<<<<<< * elif float(pixel_pairs(labels)) / float(voxels) > 0.66: * uniq, index, counts = unique_via_renumber(labels, return_index=return_index) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_unique_via_shifted_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 769, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_unique_via_shifted_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_min_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 769, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_min_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_max_label); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 769, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_max_label); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 769, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_labels); __Pyx_GIVEREF(__pyx_v_labels); @@ -90966,10 +93708,10 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 769, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return_index, __pyx_v_return_index) < 0) __PYX_ERR(0, 769, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 769, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return_index, __pyx_v_return_index) < 0) __PYX_ERR(0, 785, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -90980,7 +93722,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 769, __pyx_L1_error) + __PYX_ERR(0, 785, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -90996,17 +93738,17 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 769, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 769, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 769, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 769, __pyx_L1_error) + __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_12 = Py_TYPE(__pyx_t_7)->tp_iternext; @@ -91016,7 +93758,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_3 = __pyx_t_12(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_7), 3) < 0) __PYX_ERR(0, 769, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_7), 3) < 0) __PYX_ERR(0, 785, __pyx_L1_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L16_unpacking_done; @@ -91024,7 +93766,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 769, __pyx_L1_error) + __PYX_ERR(0, 785, __pyx_L1_error) __pyx_L16_unpacking_done:; } __pyx_v_uniq = __pyx_t_5; @@ -91034,7 +93776,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __pyx_v_counts = __pyx_t_3; __pyx_t_3 = 0; - /* "fastremap.pyx":768 + /* "fastremap.pyx":784 * elif min_label >= 0 and max_label < voxels: * uniq, index, counts = unique_via_array(labels, max_label, return_index=return_index) * elif (max_label - min_label) <= voxels: # <<<<<<<<<<<<<< @@ -91044,14 +93786,14 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L10; } - /* "fastremap.pyx":770 + /* "fastremap.pyx":786 * elif (max_label - min_label) <= voxels: * uniq, index, counts = unique_via_shifted_array(labels, min_label, max_label, return_index=return_index) * elif float(pixel_pairs(labels)) / float(voxels) > 0.66: # <<<<<<<<<<<<<< * uniq, index, counts = unique_via_renumber(labels, return_index=return_index) * elif return_index: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pixel_pairs_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 770, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pixel_pairs_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -91065,36 +93807,36 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_labels) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_labels); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 770, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_15 = __Pyx_PyObject_AsDouble(__pyx_t_2); if (unlikely(__pyx_t_15 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 770, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_AsDouble(__pyx_t_2); if (unlikely(__pyx_t_15 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(((double)__pyx_v_voxels) == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 770, __pyx_L1_error) + __PYX_ERR(0, 786, __pyx_L1_error) } __pyx_t_9 = (((__pyx_t_15 / ((double)__pyx_v_voxels)) > 0.66) != 0); if (__pyx_t_9) { - /* "fastremap.pyx":771 + /* "fastremap.pyx":787 * uniq, index, counts = unique_via_shifted_array(labels, min_label, max_label, return_index=return_index) * elif float(pixel_pairs(labels)) / float(voxels) > 0.66: * uniq, index, counts = unique_via_renumber(labels, return_index=return_index) # <<<<<<<<<<<<<< * elif return_index: * return np.unique(labels_orig, return_index=return_index, return_counts=return_counts) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_unique_via_renumber); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 771, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_unique_via_renumber); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 771, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_labels); __Pyx_GIVEREF(__pyx_v_labels); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_labels); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 771, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_return_index, __pyx_v_return_index) < 0) __PYX_ERR(0, 771, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 771, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_return_index, __pyx_v_return_index) < 0) __PYX_ERR(0, 787, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -91105,7 +93847,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 771, __pyx_L1_error) + __PYX_ERR(0, 787, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -91121,17 +93863,17 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 771, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 771, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 771, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 771, __pyx_L1_error) + __pyx_t_7 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_12 = Py_TYPE(__pyx_t_7)->tp_iternext; @@ -91141,7 +93883,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_2 = __pyx_t_12(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L17_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_7), 3) < 0) __PYX_ERR(0, 771, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_7), 3) < 0) __PYX_ERR(0, 787, __pyx_L1_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L18_unpacking_done; @@ -91149,7 +93891,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 771, __pyx_L1_error) + __PYX_ERR(0, 787, __pyx_L1_error) __pyx_L18_unpacking_done:; } __pyx_v_uniq = __pyx_t_1; @@ -91159,7 +93901,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __pyx_v_counts = __pyx_t_2; __pyx_t_2 = 0; - /* "fastremap.pyx":770 + /* "fastremap.pyx":786 * elif (max_label - min_label) <= voxels: * uniq, index, counts = unique_via_shifted_array(labels, min_label, max_label, return_index=return_index) * elif float(pixel_pairs(labels)) / float(voxels) > 0.66: # <<<<<<<<<<<<<< @@ -91169,17 +93911,17 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L10; } - /* "fastremap.pyx":772 + /* "fastremap.pyx":788 * elif float(pixel_pairs(labels)) / float(voxels) > 0.66: * uniq, index, counts = unique_via_renumber(labels, return_index=return_index) * elif return_index: # <<<<<<<<<<<<<< * return np.unique(labels_orig, return_index=return_index, return_counts=return_counts) * else: */ - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 772, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 788, __pyx_L1_error) if (__pyx_t_9) { - /* "fastremap.pyx":773 + /* "fastremap.pyx":789 * uniq, index, counts = unique_via_renumber(labels, return_index=return_index) * elif return_index: * return np.unique(labels_orig, return_index=return_index, return_counts=return_counts) # <<<<<<<<<<<<<< @@ -91187,21 +93929,21 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self * uniq, counts = unique_via_sort(labels) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 773, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_unique); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 773, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_unique); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 773, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_labels_orig); __Pyx_GIVEREF(__pyx_v_labels_orig); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_labels_orig); - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 773, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return_index, __pyx_v_return_index) < 0) __PYX_ERR(0, 773, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return_counts, __pyx_v_return_counts) < 0) __PYX_ERR(0, 773, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 773, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return_index, __pyx_v_return_index) < 0) __PYX_ERR(0, 789, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return_counts, __pyx_v_return_counts) < 0) __PYX_ERR(0, 789, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -91210,7 +93952,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":772 + /* "fastremap.pyx":788 * elif float(pixel_pairs(labels)) / float(voxels) > 0.66: * uniq, index, counts = unique_via_renumber(labels, return_index=return_index) * elif return_index: # <<<<<<<<<<<<<< @@ -91219,7 +93961,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self */ } - /* "fastremap.pyx":775 + /* "fastremap.pyx":791 * return np.unique(labels_orig, return_index=return_index, return_counts=return_counts) * else: * uniq, counts = unique_via_sort(labels) # <<<<<<<<<<<<<< @@ -91227,7 +93969,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self * results = [ uniq ] */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_unique_via_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 775, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_unique_via_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -91241,7 +93983,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_labels) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_labels); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 775, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -91250,7 +93992,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 775, __pyx_L1_error) + __PYX_ERR(0, 791, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -91263,15 +94005,15 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 775, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 775, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 775, __pyx_L1_error) + __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext; @@ -91279,7 +94021,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_5 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_5)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_2), 2) < 0) __PYX_ERR(0, 775, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_2), 2) < 0) __PYX_ERR(0, 791, __pyx_L1_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L20_unpacking_done; @@ -91287,7 +94029,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 775, __pyx_L1_error) + __PYX_ERR(0, 791, __pyx_L1_error) __pyx_L20_unpacking_done:; } __pyx_v_uniq = __pyx_t_3; @@ -91297,14 +94039,14 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L10:; - /* "fastremap.pyx":777 + /* "fastremap.pyx":793 * uniq, counts = unique_via_sort(labels) * * results = [ uniq ] # <<<<<<<<<<<<<< * if return_index: * # This is required to match numpy's behavior */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 777, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_uniq); __Pyx_GIVEREF(__pyx_v_uniq); @@ -91312,30 +94054,30 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __pyx_v_results = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":778 + /* "fastremap.pyx":794 * * results = [ uniq ] * if return_index: # <<<<<<<<<<<<<< * # This is required to match numpy's behavior * results.append(c_order_index(index)) */ - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 778, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 794, __pyx_L1_error) if (__pyx_t_9) { - /* "fastremap.pyx":780 + /* "fastremap.pyx":796 * if return_index: * # This is required to match numpy's behavior * results.append(c_order_index(index)) # <<<<<<<<<<<<<< * if return_counts: * results.append(counts) */ - if (unlikely(!__pyx_v_index)) { __Pyx_RaiseUnboundLocalError("index"); __PYX_ERR(0, 780, __pyx_L1_error) } - __pyx_t_1 = __pyx_pf_9fastremap_6unique_c_order_index(__pyx_v_c_order_index, __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 780, __pyx_L1_error) + if (unlikely(!__pyx_v_index)) { __Pyx_RaiseUnboundLocalError("index"); __PYX_ERR(0, 796, __pyx_L1_error) } + __pyx_t_1 = __pyx_pf_9fastremap_6unique_c_order_index(__pyx_v_c_order_index, __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_results, __pyx_t_1); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 780, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_results, __pyx_t_1); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 796, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":778 + /* "fastremap.pyx":794 * * results = [ uniq ] * if return_index: # <<<<<<<<<<<<<< @@ -91344,26 +94086,26 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self */ } - /* "fastremap.pyx":781 + /* "fastremap.pyx":797 * # This is required to match numpy's behavior * results.append(c_order_index(index)) * if return_counts: # <<<<<<<<<<<<<< * results.append(counts) * */ - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_return_counts); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 781, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_return_counts); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 797, __pyx_L1_error) if (__pyx_t_9) { - /* "fastremap.pyx":782 + /* "fastremap.pyx":798 * results.append(c_order_index(index)) * if return_counts: * results.append(counts) # <<<<<<<<<<<<<< * * if len(results) > 1: */ - __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_results, __pyx_v_counts); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 782, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_results, __pyx_v_counts); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 798, __pyx_L1_error) - /* "fastremap.pyx":781 + /* "fastremap.pyx":797 * # This is required to match numpy's behavior * results.append(c_order_index(index)) * if return_counts: # <<<<<<<<<<<<<< @@ -91372,18 +94114,18 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self */ } - /* "fastremap.pyx":784 + /* "fastremap.pyx":800 * results.append(counts) * * if len(results) > 1: # <<<<<<<<<<<<<< * return tuple(results) * return uniq */ - __pyx_t_17 = PyList_GET_SIZE(__pyx_v_results); if (unlikely(__pyx_t_17 == ((Py_ssize_t)-1))) __PYX_ERR(0, 784, __pyx_L1_error) + __pyx_t_17 = PyList_GET_SIZE(__pyx_v_results); if (unlikely(__pyx_t_17 == ((Py_ssize_t)-1))) __PYX_ERR(0, 800, __pyx_L1_error) __pyx_t_9 = ((__pyx_t_17 > 1) != 0); if (__pyx_t_9) { - /* "fastremap.pyx":785 + /* "fastremap.pyx":801 * * if len(results) > 1: * return tuple(results) # <<<<<<<<<<<<<< @@ -91391,13 +94133,13 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_AsTuple(__pyx_v_results); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L1_error) + __pyx_t_1 = PyList_AsTuple(__pyx_v_results); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":784 + /* "fastremap.pyx":800 * results.append(counts) * * if len(results) > 1: # <<<<<<<<<<<<<< @@ -91406,7 +94148,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self */ } - /* "fastremap.pyx":786 + /* "fastremap.pyx":802 * if len(results) > 1: * return tuple(results) * return uniq # <<<<<<<<<<<<<< @@ -91418,7 +94160,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = __pyx_v_uniq; goto __pyx_L0; - /* "fastremap.pyx":712 + /* "fastremap.pyx":728 * return pairs * * def unique(labels, return_index=False, return_inverse=False, return_counts=False, axis=None): # <<<<<<<<<<<<<< @@ -91450,7 +94192,7 @@ static PyObject *__pyx_pf_9fastremap_40unique(CYTHON_UNUSED PyObject *__pyx_self return __pyx_r; } -/* "fastremap.pyx":788 +/* "fastremap.pyx":804 * return uniq * * def unique_via_shifted_array(labels, min_label=None, max_label=None, return_index=False): # <<<<<<<<<<<<<< @@ -91518,7 +94260,7 @@ static PyObject *__pyx_pw_9fastremap_43unique_via_shifted_array(PyObject *__pyx_ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unique_via_shifted_array") < 0)) __PYX_ERR(0, 788, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unique_via_shifted_array") < 0)) __PYX_ERR(0, 804, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -91540,7 +94282,7 @@ static PyObject *__pyx_pw_9fastremap_43unique_via_shifted_array(PyObject *__pyx_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("unique_via_shifted_array", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 788, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("unique_via_shifted_array", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 804, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.unique_via_shifted_array", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -91577,7 +94319,7 @@ static PyObject *__pyx_pf_9fastremap_42unique_via_shifted_array(CYTHON_UNUSED Py __Pyx_INCREF(__pyx_v_min_label); __Pyx_INCREF(__pyx_v_max_label); - /* "fastremap.pyx":789 + /* "fastremap.pyx":805 * * def unique_via_shifted_array(labels, min_label=None, max_label=None, return_index=False): * if min_label is None or max_label is None: # <<<<<<<<<<<<<< @@ -91597,14 +94339,14 @@ static PyObject *__pyx_pf_9fastremap_42unique_via_shifted_array(CYTHON_UNUSED Py __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "fastremap.pyx":790 + /* "fastremap.pyx":806 * def unique_via_shifted_array(labels, min_label=None, max_label=None, return_index=False): * if min_label is None or max_label is None: * min_label, max_label = minmax(labels) # <<<<<<<<<<<<<< * * labels -= min_label */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_minmax_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 790, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_minmax_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -91618,7 +94360,7 @@ static PyObject *__pyx_pf_9fastremap_42unique_via_shifted_array(CYTHON_UNUSED Py } __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_labels) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_labels); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 790, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { @@ -91627,7 +94369,7 @@ static PyObject *__pyx_pf_9fastremap_42unique_via_shifted_array(CYTHON_UNUSED Py if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 790, __pyx_L1_error) + __PYX_ERR(0, 806, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -91640,15 +94382,15 @@ static PyObject *__pyx_pf_9fastremap_42unique_via_shifted_array(CYTHON_UNUSED Py __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 790, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 790, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 790, __pyx_L1_error) + __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; @@ -91656,7 +94398,7 @@ static PyObject *__pyx_pf_9fastremap_42unique_via_shifted_array(CYTHON_UNUSED Py __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 790, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 806, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L7_unpacking_done; @@ -91664,7 +94406,7 @@ static PyObject *__pyx_pf_9fastremap_42unique_via_shifted_array(CYTHON_UNUSED Py __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 790, __pyx_L1_error) + __PYX_ERR(0, 806, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_min_label, __pyx_t_5); @@ -91672,7 +94414,7 @@ static PyObject *__pyx_pf_9fastremap_42unique_via_shifted_array(CYTHON_UNUSED Py __Pyx_DECREF_SET(__pyx_v_max_label, __pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":789 + /* "fastremap.pyx":805 * * def unique_via_shifted_array(labels, min_label=None, max_label=None, return_index=False): * if min_label is None or max_label is None: # <<<<<<<<<<<<<< @@ -91681,30 +94423,30 @@ static PyObject *__pyx_pf_9fastremap_42unique_via_shifted_array(CYTHON_UNUSED Py */ } - /* "fastremap.pyx":792 + /* "fastremap.pyx":808 * min_label, max_label = minmax(labels) * * labels -= min_label # <<<<<<<<<<<<<< * uniq, idx, counts = unique_via_array(labels, max_label - min_label + 1, return_index) * labels += min_label */ - __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_v_labels, __pyx_v_min_label); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 792, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_v_labels, __pyx_v_min_label); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 808, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_labels, __pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":793 + /* "fastremap.pyx":809 * * labels -= min_label * uniq, idx, counts = unique_via_array(labels, max_label - min_label + 1, return_index) # <<<<<<<<<<<<<< * labels += min_label * uniq += min_label */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_unique_via_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_unique_via_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyNumber_Subtract(__pyx_v_max_label, __pyx_v_min_label); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 793, __pyx_L1_error) + __pyx_t_5 = PyNumber_Subtract(__pyx_v_max_label, __pyx_v_min_label); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_5, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 793, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_5, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -91722,7 +94464,7 @@ static PyObject *__pyx_pf_9fastremap_42unique_via_shifted_array(CYTHON_UNUSED Py #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_labels, __pyx_t_7, __pyx_v_return_index}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 793, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -91731,14 +94473,14 @@ static PyObject *__pyx_pf_9fastremap_42unique_via_shifted_array(CYTHON_UNUSED Py #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_labels, __pyx_t_7, __pyx_v_return_index}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 793, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { - __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 793, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -91752,7 +94494,7 @@ static PyObject *__pyx_pf_9fastremap_42unique_via_shifted_array(CYTHON_UNUSED Py __Pyx_GIVEREF(__pyx_v_return_index); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_v_return_index); __pyx_t_7 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 793, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } @@ -91763,7 +94505,7 @@ static PyObject *__pyx_pf_9fastremap_42unique_via_shifted_array(CYTHON_UNUSED Py if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 793, __pyx_L1_error) + __PYX_ERR(0, 809, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -91779,17 +94521,17 @@ static PyObject *__pyx_pf_9fastremap_42unique_via_shifted_array(CYTHON_UNUSED Py __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_7); #else - __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 793, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 793, __pyx_L1_error) + __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 793, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 793, __pyx_L1_error) + __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; @@ -91799,7 +94541,7 @@ static PyObject *__pyx_pf_9fastremap_42unique_via_shifted_array(CYTHON_UNUSED Py __Pyx_GOTREF(__pyx_t_10); index = 2; __pyx_t_7 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_7)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_5), 3) < 0) __PYX_ERR(0, 793, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_5), 3) < 0) __PYX_ERR(0, 809, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L9_unpacking_done; @@ -91807,7 +94549,7 @@ static PyObject *__pyx_pf_9fastremap_42unique_via_shifted_array(CYTHON_UNUSED Py __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 793, __pyx_L1_error) + __PYX_ERR(0, 809, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_uniq = __pyx_t_6; @@ -91817,31 +94559,31 @@ static PyObject *__pyx_pf_9fastremap_42unique_via_shifted_array(CYTHON_UNUSED Py __pyx_v_counts = __pyx_t_7; __pyx_t_7 = 0; - /* "fastremap.pyx":794 + /* "fastremap.pyx":810 * labels -= min_label * uniq, idx, counts = unique_via_array(labels, max_label - min_label + 1, return_index) * labels += min_label # <<<<<<<<<<<<<< * uniq += min_label * return uniq, idx, counts */ - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_labels, __pyx_v_min_label); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 794, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_labels, __pyx_v_min_label); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_labels, __pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":795 + /* "fastremap.pyx":811 * uniq, idx, counts = unique_via_array(labels, max_label - min_label + 1, return_index) * labels += min_label * uniq += min_label # <<<<<<<<<<<<<< * return uniq, idx, counts * */ - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_uniq, __pyx_v_min_label); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 795, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_uniq, __pyx_v_min_label); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_uniq, __pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":796 + /* "fastremap.pyx":812 * labels += min_label * uniq += min_label * return uniq, idx, counts # <<<<<<<<<<<<<< @@ -91849,7 +94591,7 @@ static PyObject *__pyx_pf_9fastremap_42unique_via_shifted_array(CYTHON_UNUSED Py * def unique_via_renumber(labels, return_index=False): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 796, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_uniq); __Pyx_GIVEREF(__pyx_v_uniq); @@ -91864,7 +94606,7 @@ static PyObject *__pyx_pf_9fastremap_42unique_via_shifted_array(CYTHON_UNUSED Py __pyx_t_4 = 0; goto __pyx_L0; - /* "fastremap.pyx":788 + /* "fastremap.pyx":804 * return uniq * * def unique_via_shifted_array(labels, min_label=None, max_label=None, return_index=False): # <<<<<<<<<<<<<< @@ -91893,7 +94635,7 @@ static PyObject *__pyx_pf_9fastremap_42unique_via_shifted_array(CYTHON_UNUSED Py return __pyx_r; } -/* "fastremap.pyx":798 +/* "fastremap.pyx":814 * return uniq, idx, counts * * def unique_via_renumber(labels, return_index=False): # <<<<<<<<<<<<<< @@ -91941,7 +94683,7 @@ static PyObject *__pyx_pw_9fastremap_45unique_via_renumber(PyObject *__pyx_self, } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unique_via_renumber") < 0)) __PYX_ERR(0, 798, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unique_via_renumber") < 0)) __PYX_ERR(0, 814, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -91957,7 +94699,7 @@ static PyObject *__pyx_pw_9fastremap_45unique_via_renumber(PyObject *__pyx_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("unique_via_renumber", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 798, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("unique_via_renumber", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 814, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.unique_via_renumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -91976,9 +94718,9 @@ static PyObject *__pyx_pf_9fastremap_44unique_via_renumber(CYTHON_UNUSED PyObjec PyObject *__pyx_v_uniq = NULL; PyObject *__pyx_v_idx = NULL; PyObject *__pyx_v_counts = NULL; - PyObject *__pyx_8genexpr4__pyx_v_k = NULL; - PyObject *__pyx_8genexpr4__pyx_v_v = NULL; - PyObject *__pyx_8genexpr5__pyx_v_segid = NULL; + PyObject *__pyx_9genexpr14__pyx_v_k = NULL; + PyObject *__pyx_9genexpr14__pyx_v_v = NULL; + PyObject *__pyx_9genexpr15__pyx_v_segid = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -91998,26 +94740,26 @@ static PyObject *__pyx_pf_9fastremap_44unique_via_renumber(CYTHON_UNUSED PyObjec __Pyx_RefNannySetupContext("unique_via_renumber", 0); __Pyx_INCREF(__pyx_v_labels); - /* "fastremap.pyx":799 + /* "fastremap.pyx":815 * * def unique_via_renumber(labels, return_index=False): * dtype = labels.dtype # <<<<<<<<<<<<<< * labels, remap = renumber(labels) * remap = { v:k for k,v in remap.items() } */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 799, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_dtype = __pyx_t_1; __pyx_t_1 = 0; - /* "fastremap.pyx":800 + /* "fastremap.pyx":816 * def unique_via_renumber(labels, return_index=False): * dtype = labels.dtype * labels, remap = renumber(labels) # <<<<<<<<<<<<<< * remap = { v:k for k,v in remap.items() } * uniq, idx, counts = unique_via_array(labels, max(remap.keys()), return_index) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_renumber_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 800, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_renumber_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -92031,7 +94773,7 @@ static PyObject *__pyx_pf_9fastremap_44unique_via_renumber(CYTHON_UNUSED PyObjec } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_labels) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_labels); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 800, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -92040,7 +94782,7 @@ static PyObject *__pyx_pf_9fastremap_44unique_via_renumber(CYTHON_UNUSED PyObjec if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 800, __pyx_L1_error) + __PYX_ERR(0, 816, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -92053,15 +94795,15 @@ static PyObject *__pyx_pf_9fastremap_44unique_via_renumber(CYTHON_UNUSED PyObjec __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 800, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 800, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 800, __pyx_L1_error) + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; @@ -92069,7 +94811,7 @@ static PyObject *__pyx_pf_9fastremap_44unique_via_renumber(CYTHON_UNUSED PyObjec __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 800, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 816, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_unpacking_done; @@ -92077,7 +94819,7 @@ static PyObject *__pyx_pf_9fastremap_44unique_via_renumber(CYTHON_UNUSED PyObjec __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 800, __pyx_L1_error) + __PYX_ERR(0, 816, __pyx_L1_error) __pyx_L4_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_labels, __pyx_t_2); @@ -92085,7 +94827,7 @@ static PyObject *__pyx_pf_9fastremap_44unique_via_renumber(CYTHON_UNUSED PyObjec __pyx_v_remap = __pyx_t_3; __pyx_t_3 = 0; - /* "fastremap.pyx":801 + /* "fastremap.pyx":817 * dtype = labels.dtype * labels, remap = renumber(labels) * remap = { v:k for k,v in remap.items() } # <<<<<<<<<<<<<< @@ -92093,14 +94835,14 @@ static PyObject *__pyx_pf_9fastremap_44unique_via_renumber(CYTHON_UNUSED PyObjec * uniq = np.array([ remap[segid] for segid in uniq ], dtype=dtype) */ { /* enter inner scope */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L7_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 0; if (unlikely(__pyx_v_remap == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 801, __pyx_L7_error) + __PYX_ERR(0, 817, __pyx_L7_error) } - __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_remap, 0, __pyx_n_s_items, (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 801, __pyx_L7_error) + __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_remap, 0, __pyx_n_s_items, (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_2; @@ -92108,38 +94850,38 @@ static PyObject *__pyx_pf_9fastremap_44unique_via_renumber(CYTHON_UNUSED PyObjec while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_7, &__pyx_t_6, &__pyx_t_2, &__pyx_t_4, NULL, __pyx_t_8); if (unlikely(__pyx_t_9 == 0)) break; - if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 801, __pyx_L7_error) + if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 817, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_k, __pyx_t_2); + __Pyx_XDECREF_SET(__pyx_9genexpr14__pyx_v_k, __pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_v, __pyx_t_4); + __Pyx_XDECREF_SET(__pyx_9genexpr14__pyx_v_v, __pyx_t_4); __pyx_t_4 = 0; - if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_8genexpr4__pyx_v_v, (PyObject*)__pyx_8genexpr4__pyx_v_k))) __PYX_ERR(0, 801, __pyx_L7_error) + if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_9genexpr14__pyx_v_v, (PyObject*)__pyx_9genexpr14__pyx_v_k))) __PYX_ERR(0, 817, __pyx_L7_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_k); __pyx_8genexpr4__pyx_v_k = 0; - __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_v); __pyx_8genexpr4__pyx_v_v = 0; + __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_k); __pyx_9genexpr14__pyx_v_k = 0; + __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_v); __pyx_9genexpr14__pyx_v_v = 0; goto __pyx_L10_exit_scope; __pyx_L7_error:; - __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_k); __pyx_8genexpr4__pyx_v_k = 0; - __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_v); __pyx_8genexpr4__pyx_v_v = 0; + __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_k); __pyx_9genexpr14__pyx_v_k = 0; + __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_v); __pyx_9genexpr14__pyx_v_v = 0; goto __pyx_L1_error; __pyx_L10_exit_scope:; } /* exit inner scope */ __Pyx_DECREF_SET(__pyx_v_remap, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":802 + /* "fastremap.pyx":818 * labels, remap = renumber(labels) * remap = { v:k for k,v in remap.items() } * uniq, idx, counts = unique_via_array(labels, max(remap.keys()), return_index) # <<<<<<<<<<<<<< * uniq = np.array([ remap[segid] for segid in uniq ], dtype=dtype) * return uniq, idx, counts */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_unique_via_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 802, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_unique_via_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_remap, __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 802, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_remap, __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -92153,10 +94895,10 @@ static PyObject *__pyx_pf_9fastremap_44unique_via_renumber(CYTHON_UNUSED PyObjec } __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 802, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 802, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -92174,7 +94916,7 @@ static PyObject *__pyx_pf_9fastremap_44unique_via_renumber(CYTHON_UNUSED PyObjec #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_labels, __pyx_t_2, __pyx_v_return_index}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 802, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -92183,14 +94925,14 @@ static PyObject *__pyx_pf_9fastremap_44unique_via_renumber(CYTHON_UNUSED PyObjec #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_labels, __pyx_t_2, __pyx_v_return_index}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 802, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { - __pyx_t_10 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 802, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -92204,7 +94946,7 @@ static PyObject *__pyx_pf_9fastremap_44unique_via_renumber(CYTHON_UNUSED PyObjec __Pyx_GIVEREF(__pyx_v_return_index); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_8, __pyx_v_return_index); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 802, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } @@ -92215,7 +94957,7 @@ static PyObject *__pyx_pf_9fastremap_44unique_via_renumber(CYTHON_UNUSED PyObjec if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 802, __pyx_L1_error) + __PYX_ERR(0, 818, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -92231,17 +94973,17 @@ static PyObject *__pyx_pf_9fastremap_44unique_via_renumber(CYTHON_UNUSED PyObjec __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_2); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 802, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 802, __pyx_L1_error) + __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 802, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 802, __pyx_L1_error) + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; @@ -92251,7 +94993,7 @@ static PyObject *__pyx_pf_9fastremap_44unique_via_renumber(CYTHON_UNUSED PyObjec __Pyx_GOTREF(__pyx_t_10); index = 2; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 3) < 0) __PYX_ERR(0, 802, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 3) < 0) __PYX_ERR(0, 818, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L12_unpacking_done; @@ -92259,7 +95001,7 @@ static PyObject *__pyx_pf_9fastremap_44unique_via_renumber(CYTHON_UNUSED PyObjec __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 802, __pyx_L1_error) + __PYX_ERR(0, 818, __pyx_L1_error) __pyx_L12_unpacking_done:; } __pyx_v_uniq = __pyx_t_3; @@ -92269,45 +95011,45 @@ static PyObject *__pyx_pf_9fastremap_44unique_via_renumber(CYTHON_UNUSED PyObjec __pyx_v_counts = __pyx_t_2; __pyx_t_2 = 0; - /* "fastremap.pyx":803 + /* "fastremap.pyx":819 * remap = { v:k for k,v in remap.items() } * uniq, idx, counts = unique_via_array(labels, max(remap.keys()), return_index) * uniq = np.array([ remap[segid] for segid in uniq ], dtype=dtype) # <<<<<<<<<<<<<< * return uniq, idx, counts * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 803, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 803, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 819, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 803, __pyx_L15_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_v_uniq)) || PyTuple_CheckExact(__pyx_v_uniq)) { __pyx_t_10 = __pyx_v_uniq; __Pyx_INCREF(__pyx_t_10); __pyx_t_7 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_v_uniq); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 803, __pyx_L15_error) + __pyx_t_7 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_v_uniq); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 819, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 803, __pyx_L15_error) + __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 819, __pyx_L15_error) } for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_10))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_10)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 803, __pyx_L15_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 819, __pyx_L15_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_10, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 803, __pyx_L15_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_10, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 819, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_10)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 803, __pyx_L15_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 819, __pyx_L15_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_10, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 803, __pyx_L15_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_10, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 819, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -92317,36 +95059,36 @@ static PyObject *__pyx_pf_9fastremap_44unique_via_renumber(CYTHON_UNUSED PyObjec PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 803, __pyx_L15_error) + else __PYX_ERR(0, 819, __pyx_L15_error) } break; } __Pyx_GOTREF(__pyx_t_3); } - __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_segid, __pyx_t_3); + __Pyx_XDECREF_SET(__pyx_9genexpr15__pyx_v_segid, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_remap, __pyx_8genexpr5__pyx_v_segid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 803, __pyx_L15_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_remap, __pyx_9genexpr15__pyx_v_segid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 819, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_3); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 803, __pyx_L15_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 819, __pyx_L15_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_segid); __pyx_8genexpr5__pyx_v_segid = 0; + __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_segid); __pyx_9genexpr15__pyx_v_segid = 0; goto __pyx_L18_exit_scope; __pyx_L15_error:; - __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_segid); __pyx_8genexpr5__pyx_v_segid = 0; + __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_segid); __pyx_9genexpr15__pyx_v_segid = 0; goto __pyx_L1_error; __pyx_L18_exit_scope:; } /* exit inner scope */ - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 803, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 819, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 803, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_v_dtype) < 0) __PYX_ERR(0, 803, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 803, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_v_dtype) < 0) __PYX_ERR(0, 819, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 819, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -92354,7 +95096,7 @@ static PyObject *__pyx_pf_9fastremap_44unique_via_renumber(CYTHON_UNUSED PyObjec __Pyx_DECREF_SET(__pyx_v_uniq, __pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":804 + /* "fastremap.pyx":820 * uniq, idx, counts = unique_via_array(labels, max(remap.keys()), return_index) * uniq = np.array([ remap[segid] for segid in uniq ], dtype=dtype) * return uniq, idx, counts # <<<<<<<<<<<<<< @@ -92362,7 +95104,7 @@ static PyObject *__pyx_pf_9fastremap_44unique_via_renumber(CYTHON_UNUSED PyObjec * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 804, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_uniq); __Pyx_GIVEREF(__pyx_v_uniq); @@ -92377,7 +95119,7 @@ static PyObject *__pyx_pf_9fastremap_44unique_via_renumber(CYTHON_UNUSED PyObjec __pyx_t_3 = 0; goto __pyx_L0; - /* "fastremap.pyx":798 + /* "fastremap.pyx":814 * return uniq, idx, counts * * def unique_via_renumber(labels, return_index=False): # <<<<<<<<<<<<<< @@ -92400,16 +95142,16 @@ static PyObject *__pyx_pf_9fastremap_44unique_via_renumber(CYTHON_UNUSED PyObjec __Pyx_XDECREF(__pyx_v_uniq); __Pyx_XDECREF(__pyx_v_idx); __Pyx_XDECREF(__pyx_v_counts); - __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_k); - __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_v); - __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_segid); + __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_k); + __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_v); + __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_segid); __Pyx_XDECREF(__pyx_v_labels); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "fastremap.pyx":809 +/* "fastremap.pyx":825 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def unique_via_sort(cnp.ndarray[ALLINT, ndim=1] labels): # <<<<<<<<<<<<<< @@ -92459,23 +95201,23 @@ static PyObject *__pyx_pw_9fastremap_47unique_via_sort(PyObject *__pyx_self, PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 809, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 825, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 809, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 825, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 809, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 825, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 809, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 825, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -92492,7 +95234,7 @@ static PyObject *__pyx_pw_9fastremap_47unique_via_sort(PyObject *__pyx_self, PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 809, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 825, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -92554,7 +95296,7 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("unique_via_sort", 0); __Pyx_INCREF(__pyx_v_kwargs); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -92568,7 +95310,7 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 825, __pyx_L1_error) __pyx_t_3 = ((!__pyx_t_4) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; @@ -92576,7 +95318,7 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_kwargs, Py_None); } - __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -92591,14 +95333,14 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_v____pyx_int64_t_is_signed = (!((((int64_t)-1L) > 0) != 0)); if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 809, __pyx_L1_error) + __PYX_ERR(0, 825, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 825, __pyx_L1_error) __pyx_t_2 = ((0 < __pyx_t_5) != 0); if (__pyx_t_2) { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 809, __pyx_L1_error) + __PYX_ERR(0, 825, __pyx_L1_error) } __pyx_t_1 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0); __Pyx_INCREF(__pyx_t_1); @@ -92615,18 +95357,18 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 809, __pyx_L1_error) + __PYX_ERR(0, 825, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_labels, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_labels, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 825, __pyx_L1_error) __pyx_t_3 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_3; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 809, __pyx_L1_error) + __PYX_ERR(0, 825, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -92635,12 +95377,12 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 809, __pyx_L1_error) + __PYX_ERR(0, 825, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 809, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 825, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); @@ -92651,15 +95393,15 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 809, __pyx_L1_error) + __PYX_ERR(0, 825, __pyx_L1_error) } __pyx_L6:; while (1) { @@ -92669,7 +95411,7 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -92678,14 +95420,14 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -92707,14 +95449,14 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_2 = (__pyx_v_dtype != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_itemsize = __pyx_t_5; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_kind = __pyx_t_7; __pyx_v_dtype_signed = (__pyx_v_kind == 'i'); @@ -92727,9 +95469,9 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -92741,7 +95483,7 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = __pyx_t_2; __pyx_L16_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 825, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint16_t)) == __pyx_v_itemsize) != 0); @@ -92750,9 +95492,9 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = __pyx_t_2; goto __pyx_L20_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -92764,7 +95506,7 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = __pyx_t_2; __pyx_L20_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 825, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint32_t)) == __pyx_v_itemsize) != 0); @@ -92773,9 +95515,9 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = __pyx_t_2; goto __pyx_L24_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -92787,7 +95529,7 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = __pyx_t_2; __pyx_L24_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 825, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint64_t)) == __pyx_v_itemsize) != 0); @@ -92796,9 +95538,9 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = __pyx_t_2; goto __pyx_L28_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -92810,7 +95552,7 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = __pyx_t_2; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 825, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int8_t)) == __pyx_v_itemsize) != 0); @@ -92819,9 +95561,9 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = __pyx_t_2; goto __pyx_L32_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -92833,7 +95575,7 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = __pyx_t_2; __pyx_L32_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 825, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int16_t)) == __pyx_v_itemsize) != 0); @@ -92842,9 +95584,9 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = __pyx_t_2; goto __pyx_L36_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -92856,7 +95598,7 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = __pyx_t_2; __pyx_L36_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 825, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int32_t)) == __pyx_v_itemsize) != 0); @@ -92865,9 +95607,9 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = __pyx_t_2; goto __pyx_L40_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -92879,7 +95621,7 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = __pyx_t_2; __pyx_L40_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 825, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int64_t)) == __pyx_v_itemsize) != 0); @@ -92888,9 +95630,9 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = __pyx_t_2; goto __pyx_L44_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -92902,7 +95644,7 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = __pyx_t_2; __pyx_L44_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 825, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -92931,7 +95673,7 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 825, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -92953,7 +95695,7 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 825, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -92975,7 +95717,7 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 825, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -92997,7 +95739,7 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 825, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -93019,7 +95761,7 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 825, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -93041,7 +95783,7 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 825, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -93063,7 +95805,7 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 825, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -93085,27 +95827,27 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 825, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); } } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 825, __pyx_L1_error) goto __pyx_L10_break; } __pyx_L10_break:; - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_candidates = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = 0; if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 809, __pyx_L1_error) + __PYX_ERR(0, 825, __pyx_L1_error) } - __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_1; @@ -93113,12 +95855,12 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ while (1) { __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_9, &__pyx_t_5, &__pyx_t_1, NULL, NULL, __pyx_t_10); if (unlikely(__pyx_t_11 == 0)) break; - if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_1); __pyx_t_1 = 0; __pyx_v_match_found = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { @@ -93132,10 +95874,10 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ } __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, __pyx_kp_s__2) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__2); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -93150,12 +95892,12 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ } __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_12, __pyx_kp_s__3) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__3); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_src_sig, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 825, __pyx_L1_error) __pyx_t_16 = __pyx_t_15; for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; @@ -93166,11 +95908,11 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_t_3 = (__pyx_v_dst_type != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_2) { __pyx_v_match_found = 1; @@ -93186,35 +95928,35 @@ static PyObject *__pyx_pf_9fastremap_46unique_via_sort(CYTHON_UNUSED PyObject *_ __pyx_L82_break:; __pyx_t_2 = (__pyx_v_match_found != 0); if (__pyx_t_2) { - __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 825, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_candidates) != 0); __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 809, __pyx_L1_error) + __PYX_ERR(0, 825, __pyx_L1_error) } - __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 825, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_9 > 1) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 809, __pyx_L1_error) + __PYX_ERR(0, 825, __pyx_L1_error) } /*else*/ { __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 809, __pyx_L1_error) + __PYX_ERR(0, 825, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; @@ -93256,7 +95998,7 @@ static PyObject *__pyx_fuse_0__pyx_pw_9fastremap_459unique_via_sort(PyObject *__ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unique_via_sort (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 825, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_458unique_via_sort(__pyx_self, ((PyArrayObject *)__pyx_v_labels)); /* function exit code */ @@ -93321,20 +96063,20 @@ static PyObject *__pyx_pf_9fastremap_458unique_via_sort(CYTHON_UNUSED PyObject * __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 825, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":811 + /* "fastremap.pyx":827 * def unique_via_sort(cnp.ndarray[ALLINT, ndim=1] labels): * """Slower than unique_via_array but can handle any label.""" * labels = np.copy(labels) # <<<<<<<<<<<<<< * labels.sort() * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 811, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -93349,10 +96091,10 @@ static PyObject *__pyx_pf_9fastremap_458unique_via_sort(CYTHON_UNUSED PyObject * } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_labels)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_labels)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 811, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 827, __pyx_L1_error) __pyx_t_4 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -93369,20 +96111,20 @@ static PyObject *__pyx_pf_9fastremap_458unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0; } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 811, __pyx_L1_error) + if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 827, __pyx_L1_error) } __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_labels, ((PyArrayObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "fastremap.pyx":812 + /* "fastremap.pyx":828 * """Slower than unique_via_array but can handle any label.""" * labels = np.copy(labels) * labels.sort() # <<<<<<<<<<<<<< * * cdef size_t voxels = labels.size */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 812, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -93396,66 +96138,66 @@ static PyObject *__pyx_pf_9fastremap_458unique_via_sort(CYTHON_UNUSED PyObject * } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":814 + /* "fastremap.pyx":830 * labels.sort() * * cdef size_t voxels = labels.size # <<<<<<<<<<<<<< * * cdef cnp.ndarray[ALLINT, ndim=1] uniq = np.zeros((voxels,), dtype=labels.dtype) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_voxels = __pyx_t_9; - /* "fastremap.pyx":816 + /* "fastremap.pyx":832 * cdef size_t voxels = labels.size * * cdef cnp.ndarray[ALLINT, ndim=1] uniq = np.zeros((voxels,), dtype=labels.dtype) # <<<<<<<<<<<<<< * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros((voxels,), dtype=np.uint32) * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 816, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 816, __pyx_L1_error) + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 832, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_10); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_uniq.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_uniq = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_uniq.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 816, __pyx_L1_error) + __PYX_ERR(0, 832, __pyx_L1_error) } else {__pyx_pybuffernd_uniq.diminfo[0].strides = __pyx_pybuffernd_uniq.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_uniq.diminfo[0].shape = __pyx_pybuffernd_uniq.rcbuffer->pybuffer.shape[0]; } } @@ -93463,51 +96205,51 @@ static PyObject *__pyx_pf_9fastremap_458unique_via_sort(CYTHON_UNUSED PyObject * __pyx_v_uniq = ((PyArrayObject *)__pyx_t_10); __pyx_t_10 = 0; - /* "fastremap.pyx":817 + /* "fastremap.pyx":833 * * cdef cnp.ndarray[ALLINT, ndim=1] uniq = np.zeros((voxels,), dtype=labels.dtype) * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros((voxels,), dtype=np.uint32) # <<<<<<<<<<<<<< * * cdef size_t i = 0 */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 817, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 817, __pyx_L1_error) + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 833, __pyx_L1_error) __pyx_t_13 = ((PyArrayObject *)__pyx_t_12); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_counts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 817, __pyx_L1_error) + __PYX_ERR(0, 833, __pyx_L1_error) } else {__pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; } } @@ -93515,7 +96257,7 @@ static PyObject *__pyx_pf_9fastremap_458unique_via_sort(CYTHON_UNUSED PyObject * __pyx_v_counts = ((PyArrayObject *)__pyx_t_12); __pyx_t_12 = 0; - /* "fastremap.pyx":819 + /* "fastremap.pyx":835 * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros((voxels,), dtype=np.uint32) * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -93524,7 +96266,7 @@ static PyObject *__pyx_pf_9fastremap_458unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_i = 0; - /* "fastremap.pyx":820 + /* "fastremap.pyx":836 * * cdef size_t i = 0 * cdef size_t j = 0 # <<<<<<<<<<<<<< @@ -93533,7 +96275,7 @@ static PyObject *__pyx_pf_9fastremap_458unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_j = 0; - /* "fastremap.pyx":822 + /* "fastremap.pyx":838 * cdef size_t j = 0 * * cdef ALLINT cur = labels[0] # <<<<<<<<<<<<<< @@ -93543,7 +96285,7 @@ static PyObject *__pyx_pf_9fastremap_458unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_14 = 0; __pyx_v_cur = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); - /* "fastremap.pyx":823 + /* "fastremap.pyx":839 * * cdef ALLINT cur = labels[0] * cdef size_t accum = 1 # <<<<<<<<<<<<<< @@ -93552,7 +96294,7 @@ static PyObject *__pyx_pf_9fastremap_458unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_accum = 1; - /* "fastremap.pyx":824 + /* "fastremap.pyx":840 * cdef ALLINT cur = labels[0] * cdef size_t accum = 1 * for i in range(1, voxels): # <<<<<<<<<<<<<< @@ -93564,7 +96306,7 @@ static PyObject *__pyx_pf_9fastremap_458unique_via_sort(CYTHON_UNUSED PyObject * for (__pyx_t_16 = 1; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":825 + /* "fastremap.pyx":841 * cdef size_t accum = 1 * for i in range(1, voxels): * if cur == labels[i]: # <<<<<<<<<<<<<< @@ -93575,7 +96317,7 @@ static PyObject *__pyx_pf_9fastremap_458unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_18 = ((__pyx_v_cur == (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides))) != 0); if (__pyx_t_18) { - /* "fastremap.pyx":826 + /* "fastremap.pyx":842 * for i in range(1, voxels): * if cur == labels[i]: * accum += 1 # <<<<<<<<<<<<<< @@ -93584,7 +96326,7 @@ static PyObject *__pyx_pf_9fastremap_458unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_accum = (__pyx_v_accum + 1); - /* "fastremap.pyx":825 + /* "fastremap.pyx":841 * cdef size_t accum = 1 * for i in range(1, voxels): * if cur == labels[i]: # <<<<<<<<<<<<<< @@ -93594,7 +96336,7 @@ static PyObject *__pyx_pf_9fastremap_458unique_via_sort(CYTHON_UNUSED PyObject * goto __pyx_L5; } - /* "fastremap.pyx":828 + /* "fastremap.pyx":844 * accum += 1 * else: * uniq[j] = cur # <<<<<<<<<<<<<< @@ -93605,7 +96347,7 @@ static PyObject *__pyx_pf_9fastremap_458unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_17 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_uniq.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_uniq.diminfo[0].strides) = __pyx_v_cur; - /* "fastremap.pyx":829 + /* "fastremap.pyx":845 * else: * uniq[j] = cur * counts[j] = accum # <<<<<<<<<<<<<< @@ -93615,7 +96357,7 @@ static PyObject *__pyx_pf_9fastremap_458unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_17 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) = __pyx_v_accum; - /* "fastremap.pyx":830 + /* "fastremap.pyx":846 * uniq[j] = cur * counts[j] = accum * accum = 1 # <<<<<<<<<<<<<< @@ -93624,7 +96366,7 @@ static PyObject *__pyx_pf_9fastremap_458unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_accum = 1; - /* "fastremap.pyx":831 + /* "fastremap.pyx":847 * counts[j] = accum * accum = 1 * cur = labels[i] # <<<<<<<<<<<<<< @@ -93634,7 +96376,7 @@ static PyObject *__pyx_pf_9fastremap_458unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_17 = __pyx_v_i; __pyx_v_cur = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides)); - /* "fastremap.pyx":832 + /* "fastremap.pyx":848 * accum = 1 * cur = labels[i] * j += 1 # <<<<<<<<<<<<<< @@ -93646,7 +96388,7 @@ static PyObject *__pyx_pf_9fastremap_458unique_via_sort(CYTHON_UNUSED PyObject * __pyx_L5:; } - /* "fastremap.pyx":834 + /* "fastremap.pyx":850 * j += 1 * * uniq[j] = cur # <<<<<<<<<<<<<< @@ -93656,7 +96398,7 @@ static PyObject *__pyx_pf_9fastremap_458unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_9 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_uniq.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_uniq.diminfo[0].strides) = __pyx_v_cur; - /* "fastremap.pyx":835 + /* "fastremap.pyx":851 * * uniq[j] = cur * counts[j] = accum # <<<<<<<<<<<<<< @@ -93666,7 +96408,7 @@ static PyObject *__pyx_pf_9fastremap_458unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_9 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_counts.diminfo[0].strides) = __pyx_v_accum; - /* "fastremap.pyx":837 + /* "fastremap.pyx":853 * counts[j] = accum * * return uniq[:j+1], counts[:j+1] # <<<<<<<<<<<<<< @@ -93674,23 +96416,23 @@ static PyObject *__pyx_pf_9fastremap_458unique_via_sort(CYTHON_UNUSED PyObject * * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_12 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = PySlice_New(Py_None, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = PySlice_New(Py_None, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_uniq), __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_uniq), __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_10 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_counts), __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_counts), __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12); @@ -93702,7 +96444,7 @@ static PyObject *__pyx_pf_9fastremap_458unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_10 = 0; goto __pyx_L0; - /* "fastremap.pyx":809 + /* "fastremap.pyx":825 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def unique_via_sort(cnp.ndarray[ALLINT, ndim=1] labels): # <<<<<<<<<<<<<< @@ -93751,7 +96493,7 @@ static PyObject *__pyx_fuse_1__pyx_pw_9fastremap_461unique_via_sort(PyObject *__ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unique_via_sort (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 825, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_460unique_via_sort(__pyx_self, ((PyArrayObject *)__pyx_v_labels)); /* function exit code */ @@ -93816,20 +96558,20 @@ static PyObject *__pyx_pf_9fastremap_460unique_via_sort(CYTHON_UNUSED PyObject * __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 825, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":811 + /* "fastremap.pyx":827 * def unique_via_sort(cnp.ndarray[ALLINT, ndim=1] labels): * """Slower than unique_via_array but can handle any label.""" * labels = np.copy(labels) # <<<<<<<<<<<<<< * labels.sort() * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 811, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -93844,10 +96586,10 @@ static PyObject *__pyx_pf_9fastremap_460unique_via_sort(CYTHON_UNUSED PyObject * } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_labels)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_labels)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 811, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 827, __pyx_L1_error) __pyx_t_4 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -93864,20 +96606,20 @@ static PyObject *__pyx_pf_9fastremap_460unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0; } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 811, __pyx_L1_error) + if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 827, __pyx_L1_error) } __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_labels, ((PyArrayObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "fastremap.pyx":812 + /* "fastremap.pyx":828 * """Slower than unique_via_array but can handle any label.""" * labels = np.copy(labels) * labels.sort() # <<<<<<<<<<<<<< * * cdef size_t voxels = labels.size */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 812, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -93891,66 +96633,66 @@ static PyObject *__pyx_pf_9fastremap_460unique_via_sort(CYTHON_UNUSED PyObject * } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":814 + /* "fastremap.pyx":830 * labels.sort() * * cdef size_t voxels = labels.size # <<<<<<<<<<<<<< * * cdef cnp.ndarray[ALLINT, ndim=1] uniq = np.zeros((voxels,), dtype=labels.dtype) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_voxels = __pyx_t_9; - /* "fastremap.pyx":816 + /* "fastremap.pyx":832 * cdef size_t voxels = labels.size * * cdef cnp.ndarray[ALLINT, ndim=1] uniq = np.zeros((voxels,), dtype=labels.dtype) # <<<<<<<<<<<<<< * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros((voxels,), dtype=np.uint32) * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 816, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 816, __pyx_L1_error) + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 832, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_10); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_uniq.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_uniq = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_uniq.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 816, __pyx_L1_error) + __PYX_ERR(0, 832, __pyx_L1_error) } else {__pyx_pybuffernd_uniq.diminfo[0].strides = __pyx_pybuffernd_uniq.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_uniq.diminfo[0].shape = __pyx_pybuffernd_uniq.rcbuffer->pybuffer.shape[0]; } } @@ -93958,51 +96700,51 @@ static PyObject *__pyx_pf_9fastremap_460unique_via_sort(CYTHON_UNUSED PyObject * __pyx_v_uniq = ((PyArrayObject *)__pyx_t_10); __pyx_t_10 = 0; - /* "fastremap.pyx":817 + /* "fastremap.pyx":833 * * cdef cnp.ndarray[ALLINT, ndim=1] uniq = np.zeros((voxels,), dtype=labels.dtype) * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros((voxels,), dtype=np.uint32) # <<<<<<<<<<<<<< * * cdef size_t i = 0 */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 817, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 817, __pyx_L1_error) + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 833, __pyx_L1_error) __pyx_t_13 = ((PyArrayObject *)__pyx_t_12); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_counts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 817, __pyx_L1_error) + __PYX_ERR(0, 833, __pyx_L1_error) } else {__pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; } } @@ -94010,7 +96752,7 @@ static PyObject *__pyx_pf_9fastremap_460unique_via_sort(CYTHON_UNUSED PyObject * __pyx_v_counts = ((PyArrayObject *)__pyx_t_12); __pyx_t_12 = 0; - /* "fastremap.pyx":819 + /* "fastremap.pyx":835 * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros((voxels,), dtype=np.uint32) * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -94019,7 +96761,7 @@ static PyObject *__pyx_pf_9fastremap_460unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_i = 0; - /* "fastremap.pyx":820 + /* "fastremap.pyx":836 * * cdef size_t i = 0 * cdef size_t j = 0 # <<<<<<<<<<<<<< @@ -94028,7 +96770,7 @@ static PyObject *__pyx_pf_9fastremap_460unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_j = 0; - /* "fastremap.pyx":822 + /* "fastremap.pyx":838 * cdef size_t j = 0 * * cdef ALLINT cur = labels[0] # <<<<<<<<<<<<<< @@ -94038,7 +96780,7 @@ static PyObject *__pyx_pf_9fastremap_460unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_14 = 0; __pyx_v_cur = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); - /* "fastremap.pyx":823 + /* "fastremap.pyx":839 * * cdef ALLINT cur = labels[0] * cdef size_t accum = 1 # <<<<<<<<<<<<<< @@ -94047,7 +96789,7 @@ static PyObject *__pyx_pf_9fastremap_460unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_accum = 1; - /* "fastremap.pyx":824 + /* "fastremap.pyx":840 * cdef ALLINT cur = labels[0] * cdef size_t accum = 1 * for i in range(1, voxels): # <<<<<<<<<<<<<< @@ -94059,7 +96801,7 @@ static PyObject *__pyx_pf_9fastremap_460unique_via_sort(CYTHON_UNUSED PyObject * for (__pyx_t_16 = 1; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":825 + /* "fastremap.pyx":841 * cdef size_t accum = 1 * for i in range(1, voxels): * if cur == labels[i]: # <<<<<<<<<<<<<< @@ -94070,7 +96812,7 @@ static PyObject *__pyx_pf_9fastremap_460unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_18 = ((__pyx_v_cur == (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides))) != 0); if (__pyx_t_18) { - /* "fastremap.pyx":826 + /* "fastremap.pyx":842 * for i in range(1, voxels): * if cur == labels[i]: * accum += 1 # <<<<<<<<<<<<<< @@ -94079,7 +96821,7 @@ static PyObject *__pyx_pf_9fastremap_460unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_accum = (__pyx_v_accum + 1); - /* "fastremap.pyx":825 + /* "fastremap.pyx":841 * cdef size_t accum = 1 * for i in range(1, voxels): * if cur == labels[i]: # <<<<<<<<<<<<<< @@ -94089,7 +96831,7 @@ static PyObject *__pyx_pf_9fastremap_460unique_via_sort(CYTHON_UNUSED PyObject * goto __pyx_L5; } - /* "fastremap.pyx":828 + /* "fastremap.pyx":844 * accum += 1 * else: * uniq[j] = cur # <<<<<<<<<<<<<< @@ -94100,7 +96842,7 @@ static PyObject *__pyx_pf_9fastremap_460unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_17 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_uniq.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_uniq.diminfo[0].strides) = __pyx_v_cur; - /* "fastremap.pyx":829 + /* "fastremap.pyx":845 * else: * uniq[j] = cur * counts[j] = accum # <<<<<<<<<<<<<< @@ -94110,7 +96852,7 @@ static PyObject *__pyx_pf_9fastremap_460unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_17 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) = __pyx_v_accum; - /* "fastremap.pyx":830 + /* "fastremap.pyx":846 * uniq[j] = cur * counts[j] = accum * accum = 1 # <<<<<<<<<<<<<< @@ -94119,7 +96861,7 @@ static PyObject *__pyx_pf_9fastremap_460unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_accum = 1; - /* "fastremap.pyx":831 + /* "fastremap.pyx":847 * counts[j] = accum * accum = 1 * cur = labels[i] # <<<<<<<<<<<<<< @@ -94129,7 +96871,7 @@ static PyObject *__pyx_pf_9fastremap_460unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_17 = __pyx_v_i; __pyx_v_cur = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides)); - /* "fastremap.pyx":832 + /* "fastremap.pyx":848 * accum = 1 * cur = labels[i] * j += 1 # <<<<<<<<<<<<<< @@ -94141,7 +96883,7 @@ static PyObject *__pyx_pf_9fastremap_460unique_via_sort(CYTHON_UNUSED PyObject * __pyx_L5:; } - /* "fastremap.pyx":834 + /* "fastremap.pyx":850 * j += 1 * * uniq[j] = cur # <<<<<<<<<<<<<< @@ -94151,7 +96893,7 @@ static PyObject *__pyx_pf_9fastremap_460unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_9 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_uniq.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_uniq.diminfo[0].strides) = __pyx_v_cur; - /* "fastremap.pyx":835 + /* "fastremap.pyx":851 * * uniq[j] = cur * counts[j] = accum # <<<<<<<<<<<<<< @@ -94161,7 +96903,7 @@ static PyObject *__pyx_pf_9fastremap_460unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_9 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_counts.diminfo[0].strides) = __pyx_v_accum; - /* "fastremap.pyx":837 + /* "fastremap.pyx":853 * counts[j] = accum * * return uniq[:j+1], counts[:j+1] # <<<<<<<<<<<<<< @@ -94169,23 +96911,23 @@ static PyObject *__pyx_pf_9fastremap_460unique_via_sort(CYTHON_UNUSED PyObject * * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_12 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = PySlice_New(Py_None, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = PySlice_New(Py_None, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_uniq), __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_uniq), __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_10 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_counts), __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_counts), __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12); @@ -94197,7 +96939,7 @@ static PyObject *__pyx_pf_9fastremap_460unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_10 = 0; goto __pyx_L0; - /* "fastremap.pyx":809 + /* "fastremap.pyx":825 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def unique_via_sort(cnp.ndarray[ALLINT, ndim=1] labels): # <<<<<<<<<<<<<< @@ -94246,7 +96988,7 @@ static PyObject *__pyx_fuse_2__pyx_pw_9fastremap_463unique_via_sort(PyObject *__ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unique_via_sort (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 825, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_462unique_via_sort(__pyx_self, ((PyArrayObject *)__pyx_v_labels)); /* function exit code */ @@ -94311,20 +97053,20 @@ static PyObject *__pyx_pf_9fastremap_462unique_via_sort(CYTHON_UNUSED PyObject * __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 825, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":811 + /* "fastremap.pyx":827 * def unique_via_sort(cnp.ndarray[ALLINT, ndim=1] labels): * """Slower than unique_via_array but can handle any label.""" * labels = np.copy(labels) # <<<<<<<<<<<<<< * labels.sort() * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 811, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -94339,10 +97081,10 @@ static PyObject *__pyx_pf_9fastremap_462unique_via_sort(CYTHON_UNUSED PyObject * } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_labels)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_labels)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 811, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 827, __pyx_L1_error) __pyx_t_4 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -94359,20 +97101,20 @@ static PyObject *__pyx_pf_9fastremap_462unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0; } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 811, __pyx_L1_error) + if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 827, __pyx_L1_error) } __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_labels, ((PyArrayObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "fastremap.pyx":812 + /* "fastremap.pyx":828 * """Slower than unique_via_array but can handle any label.""" * labels = np.copy(labels) * labels.sort() # <<<<<<<<<<<<<< * * cdef size_t voxels = labels.size */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 812, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -94386,66 +97128,66 @@ static PyObject *__pyx_pf_9fastremap_462unique_via_sort(CYTHON_UNUSED PyObject * } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":814 + /* "fastremap.pyx":830 * labels.sort() * * cdef size_t voxels = labels.size # <<<<<<<<<<<<<< * * cdef cnp.ndarray[ALLINT, ndim=1] uniq = np.zeros((voxels,), dtype=labels.dtype) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_voxels = __pyx_t_9; - /* "fastremap.pyx":816 + /* "fastremap.pyx":832 * cdef size_t voxels = labels.size * * cdef cnp.ndarray[ALLINT, ndim=1] uniq = np.zeros((voxels,), dtype=labels.dtype) # <<<<<<<<<<<<<< * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros((voxels,), dtype=np.uint32) * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 816, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 816, __pyx_L1_error) + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 832, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_10); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_uniq.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_uniq = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_uniq.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 816, __pyx_L1_error) + __PYX_ERR(0, 832, __pyx_L1_error) } else {__pyx_pybuffernd_uniq.diminfo[0].strides = __pyx_pybuffernd_uniq.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_uniq.diminfo[0].shape = __pyx_pybuffernd_uniq.rcbuffer->pybuffer.shape[0]; } } @@ -94453,51 +97195,51 @@ static PyObject *__pyx_pf_9fastremap_462unique_via_sort(CYTHON_UNUSED PyObject * __pyx_v_uniq = ((PyArrayObject *)__pyx_t_10); __pyx_t_10 = 0; - /* "fastremap.pyx":817 + /* "fastremap.pyx":833 * * cdef cnp.ndarray[ALLINT, ndim=1] uniq = np.zeros((voxels,), dtype=labels.dtype) * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros((voxels,), dtype=np.uint32) # <<<<<<<<<<<<<< * * cdef size_t i = 0 */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 817, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 817, __pyx_L1_error) + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 833, __pyx_L1_error) __pyx_t_13 = ((PyArrayObject *)__pyx_t_12); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_counts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 817, __pyx_L1_error) + __PYX_ERR(0, 833, __pyx_L1_error) } else {__pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; } } @@ -94505,7 +97247,7 @@ static PyObject *__pyx_pf_9fastremap_462unique_via_sort(CYTHON_UNUSED PyObject * __pyx_v_counts = ((PyArrayObject *)__pyx_t_12); __pyx_t_12 = 0; - /* "fastremap.pyx":819 + /* "fastremap.pyx":835 * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros((voxels,), dtype=np.uint32) * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -94514,7 +97256,7 @@ static PyObject *__pyx_pf_9fastremap_462unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_i = 0; - /* "fastremap.pyx":820 + /* "fastremap.pyx":836 * * cdef size_t i = 0 * cdef size_t j = 0 # <<<<<<<<<<<<<< @@ -94523,7 +97265,7 @@ static PyObject *__pyx_pf_9fastremap_462unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_j = 0; - /* "fastremap.pyx":822 + /* "fastremap.pyx":838 * cdef size_t j = 0 * * cdef ALLINT cur = labels[0] # <<<<<<<<<<<<<< @@ -94533,7 +97275,7 @@ static PyObject *__pyx_pf_9fastremap_462unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_14 = 0; __pyx_v_cur = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); - /* "fastremap.pyx":823 + /* "fastremap.pyx":839 * * cdef ALLINT cur = labels[0] * cdef size_t accum = 1 # <<<<<<<<<<<<<< @@ -94542,7 +97284,7 @@ static PyObject *__pyx_pf_9fastremap_462unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_accum = 1; - /* "fastremap.pyx":824 + /* "fastremap.pyx":840 * cdef ALLINT cur = labels[0] * cdef size_t accum = 1 * for i in range(1, voxels): # <<<<<<<<<<<<<< @@ -94554,7 +97296,7 @@ static PyObject *__pyx_pf_9fastremap_462unique_via_sort(CYTHON_UNUSED PyObject * for (__pyx_t_16 = 1; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":825 + /* "fastremap.pyx":841 * cdef size_t accum = 1 * for i in range(1, voxels): * if cur == labels[i]: # <<<<<<<<<<<<<< @@ -94565,7 +97307,7 @@ static PyObject *__pyx_pf_9fastremap_462unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_18 = ((__pyx_v_cur == (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides))) != 0); if (__pyx_t_18) { - /* "fastremap.pyx":826 + /* "fastremap.pyx":842 * for i in range(1, voxels): * if cur == labels[i]: * accum += 1 # <<<<<<<<<<<<<< @@ -94574,7 +97316,7 @@ static PyObject *__pyx_pf_9fastremap_462unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_accum = (__pyx_v_accum + 1); - /* "fastremap.pyx":825 + /* "fastremap.pyx":841 * cdef size_t accum = 1 * for i in range(1, voxels): * if cur == labels[i]: # <<<<<<<<<<<<<< @@ -94584,7 +97326,7 @@ static PyObject *__pyx_pf_9fastremap_462unique_via_sort(CYTHON_UNUSED PyObject * goto __pyx_L5; } - /* "fastremap.pyx":828 + /* "fastremap.pyx":844 * accum += 1 * else: * uniq[j] = cur # <<<<<<<<<<<<<< @@ -94595,7 +97337,7 @@ static PyObject *__pyx_pf_9fastremap_462unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_17 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_uniq.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_uniq.diminfo[0].strides) = __pyx_v_cur; - /* "fastremap.pyx":829 + /* "fastremap.pyx":845 * else: * uniq[j] = cur * counts[j] = accum # <<<<<<<<<<<<<< @@ -94605,7 +97347,7 @@ static PyObject *__pyx_pf_9fastremap_462unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_17 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) = __pyx_v_accum; - /* "fastremap.pyx":830 + /* "fastremap.pyx":846 * uniq[j] = cur * counts[j] = accum * accum = 1 # <<<<<<<<<<<<<< @@ -94614,7 +97356,7 @@ static PyObject *__pyx_pf_9fastremap_462unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_accum = 1; - /* "fastremap.pyx":831 + /* "fastremap.pyx":847 * counts[j] = accum * accum = 1 * cur = labels[i] # <<<<<<<<<<<<<< @@ -94624,7 +97366,7 @@ static PyObject *__pyx_pf_9fastremap_462unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_17 = __pyx_v_i; __pyx_v_cur = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides)); - /* "fastremap.pyx":832 + /* "fastremap.pyx":848 * accum = 1 * cur = labels[i] * j += 1 # <<<<<<<<<<<<<< @@ -94636,7 +97378,7 @@ static PyObject *__pyx_pf_9fastremap_462unique_via_sort(CYTHON_UNUSED PyObject * __pyx_L5:; } - /* "fastremap.pyx":834 + /* "fastremap.pyx":850 * j += 1 * * uniq[j] = cur # <<<<<<<<<<<<<< @@ -94646,7 +97388,7 @@ static PyObject *__pyx_pf_9fastremap_462unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_9 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_uniq.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_uniq.diminfo[0].strides) = __pyx_v_cur; - /* "fastremap.pyx":835 + /* "fastremap.pyx":851 * * uniq[j] = cur * counts[j] = accum # <<<<<<<<<<<<<< @@ -94656,7 +97398,7 @@ static PyObject *__pyx_pf_9fastremap_462unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_9 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_counts.diminfo[0].strides) = __pyx_v_accum; - /* "fastremap.pyx":837 + /* "fastremap.pyx":853 * counts[j] = accum * * return uniq[:j+1], counts[:j+1] # <<<<<<<<<<<<<< @@ -94664,23 +97406,23 @@ static PyObject *__pyx_pf_9fastremap_462unique_via_sort(CYTHON_UNUSED PyObject * * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_12 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = PySlice_New(Py_None, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = PySlice_New(Py_None, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_uniq), __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_uniq), __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_10 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_counts), __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_counts), __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12); @@ -94692,7 +97434,7 @@ static PyObject *__pyx_pf_9fastremap_462unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_10 = 0; goto __pyx_L0; - /* "fastremap.pyx":809 + /* "fastremap.pyx":825 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def unique_via_sort(cnp.ndarray[ALLINT, ndim=1] labels): # <<<<<<<<<<<<<< @@ -94741,7 +97483,7 @@ static PyObject *__pyx_fuse_3__pyx_pw_9fastremap_465unique_via_sort(PyObject *__ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unique_via_sort (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 825, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_464unique_via_sort(__pyx_self, ((PyArrayObject *)__pyx_v_labels)); /* function exit code */ @@ -94806,20 +97548,20 @@ static PyObject *__pyx_pf_9fastremap_464unique_via_sort(CYTHON_UNUSED PyObject * __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 825, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":811 + /* "fastremap.pyx":827 * def unique_via_sort(cnp.ndarray[ALLINT, ndim=1] labels): * """Slower than unique_via_array but can handle any label.""" * labels = np.copy(labels) # <<<<<<<<<<<<<< * labels.sort() * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 811, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -94834,10 +97576,10 @@ static PyObject *__pyx_pf_9fastremap_464unique_via_sort(CYTHON_UNUSED PyObject * } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_labels)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_labels)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 811, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 827, __pyx_L1_error) __pyx_t_4 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -94854,20 +97596,20 @@ static PyObject *__pyx_pf_9fastremap_464unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0; } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 811, __pyx_L1_error) + if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 827, __pyx_L1_error) } __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_labels, ((PyArrayObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "fastremap.pyx":812 + /* "fastremap.pyx":828 * """Slower than unique_via_array but can handle any label.""" * labels = np.copy(labels) * labels.sort() # <<<<<<<<<<<<<< * * cdef size_t voxels = labels.size */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 812, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -94881,66 +97623,66 @@ static PyObject *__pyx_pf_9fastremap_464unique_via_sort(CYTHON_UNUSED PyObject * } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":814 + /* "fastremap.pyx":830 * labels.sort() * * cdef size_t voxels = labels.size # <<<<<<<<<<<<<< * * cdef cnp.ndarray[ALLINT, ndim=1] uniq = np.zeros((voxels,), dtype=labels.dtype) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_voxels = __pyx_t_9; - /* "fastremap.pyx":816 + /* "fastremap.pyx":832 * cdef size_t voxels = labels.size * * cdef cnp.ndarray[ALLINT, ndim=1] uniq = np.zeros((voxels,), dtype=labels.dtype) # <<<<<<<<<<<<<< * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros((voxels,), dtype=np.uint32) * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 816, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 816, __pyx_L1_error) + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 832, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_10); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_uniq.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_uniq = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_uniq.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 816, __pyx_L1_error) + __PYX_ERR(0, 832, __pyx_L1_error) } else {__pyx_pybuffernd_uniq.diminfo[0].strides = __pyx_pybuffernd_uniq.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_uniq.diminfo[0].shape = __pyx_pybuffernd_uniq.rcbuffer->pybuffer.shape[0]; } } @@ -94948,51 +97690,51 @@ static PyObject *__pyx_pf_9fastremap_464unique_via_sort(CYTHON_UNUSED PyObject * __pyx_v_uniq = ((PyArrayObject *)__pyx_t_10); __pyx_t_10 = 0; - /* "fastremap.pyx":817 + /* "fastremap.pyx":833 * * cdef cnp.ndarray[ALLINT, ndim=1] uniq = np.zeros((voxels,), dtype=labels.dtype) * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros((voxels,), dtype=np.uint32) # <<<<<<<<<<<<<< * * cdef size_t i = 0 */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 817, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 817, __pyx_L1_error) + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 833, __pyx_L1_error) __pyx_t_13 = ((PyArrayObject *)__pyx_t_12); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_counts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 817, __pyx_L1_error) + __PYX_ERR(0, 833, __pyx_L1_error) } else {__pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; } } @@ -95000,7 +97742,7 @@ static PyObject *__pyx_pf_9fastremap_464unique_via_sort(CYTHON_UNUSED PyObject * __pyx_v_counts = ((PyArrayObject *)__pyx_t_12); __pyx_t_12 = 0; - /* "fastremap.pyx":819 + /* "fastremap.pyx":835 * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros((voxels,), dtype=np.uint32) * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -95009,7 +97751,7 @@ static PyObject *__pyx_pf_9fastremap_464unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_i = 0; - /* "fastremap.pyx":820 + /* "fastremap.pyx":836 * * cdef size_t i = 0 * cdef size_t j = 0 # <<<<<<<<<<<<<< @@ -95018,7 +97760,7 @@ static PyObject *__pyx_pf_9fastremap_464unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_j = 0; - /* "fastremap.pyx":822 + /* "fastremap.pyx":838 * cdef size_t j = 0 * * cdef ALLINT cur = labels[0] # <<<<<<<<<<<<<< @@ -95028,7 +97770,7 @@ static PyObject *__pyx_pf_9fastremap_464unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_14 = 0; __pyx_v_cur = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); - /* "fastremap.pyx":823 + /* "fastremap.pyx":839 * * cdef ALLINT cur = labels[0] * cdef size_t accum = 1 # <<<<<<<<<<<<<< @@ -95037,7 +97779,7 @@ static PyObject *__pyx_pf_9fastremap_464unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_accum = 1; - /* "fastremap.pyx":824 + /* "fastremap.pyx":840 * cdef ALLINT cur = labels[0] * cdef size_t accum = 1 * for i in range(1, voxels): # <<<<<<<<<<<<<< @@ -95049,7 +97791,7 @@ static PyObject *__pyx_pf_9fastremap_464unique_via_sort(CYTHON_UNUSED PyObject * for (__pyx_t_16 = 1; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":825 + /* "fastremap.pyx":841 * cdef size_t accum = 1 * for i in range(1, voxels): * if cur == labels[i]: # <<<<<<<<<<<<<< @@ -95060,7 +97802,7 @@ static PyObject *__pyx_pf_9fastremap_464unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_18 = ((__pyx_v_cur == (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides))) != 0); if (__pyx_t_18) { - /* "fastremap.pyx":826 + /* "fastremap.pyx":842 * for i in range(1, voxels): * if cur == labels[i]: * accum += 1 # <<<<<<<<<<<<<< @@ -95069,7 +97811,7 @@ static PyObject *__pyx_pf_9fastremap_464unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_accum = (__pyx_v_accum + 1); - /* "fastremap.pyx":825 + /* "fastremap.pyx":841 * cdef size_t accum = 1 * for i in range(1, voxels): * if cur == labels[i]: # <<<<<<<<<<<<<< @@ -95079,7 +97821,7 @@ static PyObject *__pyx_pf_9fastremap_464unique_via_sort(CYTHON_UNUSED PyObject * goto __pyx_L5; } - /* "fastremap.pyx":828 + /* "fastremap.pyx":844 * accum += 1 * else: * uniq[j] = cur # <<<<<<<<<<<<<< @@ -95090,7 +97832,7 @@ static PyObject *__pyx_pf_9fastremap_464unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_17 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_uniq.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_uniq.diminfo[0].strides) = __pyx_v_cur; - /* "fastremap.pyx":829 + /* "fastremap.pyx":845 * else: * uniq[j] = cur * counts[j] = accum # <<<<<<<<<<<<<< @@ -95100,7 +97842,7 @@ static PyObject *__pyx_pf_9fastremap_464unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_17 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) = __pyx_v_accum; - /* "fastremap.pyx":830 + /* "fastremap.pyx":846 * uniq[j] = cur * counts[j] = accum * accum = 1 # <<<<<<<<<<<<<< @@ -95109,7 +97851,7 @@ static PyObject *__pyx_pf_9fastremap_464unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_accum = 1; - /* "fastremap.pyx":831 + /* "fastremap.pyx":847 * counts[j] = accum * accum = 1 * cur = labels[i] # <<<<<<<<<<<<<< @@ -95119,7 +97861,7 @@ static PyObject *__pyx_pf_9fastremap_464unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_17 = __pyx_v_i; __pyx_v_cur = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides)); - /* "fastremap.pyx":832 + /* "fastremap.pyx":848 * accum = 1 * cur = labels[i] * j += 1 # <<<<<<<<<<<<<< @@ -95131,7 +97873,7 @@ static PyObject *__pyx_pf_9fastremap_464unique_via_sort(CYTHON_UNUSED PyObject * __pyx_L5:; } - /* "fastremap.pyx":834 + /* "fastremap.pyx":850 * j += 1 * * uniq[j] = cur # <<<<<<<<<<<<<< @@ -95141,7 +97883,7 @@ static PyObject *__pyx_pf_9fastremap_464unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_9 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_uniq.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_uniq.diminfo[0].strides) = __pyx_v_cur; - /* "fastremap.pyx":835 + /* "fastremap.pyx":851 * * uniq[j] = cur * counts[j] = accum # <<<<<<<<<<<<<< @@ -95151,7 +97893,7 @@ static PyObject *__pyx_pf_9fastremap_464unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_9 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_counts.diminfo[0].strides) = __pyx_v_accum; - /* "fastremap.pyx":837 + /* "fastremap.pyx":853 * counts[j] = accum * * return uniq[:j+1], counts[:j+1] # <<<<<<<<<<<<<< @@ -95159,23 +97901,23 @@ static PyObject *__pyx_pf_9fastremap_464unique_via_sort(CYTHON_UNUSED PyObject * * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_12 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = PySlice_New(Py_None, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = PySlice_New(Py_None, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_uniq), __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_uniq), __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_10 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_counts), __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_counts), __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12); @@ -95187,7 +97929,7 @@ static PyObject *__pyx_pf_9fastremap_464unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_10 = 0; goto __pyx_L0; - /* "fastremap.pyx":809 + /* "fastremap.pyx":825 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def unique_via_sort(cnp.ndarray[ALLINT, ndim=1] labels): # <<<<<<<<<<<<<< @@ -95236,7 +97978,7 @@ static PyObject *__pyx_fuse_4__pyx_pw_9fastremap_467unique_via_sort(PyObject *__ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unique_via_sort (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 825, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_466unique_via_sort(__pyx_self, ((PyArrayObject *)__pyx_v_labels)); /* function exit code */ @@ -95301,20 +98043,20 @@ static PyObject *__pyx_pf_9fastremap_466unique_via_sort(CYTHON_UNUSED PyObject * __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 825, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":811 + /* "fastremap.pyx":827 * def unique_via_sort(cnp.ndarray[ALLINT, ndim=1] labels): * """Slower than unique_via_array but can handle any label.""" * labels = np.copy(labels) # <<<<<<<<<<<<<< * labels.sort() * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 811, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -95329,10 +98071,10 @@ static PyObject *__pyx_pf_9fastremap_466unique_via_sort(CYTHON_UNUSED PyObject * } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_labels)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_labels)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 811, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 827, __pyx_L1_error) __pyx_t_4 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -95349,20 +98091,20 @@ static PyObject *__pyx_pf_9fastremap_466unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0; } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 811, __pyx_L1_error) + if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 827, __pyx_L1_error) } __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_labels, ((PyArrayObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "fastremap.pyx":812 + /* "fastremap.pyx":828 * """Slower than unique_via_array but can handle any label.""" * labels = np.copy(labels) * labels.sort() # <<<<<<<<<<<<<< * * cdef size_t voxels = labels.size */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 812, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -95376,66 +98118,66 @@ static PyObject *__pyx_pf_9fastremap_466unique_via_sort(CYTHON_UNUSED PyObject * } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":814 + /* "fastremap.pyx":830 * labels.sort() * * cdef size_t voxels = labels.size # <<<<<<<<<<<<<< * * cdef cnp.ndarray[ALLINT, ndim=1] uniq = np.zeros((voxels,), dtype=labels.dtype) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_voxels = __pyx_t_9; - /* "fastremap.pyx":816 + /* "fastremap.pyx":832 * cdef size_t voxels = labels.size * * cdef cnp.ndarray[ALLINT, ndim=1] uniq = np.zeros((voxels,), dtype=labels.dtype) # <<<<<<<<<<<<<< * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros((voxels,), dtype=np.uint32) * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 816, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 816, __pyx_L1_error) + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 832, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_10); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_uniq.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_uniq = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_uniq.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 816, __pyx_L1_error) + __PYX_ERR(0, 832, __pyx_L1_error) } else {__pyx_pybuffernd_uniq.diminfo[0].strides = __pyx_pybuffernd_uniq.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_uniq.diminfo[0].shape = __pyx_pybuffernd_uniq.rcbuffer->pybuffer.shape[0]; } } @@ -95443,51 +98185,51 @@ static PyObject *__pyx_pf_9fastremap_466unique_via_sort(CYTHON_UNUSED PyObject * __pyx_v_uniq = ((PyArrayObject *)__pyx_t_10); __pyx_t_10 = 0; - /* "fastremap.pyx":817 + /* "fastremap.pyx":833 * * cdef cnp.ndarray[ALLINT, ndim=1] uniq = np.zeros((voxels,), dtype=labels.dtype) * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros((voxels,), dtype=np.uint32) # <<<<<<<<<<<<<< * * cdef size_t i = 0 */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 817, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 817, __pyx_L1_error) + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 833, __pyx_L1_error) __pyx_t_13 = ((PyArrayObject *)__pyx_t_12); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_counts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 817, __pyx_L1_error) + __PYX_ERR(0, 833, __pyx_L1_error) } else {__pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; } } @@ -95495,7 +98237,7 @@ static PyObject *__pyx_pf_9fastremap_466unique_via_sort(CYTHON_UNUSED PyObject * __pyx_v_counts = ((PyArrayObject *)__pyx_t_12); __pyx_t_12 = 0; - /* "fastremap.pyx":819 + /* "fastremap.pyx":835 * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros((voxels,), dtype=np.uint32) * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -95504,7 +98246,7 @@ static PyObject *__pyx_pf_9fastremap_466unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_i = 0; - /* "fastremap.pyx":820 + /* "fastremap.pyx":836 * * cdef size_t i = 0 * cdef size_t j = 0 # <<<<<<<<<<<<<< @@ -95513,7 +98255,7 @@ static PyObject *__pyx_pf_9fastremap_466unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_j = 0; - /* "fastremap.pyx":822 + /* "fastremap.pyx":838 * cdef size_t j = 0 * * cdef ALLINT cur = labels[0] # <<<<<<<<<<<<<< @@ -95523,7 +98265,7 @@ static PyObject *__pyx_pf_9fastremap_466unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_14 = 0; __pyx_v_cur = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); - /* "fastremap.pyx":823 + /* "fastremap.pyx":839 * * cdef ALLINT cur = labels[0] * cdef size_t accum = 1 # <<<<<<<<<<<<<< @@ -95532,7 +98274,7 @@ static PyObject *__pyx_pf_9fastremap_466unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_accum = 1; - /* "fastremap.pyx":824 + /* "fastremap.pyx":840 * cdef ALLINT cur = labels[0] * cdef size_t accum = 1 * for i in range(1, voxels): # <<<<<<<<<<<<<< @@ -95544,7 +98286,7 @@ static PyObject *__pyx_pf_9fastremap_466unique_via_sort(CYTHON_UNUSED PyObject * for (__pyx_t_16 = 1; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":825 + /* "fastremap.pyx":841 * cdef size_t accum = 1 * for i in range(1, voxels): * if cur == labels[i]: # <<<<<<<<<<<<<< @@ -95555,7 +98297,7 @@ static PyObject *__pyx_pf_9fastremap_466unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_18 = ((__pyx_v_cur == (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides))) != 0); if (__pyx_t_18) { - /* "fastremap.pyx":826 + /* "fastremap.pyx":842 * for i in range(1, voxels): * if cur == labels[i]: * accum += 1 # <<<<<<<<<<<<<< @@ -95564,7 +98306,7 @@ static PyObject *__pyx_pf_9fastremap_466unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_accum = (__pyx_v_accum + 1); - /* "fastremap.pyx":825 + /* "fastremap.pyx":841 * cdef size_t accum = 1 * for i in range(1, voxels): * if cur == labels[i]: # <<<<<<<<<<<<<< @@ -95574,7 +98316,7 @@ static PyObject *__pyx_pf_9fastremap_466unique_via_sort(CYTHON_UNUSED PyObject * goto __pyx_L5; } - /* "fastremap.pyx":828 + /* "fastremap.pyx":844 * accum += 1 * else: * uniq[j] = cur # <<<<<<<<<<<<<< @@ -95585,7 +98327,7 @@ static PyObject *__pyx_pf_9fastremap_466unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_17 = __pyx_v_j; *__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_uniq.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_uniq.diminfo[0].strides) = __pyx_v_cur; - /* "fastremap.pyx":829 + /* "fastremap.pyx":845 * else: * uniq[j] = cur * counts[j] = accum # <<<<<<<<<<<<<< @@ -95595,7 +98337,7 @@ static PyObject *__pyx_pf_9fastremap_466unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_17 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) = __pyx_v_accum; - /* "fastremap.pyx":830 + /* "fastremap.pyx":846 * uniq[j] = cur * counts[j] = accum * accum = 1 # <<<<<<<<<<<<<< @@ -95604,7 +98346,7 @@ static PyObject *__pyx_pf_9fastremap_466unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_accum = 1; - /* "fastremap.pyx":831 + /* "fastremap.pyx":847 * counts[j] = accum * accum = 1 * cur = labels[i] # <<<<<<<<<<<<<< @@ -95614,7 +98356,7 @@ static PyObject *__pyx_pf_9fastremap_466unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_17 = __pyx_v_i; __pyx_v_cur = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides)); - /* "fastremap.pyx":832 + /* "fastremap.pyx":848 * accum = 1 * cur = labels[i] * j += 1 # <<<<<<<<<<<<<< @@ -95626,7 +98368,7 @@ static PyObject *__pyx_pf_9fastremap_466unique_via_sort(CYTHON_UNUSED PyObject * __pyx_L5:; } - /* "fastremap.pyx":834 + /* "fastremap.pyx":850 * j += 1 * * uniq[j] = cur # <<<<<<<<<<<<<< @@ -95636,7 +98378,7 @@ static PyObject *__pyx_pf_9fastremap_466unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_9 = __pyx_v_j; *__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_uniq.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_uniq.diminfo[0].strides) = __pyx_v_cur; - /* "fastremap.pyx":835 + /* "fastremap.pyx":851 * * uniq[j] = cur * counts[j] = accum # <<<<<<<<<<<<<< @@ -95646,7 +98388,7 @@ static PyObject *__pyx_pf_9fastremap_466unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_9 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_counts.diminfo[0].strides) = __pyx_v_accum; - /* "fastremap.pyx":837 + /* "fastremap.pyx":853 * counts[j] = accum * * return uniq[:j+1], counts[:j+1] # <<<<<<<<<<<<<< @@ -95654,23 +98396,23 @@ static PyObject *__pyx_pf_9fastremap_466unique_via_sort(CYTHON_UNUSED PyObject * * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_12 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = PySlice_New(Py_None, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = PySlice_New(Py_None, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_uniq), __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_uniq), __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_10 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_counts), __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_counts), __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12); @@ -95682,7 +98424,7 @@ static PyObject *__pyx_pf_9fastremap_466unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_10 = 0; goto __pyx_L0; - /* "fastremap.pyx":809 + /* "fastremap.pyx":825 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def unique_via_sort(cnp.ndarray[ALLINT, ndim=1] labels): # <<<<<<<<<<<<<< @@ -95731,7 +98473,7 @@ static PyObject *__pyx_fuse_5__pyx_pw_9fastremap_469unique_via_sort(PyObject *__ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unique_via_sort (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 825, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_468unique_via_sort(__pyx_self, ((PyArrayObject *)__pyx_v_labels)); /* function exit code */ @@ -95796,20 +98538,20 @@ static PyObject *__pyx_pf_9fastremap_468unique_via_sort(CYTHON_UNUSED PyObject * __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 825, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":811 + /* "fastremap.pyx":827 * def unique_via_sort(cnp.ndarray[ALLINT, ndim=1] labels): * """Slower than unique_via_array but can handle any label.""" * labels = np.copy(labels) # <<<<<<<<<<<<<< * labels.sort() * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 811, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -95824,10 +98566,10 @@ static PyObject *__pyx_pf_9fastremap_468unique_via_sort(CYTHON_UNUSED PyObject * } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_labels)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_labels)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 811, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 827, __pyx_L1_error) __pyx_t_4 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -95844,20 +98586,20 @@ static PyObject *__pyx_pf_9fastremap_468unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0; } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 811, __pyx_L1_error) + if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 827, __pyx_L1_error) } __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_labels, ((PyArrayObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "fastremap.pyx":812 + /* "fastremap.pyx":828 * """Slower than unique_via_array but can handle any label.""" * labels = np.copy(labels) * labels.sort() # <<<<<<<<<<<<<< * * cdef size_t voxels = labels.size */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 812, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -95871,66 +98613,66 @@ static PyObject *__pyx_pf_9fastremap_468unique_via_sort(CYTHON_UNUSED PyObject * } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":814 + /* "fastremap.pyx":830 * labels.sort() * * cdef size_t voxels = labels.size # <<<<<<<<<<<<<< * * cdef cnp.ndarray[ALLINT, ndim=1] uniq = np.zeros((voxels,), dtype=labels.dtype) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_voxels = __pyx_t_9; - /* "fastremap.pyx":816 + /* "fastremap.pyx":832 * cdef size_t voxels = labels.size * * cdef cnp.ndarray[ALLINT, ndim=1] uniq = np.zeros((voxels,), dtype=labels.dtype) # <<<<<<<<<<<<<< * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros((voxels,), dtype=np.uint32) * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 816, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 816, __pyx_L1_error) + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 832, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_10); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_uniq.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_uniq = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_uniq.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 816, __pyx_L1_error) + __PYX_ERR(0, 832, __pyx_L1_error) } else {__pyx_pybuffernd_uniq.diminfo[0].strides = __pyx_pybuffernd_uniq.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_uniq.diminfo[0].shape = __pyx_pybuffernd_uniq.rcbuffer->pybuffer.shape[0]; } } @@ -95938,51 +98680,51 @@ static PyObject *__pyx_pf_9fastremap_468unique_via_sort(CYTHON_UNUSED PyObject * __pyx_v_uniq = ((PyArrayObject *)__pyx_t_10); __pyx_t_10 = 0; - /* "fastremap.pyx":817 + /* "fastremap.pyx":833 * * cdef cnp.ndarray[ALLINT, ndim=1] uniq = np.zeros((voxels,), dtype=labels.dtype) * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros((voxels,), dtype=np.uint32) # <<<<<<<<<<<<<< * * cdef size_t i = 0 */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 817, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 817, __pyx_L1_error) + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 833, __pyx_L1_error) __pyx_t_13 = ((PyArrayObject *)__pyx_t_12); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_counts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 817, __pyx_L1_error) + __PYX_ERR(0, 833, __pyx_L1_error) } else {__pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; } } @@ -95990,7 +98732,7 @@ static PyObject *__pyx_pf_9fastremap_468unique_via_sort(CYTHON_UNUSED PyObject * __pyx_v_counts = ((PyArrayObject *)__pyx_t_12); __pyx_t_12 = 0; - /* "fastremap.pyx":819 + /* "fastremap.pyx":835 * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros((voxels,), dtype=np.uint32) * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -95999,7 +98741,7 @@ static PyObject *__pyx_pf_9fastremap_468unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_i = 0; - /* "fastremap.pyx":820 + /* "fastremap.pyx":836 * * cdef size_t i = 0 * cdef size_t j = 0 # <<<<<<<<<<<<<< @@ -96008,7 +98750,7 @@ static PyObject *__pyx_pf_9fastremap_468unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_j = 0; - /* "fastremap.pyx":822 + /* "fastremap.pyx":838 * cdef size_t j = 0 * * cdef ALLINT cur = labels[0] # <<<<<<<<<<<<<< @@ -96018,7 +98760,7 @@ static PyObject *__pyx_pf_9fastremap_468unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_14 = 0; __pyx_v_cur = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); - /* "fastremap.pyx":823 + /* "fastremap.pyx":839 * * cdef ALLINT cur = labels[0] * cdef size_t accum = 1 # <<<<<<<<<<<<<< @@ -96027,7 +98769,7 @@ static PyObject *__pyx_pf_9fastremap_468unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_accum = 1; - /* "fastremap.pyx":824 + /* "fastremap.pyx":840 * cdef ALLINT cur = labels[0] * cdef size_t accum = 1 * for i in range(1, voxels): # <<<<<<<<<<<<<< @@ -96039,7 +98781,7 @@ static PyObject *__pyx_pf_9fastremap_468unique_via_sort(CYTHON_UNUSED PyObject * for (__pyx_t_16 = 1; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":825 + /* "fastremap.pyx":841 * cdef size_t accum = 1 * for i in range(1, voxels): * if cur == labels[i]: # <<<<<<<<<<<<<< @@ -96050,7 +98792,7 @@ static PyObject *__pyx_pf_9fastremap_468unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_18 = ((__pyx_v_cur == (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides))) != 0); if (__pyx_t_18) { - /* "fastremap.pyx":826 + /* "fastremap.pyx":842 * for i in range(1, voxels): * if cur == labels[i]: * accum += 1 # <<<<<<<<<<<<<< @@ -96059,7 +98801,7 @@ static PyObject *__pyx_pf_9fastremap_468unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_accum = (__pyx_v_accum + 1); - /* "fastremap.pyx":825 + /* "fastremap.pyx":841 * cdef size_t accum = 1 * for i in range(1, voxels): * if cur == labels[i]: # <<<<<<<<<<<<<< @@ -96069,7 +98811,7 @@ static PyObject *__pyx_pf_9fastremap_468unique_via_sort(CYTHON_UNUSED PyObject * goto __pyx_L5; } - /* "fastremap.pyx":828 + /* "fastremap.pyx":844 * accum += 1 * else: * uniq[j] = cur # <<<<<<<<<<<<<< @@ -96080,7 +98822,7 @@ static PyObject *__pyx_pf_9fastremap_468unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_17 = __pyx_v_j; *__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_uniq.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_uniq.diminfo[0].strides) = __pyx_v_cur; - /* "fastremap.pyx":829 + /* "fastremap.pyx":845 * else: * uniq[j] = cur * counts[j] = accum # <<<<<<<<<<<<<< @@ -96090,7 +98832,7 @@ static PyObject *__pyx_pf_9fastremap_468unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_17 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) = __pyx_v_accum; - /* "fastremap.pyx":830 + /* "fastremap.pyx":846 * uniq[j] = cur * counts[j] = accum * accum = 1 # <<<<<<<<<<<<<< @@ -96099,7 +98841,7 @@ static PyObject *__pyx_pf_9fastremap_468unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_accum = 1; - /* "fastremap.pyx":831 + /* "fastremap.pyx":847 * counts[j] = accum * accum = 1 * cur = labels[i] # <<<<<<<<<<<<<< @@ -96109,7 +98851,7 @@ static PyObject *__pyx_pf_9fastremap_468unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_17 = __pyx_v_i; __pyx_v_cur = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides)); - /* "fastremap.pyx":832 + /* "fastremap.pyx":848 * accum = 1 * cur = labels[i] * j += 1 # <<<<<<<<<<<<<< @@ -96121,7 +98863,7 @@ static PyObject *__pyx_pf_9fastremap_468unique_via_sort(CYTHON_UNUSED PyObject * __pyx_L5:; } - /* "fastremap.pyx":834 + /* "fastremap.pyx":850 * j += 1 * * uniq[j] = cur # <<<<<<<<<<<<<< @@ -96131,7 +98873,7 @@ static PyObject *__pyx_pf_9fastremap_468unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_9 = __pyx_v_j; *__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_uniq.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_uniq.diminfo[0].strides) = __pyx_v_cur; - /* "fastremap.pyx":835 + /* "fastremap.pyx":851 * * uniq[j] = cur * counts[j] = accum # <<<<<<<<<<<<<< @@ -96141,7 +98883,7 @@ static PyObject *__pyx_pf_9fastremap_468unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_9 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_counts.diminfo[0].strides) = __pyx_v_accum; - /* "fastremap.pyx":837 + /* "fastremap.pyx":853 * counts[j] = accum * * return uniq[:j+1], counts[:j+1] # <<<<<<<<<<<<<< @@ -96149,23 +98891,23 @@ static PyObject *__pyx_pf_9fastremap_468unique_via_sort(CYTHON_UNUSED PyObject * * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_12 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = PySlice_New(Py_None, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = PySlice_New(Py_None, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_uniq), __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_uniq), __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_10 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_counts), __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_counts), __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12); @@ -96177,7 +98919,7 @@ static PyObject *__pyx_pf_9fastremap_468unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_10 = 0; goto __pyx_L0; - /* "fastremap.pyx":809 + /* "fastremap.pyx":825 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def unique_via_sort(cnp.ndarray[ALLINT, ndim=1] labels): # <<<<<<<<<<<<<< @@ -96226,7 +98968,7 @@ static PyObject *__pyx_fuse_6__pyx_pw_9fastremap_471unique_via_sort(PyObject *__ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unique_via_sort (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 825, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_470unique_via_sort(__pyx_self, ((PyArrayObject *)__pyx_v_labels)); /* function exit code */ @@ -96291,20 +99033,20 @@ static PyObject *__pyx_pf_9fastremap_470unique_via_sort(CYTHON_UNUSED PyObject * __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 825, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":811 + /* "fastremap.pyx":827 * def unique_via_sort(cnp.ndarray[ALLINT, ndim=1] labels): * """Slower than unique_via_array but can handle any label.""" * labels = np.copy(labels) # <<<<<<<<<<<<<< * labels.sort() * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 811, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -96319,10 +99061,10 @@ static PyObject *__pyx_pf_9fastremap_470unique_via_sort(CYTHON_UNUSED PyObject * } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_labels)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_labels)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 811, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 827, __pyx_L1_error) __pyx_t_4 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -96339,20 +99081,20 @@ static PyObject *__pyx_pf_9fastremap_470unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0; } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 811, __pyx_L1_error) + if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 827, __pyx_L1_error) } __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_labels, ((PyArrayObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "fastremap.pyx":812 + /* "fastremap.pyx":828 * """Slower than unique_via_array but can handle any label.""" * labels = np.copy(labels) * labels.sort() # <<<<<<<<<<<<<< * * cdef size_t voxels = labels.size */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 812, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -96366,66 +99108,66 @@ static PyObject *__pyx_pf_9fastremap_470unique_via_sort(CYTHON_UNUSED PyObject * } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":814 + /* "fastremap.pyx":830 * labels.sort() * * cdef size_t voxels = labels.size # <<<<<<<<<<<<<< * * cdef cnp.ndarray[ALLINT, ndim=1] uniq = np.zeros((voxels,), dtype=labels.dtype) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_voxels = __pyx_t_9; - /* "fastremap.pyx":816 + /* "fastremap.pyx":832 * cdef size_t voxels = labels.size * * cdef cnp.ndarray[ALLINT, ndim=1] uniq = np.zeros((voxels,), dtype=labels.dtype) # <<<<<<<<<<<<<< * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros((voxels,), dtype=np.uint32) * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 816, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 816, __pyx_L1_error) + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 832, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_10); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_uniq.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_uniq = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_uniq.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 816, __pyx_L1_error) + __PYX_ERR(0, 832, __pyx_L1_error) } else {__pyx_pybuffernd_uniq.diminfo[0].strides = __pyx_pybuffernd_uniq.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_uniq.diminfo[0].shape = __pyx_pybuffernd_uniq.rcbuffer->pybuffer.shape[0]; } } @@ -96433,51 +99175,51 @@ static PyObject *__pyx_pf_9fastremap_470unique_via_sort(CYTHON_UNUSED PyObject * __pyx_v_uniq = ((PyArrayObject *)__pyx_t_10); __pyx_t_10 = 0; - /* "fastremap.pyx":817 + /* "fastremap.pyx":833 * * cdef cnp.ndarray[ALLINT, ndim=1] uniq = np.zeros((voxels,), dtype=labels.dtype) * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros((voxels,), dtype=np.uint32) # <<<<<<<<<<<<<< * * cdef size_t i = 0 */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 817, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 817, __pyx_L1_error) + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 833, __pyx_L1_error) __pyx_t_13 = ((PyArrayObject *)__pyx_t_12); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_counts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 817, __pyx_L1_error) + __PYX_ERR(0, 833, __pyx_L1_error) } else {__pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; } } @@ -96485,7 +99227,7 @@ static PyObject *__pyx_pf_9fastremap_470unique_via_sort(CYTHON_UNUSED PyObject * __pyx_v_counts = ((PyArrayObject *)__pyx_t_12); __pyx_t_12 = 0; - /* "fastremap.pyx":819 + /* "fastremap.pyx":835 * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros((voxels,), dtype=np.uint32) * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -96494,7 +99236,7 @@ static PyObject *__pyx_pf_9fastremap_470unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_i = 0; - /* "fastremap.pyx":820 + /* "fastremap.pyx":836 * * cdef size_t i = 0 * cdef size_t j = 0 # <<<<<<<<<<<<<< @@ -96503,7 +99245,7 @@ static PyObject *__pyx_pf_9fastremap_470unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_j = 0; - /* "fastremap.pyx":822 + /* "fastremap.pyx":838 * cdef size_t j = 0 * * cdef ALLINT cur = labels[0] # <<<<<<<<<<<<<< @@ -96513,7 +99255,7 @@ static PyObject *__pyx_pf_9fastremap_470unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_14 = 0; __pyx_v_cur = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); - /* "fastremap.pyx":823 + /* "fastremap.pyx":839 * * cdef ALLINT cur = labels[0] * cdef size_t accum = 1 # <<<<<<<<<<<<<< @@ -96522,7 +99264,7 @@ static PyObject *__pyx_pf_9fastremap_470unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_accum = 1; - /* "fastremap.pyx":824 + /* "fastremap.pyx":840 * cdef ALLINT cur = labels[0] * cdef size_t accum = 1 * for i in range(1, voxels): # <<<<<<<<<<<<<< @@ -96534,7 +99276,7 @@ static PyObject *__pyx_pf_9fastremap_470unique_via_sort(CYTHON_UNUSED PyObject * for (__pyx_t_16 = 1; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":825 + /* "fastremap.pyx":841 * cdef size_t accum = 1 * for i in range(1, voxels): * if cur == labels[i]: # <<<<<<<<<<<<<< @@ -96545,7 +99287,7 @@ static PyObject *__pyx_pf_9fastremap_470unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_18 = ((__pyx_v_cur == (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides))) != 0); if (__pyx_t_18) { - /* "fastremap.pyx":826 + /* "fastremap.pyx":842 * for i in range(1, voxels): * if cur == labels[i]: * accum += 1 # <<<<<<<<<<<<<< @@ -96554,7 +99296,7 @@ static PyObject *__pyx_pf_9fastremap_470unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_accum = (__pyx_v_accum + 1); - /* "fastremap.pyx":825 + /* "fastremap.pyx":841 * cdef size_t accum = 1 * for i in range(1, voxels): * if cur == labels[i]: # <<<<<<<<<<<<<< @@ -96564,7 +99306,7 @@ static PyObject *__pyx_pf_9fastremap_470unique_via_sort(CYTHON_UNUSED PyObject * goto __pyx_L5; } - /* "fastremap.pyx":828 + /* "fastremap.pyx":844 * accum += 1 * else: * uniq[j] = cur # <<<<<<<<<<<<<< @@ -96575,7 +99317,7 @@ static PyObject *__pyx_pf_9fastremap_470unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_17 = __pyx_v_j; *__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_uniq.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_uniq.diminfo[0].strides) = __pyx_v_cur; - /* "fastremap.pyx":829 + /* "fastremap.pyx":845 * else: * uniq[j] = cur * counts[j] = accum # <<<<<<<<<<<<<< @@ -96585,7 +99327,7 @@ static PyObject *__pyx_pf_9fastremap_470unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_17 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) = __pyx_v_accum; - /* "fastremap.pyx":830 + /* "fastremap.pyx":846 * uniq[j] = cur * counts[j] = accum * accum = 1 # <<<<<<<<<<<<<< @@ -96594,7 +99336,7 @@ static PyObject *__pyx_pf_9fastremap_470unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_accum = 1; - /* "fastremap.pyx":831 + /* "fastremap.pyx":847 * counts[j] = accum * accum = 1 * cur = labels[i] # <<<<<<<<<<<<<< @@ -96604,7 +99346,7 @@ static PyObject *__pyx_pf_9fastremap_470unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_17 = __pyx_v_i; __pyx_v_cur = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides)); - /* "fastremap.pyx":832 + /* "fastremap.pyx":848 * accum = 1 * cur = labels[i] * j += 1 # <<<<<<<<<<<<<< @@ -96616,7 +99358,7 @@ static PyObject *__pyx_pf_9fastremap_470unique_via_sort(CYTHON_UNUSED PyObject * __pyx_L5:; } - /* "fastremap.pyx":834 + /* "fastremap.pyx":850 * j += 1 * * uniq[j] = cur # <<<<<<<<<<<<<< @@ -96626,7 +99368,7 @@ static PyObject *__pyx_pf_9fastremap_470unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_9 = __pyx_v_j; *__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_uniq.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_uniq.diminfo[0].strides) = __pyx_v_cur; - /* "fastremap.pyx":835 + /* "fastremap.pyx":851 * * uniq[j] = cur * counts[j] = accum # <<<<<<<<<<<<<< @@ -96636,7 +99378,7 @@ static PyObject *__pyx_pf_9fastremap_470unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_9 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_counts.diminfo[0].strides) = __pyx_v_accum; - /* "fastremap.pyx":837 + /* "fastremap.pyx":853 * counts[j] = accum * * return uniq[:j+1], counts[:j+1] # <<<<<<<<<<<<<< @@ -96644,23 +99386,23 @@ static PyObject *__pyx_pf_9fastremap_470unique_via_sort(CYTHON_UNUSED PyObject * * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_12 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = PySlice_New(Py_None, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = PySlice_New(Py_None, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_uniq), __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_uniq), __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_10 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_counts), __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_counts), __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12); @@ -96672,7 +99414,7 @@ static PyObject *__pyx_pf_9fastremap_470unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_10 = 0; goto __pyx_L0; - /* "fastremap.pyx":809 + /* "fastremap.pyx":825 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def unique_via_sort(cnp.ndarray[ALLINT, ndim=1] labels): # <<<<<<<<<<<<<< @@ -96721,7 +99463,7 @@ static PyObject *__pyx_fuse_7__pyx_pw_9fastremap_473unique_via_sort(PyObject *__ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unique_via_sort (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 825, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_472unique_via_sort(__pyx_self, ((PyArrayObject *)__pyx_v_labels)); /* function exit code */ @@ -96786,20 +99528,20 @@ static PyObject *__pyx_pf_9fastremap_472unique_via_sort(CYTHON_UNUSED PyObject * __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 825, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":811 + /* "fastremap.pyx":827 * def unique_via_sort(cnp.ndarray[ALLINT, ndim=1] labels): * """Slower than unique_via_array but can handle any label.""" * labels = np.copy(labels) # <<<<<<<<<<<<<< * labels.sort() * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 811, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -96814,10 +99556,10 @@ static PyObject *__pyx_pf_9fastremap_472unique_via_sort(CYTHON_UNUSED PyObject * } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_labels)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_labels)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 811, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 827, __pyx_L1_error) __pyx_t_4 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -96834,20 +99576,20 @@ static PyObject *__pyx_pf_9fastremap_472unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0; } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 811, __pyx_L1_error) + if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 827, __pyx_L1_error) } __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_labels, ((PyArrayObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "fastremap.pyx":812 + /* "fastremap.pyx":828 * """Slower than unique_via_array but can handle any label.""" * labels = np.copy(labels) * labels.sort() # <<<<<<<<<<<<<< * * cdef size_t voxels = labels.size */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 812, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -96861,66 +99603,66 @@ static PyObject *__pyx_pf_9fastremap_472unique_via_sort(CYTHON_UNUSED PyObject * } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":814 + /* "fastremap.pyx":830 * labels.sort() * * cdef size_t voxels = labels.size # <<<<<<<<<<<<<< * * cdef cnp.ndarray[ALLINT, ndim=1] uniq = np.zeros((voxels,), dtype=labels.dtype) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_voxels = __pyx_t_9; - /* "fastremap.pyx":816 + /* "fastremap.pyx":832 * cdef size_t voxels = labels.size * * cdef cnp.ndarray[ALLINT, ndim=1] uniq = np.zeros((voxels,), dtype=labels.dtype) # <<<<<<<<<<<<<< * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros((voxels,), dtype=np.uint32) * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 816, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 816, __pyx_L1_error) + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 832, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_10); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_uniq.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_uniq = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_uniq.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 816, __pyx_L1_error) + __PYX_ERR(0, 832, __pyx_L1_error) } else {__pyx_pybuffernd_uniq.diminfo[0].strides = __pyx_pybuffernd_uniq.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_uniq.diminfo[0].shape = __pyx_pybuffernd_uniq.rcbuffer->pybuffer.shape[0]; } } @@ -96928,51 +99670,51 @@ static PyObject *__pyx_pf_9fastremap_472unique_via_sort(CYTHON_UNUSED PyObject * __pyx_v_uniq = ((PyArrayObject *)__pyx_t_10); __pyx_t_10 = 0; - /* "fastremap.pyx":817 + /* "fastremap.pyx":833 * * cdef cnp.ndarray[ALLINT, ndim=1] uniq = np.zeros((voxels,), dtype=labels.dtype) * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros((voxels,), dtype=np.uint32) # <<<<<<<<<<<<<< * * cdef size_t i = 0 */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_FromSize_t(__pyx_v_voxels); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 817, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 817, __pyx_L1_error) + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 833, __pyx_L1_error) __pyx_t_13 = ((PyArrayObject *)__pyx_t_12); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_counts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 817, __pyx_L1_error) + __PYX_ERR(0, 833, __pyx_L1_error) } else {__pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; } } @@ -96980,7 +99722,7 @@ static PyObject *__pyx_pf_9fastremap_472unique_via_sort(CYTHON_UNUSED PyObject * __pyx_v_counts = ((PyArrayObject *)__pyx_t_12); __pyx_t_12 = 0; - /* "fastremap.pyx":819 + /* "fastremap.pyx":835 * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros((voxels,), dtype=np.uint32) * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -96989,7 +99731,7 @@ static PyObject *__pyx_pf_9fastremap_472unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_i = 0; - /* "fastremap.pyx":820 + /* "fastremap.pyx":836 * * cdef size_t i = 0 * cdef size_t j = 0 # <<<<<<<<<<<<<< @@ -96998,7 +99740,7 @@ static PyObject *__pyx_pf_9fastremap_472unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_j = 0; - /* "fastremap.pyx":822 + /* "fastremap.pyx":838 * cdef size_t j = 0 * * cdef ALLINT cur = labels[0] # <<<<<<<<<<<<<< @@ -97008,7 +99750,7 @@ static PyObject *__pyx_pf_9fastremap_472unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_14 = 0; __pyx_v_cur = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_labels.diminfo[0].strides)); - /* "fastremap.pyx":823 + /* "fastremap.pyx":839 * * cdef ALLINT cur = labels[0] * cdef size_t accum = 1 # <<<<<<<<<<<<<< @@ -97017,7 +99759,7 @@ static PyObject *__pyx_pf_9fastremap_472unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_accum = 1; - /* "fastremap.pyx":824 + /* "fastremap.pyx":840 * cdef ALLINT cur = labels[0] * cdef size_t accum = 1 * for i in range(1, voxels): # <<<<<<<<<<<<<< @@ -97029,7 +99771,7 @@ static PyObject *__pyx_pf_9fastremap_472unique_via_sort(CYTHON_UNUSED PyObject * for (__pyx_t_16 = 1; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":825 + /* "fastremap.pyx":841 * cdef size_t accum = 1 * for i in range(1, voxels): * if cur == labels[i]: # <<<<<<<<<<<<<< @@ -97040,7 +99782,7 @@ static PyObject *__pyx_pf_9fastremap_472unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_18 = ((__pyx_v_cur == (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides))) != 0); if (__pyx_t_18) { - /* "fastremap.pyx":826 + /* "fastremap.pyx":842 * for i in range(1, voxels): * if cur == labels[i]: * accum += 1 # <<<<<<<<<<<<<< @@ -97049,7 +99791,7 @@ static PyObject *__pyx_pf_9fastremap_472unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_accum = (__pyx_v_accum + 1); - /* "fastremap.pyx":825 + /* "fastremap.pyx":841 * cdef size_t accum = 1 * for i in range(1, voxels): * if cur == labels[i]: # <<<<<<<<<<<<<< @@ -97059,7 +99801,7 @@ static PyObject *__pyx_pf_9fastremap_472unique_via_sort(CYTHON_UNUSED PyObject * goto __pyx_L5; } - /* "fastremap.pyx":828 + /* "fastremap.pyx":844 * accum += 1 * else: * uniq[j] = cur # <<<<<<<<<<<<<< @@ -97070,7 +99812,7 @@ static PyObject *__pyx_pf_9fastremap_472unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_17 = __pyx_v_j; *__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_uniq.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_uniq.diminfo[0].strides) = __pyx_v_cur; - /* "fastremap.pyx":829 + /* "fastremap.pyx":845 * else: * uniq[j] = cur * counts[j] = accum # <<<<<<<<<<<<<< @@ -97080,7 +99822,7 @@ static PyObject *__pyx_pf_9fastremap_472unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_17 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides) = __pyx_v_accum; - /* "fastremap.pyx":830 + /* "fastremap.pyx":846 * uniq[j] = cur * counts[j] = accum * accum = 1 # <<<<<<<<<<<<<< @@ -97089,7 +99831,7 @@ static PyObject *__pyx_pf_9fastremap_472unique_via_sort(CYTHON_UNUSED PyObject * */ __pyx_v_accum = 1; - /* "fastremap.pyx":831 + /* "fastremap.pyx":847 * counts[j] = accum * accum = 1 * cur = labels[i] # <<<<<<<<<<<<<< @@ -97099,7 +99841,7 @@ static PyObject *__pyx_pf_9fastremap_472unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_17 = __pyx_v_i; __pyx_v_cur = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides)); - /* "fastremap.pyx":832 + /* "fastremap.pyx":848 * accum = 1 * cur = labels[i] * j += 1 # <<<<<<<<<<<<<< @@ -97111,7 +99853,7 @@ static PyObject *__pyx_pf_9fastremap_472unique_via_sort(CYTHON_UNUSED PyObject * __pyx_L5:; } - /* "fastremap.pyx":834 + /* "fastremap.pyx":850 * j += 1 * * uniq[j] = cur # <<<<<<<<<<<<<< @@ -97121,7 +99863,7 @@ static PyObject *__pyx_pf_9fastremap_472unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_9 = __pyx_v_j; *__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_uniq.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_uniq.diminfo[0].strides) = __pyx_v_cur; - /* "fastremap.pyx":835 + /* "fastremap.pyx":851 * * uniq[j] = cur * counts[j] = accum # <<<<<<<<<<<<<< @@ -97131,7 +99873,7 @@ static PyObject *__pyx_pf_9fastremap_472unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_9 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_counts.diminfo[0].strides) = __pyx_v_accum; - /* "fastremap.pyx":837 + /* "fastremap.pyx":853 * counts[j] = accum * * return uniq[:j+1], counts[:j+1] # <<<<<<<<<<<<<< @@ -97139,23 +99881,23 @@ static PyObject *__pyx_pf_9fastremap_472unique_via_sort(CYTHON_UNUSED PyObject * * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_12 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = PySlice_New(Py_None, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = PySlice_New(Py_None, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_uniq), __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_uniq), __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_j + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_10 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_counts), __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_counts), __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12); @@ -97167,7 +99909,7 @@ static PyObject *__pyx_pf_9fastremap_472unique_via_sort(CYTHON_UNUSED PyObject * __pyx_t_10 = 0; goto __pyx_L0; - /* "fastremap.pyx":809 + /* "fastremap.pyx":825 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def unique_via_sort(cnp.ndarray[ALLINT, ndim=1] labels): # <<<<<<<<<<<<<< @@ -97206,7 +99948,7 @@ static PyObject *__pyx_pf_9fastremap_472unique_via_sort(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "fastremap.pyx":842 +/* "fastremap.pyx":858 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def unique_via_array(cnp.ndarray[ALLINT, ndim=1] labels, size_t max_label, return_index=False): # <<<<<<<<<<<<<< @@ -97257,7 +99999,7 @@ static PyObject *__pyx_pw_9fastremap_49unique_via_array(PyObject *__pyx_self, Py case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 842, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 858, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -97269,11 +100011,11 @@ static PyObject *__pyx_pw_9fastremap_49unique_via_array(PyObject *__pyx_self, Py case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 842, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 858, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 842, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 858, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -97290,7 +100032,7 @@ static PyObject *__pyx_pw_9fastremap_49unique_via_array(PyObject *__pyx_self, Py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 842, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 858, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -97352,7 +100094,7 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("unique_via_array", 0); __Pyx_INCREF(__pyx_v_kwargs); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -97366,7 +100108,7 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 858, __pyx_L1_error) __pyx_t_3 = ((!__pyx_t_4) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; @@ -97374,7 +100116,7 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_kwargs, Py_None); } - __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -97389,14 +100131,14 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_v____pyx_int64_t_is_signed = (!((((int64_t)-1L) > 0) != 0)); if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 842, __pyx_L1_error) + __PYX_ERR(0, 858, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 858, __pyx_L1_error) __pyx_t_2 = ((0 < __pyx_t_5) != 0); if (__pyx_t_2) { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 842, __pyx_L1_error) + __PYX_ERR(0, 858, __pyx_L1_error) } __pyx_t_1 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0); __Pyx_INCREF(__pyx_t_1); @@ -97413,18 +100155,18 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 842, __pyx_L1_error) + __PYX_ERR(0, 858, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_labels, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_labels, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 858, __pyx_L1_error) __pyx_t_3 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_3; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 842, __pyx_L1_error) + __PYX_ERR(0, 858, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -97433,12 +100175,12 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 842, __pyx_L1_error) + __PYX_ERR(0, 858, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 842, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_2); __Pyx_GIVEREF(__pyx_int_2); @@ -97449,15 +100191,15 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 842, __pyx_L1_error) + __PYX_ERR(0, 858, __pyx_L1_error) } __pyx_L6:; while (1) { @@ -97467,7 +100209,7 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -97476,14 +100218,14 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -97505,14 +100247,14 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_2 = (__pyx_v_dtype != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_itemsize = __pyx_t_5; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_kind = __pyx_t_7; __pyx_v_dtype_signed = (__pyx_v_kind == 'i'); @@ -97525,9 +100267,9 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -97539,7 +100281,7 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_2; __pyx_L16_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 858, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint16_t)) == __pyx_v_itemsize) != 0); @@ -97548,9 +100290,9 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_2; goto __pyx_L20_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -97562,7 +100304,7 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_2; __pyx_L20_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 858, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint32_t)) == __pyx_v_itemsize) != 0); @@ -97571,9 +100313,9 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_2; goto __pyx_L24_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -97585,7 +100327,7 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_2; __pyx_L24_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 858, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint64_t)) == __pyx_v_itemsize) != 0); @@ -97594,9 +100336,9 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_2; goto __pyx_L28_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -97608,7 +100350,7 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_2; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 858, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int8_t)) == __pyx_v_itemsize) != 0); @@ -97617,9 +100359,9 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_2; goto __pyx_L32_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -97631,7 +100373,7 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_2; __pyx_L32_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 858, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int16_t)) == __pyx_v_itemsize) != 0); @@ -97640,9 +100382,9 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_2; goto __pyx_L36_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -97654,7 +100396,7 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_2; __pyx_L36_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 858, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int32_t)) == __pyx_v_itemsize) != 0); @@ -97663,9 +100405,9 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_2; goto __pyx_L40_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -97677,7 +100419,7 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_2; __pyx_L40_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 858, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int64_t)) == __pyx_v_itemsize) != 0); @@ -97686,9 +100428,9 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_2; goto __pyx_L44_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -97700,7 +100442,7 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = __pyx_t_2; __pyx_L44_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 858, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -97729,7 +100471,7 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 858, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -97751,7 +100493,7 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 858, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -97773,7 +100515,7 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 858, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -97795,7 +100537,7 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 858, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -97817,7 +100559,7 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 858, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -97839,7 +100581,7 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 858, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -97861,7 +100603,7 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 858, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -97883,27 +100625,27 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 858, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); } } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 858, __pyx_L1_error) goto __pyx_L10_break; } __pyx_L10_break:; - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_candidates = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = 0; if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 842, __pyx_L1_error) + __PYX_ERR(0, 858, __pyx_L1_error) } - __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_1; @@ -97911,12 +100653,12 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * while (1) { __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_9, &__pyx_t_5, &__pyx_t_1, NULL, NULL, __pyx_t_10); if (unlikely(__pyx_t_11 == 0)) break; - if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_1); __pyx_t_1 = 0; __pyx_v_match_found = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { @@ -97930,10 +100672,10 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * } __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, __pyx_kp_s__2) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__2); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -97948,12 +100690,12 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * } __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_12, __pyx_kp_s__3) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__3); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_src_sig, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 858, __pyx_L1_error) __pyx_t_16 = __pyx_t_15; for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; @@ -97964,11 +100706,11 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_t_3 = (__pyx_v_dst_type != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_2) { __pyx_v_match_found = 1; @@ -97984,35 +100726,35 @@ static PyObject *__pyx_pf_9fastremap_48unique_via_array(CYTHON_UNUSED PyObject * __pyx_L82_break:; __pyx_t_2 = (__pyx_v_match_found != 0); if (__pyx_t_2) { - __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 858, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_candidates) != 0); __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 842, __pyx_L1_error) + __PYX_ERR(0, 858, __pyx_L1_error) } - __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 858, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_9 > 1) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 842, __pyx_L1_error) + __PYX_ERR(0, 858, __pyx_L1_error) } /*else*/ { __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 842, __pyx_L1_error) + __PYX_ERR(0, 858, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; @@ -98054,12 +100796,12 @@ static PyObject *__pyx_pf_9fastremap_658__defaults__(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults28, __pyx_self)->__pyx_arg_return_index); __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults28, __pyx_self)->__pyx_arg_return_index); PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults28, __pyx_self)->__pyx_arg_return_index); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -98123,7 +100865,7 @@ static PyObject *__pyx_fuse_0__pyx_pw_9fastremap_477unique_via_array(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_label)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, 1); __PYX_ERR(0, 842, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, 1); __PYX_ERR(0, 858, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -98133,7 +100875,7 @@ static PyObject *__pyx_fuse_0__pyx_pw_9fastremap_477unique_via_array(PyObject *_ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unique_via_array") < 0)) __PYX_ERR(0, 842, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unique_via_array") < 0)) __PYX_ERR(0, 858, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -98146,18 +100888,18 @@ static PyObject *__pyx_fuse_0__pyx_pw_9fastremap_477unique_via_array(PyObject *_ } } __pyx_v_labels = ((PyArrayObject *)values[0]); - __pyx_v_max_label = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_max_label == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 842, __pyx_L3_error) + __pyx_v_max_label = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_max_label == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 858, __pyx_L3_error) __pyx_v_return_index = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 842, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 858, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.unique_via_array", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 858, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_476unique_via_array(__pyx_self, __pyx_v_labels, __pyx_v_max_label, __pyx_v_return_index); /* function exit code */ @@ -98245,87 +100987,87 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 858, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":850 + /* "fastremap.pyx":866 * the size of the array. * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uint32 * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":851 + /* "fastremap.pyx":867 * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( * (max_label+1,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] index */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":850 + /* "fastremap.pyx":866 * the size of the array. * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uint32 * ) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":851 + /* "fastremap.pyx":867 * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( * (max_label+1,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] index */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 851, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":850 + /* "fastremap.pyx":866 * the size of the array. * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uint32 * ) */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 850, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 866, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_counts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 850, __pyx_L1_error) + __PYX_ERR(0, 866, __pyx_L1_error) } else {__pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; } } @@ -98333,21 +101075,21 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject __pyx_v_counts = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":855 + /* "fastremap.pyx":871 * cdef cnp.ndarray[uintptr_t, ndim=1] index * * cdef uintptr_t sentinel = np.iinfo(np.uintp).max # <<<<<<<<<<<<<< * if return_index: * index = np.zeros( */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -98363,111 +101105,111 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 855, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sentinel = __pyx_t_7; - /* "fastremap.pyx":856 + /* "fastremap.pyx":872 * * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: # <<<<<<<<<<<<<< * index = np.zeros( * (max_label+1,), dtype=np.uintp */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 872, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":857 + /* "fastremap.pyx":873 * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: * index = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uintp * ) + sentinel */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":858 + /* "fastremap.pyx":874 * if return_index: * index = np.zeros( * (max_label+1,), dtype=np.uintp # <<<<<<<<<<<<<< * ) + sentinel * */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":857 + /* "fastremap.pyx":873 * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: * index = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uintp * ) + sentinel */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":858 + /* "fastremap.pyx":874 * if return_index: * index = np.zeros( * (max_label+1,), dtype=np.uintp # <<<<<<<<<<<<<< * ) + sentinel * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 858, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":857 + /* "fastremap.pyx":873 * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: * index = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uintp * ) + sentinel */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":859 + /* "fastremap.pyx":875 * index = np.zeros( * (max_label+1,), dtype=np.uintp * ) + sentinel # <<<<<<<<<<<<<< * * cdef size_t voxels = labels.shape[0] */ - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_sentinel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_sentinel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 859, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 875, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -98484,13 +101226,13 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0; } __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 857, __pyx_L1_error) + if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 873, __pyx_L1_error) } __pyx_t_9 = 0; __pyx_v_index = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":856 + /* "fastremap.pyx":872 * * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: # <<<<<<<<<<<<<< @@ -98499,7 +101241,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":861 + /* "fastremap.pyx":877 * ) + sentinel * * cdef size_t voxels = labels.shape[0] # <<<<<<<<<<<<<< @@ -98508,7 +101250,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_voxels = (__pyx_v_labels->dimensions[0]); - /* "fastremap.pyx":862 + /* "fastremap.pyx":878 * * cdef size_t voxels = labels.shape[0] * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -98517,7 +101259,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_i = 0; - /* "fastremap.pyx":863 + /* "fastremap.pyx":879 * cdef size_t voxels = labels.shape[0] * cdef size_t i = 0 * for i in range(voxels): # <<<<<<<<<<<<<< @@ -98529,7 +101271,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":864 + /* "fastremap.pyx":880 * cdef size_t i = 0 * for i in range(voxels): * counts[labels[i]] += 1 # <<<<<<<<<<<<<< @@ -98541,17 +101283,17 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; } - /* "fastremap.pyx":866 + /* "fastremap.pyx":882 * counts[labels[i]] += 1 * * if return_index: # <<<<<<<<<<<<<< * for i in range(voxels): * if index[labels[i]] == sentinel: */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 866, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 882, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":867 + /* "fastremap.pyx":883 * * if return_index: * for i in range(voxels): # <<<<<<<<<<<<<< @@ -98563,7 +101305,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":868 + /* "fastremap.pyx":884 * if return_index: * for i in range(voxels): * if index[labels[i]] == sentinel: # <<<<<<<<<<<<<< @@ -98575,7 +101317,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_index.diminfo[0].strides)) == __pyx_v_sentinel) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":869 + /* "fastremap.pyx":885 * for i in range(voxels): * if index[labels[i]] == sentinel: * index[labels[i]] = i # <<<<<<<<<<<<<< @@ -98586,7 +101328,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject __pyx_t_18 = (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides)); *__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_index.diminfo[0].strides) = __pyx_v_i; - /* "fastremap.pyx":868 + /* "fastremap.pyx":884 * if return_index: * for i in range(voxels): * if index[labels[i]] == sentinel: # <<<<<<<<<<<<<< @@ -98596,7 +101338,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":866 + /* "fastremap.pyx":882 * counts[labels[i]] += 1 * * if return_index: # <<<<<<<<<<<<<< @@ -98605,7 +101347,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":871 + /* "fastremap.pyx":887 * index[labels[i]] = i * * cdef size_t real_size = 0 # <<<<<<<<<<<<<< @@ -98614,7 +101356,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_real_size = 0; - /* "fastremap.pyx":872 + /* "fastremap.pyx":888 * * cdef size_t real_size = 0 * for i in range(max_label + 1): # <<<<<<<<<<<<<< @@ -98626,7 +101368,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":873 + /* "fastremap.pyx":889 * cdef size_t real_size = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -98637,7 +101379,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)) > 0) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":874 + /* "fastremap.pyx":890 * for i in range(max_label + 1): * if counts[i] > 0: * real_size += 1 # <<<<<<<<<<<<<< @@ -98646,7 +101388,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_real_size = (__pyx_v_real_size + 1); - /* "fastremap.pyx":873 + /* "fastremap.pyx":889 * cdef size_t real_size = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -98656,80 +101398,80 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":876 + /* "fastremap.pyx":892 * real_size += 1 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=labels.dtype * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":877 + /* "fastremap.pyx":893 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( * (real_size,), dtype=labels.dtype # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":876 + /* "fastremap.pyx":892 * real_size += 1 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=labels.dtype * ) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":877 + /* "fastremap.pyx":893 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( * (real_size,), dtype=labels.dtype # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 877, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":876 + /* "fastremap.pyx":892 * real_size += 1 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=labels.dtype * ) */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 876, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 892, __pyx_L1_error) __pyx_t_19 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segids.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_segids = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_segids.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 876, __pyx_L1_error) + __PYX_ERR(0, 892, __pyx_L1_error) } else {__pyx_pybuffernd_segids.diminfo[0].strides = __pyx_pybuffernd_segids.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_segids.diminfo[0].shape = __pyx_pybuffernd_segids.rcbuffer->pybuffer.shape[0]; } } @@ -98737,83 +101479,83 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject __pyx_v_segids = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":879 + /* "fastremap.pyx":895 * (real_size,), dtype=labels.dtype * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=np.uint32 * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":880 + /* "fastremap.pyx":896 * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( * (real_size,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] idx */ - __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":879 + /* "fastremap.pyx":895 * (real_size,), dtype=labels.dtype * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=np.uint32 * ) */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":880 + /* "fastremap.pyx":896 * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( * (real_size,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] idx */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 880, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":879 + /* "fastremap.pyx":895 * (real_size,), dtype=labels.dtype * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=np.uint32 * ) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 879, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 895, __pyx_L1_error) __pyx_t_20 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cts.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_cts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 879, __pyx_L1_error) + __PYX_ERR(0, 895, __pyx_L1_error) } else {__pyx_pybuffernd_cts.diminfo[0].strides = __pyx_pybuffernd_cts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cts.diminfo[0].shape = __pyx_pybuffernd_cts.rcbuffer->pybuffer.shape[0]; } } @@ -98821,7 +101563,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject __pyx_v_cts = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":884 + /* "fastremap.pyx":900 * cdef cnp.ndarray[uintptr_t, ndim=1] idx * * cdef size_t j = 0 # <<<<<<<<<<<<<< @@ -98830,7 +101572,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = 0; - /* "fastremap.pyx":885 + /* "fastremap.pyx":901 * * cdef size_t j = 0 * for i in range(max_label + 1): # <<<<<<<<<<<<<< @@ -98842,7 +101584,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":886 + /* "fastremap.pyx":902 * cdef size_t j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -98853,7 +101595,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)) > 0) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":887 + /* "fastremap.pyx":903 * for i in range(max_label + 1): * if counts[i] > 0: * segids[j] = i # <<<<<<<<<<<<<< @@ -98863,7 +101605,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject __pyx_t_17 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_segids.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_segids.diminfo[0].strides) = __pyx_v_i; - /* "fastremap.pyx":888 + /* "fastremap.pyx":904 * if counts[i] > 0: * segids[j] = i * cts[j] = counts[i] # <<<<<<<<<<<<<< @@ -98874,7 +101616,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject __pyx_t_18 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_cts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_cts.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)); - /* "fastremap.pyx":889 + /* "fastremap.pyx":905 * segids[j] = i * cts[j] = counts[i] * j += 1 # <<<<<<<<<<<<<< @@ -98883,7 +101625,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = (__pyx_v_j + 1); - /* "fastremap.pyx":886 + /* "fastremap.pyx":902 * cdef size_t j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -98893,55 +101635,55 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":891 + /* "fastremap.pyx":907 * j += 1 * * if return_index: # <<<<<<<<<<<<<< * idx = np.zeros( (real_size,), dtype=np.uintp) * j = 0 */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 907, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":892 + /* "fastremap.pyx":908 * * if return_index: * idx = np.zeros( (real_size,), dtype=np.uintp) # <<<<<<<<<<<<<< * j = 0 * for i in range(max_label + 1): */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 892, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 892, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 892, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 908, __pyx_L1_error) __pyx_t_21 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -98958,13 +101700,13 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject __pyx_t_13 = __pyx_t_12 = __pyx_t_11 = 0; } __pyx_pybuffernd_idx.diminfo[0].strides = __pyx_pybuffernd_idx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx.diminfo[0].shape = __pyx_pybuffernd_idx.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 892, __pyx_L1_error) + if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 908, __pyx_L1_error) } __pyx_t_21 = 0; __pyx_v_idx = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":893 + /* "fastremap.pyx":909 * if return_index: * idx = np.zeros( (real_size,), dtype=np.uintp) * j = 0 # <<<<<<<<<<<<<< @@ -98973,7 +101715,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = 0; - /* "fastremap.pyx":894 + /* "fastremap.pyx":910 * idx = np.zeros( (real_size,), dtype=np.uintp) * j = 0 * for i in range(max_label + 1): # <<<<<<<<<<<<<< @@ -98985,7 +101727,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":895 + /* "fastremap.pyx":911 * j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -98996,7 +101738,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)) > 0) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":896 + /* "fastremap.pyx":912 * for i in range(max_label + 1): * if counts[i] > 0: * idx[j] = index[i] # <<<<<<<<<<<<<< @@ -99007,7 +101749,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject __pyx_t_18 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_idx.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_idx.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_index.diminfo[0].strides)); - /* "fastremap.pyx":897 + /* "fastremap.pyx":913 * if counts[i] > 0: * idx[j] = index[i] * j += 1 # <<<<<<<<<<<<<< @@ -99016,7 +101758,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = (__pyx_v_j + 1); - /* "fastremap.pyx":895 + /* "fastremap.pyx":911 * j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -99026,7 +101768,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":891 + /* "fastremap.pyx":907 * j += 1 * * if return_index: # <<<<<<<<<<<<<< @@ -99035,17 +101777,17 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":899 + /* "fastremap.pyx":915 * j += 1 * * if return_index: # <<<<<<<<<<<<<< * return segids, idx, cts * else: */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 899, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 915, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":900 + /* "fastremap.pyx":916 * * if return_index: * return segids, idx, cts # <<<<<<<<<<<<<< @@ -99053,7 +101795,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject * return segids, None, cts */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 900, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_segids)); __Pyx_GIVEREF(((PyObject *)__pyx_v_segids)); @@ -99068,7 +101810,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject __pyx_t_2 = 0; goto __pyx_L0; - /* "fastremap.pyx":899 + /* "fastremap.pyx":915 * j += 1 * * if return_index: # <<<<<<<<<<<<<< @@ -99077,7 +101819,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":902 + /* "fastremap.pyx":918 * return segids, idx, cts * else: * return segids, None, cts # <<<<<<<<<<<<<< @@ -99086,7 +101828,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_segids)); __Pyx_GIVEREF(((PyObject *)__pyx_v_segids)); @@ -99102,7 +101844,7 @@ static PyObject *__pyx_pf_9fastremap_476unique_via_array(CYTHON_UNUSED PyObject goto __pyx_L0; } - /* "fastremap.pyx":842 + /* "fastremap.pyx":858 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def unique_via_array(cnp.ndarray[ALLINT, ndim=1] labels, size_t max_label, return_index=False): # <<<<<<<<<<<<<< @@ -99159,12 +101901,12 @@ static PyObject *__pyx_pf_9fastremap_660__defaults__(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults29, __pyx_self)->__pyx_arg_return_index); __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults29, __pyx_self)->__pyx_arg_return_index); PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults29, __pyx_self)->__pyx_arg_return_index); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -99228,7 +101970,7 @@ static PyObject *__pyx_fuse_1__pyx_pw_9fastremap_479unique_via_array(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_label)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, 1); __PYX_ERR(0, 842, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, 1); __PYX_ERR(0, 858, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -99238,7 +101980,7 @@ static PyObject *__pyx_fuse_1__pyx_pw_9fastremap_479unique_via_array(PyObject *_ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unique_via_array") < 0)) __PYX_ERR(0, 842, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unique_via_array") < 0)) __PYX_ERR(0, 858, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -99251,18 +101993,18 @@ static PyObject *__pyx_fuse_1__pyx_pw_9fastremap_479unique_via_array(PyObject *_ } } __pyx_v_labels = ((PyArrayObject *)values[0]); - __pyx_v_max_label = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_max_label == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 842, __pyx_L3_error) + __pyx_v_max_label = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_max_label == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 858, __pyx_L3_error) __pyx_v_return_index = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 842, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 858, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.unique_via_array", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 858, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_478unique_via_array(__pyx_self, __pyx_v_labels, __pyx_v_max_label, __pyx_v_return_index); /* function exit code */ @@ -99350,87 +102092,87 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 858, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":850 + /* "fastremap.pyx":866 * the size of the array. * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uint32 * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":851 + /* "fastremap.pyx":867 * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( * (max_label+1,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] index */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":850 + /* "fastremap.pyx":866 * the size of the array. * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uint32 * ) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":851 + /* "fastremap.pyx":867 * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( * (max_label+1,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] index */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 851, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":850 + /* "fastremap.pyx":866 * the size of the array. * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uint32 * ) */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 850, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 866, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_counts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 850, __pyx_L1_error) + __PYX_ERR(0, 866, __pyx_L1_error) } else {__pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; } } @@ -99438,21 +102180,21 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject __pyx_v_counts = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":855 + /* "fastremap.pyx":871 * cdef cnp.ndarray[uintptr_t, ndim=1] index * * cdef uintptr_t sentinel = np.iinfo(np.uintp).max # <<<<<<<<<<<<<< * if return_index: * index = np.zeros( */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -99468,111 +102210,111 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 855, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sentinel = __pyx_t_7; - /* "fastremap.pyx":856 + /* "fastremap.pyx":872 * * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: # <<<<<<<<<<<<<< * index = np.zeros( * (max_label+1,), dtype=np.uintp */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 872, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":857 + /* "fastremap.pyx":873 * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: * index = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uintp * ) + sentinel */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":858 + /* "fastremap.pyx":874 * if return_index: * index = np.zeros( * (max_label+1,), dtype=np.uintp # <<<<<<<<<<<<<< * ) + sentinel * */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":857 + /* "fastremap.pyx":873 * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: * index = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uintp * ) + sentinel */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":858 + /* "fastremap.pyx":874 * if return_index: * index = np.zeros( * (max_label+1,), dtype=np.uintp # <<<<<<<<<<<<<< * ) + sentinel * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 858, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":857 + /* "fastremap.pyx":873 * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: * index = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uintp * ) + sentinel */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":859 + /* "fastremap.pyx":875 * index = np.zeros( * (max_label+1,), dtype=np.uintp * ) + sentinel # <<<<<<<<<<<<<< * * cdef size_t voxels = labels.shape[0] */ - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_sentinel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_sentinel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 859, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 875, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -99589,13 +102331,13 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0; } __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 857, __pyx_L1_error) + if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 873, __pyx_L1_error) } __pyx_t_9 = 0; __pyx_v_index = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":856 + /* "fastremap.pyx":872 * * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: # <<<<<<<<<<<<<< @@ -99604,7 +102346,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":861 + /* "fastremap.pyx":877 * ) + sentinel * * cdef size_t voxels = labels.shape[0] # <<<<<<<<<<<<<< @@ -99613,7 +102355,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_voxels = (__pyx_v_labels->dimensions[0]); - /* "fastremap.pyx":862 + /* "fastremap.pyx":878 * * cdef size_t voxels = labels.shape[0] * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -99622,7 +102364,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_i = 0; - /* "fastremap.pyx":863 + /* "fastremap.pyx":879 * cdef size_t voxels = labels.shape[0] * cdef size_t i = 0 * for i in range(voxels): # <<<<<<<<<<<<<< @@ -99634,7 +102376,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":864 + /* "fastremap.pyx":880 * cdef size_t i = 0 * for i in range(voxels): * counts[labels[i]] += 1 # <<<<<<<<<<<<<< @@ -99646,17 +102388,17 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; } - /* "fastremap.pyx":866 + /* "fastremap.pyx":882 * counts[labels[i]] += 1 * * if return_index: # <<<<<<<<<<<<<< * for i in range(voxels): * if index[labels[i]] == sentinel: */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 866, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 882, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":867 + /* "fastremap.pyx":883 * * if return_index: * for i in range(voxels): # <<<<<<<<<<<<<< @@ -99668,7 +102410,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":868 + /* "fastremap.pyx":884 * if return_index: * for i in range(voxels): * if index[labels[i]] == sentinel: # <<<<<<<<<<<<<< @@ -99680,7 +102422,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_index.diminfo[0].strides)) == __pyx_v_sentinel) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":869 + /* "fastremap.pyx":885 * for i in range(voxels): * if index[labels[i]] == sentinel: * index[labels[i]] = i # <<<<<<<<<<<<<< @@ -99691,7 +102433,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject __pyx_t_18 = (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides)); *__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_index.diminfo[0].strides) = __pyx_v_i; - /* "fastremap.pyx":868 + /* "fastremap.pyx":884 * if return_index: * for i in range(voxels): * if index[labels[i]] == sentinel: # <<<<<<<<<<<<<< @@ -99701,7 +102443,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":866 + /* "fastremap.pyx":882 * counts[labels[i]] += 1 * * if return_index: # <<<<<<<<<<<<<< @@ -99710,7 +102452,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":871 + /* "fastremap.pyx":887 * index[labels[i]] = i * * cdef size_t real_size = 0 # <<<<<<<<<<<<<< @@ -99719,7 +102461,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_real_size = 0; - /* "fastremap.pyx":872 + /* "fastremap.pyx":888 * * cdef size_t real_size = 0 * for i in range(max_label + 1): # <<<<<<<<<<<<<< @@ -99731,7 +102473,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":873 + /* "fastremap.pyx":889 * cdef size_t real_size = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -99742,7 +102484,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)) > 0) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":874 + /* "fastremap.pyx":890 * for i in range(max_label + 1): * if counts[i] > 0: * real_size += 1 # <<<<<<<<<<<<<< @@ -99751,7 +102493,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_real_size = (__pyx_v_real_size + 1); - /* "fastremap.pyx":873 + /* "fastremap.pyx":889 * cdef size_t real_size = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -99761,80 +102503,80 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":876 + /* "fastremap.pyx":892 * real_size += 1 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=labels.dtype * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":877 + /* "fastremap.pyx":893 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( * (real_size,), dtype=labels.dtype # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":876 + /* "fastremap.pyx":892 * real_size += 1 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=labels.dtype * ) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":877 + /* "fastremap.pyx":893 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( * (real_size,), dtype=labels.dtype # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 877, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":876 + /* "fastremap.pyx":892 * real_size += 1 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=labels.dtype * ) */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 876, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 892, __pyx_L1_error) __pyx_t_19 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segids.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_segids = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_segids.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 876, __pyx_L1_error) + __PYX_ERR(0, 892, __pyx_L1_error) } else {__pyx_pybuffernd_segids.diminfo[0].strides = __pyx_pybuffernd_segids.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_segids.diminfo[0].shape = __pyx_pybuffernd_segids.rcbuffer->pybuffer.shape[0]; } } @@ -99842,83 +102584,83 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject __pyx_v_segids = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":879 + /* "fastremap.pyx":895 * (real_size,), dtype=labels.dtype * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=np.uint32 * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":880 + /* "fastremap.pyx":896 * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( * (real_size,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] idx */ - __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":879 + /* "fastremap.pyx":895 * (real_size,), dtype=labels.dtype * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=np.uint32 * ) */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":880 + /* "fastremap.pyx":896 * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( * (real_size,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] idx */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 880, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":879 + /* "fastremap.pyx":895 * (real_size,), dtype=labels.dtype * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=np.uint32 * ) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 879, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 895, __pyx_L1_error) __pyx_t_20 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cts.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_cts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 879, __pyx_L1_error) + __PYX_ERR(0, 895, __pyx_L1_error) } else {__pyx_pybuffernd_cts.diminfo[0].strides = __pyx_pybuffernd_cts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cts.diminfo[0].shape = __pyx_pybuffernd_cts.rcbuffer->pybuffer.shape[0]; } } @@ -99926,7 +102668,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject __pyx_v_cts = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":884 + /* "fastremap.pyx":900 * cdef cnp.ndarray[uintptr_t, ndim=1] idx * * cdef size_t j = 0 # <<<<<<<<<<<<<< @@ -99935,7 +102677,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = 0; - /* "fastremap.pyx":885 + /* "fastremap.pyx":901 * * cdef size_t j = 0 * for i in range(max_label + 1): # <<<<<<<<<<<<<< @@ -99947,7 +102689,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":886 + /* "fastremap.pyx":902 * cdef size_t j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -99958,7 +102700,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)) > 0) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":887 + /* "fastremap.pyx":903 * for i in range(max_label + 1): * if counts[i] > 0: * segids[j] = i # <<<<<<<<<<<<<< @@ -99968,7 +102710,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject __pyx_t_17 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_segids.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_segids.diminfo[0].strides) = __pyx_v_i; - /* "fastremap.pyx":888 + /* "fastremap.pyx":904 * if counts[i] > 0: * segids[j] = i * cts[j] = counts[i] # <<<<<<<<<<<<<< @@ -99979,7 +102721,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject __pyx_t_18 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_cts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_cts.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)); - /* "fastremap.pyx":889 + /* "fastremap.pyx":905 * segids[j] = i * cts[j] = counts[i] * j += 1 # <<<<<<<<<<<<<< @@ -99988,7 +102730,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = (__pyx_v_j + 1); - /* "fastremap.pyx":886 + /* "fastremap.pyx":902 * cdef size_t j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -99998,55 +102740,55 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":891 + /* "fastremap.pyx":907 * j += 1 * * if return_index: # <<<<<<<<<<<<<< * idx = np.zeros( (real_size,), dtype=np.uintp) * j = 0 */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 907, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":892 + /* "fastremap.pyx":908 * * if return_index: * idx = np.zeros( (real_size,), dtype=np.uintp) # <<<<<<<<<<<<<< * j = 0 * for i in range(max_label + 1): */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 892, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 892, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 892, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 908, __pyx_L1_error) __pyx_t_21 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -100063,13 +102805,13 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject __pyx_t_13 = __pyx_t_12 = __pyx_t_11 = 0; } __pyx_pybuffernd_idx.diminfo[0].strides = __pyx_pybuffernd_idx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx.diminfo[0].shape = __pyx_pybuffernd_idx.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 892, __pyx_L1_error) + if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 908, __pyx_L1_error) } __pyx_t_21 = 0; __pyx_v_idx = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":893 + /* "fastremap.pyx":909 * if return_index: * idx = np.zeros( (real_size,), dtype=np.uintp) * j = 0 # <<<<<<<<<<<<<< @@ -100078,7 +102820,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = 0; - /* "fastremap.pyx":894 + /* "fastremap.pyx":910 * idx = np.zeros( (real_size,), dtype=np.uintp) * j = 0 * for i in range(max_label + 1): # <<<<<<<<<<<<<< @@ -100090,7 +102832,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":895 + /* "fastremap.pyx":911 * j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -100101,7 +102843,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)) > 0) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":896 + /* "fastremap.pyx":912 * for i in range(max_label + 1): * if counts[i] > 0: * idx[j] = index[i] # <<<<<<<<<<<<<< @@ -100112,7 +102854,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject __pyx_t_18 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_idx.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_idx.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_index.diminfo[0].strides)); - /* "fastremap.pyx":897 + /* "fastremap.pyx":913 * if counts[i] > 0: * idx[j] = index[i] * j += 1 # <<<<<<<<<<<<<< @@ -100121,7 +102863,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = (__pyx_v_j + 1); - /* "fastremap.pyx":895 + /* "fastremap.pyx":911 * j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -100131,7 +102873,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":891 + /* "fastremap.pyx":907 * j += 1 * * if return_index: # <<<<<<<<<<<<<< @@ -100140,17 +102882,17 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":899 + /* "fastremap.pyx":915 * j += 1 * * if return_index: # <<<<<<<<<<<<<< * return segids, idx, cts * else: */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 899, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 915, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":900 + /* "fastremap.pyx":916 * * if return_index: * return segids, idx, cts # <<<<<<<<<<<<<< @@ -100158,7 +102900,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject * return segids, None, cts */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 900, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_segids)); __Pyx_GIVEREF(((PyObject *)__pyx_v_segids)); @@ -100173,7 +102915,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject __pyx_t_2 = 0; goto __pyx_L0; - /* "fastremap.pyx":899 + /* "fastremap.pyx":915 * j += 1 * * if return_index: # <<<<<<<<<<<<<< @@ -100182,7 +102924,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":902 + /* "fastremap.pyx":918 * return segids, idx, cts * else: * return segids, None, cts # <<<<<<<<<<<<<< @@ -100191,7 +102933,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_segids)); __Pyx_GIVEREF(((PyObject *)__pyx_v_segids)); @@ -100207,7 +102949,7 @@ static PyObject *__pyx_pf_9fastremap_478unique_via_array(CYTHON_UNUSED PyObject goto __pyx_L0; } - /* "fastremap.pyx":842 + /* "fastremap.pyx":858 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def unique_via_array(cnp.ndarray[ALLINT, ndim=1] labels, size_t max_label, return_index=False): # <<<<<<<<<<<<<< @@ -100264,12 +103006,12 @@ static PyObject *__pyx_pf_9fastremap_662__defaults__(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults30, __pyx_self)->__pyx_arg_return_index); __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults30, __pyx_self)->__pyx_arg_return_index); PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults30, __pyx_self)->__pyx_arg_return_index); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -100333,7 +103075,7 @@ static PyObject *__pyx_fuse_2__pyx_pw_9fastremap_481unique_via_array(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_label)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, 1); __PYX_ERR(0, 842, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, 1); __PYX_ERR(0, 858, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -100343,7 +103085,7 @@ static PyObject *__pyx_fuse_2__pyx_pw_9fastremap_481unique_via_array(PyObject *_ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unique_via_array") < 0)) __PYX_ERR(0, 842, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unique_via_array") < 0)) __PYX_ERR(0, 858, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -100356,18 +103098,18 @@ static PyObject *__pyx_fuse_2__pyx_pw_9fastremap_481unique_via_array(PyObject *_ } } __pyx_v_labels = ((PyArrayObject *)values[0]); - __pyx_v_max_label = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_max_label == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 842, __pyx_L3_error) + __pyx_v_max_label = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_max_label == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 858, __pyx_L3_error) __pyx_v_return_index = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 842, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 858, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.unique_via_array", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 858, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_480unique_via_array(__pyx_self, __pyx_v_labels, __pyx_v_max_label, __pyx_v_return_index); /* function exit code */ @@ -100455,87 +103197,87 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 858, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":850 + /* "fastremap.pyx":866 * the size of the array. * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uint32 * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":851 + /* "fastremap.pyx":867 * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( * (max_label+1,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] index */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":850 + /* "fastremap.pyx":866 * the size of the array. * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uint32 * ) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":851 + /* "fastremap.pyx":867 * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( * (max_label+1,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] index */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 851, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":850 + /* "fastremap.pyx":866 * the size of the array. * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uint32 * ) */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 850, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 866, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_counts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 850, __pyx_L1_error) + __PYX_ERR(0, 866, __pyx_L1_error) } else {__pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; } } @@ -100543,21 +103285,21 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject __pyx_v_counts = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":855 + /* "fastremap.pyx":871 * cdef cnp.ndarray[uintptr_t, ndim=1] index * * cdef uintptr_t sentinel = np.iinfo(np.uintp).max # <<<<<<<<<<<<<< * if return_index: * index = np.zeros( */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -100573,111 +103315,111 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 855, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sentinel = __pyx_t_7; - /* "fastremap.pyx":856 + /* "fastremap.pyx":872 * * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: # <<<<<<<<<<<<<< * index = np.zeros( * (max_label+1,), dtype=np.uintp */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 872, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":857 + /* "fastremap.pyx":873 * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: * index = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uintp * ) + sentinel */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":858 + /* "fastremap.pyx":874 * if return_index: * index = np.zeros( * (max_label+1,), dtype=np.uintp # <<<<<<<<<<<<<< * ) + sentinel * */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":857 + /* "fastremap.pyx":873 * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: * index = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uintp * ) + sentinel */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":858 + /* "fastremap.pyx":874 * if return_index: * index = np.zeros( * (max_label+1,), dtype=np.uintp # <<<<<<<<<<<<<< * ) + sentinel * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 858, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":857 + /* "fastremap.pyx":873 * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: * index = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uintp * ) + sentinel */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":859 + /* "fastremap.pyx":875 * index = np.zeros( * (max_label+1,), dtype=np.uintp * ) + sentinel # <<<<<<<<<<<<<< * * cdef size_t voxels = labels.shape[0] */ - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_sentinel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_sentinel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 859, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 875, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -100694,13 +103436,13 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0; } __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 857, __pyx_L1_error) + if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 873, __pyx_L1_error) } __pyx_t_9 = 0; __pyx_v_index = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":856 + /* "fastremap.pyx":872 * * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: # <<<<<<<<<<<<<< @@ -100709,7 +103451,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":861 + /* "fastremap.pyx":877 * ) + sentinel * * cdef size_t voxels = labels.shape[0] # <<<<<<<<<<<<<< @@ -100718,7 +103460,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_voxels = (__pyx_v_labels->dimensions[0]); - /* "fastremap.pyx":862 + /* "fastremap.pyx":878 * * cdef size_t voxels = labels.shape[0] * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -100727,7 +103469,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_i = 0; - /* "fastremap.pyx":863 + /* "fastremap.pyx":879 * cdef size_t voxels = labels.shape[0] * cdef size_t i = 0 * for i in range(voxels): # <<<<<<<<<<<<<< @@ -100739,7 +103481,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":864 + /* "fastremap.pyx":880 * cdef size_t i = 0 * for i in range(voxels): * counts[labels[i]] += 1 # <<<<<<<<<<<<<< @@ -100751,17 +103493,17 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; } - /* "fastremap.pyx":866 + /* "fastremap.pyx":882 * counts[labels[i]] += 1 * * if return_index: # <<<<<<<<<<<<<< * for i in range(voxels): * if index[labels[i]] == sentinel: */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 866, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 882, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":867 + /* "fastremap.pyx":883 * * if return_index: * for i in range(voxels): # <<<<<<<<<<<<<< @@ -100773,7 +103515,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":868 + /* "fastremap.pyx":884 * if return_index: * for i in range(voxels): * if index[labels[i]] == sentinel: # <<<<<<<<<<<<<< @@ -100785,7 +103527,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_index.diminfo[0].strides)) == __pyx_v_sentinel) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":869 + /* "fastremap.pyx":885 * for i in range(voxels): * if index[labels[i]] == sentinel: * index[labels[i]] = i # <<<<<<<<<<<<<< @@ -100796,7 +103538,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject __pyx_t_18 = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides)); *__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_index.diminfo[0].strides) = __pyx_v_i; - /* "fastremap.pyx":868 + /* "fastremap.pyx":884 * if return_index: * for i in range(voxels): * if index[labels[i]] == sentinel: # <<<<<<<<<<<<<< @@ -100806,7 +103548,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":866 + /* "fastremap.pyx":882 * counts[labels[i]] += 1 * * if return_index: # <<<<<<<<<<<<<< @@ -100815,7 +103557,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":871 + /* "fastremap.pyx":887 * index[labels[i]] = i * * cdef size_t real_size = 0 # <<<<<<<<<<<<<< @@ -100824,7 +103566,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_real_size = 0; - /* "fastremap.pyx":872 + /* "fastremap.pyx":888 * * cdef size_t real_size = 0 * for i in range(max_label + 1): # <<<<<<<<<<<<<< @@ -100836,7 +103578,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":873 + /* "fastremap.pyx":889 * cdef size_t real_size = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -100847,7 +103589,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)) > 0) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":874 + /* "fastremap.pyx":890 * for i in range(max_label + 1): * if counts[i] > 0: * real_size += 1 # <<<<<<<<<<<<<< @@ -100856,7 +103598,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_real_size = (__pyx_v_real_size + 1); - /* "fastremap.pyx":873 + /* "fastremap.pyx":889 * cdef size_t real_size = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -100866,80 +103608,80 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":876 + /* "fastremap.pyx":892 * real_size += 1 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=labels.dtype * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":877 + /* "fastremap.pyx":893 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( * (real_size,), dtype=labels.dtype # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":876 + /* "fastremap.pyx":892 * real_size += 1 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=labels.dtype * ) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":877 + /* "fastremap.pyx":893 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( * (real_size,), dtype=labels.dtype # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 877, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":876 + /* "fastremap.pyx":892 * real_size += 1 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=labels.dtype * ) */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 876, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 892, __pyx_L1_error) __pyx_t_19 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segids.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_segids = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_segids.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 876, __pyx_L1_error) + __PYX_ERR(0, 892, __pyx_L1_error) } else {__pyx_pybuffernd_segids.diminfo[0].strides = __pyx_pybuffernd_segids.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_segids.diminfo[0].shape = __pyx_pybuffernd_segids.rcbuffer->pybuffer.shape[0]; } } @@ -100947,83 +103689,83 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject __pyx_v_segids = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":879 + /* "fastremap.pyx":895 * (real_size,), dtype=labels.dtype * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=np.uint32 * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":880 + /* "fastremap.pyx":896 * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( * (real_size,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] idx */ - __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":879 + /* "fastremap.pyx":895 * (real_size,), dtype=labels.dtype * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=np.uint32 * ) */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":880 + /* "fastremap.pyx":896 * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( * (real_size,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] idx */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 880, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":879 + /* "fastremap.pyx":895 * (real_size,), dtype=labels.dtype * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=np.uint32 * ) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 879, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 895, __pyx_L1_error) __pyx_t_20 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cts.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_cts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 879, __pyx_L1_error) + __PYX_ERR(0, 895, __pyx_L1_error) } else {__pyx_pybuffernd_cts.diminfo[0].strides = __pyx_pybuffernd_cts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cts.diminfo[0].shape = __pyx_pybuffernd_cts.rcbuffer->pybuffer.shape[0]; } } @@ -101031,7 +103773,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject __pyx_v_cts = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":884 + /* "fastremap.pyx":900 * cdef cnp.ndarray[uintptr_t, ndim=1] idx * * cdef size_t j = 0 # <<<<<<<<<<<<<< @@ -101040,7 +103782,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = 0; - /* "fastremap.pyx":885 + /* "fastremap.pyx":901 * * cdef size_t j = 0 * for i in range(max_label + 1): # <<<<<<<<<<<<<< @@ -101052,7 +103794,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":886 + /* "fastremap.pyx":902 * cdef size_t j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -101063,7 +103805,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)) > 0) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":887 + /* "fastremap.pyx":903 * for i in range(max_label + 1): * if counts[i] > 0: * segids[j] = i # <<<<<<<<<<<<<< @@ -101073,7 +103815,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject __pyx_t_17 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_segids.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_segids.diminfo[0].strides) = __pyx_v_i; - /* "fastremap.pyx":888 + /* "fastremap.pyx":904 * if counts[i] > 0: * segids[j] = i * cts[j] = counts[i] # <<<<<<<<<<<<<< @@ -101084,7 +103826,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject __pyx_t_18 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_cts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_cts.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)); - /* "fastremap.pyx":889 + /* "fastremap.pyx":905 * segids[j] = i * cts[j] = counts[i] * j += 1 # <<<<<<<<<<<<<< @@ -101093,7 +103835,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = (__pyx_v_j + 1); - /* "fastremap.pyx":886 + /* "fastremap.pyx":902 * cdef size_t j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -101103,55 +103845,55 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":891 + /* "fastremap.pyx":907 * j += 1 * * if return_index: # <<<<<<<<<<<<<< * idx = np.zeros( (real_size,), dtype=np.uintp) * j = 0 */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 907, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":892 + /* "fastremap.pyx":908 * * if return_index: * idx = np.zeros( (real_size,), dtype=np.uintp) # <<<<<<<<<<<<<< * j = 0 * for i in range(max_label + 1): */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 892, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 892, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 892, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 908, __pyx_L1_error) __pyx_t_21 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -101168,13 +103910,13 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject __pyx_t_13 = __pyx_t_12 = __pyx_t_11 = 0; } __pyx_pybuffernd_idx.diminfo[0].strides = __pyx_pybuffernd_idx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx.diminfo[0].shape = __pyx_pybuffernd_idx.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 892, __pyx_L1_error) + if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 908, __pyx_L1_error) } __pyx_t_21 = 0; __pyx_v_idx = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":893 + /* "fastremap.pyx":909 * if return_index: * idx = np.zeros( (real_size,), dtype=np.uintp) * j = 0 # <<<<<<<<<<<<<< @@ -101183,7 +103925,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = 0; - /* "fastremap.pyx":894 + /* "fastremap.pyx":910 * idx = np.zeros( (real_size,), dtype=np.uintp) * j = 0 * for i in range(max_label + 1): # <<<<<<<<<<<<<< @@ -101195,7 +103937,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":895 + /* "fastremap.pyx":911 * j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -101206,7 +103948,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)) > 0) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":896 + /* "fastremap.pyx":912 * for i in range(max_label + 1): * if counts[i] > 0: * idx[j] = index[i] # <<<<<<<<<<<<<< @@ -101217,7 +103959,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject __pyx_t_18 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_idx.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_idx.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_index.diminfo[0].strides)); - /* "fastremap.pyx":897 + /* "fastremap.pyx":913 * if counts[i] > 0: * idx[j] = index[i] * j += 1 # <<<<<<<<<<<<<< @@ -101226,7 +103968,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = (__pyx_v_j + 1); - /* "fastremap.pyx":895 + /* "fastremap.pyx":911 * j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -101236,7 +103978,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":891 + /* "fastremap.pyx":907 * j += 1 * * if return_index: # <<<<<<<<<<<<<< @@ -101245,17 +103987,17 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":899 + /* "fastremap.pyx":915 * j += 1 * * if return_index: # <<<<<<<<<<<<<< * return segids, idx, cts * else: */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 899, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 915, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":900 + /* "fastremap.pyx":916 * * if return_index: * return segids, idx, cts # <<<<<<<<<<<<<< @@ -101263,7 +104005,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject * return segids, None, cts */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 900, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_segids)); __Pyx_GIVEREF(((PyObject *)__pyx_v_segids)); @@ -101278,7 +104020,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject __pyx_t_2 = 0; goto __pyx_L0; - /* "fastremap.pyx":899 + /* "fastremap.pyx":915 * j += 1 * * if return_index: # <<<<<<<<<<<<<< @@ -101287,7 +104029,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":902 + /* "fastremap.pyx":918 * return segids, idx, cts * else: * return segids, None, cts # <<<<<<<<<<<<<< @@ -101296,7 +104038,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_segids)); __Pyx_GIVEREF(((PyObject *)__pyx_v_segids)); @@ -101312,7 +104054,7 @@ static PyObject *__pyx_pf_9fastremap_480unique_via_array(CYTHON_UNUSED PyObject goto __pyx_L0; } - /* "fastremap.pyx":842 + /* "fastremap.pyx":858 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def unique_via_array(cnp.ndarray[ALLINT, ndim=1] labels, size_t max_label, return_index=False): # <<<<<<<<<<<<<< @@ -101369,12 +104111,12 @@ static PyObject *__pyx_pf_9fastremap_664__defaults__(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults31, __pyx_self)->__pyx_arg_return_index); __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults31, __pyx_self)->__pyx_arg_return_index); PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults31, __pyx_self)->__pyx_arg_return_index); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -101438,7 +104180,7 @@ static PyObject *__pyx_fuse_3__pyx_pw_9fastremap_483unique_via_array(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_label)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, 1); __PYX_ERR(0, 842, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, 1); __PYX_ERR(0, 858, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -101448,7 +104190,7 @@ static PyObject *__pyx_fuse_3__pyx_pw_9fastremap_483unique_via_array(PyObject *_ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unique_via_array") < 0)) __PYX_ERR(0, 842, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unique_via_array") < 0)) __PYX_ERR(0, 858, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -101461,18 +104203,18 @@ static PyObject *__pyx_fuse_3__pyx_pw_9fastremap_483unique_via_array(PyObject *_ } } __pyx_v_labels = ((PyArrayObject *)values[0]); - __pyx_v_max_label = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_max_label == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 842, __pyx_L3_error) + __pyx_v_max_label = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_max_label == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 858, __pyx_L3_error) __pyx_v_return_index = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 842, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 858, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.unique_via_array", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 858, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_482unique_via_array(__pyx_self, __pyx_v_labels, __pyx_v_max_label, __pyx_v_return_index); /* function exit code */ @@ -101561,87 +104303,87 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 858, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":850 + /* "fastremap.pyx":866 * the size of the array. * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uint32 * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":851 + /* "fastremap.pyx":867 * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( * (max_label+1,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] index */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":850 + /* "fastremap.pyx":866 * the size of the array. * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uint32 * ) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":851 + /* "fastremap.pyx":867 * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( * (max_label+1,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] index */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 851, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":850 + /* "fastremap.pyx":866 * the size of the array. * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uint32 * ) */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 850, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 866, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_counts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 850, __pyx_L1_error) + __PYX_ERR(0, 866, __pyx_L1_error) } else {__pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; } } @@ -101649,21 +104391,21 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject __pyx_v_counts = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":855 + /* "fastremap.pyx":871 * cdef cnp.ndarray[uintptr_t, ndim=1] index * * cdef uintptr_t sentinel = np.iinfo(np.uintp).max # <<<<<<<<<<<<<< * if return_index: * index = np.zeros( */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -101679,111 +104421,111 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 855, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sentinel = __pyx_t_7; - /* "fastremap.pyx":856 + /* "fastremap.pyx":872 * * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: # <<<<<<<<<<<<<< * index = np.zeros( * (max_label+1,), dtype=np.uintp */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 872, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":857 + /* "fastremap.pyx":873 * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: * index = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uintp * ) + sentinel */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":858 + /* "fastremap.pyx":874 * if return_index: * index = np.zeros( * (max_label+1,), dtype=np.uintp # <<<<<<<<<<<<<< * ) + sentinel * */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":857 + /* "fastremap.pyx":873 * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: * index = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uintp * ) + sentinel */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":858 + /* "fastremap.pyx":874 * if return_index: * index = np.zeros( * (max_label+1,), dtype=np.uintp # <<<<<<<<<<<<<< * ) + sentinel * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 858, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":857 + /* "fastremap.pyx":873 * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: * index = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uintp * ) + sentinel */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":859 + /* "fastremap.pyx":875 * index = np.zeros( * (max_label+1,), dtype=np.uintp * ) + sentinel # <<<<<<<<<<<<<< * * cdef size_t voxels = labels.shape[0] */ - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_sentinel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_sentinel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 859, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 875, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -101800,13 +104542,13 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0; } __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 857, __pyx_L1_error) + if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 873, __pyx_L1_error) } __pyx_t_9 = 0; __pyx_v_index = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":856 + /* "fastremap.pyx":872 * * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: # <<<<<<<<<<<<<< @@ -101815,7 +104557,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":861 + /* "fastremap.pyx":877 * ) + sentinel * * cdef size_t voxels = labels.shape[0] # <<<<<<<<<<<<<< @@ -101824,7 +104566,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_voxels = (__pyx_v_labels->dimensions[0]); - /* "fastremap.pyx":862 + /* "fastremap.pyx":878 * * cdef size_t voxels = labels.shape[0] * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -101833,7 +104575,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_i = 0; - /* "fastremap.pyx":863 + /* "fastremap.pyx":879 * cdef size_t voxels = labels.shape[0] * cdef size_t i = 0 * for i in range(voxels): # <<<<<<<<<<<<<< @@ -101845,7 +104587,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":864 + /* "fastremap.pyx":880 * cdef size_t i = 0 * for i in range(voxels): * counts[labels[i]] += 1 # <<<<<<<<<<<<<< @@ -101857,17 +104599,17 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; } - /* "fastremap.pyx":866 + /* "fastremap.pyx":882 * counts[labels[i]] += 1 * * if return_index: # <<<<<<<<<<<<<< * for i in range(voxels): * if index[labels[i]] == sentinel: */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 866, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 882, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":867 + /* "fastremap.pyx":883 * * if return_index: * for i in range(voxels): # <<<<<<<<<<<<<< @@ -101879,7 +104621,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":868 + /* "fastremap.pyx":884 * if return_index: * for i in range(voxels): * if index[labels[i]] == sentinel: # <<<<<<<<<<<<<< @@ -101891,7 +104633,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_index.diminfo[0].strides)) == __pyx_v_sentinel) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":869 + /* "fastremap.pyx":885 * for i in range(voxels): * if index[labels[i]] == sentinel: * index[labels[i]] = i # <<<<<<<<<<<<<< @@ -101902,7 +104644,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject __pyx_t_18 = (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides)); *__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_index.diminfo[0].strides) = __pyx_v_i; - /* "fastremap.pyx":868 + /* "fastremap.pyx":884 * if return_index: * for i in range(voxels): * if index[labels[i]] == sentinel: # <<<<<<<<<<<<<< @@ -101912,7 +104654,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":866 + /* "fastremap.pyx":882 * counts[labels[i]] += 1 * * if return_index: # <<<<<<<<<<<<<< @@ -101921,7 +104663,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":871 + /* "fastremap.pyx":887 * index[labels[i]] = i * * cdef size_t real_size = 0 # <<<<<<<<<<<<<< @@ -101930,7 +104672,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_real_size = 0; - /* "fastremap.pyx":872 + /* "fastremap.pyx":888 * * cdef size_t real_size = 0 * for i in range(max_label + 1): # <<<<<<<<<<<<<< @@ -101942,7 +104684,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":873 + /* "fastremap.pyx":889 * cdef size_t real_size = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -101953,7 +104695,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)) > 0) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":874 + /* "fastremap.pyx":890 * for i in range(max_label + 1): * if counts[i] > 0: * real_size += 1 # <<<<<<<<<<<<<< @@ -101962,7 +104704,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_real_size = (__pyx_v_real_size + 1); - /* "fastremap.pyx":873 + /* "fastremap.pyx":889 * cdef size_t real_size = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -101972,80 +104714,80 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":876 + /* "fastremap.pyx":892 * real_size += 1 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=labels.dtype * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":877 + /* "fastremap.pyx":893 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( * (real_size,), dtype=labels.dtype # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":876 + /* "fastremap.pyx":892 * real_size += 1 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=labels.dtype * ) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":877 + /* "fastremap.pyx":893 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( * (real_size,), dtype=labels.dtype # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 877, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":876 + /* "fastremap.pyx":892 * real_size += 1 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=labels.dtype * ) */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 876, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 892, __pyx_L1_error) __pyx_t_19 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segids.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_segids = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_segids.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 876, __pyx_L1_error) + __PYX_ERR(0, 892, __pyx_L1_error) } else {__pyx_pybuffernd_segids.diminfo[0].strides = __pyx_pybuffernd_segids.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_segids.diminfo[0].shape = __pyx_pybuffernd_segids.rcbuffer->pybuffer.shape[0]; } } @@ -102053,83 +104795,83 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject __pyx_v_segids = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":879 + /* "fastremap.pyx":895 * (real_size,), dtype=labels.dtype * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=np.uint32 * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":880 + /* "fastremap.pyx":896 * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( * (real_size,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] idx */ - __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":879 + /* "fastremap.pyx":895 * (real_size,), dtype=labels.dtype * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=np.uint32 * ) */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":880 + /* "fastremap.pyx":896 * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( * (real_size,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] idx */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 880, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":879 + /* "fastremap.pyx":895 * (real_size,), dtype=labels.dtype * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=np.uint32 * ) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 879, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 895, __pyx_L1_error) __pyx_t_20 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cts.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_cts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 879, __pyx_L1_error) + __PYX_ERR(0, 895, __pyx_L1_error) } else {__pyx_pybuffernd_cts.diminfo[0].strides = __pyx_pybuffernd_cts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cts.diminfo[0].shape = __pyx_pybuffernd_cts.rcbuffer->pybuffer.shape[0]; } } @@ -102137,7 +104879,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject __pyx_v_cts = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":884 + /* "fastremap.pyx":900 * cdef cnp.ndarray[uintptr_t, ndim=1] idx * * cdef size_t j = 0 # <<<<<<<<<<<<<< @@ -102146,7 +104888,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = 0; - /* "fastremap.pyx":885 + /* "fastremap.pyx":901 * * cdef size_t j = 0 * for i in range(max_label + 1): # <<<<<<<<<<<<<< @@ -102158,7 +104900,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":886 + /* "fastremap.pyx":902 * cdef size_t j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -102169,7 +104911,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)) > 0) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":887 + /* "fastremap.pyx":903 * for i in range(max_label + 1): * if counts[i] > 0: * segids[j] = i # <<<<<<<<<<<<<< @@ -102179,7 +104921,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject __pyx_t_17 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_segids.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_segids.diminfo[0].strides) = __pyx_v_i; - /* "fastremap.pyx":888 + /* "fastremap.pyx":904 * if counts[i] > 0: * segids[j] = i * cts[j] = counts[i] # <<<<<<<<<<<<<< @@ -102190,7 +104932,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject __pyx_t_21 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_cts.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_cts.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)); - /* "fastremap.pyx":889 + /* "fastremap.pyx":905 * segids[j] = i * cts[j] = counts[i] * j += 1 # <<<<<<<<<<<<<< @@ -102199,7 +104941,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = (__pyx_v_j + 1); - /* "fastremap.pyx":886 + /* "fastremap.pyx":902 * cdef size_t j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -102209,55 +104951,55 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":891 + /* "fastremap.pyx":907 * j += 1 * * if return_index: # <<<<<<<<<<<<<< * idx = np.zeros( (real_size,), dtype=np.uintp) * j = 0 */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 907, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":892 + /* "fastremap.pyx":908 * * if return_index: * idx = np.zeros( (real_size,), dtype=np.uintp) # <<<<<<<<<<<<<< * j = 0 * for i in range(max_label + 1): */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 892, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 892, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 892, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 908, __pyx_L1_error) __pyx_t_22 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -102274,13 +105016,13 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject __pyx_t_13 = __pyx_t_12 = __pyx_t_11 = 0; } __pyx_pybuffernd_idx.diminfo[0].strides = __pyx_pybuffernd_idx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx.diminfo[0].shape = __pyx_pybuffernd_idx.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 892, __pyx_L1_error) + if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 908, __pyx_L1_error) } __pyx_t_22 = 0; __pyx_v_idx = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":893 + /* "fastremap.pyx":909 * if return_index: * idx = np.zeros( (real_size,), dtype=np.uintp) * j = 0 # <<<<<<<<<<<<<< @@ -102289,7 +105031,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = 0; - /* "fastremap.pyx":894 + /* "fastremap.pyx":910 * idx = np.zeros( (real_size,), dtype=np.uintp) * j = 0 * for i in range(max_label + 1): # <<<<<<<<<<<<<< @@ -102301,7 +105043,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":895 + /* "fastremap.pyx":911 * j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -102312,7 +105054,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)) > 0) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":896 + /* "fastremap.pyx":912 * for i in range(max_label + 1): * if counts[i] > 0: * idx[j] = index[i] # <<<<<<<<<<<<<< @@ -102323,7 +105065,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject __pyx_t_21 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_idx.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_idx.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_index.diminfo[0].strides)); - /* "fastremap.pyx":897 + /* "fastremap.pyx":913 * if counts[i] > 0: * idx[j] = index[i] * j += 1 # <<<<<<<<<<<<<< @@ -102332,7 +105074,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = (__pyx_v_j + 1); - /* "fastremap.pyx":895 + /* "fastremap.pyx":911 * j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -102342,7 +105084,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":891 + /* "fastremap.pyx":907 * j += 1 * * if return_index: # <<<<<<<<<<<<<< @@ -102351,17 +105093,17 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":899 + /* "fastremap.pyx":915 * j += 1 * * if return_index: # <<<<<<<<<<<<<< * return segids, idx, cts * else: */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 899, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 915, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":900 + /* "fastremap.pyx":916 * * if return_index: * return segids, idx, cts # <<<<<<<<<<<<<< @@ -102369,7 +105111,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject * return segids, None, cts */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 900, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_segids)); __Pyx_GIVEREF(((PyObject *)__pyx_v_segids)); @@ -102384,7 +105126,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject __pyx_t_2 = 0; goto __pyx_L0; - /* "fastremap.pyx":899 + /* "fastremap.pyx":915 * j += 1 * * if return_index: # <<<<<<<<<<<<<< @@ -102393,7 +105135,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":902 + /* "fastremap.pyx":918 * return segids, idx, cts * else: * return segids, None, cts # <<<<<<<<<<<<<< @@ -102402,7 +105144,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_segids)); __Pyx_GIVEREF(((PyObject *)__pyx_v_segids)); @@ -102418,7 +105160,7 @@ static PyObject *__pyx_pf_9fastremap_482unique_via_array(CYTHON_UNUSED PyObject goto __pyx_L0; } - /* "fastremap.pyx":842 + /* "fastremap.pyx":858 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def unique_via_array(cnp.ndarray[ALLINT, ndim=1] labels, size_t max_label, return_index=False): # <<<<<<<<<<<<<< @@ -102475,12 +105217,12 @@ static PyObject *__pyx_pf_9fastremap_666__defaults__(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults32, __pyx_self)->__pyx_arg_return_index); __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults32, __pyx_self)->__pyx_arg_return_index); PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults32, __pyx_self)->__pyx_arg_return_index); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -102544,7 +105286,7 @@ static PyObject *__pyx_fuse_4__pyx_pw_9fastremap_485unique_via_array(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_label)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, 1); __PYX_ERR(0, 842, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, 1); __PYX_ERR(0, 858, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -102554,7 +105296,7 @@ static PyObject *__pyx_fuse_4__pyx_pw_9fastremap_485unique_via_array(PyObject *_ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unique_via_array") < 0)) __PYX_ERR(0, 842, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unique_via_array") < 0)) __PYX_ERR(0, 858, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -102567,18 +105309,18 @@ static PyObject *__pyx_fuse_4__pyx_pw_9fastremap_485unique_via_array(PyObject *_ } } __pyx_v_labels = ((PyArrayObject *)values[0]); - __pyx_v_max_label = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_max_label == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 842, __pyx_L3_error) + __pyx_v_max_label = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_max_label == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 858, __pyx_L3_error) __pyx_v_return_index = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 842, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 858, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.unique_via_array", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 858, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_484unique_via_array(__pyx_self, __pyx_v_labels, __pyx_v_max_label, __pyx_v_return_index); /* function exit code */ @@ -102667,87 +105409,87 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 858, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":850 + /* "fastremap.pyx":866 * the size of the array. * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uint32 * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":851 + /* "fastremap.pyx":867 * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( * (max_label+1,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] index */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":850 + /* "fastremap.pyx":866 * the size of the array. * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uint32 * ) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":851 + /* "fastremap.pyx":867 * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( * (max_label+1,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] index */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 851, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":850 + /* "fastremap.pyx":866 * the size of the array. * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uint32 * ) */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 850, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 866, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_counts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 850, __pyx_L1_error) + __PYX_ERR(0, 866, __pyx_L1_error) } else {__pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; } } @@ -102755,21 +105497,21 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject __pyx_v_counts = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":855 + /* "fastremap.pyx":871 * cdef cnp.ndarray[uintptr_t, ndim=1] index * * cdef uintptr_t sentinel = np.iinfo(np.uintp).max # <<<<<<<<<<<<<< * if return_index: * index = np.zeros( */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -102785,111 +105527,111 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 855, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sentinel = __pyx_t_7; - /* "fastremap.pyx":856 + /* "fastremap.pyx":872 * * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: # <<<<<<<<<<<<<< * index = np.zeros( * (max_label+1,), dtype=np.uintp */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 872, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":857 + /* "fastremap.pyx":873 * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: * index = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uintp * ) + sentinel */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":858 + /* "fastremap.pyx":874 * if return_index: * index = np.zeros( * (max_label+1,), dtype=np.uintp # <<<<<<<<<<<<<< * ) + sentinel * */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":857 + /* "fastremap.pyx":873 * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: * index = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uintp * ) + sentinel */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":858 + /* "fastremap.pyx":874 * if return_index: * index = np.zeros( * (max_label+1,), dtype=np.uintp # <<<<<<<<<<<<<< * ) + sentinel * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 858, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":857 + /* "fastremap.pyx":873 * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: * index = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uintp * ) + sentinel */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":859 + /* "fastremap.pyx":875 * index = np.zeros( * (max_label+1,), dtype=np.uintp * ) + sentinel # <<<<<<<<<<<<<< * * cdef size_t voxels = labels.shape[0] */ - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_sentinel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_sentinel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 859, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 875, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -102906,13 +105648,13 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0; } __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 857, __pyx_L1_error) + if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 873, __pyx_L1_error) } __pyx_t_9 = 0; __pyx_v_index = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":856 + /* "fastremap.pyx":872 * * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: # <<<<<<<<<<<<<< @@ -102921,7 +105663,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":861 + /* "fastremap.pyx":877 * ) + sentinel * * cdef size_t voxels = labels.shape[0] # <<<<<<<<<<<<<< @@ -102930,7 +105672,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_voxels = (__pyx_v_labels->dimensions[0]); - /* "fastremap.pyx":862 + /* "fastremap.pyx":878 * * cdef size_t voxels = labels.shape[0] * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -102939,7 +105681,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_i = 0; - /* "fastremap.pyx":863 + /* "fastremap.pyx":879 * cdef size_t voxels = labels.shape[0] * cdef size_t i = 0 * for i in range(voxels): # <<<<<<<<<<<<<< @@ -102951,7 +105693,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":864 + /* "fastremap.pyx":880 * cdef size_t i = 0 * for i in range(voxels): * counts[labels[i]] += 1 # <<<<<<<<<<<<<< @@ -102963,17 +105705,17 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; } - /* "fastremap.pyx":866 + /* "fastremap.pyx":882 * counts[labels[i]] += 1 * * if return_index: # <<<<<<<<<<<<<< * for i in range(voxels): * if index[labels[i]] == sentinel: */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 866, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 882, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":867 + /* "fastremap.pyx":883 * * if return_index: * for i in range(voxels): # <<<<<<<<<<<<<< @@ -102985,7 +105727,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":868 + /* "fastremap.pyx":884 * if return_index: * for i in range(voxels): * if index[labels[i]] == sentinel: # <<<<<<<<<<<<<< @@ -102997,7 +105739,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_index.diminfo[0].strides)) == __pyx_v_sentinel) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":869 + /* "fastremap.pyx":885 * for i in range(voxels): * if index[labels[i]] == sentinel: * index[labels[i]] = i # <<<<<<<<<<<<<< @@ -103008,7 +105750,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject __pyx_t_18 = (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides)); *__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_index.diminfo[0].strides) = __pyx_v_i; - /* "fastremap.pyx":868 + /* "fastremap.pyx":884 * if return_index: * for i in range(voxels): * if index[labels[i]] == sentinel: # <<<<<<<<<<<<<< @@ -103018,7 +105760,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":866 + /* "fastremap.pyx":882 * counts[labels[i]] += 1 * * if return_index: # <<<<<<<<<<<<<< @@ -103027,7 +105769,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":871 + /* "fastremap.pyx":887 * index[labels[i]] = i * * cdef size_t real_size = 0 # <<<<<<<<<<<<<< @@ -103036,7 +105778,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_real_size = 0; - /* "fastremap.pyx":872 + /* "fastremap.pyx":888 * * cdef size_t real_size = 0 * for i in range(max_label + 1): # <<<<<<<<<<<<<< @@ -103048,7 +105790,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":873 + /* "fastremap.pyx":889 * cdef size_t real_size = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -103059,7 +105801,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)) > 0) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":874 + /* "fastremap.pyx":890 * for i in range(max_label + 1): * if counts[i] > 0: * real_size += 1 # <<<<<<<<<<<<<< @@ -103068,7 +105810,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_real_size = (__pyx_v_real_size + 1); - /* "fastremap.pyx":873 + /* "fastremap.pyx":889 * cdef size_t real_size = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -103078,80 +105820,80 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":876 + /* "fastremap.pyx":892 * real_size += 1 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=labels.dtype * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":877 + /* "fastremap.pyx":893 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( * (real_size,), dtype=labels.dtype # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":876 + /* "fastremap.pyx":892 * real_size += 1 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=labels.dtype * ) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":877 + /* "fastremap.pyx":893 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( * (real_size,), dtype=labels.dtype # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 877, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":876 + /* "fastremap.pyx":892 * real_size += 1 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=labels.dtype * ) */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 876, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 892, __pyx_L1_error) __pyx_t_19 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segids.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_segids = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_segids.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 876, __pyx_L1_error) + __PYX_ERR(0, 892, __pyx_L1_error) } else {__pyx_pybuffernd_segids.diminfo[0].strides = __pyx_pybuffernd_segids.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_segids.diminfo[0].shape = __pyx_pybuffernd_segids.rcbuffer->pybuffer.shape[0]; } } @@ -103159,83 +105901,83 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject __pyx_v_segids = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":879 + /* "fastremap.pyx":895 * (real_size,), dtype=labels.dtype * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=np.uint32 * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":880 + /* "fastremap.pyx":896 * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( * (real_size,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] idx */ - __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":879 + /* "fastremap.pyx":895 * (real_size,), dtype=labels.dtype * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=np.uint32 * ) */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":880 + /* "fastremap.pyx":896 * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( * (real_size,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] idx */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 880, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":879 + /* "fastremap.pyx":895 * (real_size,), dtype=labels.dtype * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=np.uint32 * ) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 879, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 895, __pyx_L1_error) __pyx_t_20 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cts.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_cts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 879, __pyx_L1_error) + __PYX_ERR(0, 895, __pyx_L1_error) } else {__pyx_pybuffernd_cts.diminfo[0].strides = __pyx_pybuffernd_cts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cts.diminfo[0].shape = __pyx_pybuffernd_cts.rcbuffer->pybuffer.shape[0]; } } @@ -103243,7 +105985,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject __pyx_v_cts = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":884 + /* "fastremap.pyx":900 * cdef cnp.ndarray[uintptr_t, ndim=1] idx * * cdef size_t j = 0 # <<<<<<<<<<<<<< @@ -103252,7 +105994,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = 0; - /* "fastremap.pyx":885 + /* "fastremap.pyx":901 * * cdef size_t j = 0 * for i in range(max_label + 1): # <<<<<<<<<<<<<< @@ -103264,7 +106006,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":886 + /* "fastremap.pyx":902 * cdef size_t j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -103275,7 +106017,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)) > 0) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":887 + /* "fastremap.pyx":903 * for i in range(max_label + 1): * if counts[i] > 0: * segids[j] = i # <<<<<<<<<<<<<< @@ -103285,7 +106027,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject __pyx_t_17 = __pyx_v_j; *__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_segids.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_segids.diminfo[0].strides) = __pyx_v_i; - /* "fastremap.pyx":888 + /* "fastremap.pyx":904 * if counts[i] > 0: * segids[j] = i * cts[j] = counts[i] # <<<<<<<<<<<<<< @@ -103296,7 +106038,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject __pyx_t_21 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_cts.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_cts.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)); - /* "fastremap.pyx":889 + /* "fastremap.pyx":905 * segids[j] = i * cts[j] = counts[i] * j += 1 # <<<<<<<<<<<<<< @@ -103305,7 +106047,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = (__pyx_v_j + 1); - /* "fastremap.pyx":886 + /* "fastremap.pyx":902 * cdef size_t j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -103315,55 +106057,55 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":891 + /* "fastremap.pyx":907 * j += 1 * * if return_index: # <<<<<<<<<<<<<< * idx = np.zeros( (real_size,), dtype=np.uintp) * j = 0 */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 907, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":892 + /* "fastremap.pyx":908 * * if return_index: * idx = np.zeros( (real_size,), dtype=np.uintp) # <<<<<<<<<<<<<< * j = 0 * for i in range(max_label + 1): */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 892, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 892, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 892, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 908, __pyx_L1_error) __pyx_t_22 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -103380,13 +106122,13 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject __pyx_t_13 = __pyx_t_12 = __pyx_t_11 = 0; } __pyx_pybuffernd_idx.diminfo[0].strides = __pyx_pybuffernd_idx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx.diminfo[0].shape = __pyx_pybuffernd_idx.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 892, __pyx_L1_error) + if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 908, __pyx_L1_error) } __pyx_t_22 = 0; __pyx_v_idx = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":893 + /* "fastremap.pyx":909 * if return_index: * idx = np.zeros( (real_size,), dtype=np.uintp) * j = 0 # <<<<<<<<<<<<<< @@ -103395,7 +106137,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = 0; - /* "fastremap.pyx":894 + /* "fastremap.pyx":910 * idx = np.zeros( (real_size,), dtype=np.uintp) * j = 0 * for i in range(max_label + 1): # <<<<<<<<<<<<<< @@ -103407,7 +106149,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":895 + /* "fastremap.pyx":911 * j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -103418,7 +106160,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)) > 0) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":896 + /* "fastremap.pyx":912 * for i in range(max_label + 1): * if counts[i] > 0: * idx[j] = index[i] # <<<<<<<<<<<<<< @@ -103429,7 +106171,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject __pyx_t_21 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_idx.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_idx.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_index.diminfo[0].strides)); - /* "fastremap.pyx":897 + /* "fastremap.pyx":913 * if counts[i] > 0: * idx[j] = index[i] * j += 1 # <<<<<<<<<<<<<< @@ -103438,7 +106180,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = (__pyx_v_j + 1); - /* "fastremap.pyx":895 + /* "fastremap.pyx":911 * j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -103448,7 +106190,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":891 + /* "fastremap.pyx":907 * j += 1 * * if return_index: # <<<<<<<<<<<<<< @@ -103457,17 +106199,17 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":899 + /* "fastremap.pyx":915 * j += 1 * * if return_index: # <<<<<<<<<<<<<< * return segids, idx, cts * else: */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 899, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 915, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":900 + /* "fastremap.pyx":916 * * if return_index: * return segids, idx, cts # <<<<<<<<<<<<<< @@ -103475,7 +106217,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject * return segids, None, cts */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 900, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_segids)); __Pyx_GIVEREF(((PyObject *)__pyx_v_segids)); @@ -103490,7 +106232,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject __pyx_t_2 = 0; goto __pyx_L0; - /* "fastremap.pyx":899 + /* "fastremap.pyx":915 * j += 1 * * if return_index: # <<<<<<<<<<<<<< @@ -103499,7 +106241,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":902 + /* "fastremap.pyx":918 * return segids, idx, cts * else: * return segids, None, cts # <<<<<<<<<<<<<< @@ -103508,7 +106250,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_segids)); __Pyx_GIVEREF(((PyObject *)__pyx_v_segids)); @@ -103524,7 +106266,7 @@ static PyObject *__pyx_pf_9fastremap_484unique_via_array(CYTHON_UNUSED PyObject goto __pyx_L0; } - /* "fastremap.pyx":842 + /* "fastremap.pyx":858 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def unique_via_array(cnp.ndarray[ALLINT, ndim=1] labels, size_t max_label, return_index=False): # <<<<<<<<<<<<<< @@ -103581,12 +106323,12 @@ static PyObject *__pyx_pf_9fastremap_668__defaults__(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults33, __pyx_self)->__pyx_arg_return_index); __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults33, __pyx_self)->__pyx_arg_return_index); PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults33, __pyx_self)->__pyx_arg_return_index); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -103650,7 +106392,7 @@ static PyObject *__pyx_fuse_5__pyx_pw_9fastremap_487unique_via_array(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_label)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, 1); __PYX_ERR(0, 842, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, 1); __PYX_ERR(0, 858, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -103660,7 +106402,7 @@ static PyObject *__pyx_fuse_5__pyx_pw_9fastremap_487unique_via_array(PyObject *_ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unique_via_array") < 0)) __PYX_ERR(0, 842, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unique_via_array") < 0)) __PYX_ERR(0, 858, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -103673,18 +106415,18 @@ static PyObject *__pyx_fuse_5__pyx_pw_9fastremap_487unique_via_array(PyObject *_ } } __pyx_v_labels = ((PyArrayObject *)values[0]); - __pyx_v_max_label = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_max_label == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 842, __pyx_L3_error) + __pyx_v_max_label = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_max_label == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 858, __pyx_L3_error) __pyx_v_return_index = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 842, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 858, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.unique_via_array", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 858, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_486unique_via_array(__pyx_self, __pyx_v_labels, __pyx_v_max_label, __pyx_v_return_index); /* function exit code */ @@ -103773,87 +106515,87 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 858, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":850 + /* "fastremap.pyx":866 * the size of the array. * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uint32 * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":851 + /* "fastremap.pyx":867 * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( * (max_label+1,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] index */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":850 + /* "fastremap.pyx":866 * the size of the array. * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uint32 * ) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":851 + /* "fastremap.pyx":867 * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( * (max_label+1,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] index */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 851, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":850 + /* "fastremap.pyx":866 * the size of the array. * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uint32 * ) */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 850, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 866, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_counts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 850, __pyx_L1_error) + __PYX_ERR(0, 866, __pyx_L1_error) } else {__pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; } } @@ -103861,21 +106603,21 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject __pyx_v_counts = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":855 + /* "fastremap.pyx":871 * cdef cnp.ndarray[uintptr_t, ndim=1] index * * cdef uintptr_t sentinel = np.iinfo(np.uintp).max # <<<<<<<<<<<<<< * if return_index: * index = np.zeros( */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -103891,111 +106633,111 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 855, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sentinel = __pyx_t_7; - /* "fastremap.pyx":856 + /* "fastremap.pyx":872 * * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: # <<<<<<<<<<<<<< * index = np.zeros( * (max_label+1,), dtype=np.uintp */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 872, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":857 + /* "fastremap.pyx":873 * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: * index = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uintp * ) + sentinel */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":858 + /* "fastremap.pyx":874 * if return_index: * index = np.zeros( * (max_label+1,), dtype=np.uintp # <<<<<<<<<<<<<< * ) + sentinel * */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":857 + /* "fastremap.pyx":873 * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: * index = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uintp * ) + sentinel */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":858 + /* "fastremap.pyx":874 * if return_index: * index = np.zeros( * (max_label+1,), dtype=np.uintp # <<<<<<<<<<<<<< * ) + sentinel * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 858, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":857 + /* "fastremap.pyx":873 * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: * index = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uintp * ) + sentinel */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":859 + /* "fastremap.pyx":875 * index = np.zeros( * (max_label+1,), dtype=np.uintp * ) + sentinel # <<<<<<<<<<<<<< * * cdef size_t voxels = labels.shape[0] */ - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_sentinel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_sentinel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 859, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 875, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -104012,13 +106754,13 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0; } __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 857, __pyx_L1_error) + if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 873, __pyx_L1_error) } __pyx_t_9 = 0; __pyx_v_index = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":856 + /* "fastremap.pyx":872 * * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: # <<<<<<<<<<<<<< @@ -104027,7 +106769,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":861 + /* "fastremap.pyx":877 * ) + sentinel * * cdef size_t voxels = labels.shape[0] # <<<<<<<<<<<<<< @@ -104036,7 +106778,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_voxels = (__pyx_v_labels->dimensions[0]); - /* "fastremap.pyx":862 + /* "fastremap.pyx":878 * * cdef size_t voxels = labels.shape[0] * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -104045,7 +106787,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_i = 0; - /* "fastremap.pyx":863 + /* "fastremap.pyx":879 * cdef size_t voxels = labels.shape[0] * cdef size_t i = 0 * for i in range(voxels): # <<<<<<<<<<<<<< @@ -104057,7 +106799,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":864 + /* "fastremap.pyx":880 * cdef size_t i = 0 * for i in range(voxels): * counts[labels[i]] += 1 # <<<<<<<<<<<<<< @@ -104069,17 +106811,17 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; } - /* "fastremap.pyx":866 + /* "fastremap.pyx":882 * counts[labels[i]] += 1 * * if return_index: # <<<<<<<<<<<<<< * for i in range(voxels): * if index[labels[i]] == sentinel: */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 866, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 882, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":867 + /* "fastremap.pyx":883 * * if return_index: * for i in range(voxels): # <<<<<<<<<<<<<< @@ -104091,7 +106833,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":868 + /* "fastremap.pyx":884 * if return_index: * for i in range(voxels): * if index[labels[i]] == sentinel: # <<<<<<<<<<<<<< @@ -104103,7 +106845,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_index.diminfo[0].strides)) == __pyx_v_sentinel) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":869 + /* "fastremap.pyx":885 * for i in range(voxels): * if index[labels[i]] == sentinel: * index[labels[i]] = i # <<<<<<<<<<<<<< @@ -104114,7 +106856,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject __pyx_t_18 = (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides)); *__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_index.diminfo[0].strides) = __pyx_v_i; - /* "fastremap.pyx":868 + /* "fastremap.pyx":884 * if return_index: * for i in range(voxels): * if index[labels[i]] == sentinel: # <<<<<<<<<<<<<< @@ -104124,7 +106866,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":866 + /* "fastremap.pyx":882 * counts[labels[i]] += 1 * * if return_index: # <<<<<<<<<<<<<< @@ -104133,7 +106875,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":871 + /* "fastremap.pyx":887 * index[labels[i]] = i * * cdef size_t real_size = 0 # <<<<<<<<<<<<<< @@ -104142,7 +106884,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_real_size = 0; - /* "fastremap.pyx":872 + /* "fastremap.pyx":888 * * cdef size_t real_size = 0 * for i in range(max_label + 1): # <<<<<<<<<<<<<< @@ -104154,7 +106896,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":873 + /* "fastremap.pyx":889 * cdef size_t real_size = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -104165,7 +106907,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)) > 0) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":874 + /* "fastremap.pyx":890 * for i in range(max_label + 1): * if counts[i] > 0: * real_size += 1 # <<<<<<<<<<<<<< @@ -104174,7 +106916,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_real_size = (__pyx_v_real_size + 1); - /* "fastremap.pyx":873 + /* "fastremap.pyx":889 * cdef size_t real_size = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -104184,80 +106926,80 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":876 + /* "fastremap.pyx":892 * real_size += 1 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=labels.dtype * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":877 + /* "fastremap.pyx":893 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( * (real_size,), dtype=labels.dtype # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":876 + /* "fastremap.pyx":892 * real_size += 1 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=labels.dtype * ) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":877 + /* "fastremap.pyx":893 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( * (real_size,), dtype=labels.dtype # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 877, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":876 + /* "fastremap.pyx":892 * real_size += 1 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=labels.dtype * ) */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 876, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 892, __pyx_L1_error) __pyx_t_19 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segids.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_segids = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_segids.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 876, __pyx_L1_error) + __PYX_ERR(0, 892, __pyx_L1_error) } else {__pyx_pybuffernd_segids.diminfo[0].strides = __pyx_pybuffernd_segids.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_segids.diminfo[0].shape = __pyx_pybuffernd_segids.rcbuffer->pybuffer.shape[0]; } } @@ -104265,83 +107007,83 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject __pyx_v_segids = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":879 + /* "fastremap.pyx":895 * (real_size,), dtype=labels.dtype * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=np.uint32 * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":880 + /* "fastremap.pyx":896 * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( * (real_size,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] idx */ - __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":879 + /* "fastremap.pyx":895 * (real_size,), dtype=labels.dtype * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=np.uint32 * ) */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":880 + /* "fastremap.pyx":896 * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( * (real_size,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] idx */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 880, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":879 + /* "fastremap.pyx":895 * (real_size,), dtype=labels.dtype * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=np.uint32 * ) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 879, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 895, __pyx_L1_error) __pyx_t_20 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cts.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_cts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 879, __pyx_L1_error) + __PYX_ERR(0, 895, __pyx_L1_error) } else {__pyx_pybuffernd_cts.diminfo[0].strides = __pyx_pybuffernd_cts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cts.diminfo[0].shape = __pyx_pybuffernd_cts.rcbuffer->pybuffer.shape[0]; } } @@ -104349,7 +107091,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject __pyx_v_cts = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":884 + /* "fastremap.pyx":900 * cdef cnp.ndarray[uintptr_t, ndim=1] idx * * cdef size_t j = 0 # <<<<<<<<<<<<<< @@ -104358,7 +107100,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = 0; - /* "fastremap.pyx":885 + /* "fastremap.pyx":901 * * cdef size_t j = 0 * for i in range(max_label + 1): # <<<<<<<<<<<<<< @@ -104370,7 +107112,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":886 + /* "fastremap.pyx":902 * cdef size_t j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -104381,7 +107123,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)) > 0) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":887 + /* "fastremap.pyx":903 * for i in range(max_label + 1): * if counts[i] > 0: * segids[j] = i # <<<<<<<<<<<<<< @@ -104391,7 +107133,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject __pyx_t_17 = __pyx_v_j; *__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_segids.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_segids.diminfo[0].strides) = __pyx_v_i; - /* "fastremap.pyx":888 + /* "fastremap.pyx":904 * if counts[i] > 0: * segids[j] = i * cts[j] = counts[i] # <<<<<<<<<<<<<< @@ -104402,7 +107144,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject __pyx_t_21 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_cts.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_cts.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)); - /* "fastremap.pyx":889 + /* "fastremap.pyx":905 * segids[j] = i * cts[j] = counts[i] * j += 1 # <<<<<<<<<<<<<< @@ -104411,7 +107153,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = (__pyx_v_j + 1); - /* "fastremap.pyx":886 + /* "fastremap.pyx":902 * cdef size_t j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -104421,55 +107163,55 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":891 + /* "fastremap.pyx":907 * j += 1 * * if return_index: # <<<<<<<<<<<<<< * idx = np.zeros( (real_size,), dtype=np.uintp) * j = 0 */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 907, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":892 + /* "fastremap.pyx":908 * * if return_index: * idx = np.zeros( (real_size,), dtype=np.uintp) # <<<<<<<<<<<<<< * j = 0 * for i in range(max_label + 1): */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 892, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 892, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 892, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 908, __pyx_L1_error) __pyx_t_22 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -104486,13 +107228,13 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject __pyx_t_13 = __pyx_t_12 = __pyx_t_11 = 0; } __pyx_pybuffernd_idx.diminfo[0].strides = __pyx_pybuffernd_idx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx.diminfo[0].shape = __pyx_pybuffernd_idx.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 892, __pyx_L1_error) + if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 908, __pyx_L1_error) } __pyx_t_22 = 0; __pyx_v_idx = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":893 + /* "fastremap.pyx":909 * if return_index: * idx = np.zeros( (real_size,), dtype=np.uintp) * j = 0 # <<<<<<<<<<<<<< @@ -104501,7 +107243,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = 0; - /* "fastremap.pyx":894 + /* "fastremap.pyx":910 * idx = np.zeros( (real_size,), dtype=np.uintp) * j = 0 * for i in range(max_label + 1): # <<<<<<<<<<<<<< @@ -104513,7 +107255,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":895 + /* "fastremap.pyx":911 * j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -104524,7 +107266,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)) > 0) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":896 + /* "fastremap.pyx":912 * for i in range(max_label + 1): * if counts[i] > 0: * idx[j] = index[i] # <<<<<<<<<<<<<< @@ -104535,7 +107277,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject __pyx_t_21 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_idx.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_idx.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_index.diminfo[0].strides)); - /* "fastremap.pyx":897 + /* "fastremap.pyx":913 * if counts[i] > 0: * idx[j] = index[i] * j += 1 # <<<<<<<<<<<<<< @@ -104544,7 +107286,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = (__pyx_v_j + 1); - /* "fastremap.pyx":895 + /* "fastremap.pyx":911 * j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -104554,7 +107296,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":891 + /* "fastremap.pyx":907 * j += 1 * * if return_index: # <<<<<<<<<<<<<< @@ -104563,17 +107305,17 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":899 + /* "fastremap.pyx":915 * j += 1 * * if return_index: # <<<<<<<<<<<<<< * return segids, idx, cts * else: */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 899, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 915, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":900 + /* "fastremap.pyx":916 * * if return_index: * return segids, idx, cts # <<<<<<<<<<<<<< @@ -104581,7 +107323,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject * return segids, None, cts */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 900, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_segids)); __Pyx_GIVEREF(((PyObject *)__pyx_v_segids)); @@ -104596,7 +107338,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject __pyx_t_2 = 0; goto __pyx_L0; - /* "fastremap.pyx":899 + /* "fastremap.pyx":915 * j += 1 * * if return_index: # <<<<<<<<<<<<<< @@ -104605,7 +107347,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":902 + /* "fastremap.pyx":918 * return segids, idx, cts * else: * return segids, None, cts # <<<<<<<<<<<<<< @@ -104614,7 +107356,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_segids)); __Pyx_GIVEREF(((PyObject *)__pyx_v_segids)); @@ -104630,7 +107372,7 @@ static PyObject *__pyx_pf_9fastremap_486unique_via_array(CYTHON_UNUSED PyObject goto __pyx_L0; } - /* "fastremap.pyx":842 + /* "fastremap.pyx":858 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def unique_via_array(cnp.ndarray[ALLINT, ndim=1] labels, size_t max_label, return_index=False): # <<<<<<<<<<<<<< @@ -104687,12 +107429,12 @@ static PyObject *__pyx_pf_9fastremap_670__defaults__(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults34, __pyx_self)->__pyx_arg_return_index); __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults34, __pyx_self)->__pyx_arg_return_index); PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults34, __pyx_self)->__pyx_arg_return_index); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -104756,7 +107498,7 @@ static PyObject *__pyx_fuse_6__pyx_pw_9fastremap_489unique_via_array(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_label)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, 1); __PYX_ERR(0, 842, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, 1); __PYX_ERR(0, 858, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -104766,7 +107508,7 @@ static PyObject *__pyx_fuse_6__pyx_pw_9fastremap_489unique_via_array(PyObject *_ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unique_via_array") < 0)) __PYX_ERR(0, 842, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unique_via_array") < 0)) __PYX_ERR(0, 858, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -104779,18 +107521,18 @@ static PyObject *__pyx_fuse_6__pyx_pw_9fastremap_489unique_via_array(PyObject *_ } } __pyx_v_labels = ((PyArrayObject *)values[0]); - __pyx_v_max_label = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_max_label == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 842, __pyx_L3_error) + __pyx_v_max_label = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_max_label == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 858, __pyx_L3_error) __pyx_v_return_index = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 842, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 858, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.unique_via_array", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 858, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_488unique_via_array(__pyx_self, __pyx_v_labels, __pyx_v_max_label, __pyx_v_return_index); /* function exit code */ @@ -104879,87 +107621,87 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 858, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":850 + /* "fastremap.pyx":866 * the size of the array. * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uint32 * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":851 + /* "fastremap.pyx":867 * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( * (max_label+1,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] index */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":850 + /* "fastremap.pyx":866 * the size of the array. * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uint32 * ) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":851 + /* "fastremap.pyx":867 * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( * (max_label+1,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] index */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 851, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":850 + /* "fastremap.pyx":866 * the size of the array. * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uint32 * ) */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 850, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 866, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_counts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 850, __pyx_L1_error) + __PYX_ERR(0, 866, __pyx_L1_error) } else {__pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; } } @@ -104967,21 +107709,21 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject __pyx_v_counts = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":855 + /* "fastremap.pyx":871 * cdef cnp.ndarray[uintptr_t, ndim=1] index * * cdef uintptr_t sentinel = np.iinfo(np.uintp).max # <<<<<<<<<<<<<< * if return_index: * index = np.zeros( */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -104997,111 +107739,111 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 855, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sentinel = __pyx_t_7; - /* "fastremap.pyx":856 + /* "fastremap.pyx":872 * * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: # <<<<<<<<<<<<<< * index = np.zeros( * (max_label+1,), dtype=np.uintp */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 872, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":857 + /* "fastremap.pyx":873 * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: * index = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uintp * ) + sentinel */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":858 + /* "fastremap.pyx":874 * if return_index: * index = np.zeros( * (max_label+1,), dtype=np.uintp # <<<<<<<<<<<<<< * ) + sentinel * */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":857 + /* "fastremap.pyx":873 * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: * index = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uintp * ) + sentinel */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":858 + /* "fastremap.pyx":874 * if return_index: * index = np.zeros( * (max_label+1,), dtype=np.uintp # <<<<<<<<<<<<<< * ) + sentinel * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 858, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":857 + /* "fastremap.pyx":873 * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: * index = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uintp * ) + sentinel */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":859 + /* "fastremap.pyx":875 * index = np.zeros( * (max_label+1,), dtype=np.uintp * ) + sentinel # <<<<<<<<<<<<<< * * cdef size_t voxels = labels.shape[0] */ - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_sentinel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_sentinel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 859, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 875, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -105118,13 +107860,13 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0; } __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 857, __pyx_L1_error) + if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 873, __pyx_L1_error) } __pyx_t_9 = 0; __pyx_v_index = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":856 + /* "fastremap.pyx":872 * * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: # <<<<<<<<<<<<<< @@ -105133,7 +107875,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":861 + /* "fastremap.pyx":877 * ) + sentinel * * cdef size_t voxels = labels.shape[0] # <<<<<<<<<<<<<< @@ -105142,7 +107884,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_voxels = (__pyx_v_labels->dimensions[0]); - /* "fastremap.pyx":862 + /* "fastremap.pyx":878 * * cdef size_t voxels = labels.shape[0] * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -105151,7 +107893,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_i = 0; - /* "fastremap.pyx":863 + /* "fastremap.pyx":879 * cdef size_t voxels = labels.shape[0] * cdef size_t i = 0 * for i in range(voxels): # <<<<<<<<<<<<<< @@ -105163,7 +107905,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":864 + /* "fastremap.pyx":880 * cdef size_t i = 0 * for i in range(voxels): * counts[labels[i]] += 1 # <<<<<<<<<<<<<< @@ -105175,17 +107917,17 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; } - /* "fastremap.pyx":866 + /* "fastremap.pyx":882 * counts[labels[i]] += 1 * * if return_index: # <<<<<<<<<<<<<< * for i in range(voxels): * if index[labels[i]] == sentinel: */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 866, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 882, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":867 + /* "fastremap.pyx":883 * * if return_index: * for i in range(voxels): # <<<<<<<<<<<<<< @@ -105197,7 +107939,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":868 + /* "fastremap.pyx":884 * if return_index: * for i in range(voxels): * if index[labels[i]] == sentinel: # <<<<<<<<<<<<<< @@ -105209,7 +107951,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_index.diminfo[0].strides)) == __pyx_v_sentinel) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":869 + /* "fastremap.pyx":885 * for i in range(voxels): * if index[labels[i]] == sentinel: * index[labels[i]] = i # <<<<<<<<<<<<<< @@ -105220,7 +107962,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject __pyx_t_18 = (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides)); *__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_index.diminfo[0].strides) = __pyx_v_i; - /* "fastremap.pyx":868 + /* "fastremap.pyx":884 * if return_index: * for i in range(voxels): * if index[labels[i]] == sentinel: # <<<<<<<<<<<<<< @@ -105230,7 +107972,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":866 + /* "fastremap.pyx":882 * counts[labels[i]] += 1 * * if return_index: # <<<<<<<<<<<<<< @@ -105239,7 +107981,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":871 + /* "fastremap.pyx":887 * index[labels[i]] = i * * cdef size_t real_size = 0 # <<<<<<<<<<<<<< @@ -105248,7 +107990,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_real_size = 0; - /* "fastremap.pyx":872 + /* "fastremap.pyx":888 * * cdef size_t real_size = 0 * for i in range(max_label + 1): # <<<<<<<<<<<<<< @@ -105260,7 +108002,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":873 + /* "fastremap.pyx":889 * cdef size_t real_size = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -105271,7 +108013,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)) > 0) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":874 + /* "fastremap.pyx":890 * for i in range(max_label + 1): * if counts[i] > 0: * real_size += 1 # <<<<<<<<<<<<<< @@ -105280,7 +108022,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_real_size = (__pyx_v_real_size + 1); - /* "fastremap.pyx":873 + /* "fastremap.pyx":889 * cdef size_t real_size = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -105290,80 +108032,80 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":876 + /* "fastremap.pyx":892 * real_size += 1 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=labels.dtype * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":877 + /* "fastremap.pyx":893 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( * (real_size,), dtype=labels.dtype # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":876 + /* "fastremap.pyx":892 * real_size += 1 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=labels.dtype * ) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":877 + /* "fastremap.pyx":893 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( * (real_size,), dtype=labels.dtype # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 877, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":876 + /* "fastremap.pyx":892 * real_size += 1 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=labels.dtype * ) */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 876, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 892, __pyx_L1_error) __pyx_t_19 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segids.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_segids = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_segids.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 876, __pyx_L1_error) + __PYX_ERR(0, 892, __pyx_L1_error) } else {__pyx_pybuffernd_segids.diminfo[0].strides = __pyx_pybuffernd_segids.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_segids.diminfo[0].shape = __pyx_pybuffernd_segids.rcbuffer->pybuffer.shape[0]; } } @@ -105371,83 +108113,83 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject __pyx_v_segids = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":879 + /* "fastremap.pyx":895 * (real_size,), dtype=labels.dtype * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=np.uint32 * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":880 + /* "fastremap.pyx":896 * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( * (real_size,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] idx */ - __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":879 + /* "fastremap.pyx":895 * (real_size,), dtype=labels.dtype * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=np.uint32 * ) */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":880 + /* "fastremap.pyx":896 * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( * (real_size,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] idx */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 880, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":879 + /* "fastremap.pyx":895 * (real_size,), dtype=labels.dtype * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=np.uint32 * ) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 879, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 895, __pyx_L1_error) __pyx_t_20 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cts.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_cts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 879, __pyx_L1_error) + __PYX_ERR(0, 895, __pyx_L1_error) } else {__pyx_pybuffernd_cts.diminfo[0].strides = __pyx_pybuffernd_cts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cts.diminfo[0].shape = __pyx_pybuffernd_cts.rcbuffer->pybuffer.shape[0]; } } @@ -105455,7 +108197,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject __pyx_v_cts = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":884 + /* "fastremap.pyx":900 * cdef cnp.ndarray[uintptr_t, ndim=1] idx * * cdef size_t j = 0 # <<<<<<<<<<<<<< @@ -105464,7 +108206,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = 0; - /* "fastremap.pyx":885 + /* "fastremap.pyx":901 * * cdef size_t j = 0 * for i in range(max_label + 1): # <<<<<<<<<<<<<< @@ -105476,7 +108218,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":886 + /* "fastremap.pyx":902 * cdef size_t j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -105487,7 +108229,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)) > 0) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":887 + /* "fastremap.pyx":903 * for i in range(max_label + 1): * if counts[i] > 0: * segids[j] = i # <<<<<<<<<<<<<< @@ -105497,7 +108239,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject __pyx_t_17 = __pyx_v_j; *__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_segids.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_segids.diminfo[0].strides) = __pyx_v_i; - /* "fastremap.pyx":888 + /* "fastremap.pyx":904 * if counts[i] > 0: * segids[j] = i * cts[j] = counts[i] # <<<<<<<<<<<<<< @@ -105508,7 +108250,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject __pyx_t_21 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_cts.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_cts.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)); - /* "fastremap.pyx":889 + /* "fastremap.pyx":905 * segids[j] = i * cts[j] = counts[i] * j += 1 # <<<<<<<<<<<<<< @@ -105517,7 +108259,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = (__pyx_v_j + 1); - /* "fastremap.pyx":886 + /* "fastremap.pyx":902 * cdef size_t j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -105527,55 +108269,55 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":891 + /* "fastremap.pyx":907 * j += 1 * * if return_index: # <<<<<<<<<<<<<< * idx = np.zeros( (real_size,), dtype=np.uintp) * j = 0 */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 907, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":892 + /* "fastremap.pyx":908 * * if return_index: * idx = np.zeros( (real_size,), dtype=np.uintp) # <<<<<<<<<<<<<< * j = 0 * for i in range(max_label + 1): */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 892, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 892, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 892, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 908, __pyx_L1_error) __pyx_t_22 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -105592,13 +108334,13 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject __pyx_t_13 = __pyx_t_12 = __pyx_t_11 = 0; } __pyx_pybuffernd_idx.diminfo[0].strides = __pyx_pybuffernd_idx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx.diminfo[0].shape = __pyx_pybuffernd_idx.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 892, __pyx_L1_error) + if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 908, __pyx_L1_error) } __pyx_t_22 = 0; __pyx_v_idx = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":893 + /* "fastremap.pyx":909 * if return_index: * idx = np.zeros( (real_size,), dtype=np.uintp) * j = 0 # <<<<<<<<<<<<<< @@ -105607,7 +108349,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = 0; - /* "fastremap.pyx":894 + /* "fastremap.pyx":910 * idx = np.zeros( (real_size,), dtype=np.uintp) * j = 0 * for i in range(max_label + 1): # <<<<<<<<<<<<<< @@ -105619,7 +108361,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":895 + /* "fastremap.pyx":911 * j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -105630,7 +108372,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)) > 0) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":896 + /* "fastremap.pyx":912 * for i in range(max_label + 1): * if counts[i] > 0: * idx[j] = index[i] # <<<<<<<<<<<<<< @@ -105641,7 +108383,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject __pyx_t_21 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_idx.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_idx.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_index.diminfo[0].strides)); - /* "fastremap.pyx":897 + /* "fastremap.pyx":913 * if counts[i] > 0: * idx[j] = index[i] * j += 1 # <<<<<<<<<<<<<< @@ -105650,7 +108392,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = (__pyx_v_j + 1); - /* "fastremap.pyx":895 + /* "fastremap.pyx":911 * j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -105660,7 +108402,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":891 + /* "fastremap.pyx":907 * j += 1 * * if return_index: # <<<<<<<<<<<<<< @@ -105669,17 +108411,17 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":899 + /* "fastremap.pyx":915 * j += 1 * * if return_index: # <<<<<<<<<<<<<< * return segids, idx, cts * else: */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 899, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 915, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":900 + /* "fastremap.pyx":916 * * if return_index: * return segids, idx, cts # <<<<<<<<<<<<<< @@ -105687,7 +108429,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject * return segids, None, cts */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 900, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_segids)); __Pyx_GIVEREF(((PyObject *)__pyx_v_segids)); @@ -105702,7 +108444,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject __pyx_t_2 = 0; goto __pyx_L0; - /* "fastremap.pyx":899 + /* "fastremap.pyx":915 * j += 1 * * if return_index: # <<<<<<<<<<<<<< @@ -105711,7 +108453,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":902 + /* "fastremap.pyx":918 * return segids, idx, cts * else: * return segids, None, cts # <<<<<<<<<<<<<< @@ -105720,7 +108462,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_segids)); __Pyx_GIVEREF(((PyObject *)__pyx_v_segids)); @@ -105736,7 +108478,7 @@ static PyObject *__pyx_pf_9fastremap_488unique_via_array(CYTHON_UNUSED PyObject goto __pyx_L0; } - /* "fastremap.pyx":842 + /* "fastremap.pyx":858 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def unique_via_array(cnp.ndarray[ALLINT, ndim=1] labels, size_t max_label, return_index=False): # <<<<<<<<<<<<<< @@ -105793,12 +108535,12 @@ static PyObject *__pyx_pf_9fastremap_672__defaults__(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults35, __pyx_self)->__pyx_arg_return_index); __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults35, __pyx_self)->__pyx_arg_return_index); PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults35, __pyx_self)->__pyx_arg_return_index); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -105862,7 +108604,7 @@ static PyObject *__pyx_fuse_7__pyx_pw_9fastremap_491unique_via_array(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_label)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, 1); __PYX_ERR(0, 842, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, 1); __PYX_ERR(0, 858, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -105872,7 +108614,7 @@ static PyObject *__pyx_fuse_7__pyx_pw_9fastremap_491unique_via_array(PyObject *_ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unique_via_array") < 0)) __PYX_ERR(0, 842, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unique_via_array") < 0)) __PYX_ERR(0, 858, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -105885,18 +108627,18 @@ static PyObject *__pyx_fuse_7__pyx_pw_9fastremap_491unique_via_array(PyObject *_ } } __pyx_v_labels = ((PyArrayObject *)values[0]); - __pyx_v_max_label = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_max_label == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 842, __pyx_L3_error) + __pyx_v_max_label = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_max_label == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 858, __pyx_L3_error) __pyx_v_return_index = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 842, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("unique_via_array", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 858, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.unique_via_array", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 858, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_490unique_via_array(__pyx_self, __pyx_v_labels, __pyx_v_max_label, __pyx_v_return_index); /* function exit code */ @@ -105985,87 +108727,87 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 858, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":850 + /* "fastremap.pyx":866 * the size of the array. * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uint32 * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":851 + /* "fastremap.pyx":867 * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( * (max_label+1,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] index */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":850 + /* "fastremap.pyx":866 * the size of the array. * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uint32 * ) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":851 + /* "fastremap.pyx":867 * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( * (max_label+1,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] index */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 851, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":850 + /* "fastremap.pyx":866 * the size of the array. * """ * cdef cnp.ndarray[uint32_t, ndim=1] counts = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uint32 * ) */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 850, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 850, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 866, __pyx_L1_error) __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_counts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 850, __pyx_L1_error) + __PYX_ERR(0, 866, __pyx_L1_error) } else {__pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0]; } } @@ -106073,21 +108815,21 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject __pyx_v_counts = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":855 + /* "fastremap.pyx":871 * cdef cnp.ndarray[uintptr_t, ndim=1] index * * cdef uintptr_t sentinel = np.iinfo(np.uintp).max # <<<<<<<<<<<<<< * if return_index: * index = np.zeros( */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -106103,111 +108845,111 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 855, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sentinel = __pyx_t_7; - /* "fastremap.pyx":856 + /* "fastremap.pyx":872 * * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: # <<<<<<<<<<<<<< * index = np.zeros( * (max_label+1,), dtype=np.uintp */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 872, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":857 + /* "fastremap.pyx":873 * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: * index = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uintp * ) + sentinel */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":858 + /* "fastremap.pyx":874 * if return_index: * index = np.zeros( * (max_label+1,), dtype=np.uintp # <<<<<<<<<<<<<< * ) + sentinel * */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_max_label + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":857 + /* "fastremap.pyx":873 * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: * index = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uintp * ) + sentinel */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":858 + /* "fastremap.pyx":874 * if return_index: * index = np.zeros( * (max_label+1,), dtype=np.uintp # <<<<<<<<<<<<<< * ) + sentinel * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uintp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 858, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":857 + /* "fastremap.pyx":873 * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: * index = np.zeros( # <<<<<<<<<<<<<< * (max_label+1,), dtype=np.uintp * ) + sentinel */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":859 + /* "fastremap.pyx":875 * index = np.zeros( * (max_label+1,), dtype=np.uintp * ) + sentinel # <<<<<<<<<<<<<< * * cdef size_t voxels = labels.shape[0] */ - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_sentinel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_sentinel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 859, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 875, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -106224,13 +108966,13 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0; } __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 857, __pyx_L1_error) + if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 873, __pyx_L1_error) } __pyx_t_9 = 0; __pyx_v_index = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":856 + /* "fastremap.pyx":872 * * cdef uintptr_t sentinel = np.iinfo(np.uintp).max * if return_index: # <<<<<<<<<<<<<< @@ -106239,7 +108981,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":861 + /* "fastremap.pyx":877 * ) + sentinel * * cdef size_t voxels = labels.shape[0] # <<<<<<<<<<<<<< @@ -106248,7 +108990,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_voxels = (__pyx_v_labels->dimensions[0]); - /* "fastremap.pyx":862 + /* "fastremap.pyx":878 * * cdef size_t voxels = labels.shape[0] * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -106257,7 +108999,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_i = 0; - /* "fastremap.pyx":863 + /* "fastremap.pyx":879 * cdef size_t voxels = labels.shape[0] * cdef size_t i = 0 * for i in range(voxels): # <<<<<<<<<<<<<< @@ -106269,7 +109011,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":864 + /* "fastremap.pyx":880 * cdef size_t i = 0 * for i in range(voxels): * counts[labels[i]] += 1 # <<<<<<<<<<<<<< @@ -106281,17 +109023,17 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_counts.diminfo[0].strides) += 1; } - /* "fastremap.pyx":866 + /* "fastremap.pyx":882 * counts[labels[i]] += 1 * * if return_index: # <<<<<<<<<<<<<< * for i in range(voxels): * if index[labels[i]] == sentinel: */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 866, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 882, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":867 + /* "fastremap.pyx":883 * * if return_index: * for i in range(voxels): # <<<<<<<<<<<<<< @@ -106303,7 +109045,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":868 + /* "fastremap.pyx":884 * if return_index: * for i in range(voxels): * if index[labels[i]] == sentinel: # <<<<<<<<<<<<<< @@ -106315,7 +109057,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_index.diminfo[0].strides)) == __pyx_v_sentinel) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":869 + /* "fastremap.pyx":885 * for i in range(voxels): * if index[labels[i]] == sentinel: * index[labels[i]] = i # <<<<<<<<<<<<<< @@ -106326,7 +109068,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject __pyx_t_18 = (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_labels.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_labels.diminfo[0].strides)); *__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_index.diminfo[0].strides) = __pyx_v_i; - /* "fastremap.pyx":868 + /* "fastremap.pyx":884 * if return_index: * for i in range(voxels): * if index[labels[i]] == sentinel: # <<<<<<<<<<<<<< @@ -106336,7 +109078,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":866 + /* "fastremap.pyx":882 * counts[labels[i]] += 1 * * if return_index: # <<<<<<<<<<<<<< @@ -106345,7 +109087,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":871 + /* "fastremap.pyx":887 * index[labels[i]] = i * * cdef size_t real_size = 0 # <<<<<<<<<<<<<< @@ -106354,7 +109096,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_real_size = 0; - /* "fastremap.pyx":872 + /* "fastremap.pyx":888 * * cdef size_t real_size = 0 * for i in range(max_label + 1): # <<<<<<<<<<<<<< @@ -106366,7 +109108,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":873 + /* "fastremap.pyx":889 * cdef size_t real_size = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -106377,7 +109119,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)) > 0) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":874 + /* "fastremap.pyx":890 * for i in range(max_label + 1): * if counts[i] > 0: * real_size += 1 # <<<<<<<<<<<<<< @@ -106386,7 +109128,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_real_size = (__pyx_v_real_size + 1); - /* "fastremap.pyx":873 + /* "fastremap.pyx":889 * cdef size_t real_size = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -106396,80 +109138,80 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":876 + /* "fastremap.pyx":892 * real_size += 1 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=labels.dtype * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":877 + /* "fastremap.pyx":893 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( * (real_size,), dtype=labels.dtype # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":876 + /* "fastremap.pyx":892 * real_size += 1 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=labels.dtype * ) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = 0; - /* "fastremap.pyx":877 + /* "fastremap.pyx":893 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( * (real_size,), dtype=labels.dtype # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_labels), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 877, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":876 + /* "fastremap.pyx":892 * real_size += 1 * * cdef cnp.ndarray[ALLINT, ndim=1] segids = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=labels.dtype * ) */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 876, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 892, __pyx_L1_error) __pyx_t_19 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_segids.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_segids = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_segids.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 876, __pyx_L1_error) + __PYX_ERR(0, 892, __pyx_L1_error) } else {__pyx_pybuffernd_segids.diminfo[0].strides = __pyx_pybuffernd_segids.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_segids.diminfo[0].shape = __pyx_pybuffernd_segids.rcbuffer->pybuffer.shape[0]; } } @@ -106477,83 +109219,83 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject __pyx_v_segids = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":879 + /* "fastremap.pyx":895 * (real_size,), dtype=labels.dtype * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=np.uint32 * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":880 + /* "fastremap.pyx":896 * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( * (real_size,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] idx */ - __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":879 + /* "fastremap.pyx":895 * (real_size,), dtype=labels.dtype * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=np.uint32 * ) */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":880 + /* "fastremap.pyx":896 * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( * (real_size,), dtype=np.uint32 # <<<<<<<<<<<<<< * ) * cdef cnp.ndarray[uintptr_t, ndim=1] idx */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 880, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":879 + /* "fastremap.pyx":895 * (real_size,), dtype=labels.dtype * ) * cdef cnp.ndarray[uint32_t, ndim=1] cts = np.zeros( # <<<<<<<<<<<<<< * (real_size,), dtype=np.uint32 * ) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 879, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 895, __pyx_L1_error) __pyx_t_20 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cts.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_cts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cts.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 879, __pyx_L1_error) + __PYX_ERR(0, 895, __pyx_L1_error) } else {__pyx_pybuffernd_cts.diminfo[0].strides = __pyx_pybuffernd_cts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cts.diminfo[0].shape = __pyx_pybuffernd_cts.rcbuffer->pybuffer.shape[0]; } } @@ -106561,7 +109303,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject __pyx_v_cts = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":884 + /* "fastremap.pyx":900 * cdef cnp.ndarray[uintptr_t, ndim=1] idx * * cdef size_t j = 0 # <<<<<<<<<<<<<< @@ -106570,7 +109312,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = 0; - /* "fastremap.pyx":885 + /* "fastremap.pyx":901 * * cdef size_t j = 0 * for i in range(max_label + 1): # <<<<<<<<<<<<<< @@ -106582,7 +109324,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":886 + /* "fastremap.pyx":902 * cdef size_t j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -106593,7 +109335,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)) > 0) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":887 + /* "fastremap.pyx":903 * for i in range(max_label + 1): * if counts[i] > 0: * segids[j] = i # <<<<<<<<<<<<<< @@ -106603,7 +109345,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject __pyx_t_17 = __pyx_v_j; *__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_segids.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_segids.diminfo[0].strides) = __pyx_v_i; - /* "fastremap.pyx":888 + /* "fastremap.pyx":904 * if counts[i] > 0: * segids[j] = i * cts[j] = counts[i] # <<<<<<<<<<<<<< @@ -106614,7 +109356,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject __pyx_t_21 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_cts.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_cts.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)); - /* "fastremap.pyx":889 + /* "fastremap.pyx":905 * segids[j] = i * cts[j] = counts[i] * j += 1 # <<<<<<<<<<<<<< @@ -106623,7 +109365,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = (__pyx_v_j + 1); - /* "fastremap.pyx":886 + /* "fastremap.pyx":902 * cdef size_t j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -106633,55 +109375,55 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":891 + /* "fastremap.pyx":907 * j += 1 * * if return_index: # <<<<<<<<<<<<<< * idx = np.zeros( (real_size,), dtype=np.uintp) * j = 0 */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 907, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":892 + /* "fastremap.pyx":908 * * if return_index: * idx = np.zeros( (real_size,), dtype=np.uintp) # <<<<<<<<<<<<<< * j = 0 * for i in range(max_label + 1): */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_real_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 892, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uintp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 892, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 892, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 908, __pyx_L1_error) __pyx_t_22 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -106698,13 +109440,13 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject __pyx_t_13 = __pyx_t_12 = __pyx_t_11 = 0; } __pyx_pybuffernd_idx.diminfo[0].strides = __pyx_pybuffernd_idx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_idx.diminfo[0].shape = __pyx_pybuffernd_idx.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 892, __pyx_L1_error) + if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 908, __pyx_L1_error) } __pyx_t_22 = 0; __pyx_v_idx = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":893 + /* "fastremap.pyx":909 * if return_index: * idx = np.zeros( (real_size,), dtype=np.uintp) * j = 0 # <<<<<<<<<<<<<< @@ -106713,7 +109455,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = 0; - /* "fastremap.pyx":894 + /* "fastremap.pyx":910 * idx = np.zeros( (real_size,), dtype=np.uintp) * j = 0 * for i in range(max_label + 1): # <<<<<<<<<<<<<< @@ -106725,7 +109467,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "fastremap.pyx":895 + /* "fastremap.pyx":911 * j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -106736,7 +109478,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject __pyx_t_8 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_counts.diminfo[0].strides)) > 0) != 0); if (__pyx_t_8) { - /* "fastremap.pyx":896 + /* "fastremap.pyx":912 * for i in range(max_label + 1): * if counts[i] > 0: * idx[j] = index[i] # <<<<<<<<<<<<<< @@ -106747,7 +109489,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject __pyx_t_21 = __pyx_v_j; *__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_idx.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_idx.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(uintptr_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_index.diminfo[0].strides)); - /* "fastremap.pyx":897 + /* "fastremap.pyx":913 * if counts[i] > 0: * idx[j] = index[i] * j += 1 # <<<<<<<<<<<<<< @@ -106756,7 +109498,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject */ __pyx_v_j = (__pyx_v_j + 1); - /* "fastremap.pyx":895 + /* "fastremap.pyx":911 * j = 0 * for i in range(max_label + 1): * if counts[i] > 0: # <<<<<<<<<<<<<< @@ -106766,7 +109508,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject } } - /* "fastremap.pyx":891 + /* "fastremap.pyx":907 * j += 1 * * if return_index: # <<<<<<<<<<<<<< @@ -106775,17 +109517,17 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":899 + /* "fastremap.pyx":915 * j += 1 * * if return_index: # <<<<<<<<<<<<<< * return segids, idx, cts * else: */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 899, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_index); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 915, __pyx_L1_error) if (__pyx_t_8) { - /* "fastremap.pyx":900 + /* "fastremap.pyx":916 * * if return_index: * return segids, idx, cts # <<<<<<<<<<<<<< @@ -106793,7 +109535,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject * return segids, None, cts */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 900, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_segids)); __Pyx_GIVEREF(((PyObject *)__pyx_v_segids)); @@ -106808,7 +109550,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject __pyx_t_2 = 0; goto __pyx_L0; - /* "fastremap.pyx":899 + /* "fastremap.pyx":915 * j += 1 * * if return_index: # <<<<<<<<<<<<<< @@ -106817,7 +109559,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":902 + /* "fastremap.pyx":918 * return segids, idx, cts * else: * return segids, None, cts # <<<<<<<<<<<<<< @@ -106826,7 +109568,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_segids)); __Pyx_GIVEREF(((PyObject *)__pyx_v_segids)); @@ -106842,7 +109584,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject goto __pyx_L0; } - /* "fastremap.pyx":842 + /* "fastremap.pyx":858 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def unique_via_array(cnp.ndarray[ALLINT, ndim=1] labels, size_t max_label, return_index=False): # <<<<<<<<<<<<<< @@ -106889,7 +109631,7 @@ static PyObject *__pyx_pf_9fastremap_490unique_via_array(CYTHON_UNUSED PyObject return __pyx_r; } -/* "fastremap.pyx":904 +/* "fastremap.pyx":920 * return segids, None, cts * * def transpose(arr): # <<<<<<<<<<<<<< @@ -106933,19 +109675,19 @@ static PyObject *__pyx_pf_9fastremap_50transpose(CYTHON_UNUSED PyObject *__pyx_s __Pyx_RefNannySetupContext("transpose", 0); __Pyx_INCREF(__pyx_v_arr); - /* "fastremap.pyx":915 + /* "fastremap.pyx":931 * Returns: transposed numpy array * """ * if not arr.flags['F_CONTIGUOUS'] and not arr.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<< * arr = np.copy(arr, order='C') * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 915, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 915, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 915, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 931, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = ((!__pyx_t_4) != 0); if (__pyx_t_5) { @@ -106953,39 +109695,39 @@ static PyObject *__pyx_pf_9fastremap_50transpose(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_1 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 915, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 915, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 915, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 931, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = ((!__pyx_t_5) != 0); __pyx_t_1 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "fastremap.pyx":916 + /* "fastremap.pyx":932 * """ * if not arr.flags['F_CONTIGUOUS'] and not arr.flags['C_CONTIGUOUS']: * arr = np.copy(arr, order='C') # <<<<<<<<<<<<<< * * shape = arr.shape */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 916, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_arr); - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 916, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_n_u_C) < 0) __PYX_ERR(0, 916, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 916, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_n_u_C) < 0) __PYX_ERR(0, 932, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -106993,7 +109735,7 @@ static PyObject *__pyx_pf_9fastremap_50transpose(CYTHON_UNUSED PyObject *__pyx_s __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_7); __pyx_t_7 = 0; - /* "fastremap.pyx":915 + /* "fastremap.pyx":931 * Returns: transposed numpy array * """ * if not arr.flags['F_CONTIGUOUS'] and not arr.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -107002,43 +109744,43 @@ static PyObject *__pyx_pf_9fastremap_50transpose(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "fastremap.pyx":918 + /* "fastremap.pyx":934 * arr = np.copy(arr, order='C') * * shape = arr.shape # <<<<<<<<<<<<<< * strides = arr.strides * */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 918, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_shape = __pyx_t_7; __pyx_t_7 = 0; - /* "fastremap.pyx":919 + /* "fastremap.pyx":935 * * shape = arr.shape * strides = arr.strides # <<<<<<<<<<<<<< * * cdef int nbytes = np.dtype(arr.dtype).itemsize */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_strides); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 919, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_strides); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_strides = __pyx_t_7; __pyx_t_7 = 0; - /* "fastremap.pyx":921 + /* "fastremap.pyx":937 * strides = arr.strides * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * dtype = arr.dtype */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 921, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 921, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 921, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -107053,55 +109795,55 @@ static PyObject *__pyx_pf_9fastremap_50transpose(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_7 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 921, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 921, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 921, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 937, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_nbytes = __pyx_t_8; - /* "fastremap.pyx":923 + /* "fastremap.pyx":939 * cdef int nbytes = np.dtype(arr.dtype).itemsize * * dtype = arr.dtype # <<<<<<<<<<<<<< * if arr.dtype == bool: * arr = arr.view(np.uint8) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 923, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_dtype = __pyx_t_2; __pyx_t_2 = 0; - /* "fastremap.pyx":924 + /* "fastremap.pyx":940 * * dtype = arr.dtype * if arr.dtype == bool: # <<<<<<<<<<<<<< * arr = arr.view(np.uint8) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 924, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 924, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 940, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 924, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 940, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_1) { - /* "fastremap.pyx":925 + /* "fastremap.pyx":941 * dtype = arr.dtype * if arr.dtype == bool: * arr = arr.view(np.uint8) # <<<<<<<<<<<<<< * * if arr.ndim == 2: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 925, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 925, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 925, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -107117,13 +109859,13 @@ static PyObject *__pyx_pf_9fastremap_50transpose(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_7 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 925, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_7); __pyx_t_7 = 0; - /* "fastremap.pyx":924 + /* "fastremap.pyx":940 * * dtype = arr.dtype * if arr.dtype == bool: # <<<<<<<<<<<<<< @@ -107132,30 +109874,30 @@ static PyObject *__pyx_pf_9fastremap_50transpose(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "fastremap.pyx":927 + /* "fastremap.pyx":943 * arr = arr.view(np.uint8) * * if arr.ndim == 2: # <<<<<<<<<<<<<< * arr = ipt2d(arr) * return arr.view(dtype) */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 927, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_7, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 927, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_7, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 927, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 943, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "fastremap.pyx":928 + /* "fastremap.pyx":944 * * if arr.ndim == 2: * arr = ipt2d(arr) # <<<<<<<<<<<<<< * return arr.view(dtype) * elif arr.ndim == 3: */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ipt2d); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 928, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ipt2d); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { @@ -107169,13 +109911,13 @@ static PyObject *__pyx_pf_9fastremap_50transpose(CYTHON_UNUSED PyObject *__pyx_s } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, __pyx_v_arr) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_arr); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 928, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":929 + /* "fastremap.pyx":945 * if arr.ndim == 2: * arr = ipt2d(arr) * return arr.view(dtype) # <<<<<<<<<<<<<< @@ -107183,7 +109925,7 @@ static PyObject *__pyx_pf_9fastremap_50transpose(CYTHON_UNUSED PyObject *__pyx_s * arr = ipt3d(arr) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 929, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { @@ -107197,14 +109939,14 @@ static PyObject *__pyx_pf_9fastremap_50transpose(CYTHON_UNUSED PyObject *__pyx_s } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_dtype); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 929, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "fastremap.pyx":927 + /* "fastremap.pyx":943 * arr = arr.view(np.uint8) * * if arr.ndim == 2: # <<<<<<<<<<<<<< @@ -107213,30 +109955,30 @@ static PyObject *__pyx_pf_9fastremap_50transpose(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "fastremap.pyx":930 + /* "fastremap.pyx":946 * arr = ipt2d(arr) * return arr.view(dtype) * elif arr.ndim == 3: # <<<<<<<<<<<<<< * arr = ipt3d(arr) * return arr.view(dtype) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 930, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 930, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 946, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_1) { - /* "fastremap.pyx":931 + /* "fastremap.pyx":947 * return arr.view(dtype) * elif arr.ndim == 3: * arr = ipt3d(arr) # <<<<<<<<<<<<<< * return arr.view(dtype) * elif arr.ndim == 4: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ipt3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 931, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ipt3d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 947, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -107250,13 +109992,13 @@ static PyObject *__pyx_pf_9fastremap_50transpose(CYTHON_UNUSED PyObject *__pyx_s } __pyx_t_7 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_arr) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_arr); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 931, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 947, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_7); __pyx_t_7 = 0; - /* "fastremap.pyx":932 + /* "fastremap.pyx":948 * elif arr.ndim == 3: * arr = ipt3d(arr) * return arr.view(dtype) # <<<<<<<<<<<<<< @@ -107264,7 +110006,7 @@ static PyObject *__pyx_pf_9fastremap_50transpose(CYTHON_UNUSED PyObject *__pyx_s * arr = ipt4d(arr) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 932, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 948, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -107278,14 +110020,14 @@ static PyObject *__pyx_pf_9fastremap_50transpose(CYTHON_UNUSED PyObject *__pyx_s } __pyx_t_7 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_dtype); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 932, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 948, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; - /* "fastremap.pyx":930 + /* "fastremap.pyx":946 * arr = ipt2d(arr) * return arr.view(dtype) * elif arr.ndim == 3: # <<<<<<<<<<<<<< @@ -107294,30 +110036,30 @@ static PyObject *__pyx_pf_9fastremap_50transpose(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "fastremap.pyx":933 + /* "fastremap.pyx":949 * arr = ipt3d(arr) * return arr.view(dtype) * elif arr.ndim == 4: # <<<<<<<<<<<<<< * arr = ipt4d(arr) * return arr.view(dtype) */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 933, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_7, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 933, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_7, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 933, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 949, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "fastremap.pyx":934 + /* "fastremap.pyx":950 * return arr.view(dtype) * elif arr.ndim == 4: * arr = ipt4d(arr) # <<<<<<<<<<<<<< * return arr.view(dtype) * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ipt4d); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 934, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ipt4d); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { @@ -107331,13 +110073,13 @@ static PyObject *__pyx_pf_9fastremap_50transpose(CYTHON_UNUSED PyObject *__pyx_s } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, __pyx_v_arr) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_arr); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 934, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":935 + /* "fastremap.pyx":951 * elif arr.ndim == 4: * arr = ipt4d(arr) * return arr.view(dtype) # <<<<<<<<<<<<<< @@ -107345,7 +110087,7 @@ static PyObject *__pyx_pf_9fastremap_50transpose(CYTHON_UNUSED PyObject *__pyx_s * return arr.T */ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 935, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { @@ -107359,14 +110101,14 @@ static PyObject *__pyx_pf_9fastremap_50transpose(CYTHON_UNUSED PyObject *__pyx_s } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_dtype); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 935, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "fastremap.pyx":933 + /* "fastremap.pyx":949 * arr = ipt3d(arr) * return arr.view(dtype) * elif arr.ndim == 4: # <<<<<<<<<<<<<< @@ -107375,7 +110117,7 @@ static PyObject *__pyx_pf_9fastremap_50transpose(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "fastremap.pyx":937 + /* "fastremap.pyx":953 * return arr.view(dtype) * else: * return arr.T # <<<<<<<<<<<<<< @@ -107384,14 +110126,14 @@ static PyObject *__pyx_pf_9fastremap_50transpose(CYTHON_UNUSED PyObject *__pyx_s */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 937, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } - /* "fastremap.pyx":904 + /* "fastremap.pyx":920 * return segids, None, cts * * def transpose(arr): # <<<<<<<<<<<<<< @@ -107417,7 +110159,7 @@ static PyObject *__pyx_pf_9fastremap_50transpose(CYTHON_UNUSED PyObject *__pyx_s return __pyx_r; } -/* "fastremap.pyx":939 +/* "fastremap.pyx":955 * return arr.T * * def asfortranarray(arr): # <<<<<<<<<<<<<< @@ -107465,23 +110207,23 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ __Pyx_RefNannySetupContext("asfortranarray", 0); __Pyx_INCREF(__pyx_v_arr); - /* "fastremap.pyx":950 + /* "fastremap.pyx":966 * Returns: transposed numpy array * """ * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * return arr * elif not arr.flags['C_CONTIGUOUS']: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 950, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 950, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 950, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 966, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "fastremap.pyx":951 + /* "fastremap.pyx":967 * """ * if arr.flags['F_CONTIGUOUS']: * return arr # <<<<<<<<<<<<<< @@ -107493,7 +110235,7 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "fastremap.pyx":950 + /* "fastremap.pyx":966 * Returns: transposed numpy array * """ * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -107502,24 +110244,24 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ */ } - /* "fastremap.pyx":952 + /* "fastremap.pyx":968 * if arr.flags['F_CONTIGUOUS']: * return arr * elif not arr.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<< * return np.asfortranarray(arr) * elif arr.ndim == 1: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 952, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 952, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 952, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 968, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = ((!__pyx_t_3) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":953 + /* "fastremap.pyx":969 * return arr * elif not arr.flags['C_CONTIGUOUS']: * return np.asfortranarray(arr) # <<<<<<<<<<<<<< @@ -107527,9 +110269,9 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ * return arr */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 953, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -107544,14 +110286,14 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_v_arr) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_arr); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":952 + /* "fastremap.pyx":968 * if arr.flags['F_CONTIGUOUS']: * return arr * elif not arr.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -107560,23 +110302,23 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ */ } - /* "fastremap.pyx":954 + /* "fastremap.pyx":970 * elif not arr.flags['C_CONTIGUOUS']: * return np.asfortranarray(arr) * elif arr.ndim == 1: # <<<<<<<<<<<<<< * return arr * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 954, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 954, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 954, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 970, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":955 + /* "fastremap.pyx":971 * return np.asfortranarray(arr) * elif arr.ndim == 1: * return arr # <<<<<<<<<<<<<< @@ -107588,7 +110330,7 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "fastremap.pyx":954 + /* "fastremap.pyx":970 * elif not arr.flags['C_CONTIGUOUS']: * return np.asfortranarray(arr) * elif arr.ndim == 1: # <<<<<<<<<<<<<< @@ -107597,43 +110339,43 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ */ } - /* "fastremap.pyx":957 + /* "fastremap.pyx":973 * return arr * * shape = arr.shape # <<<<<<<<<<<<<< * strides = arr.strides * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 957, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 973, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_shape = __pyx_t_5; __pyx_t_5 = 0; - /* "fastremap.pyx":958 + /* "fastremap.pyx":974 * * shape = arr.shape * strides = arr.strides # <<<<<<<<<<<<<< * * cdef int nbytes = np.dtype(arr.dtype).itemsize */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_strides); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 958, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_strides); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_strides = __pyx_t_5; __pyx_t_5 = 0; - /* "fastremap.pyx":960 + /* "fastremap.pyx":976 * strides = arr.strides * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * dtype = arr.dtype */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 960, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 960, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -107648,55 +110390,55 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 960, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 960, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 976, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":962 + /* "fastremap.pyx":978 * cdef int nbytes = np.dtype(arr.dtype).itemsize * * dtype = arr.dtype # <<<<<<<<<<<<<< * if arr.dtype == bool: * arr = arr.view(np.uint8) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 962, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_dtype = __pyx_t_2; __pyx_t_2 = 0; - /* "fastremap.pyx":963 + /* "fastremap.pyx":979 * * dtype = arr.dtype * if arr.dtype == bool: # <<<<<<<<<<<<<< * arr = arr.view(np.uint8) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 963, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 963, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 979, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 963, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 979, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":964 + /* "fastremap.pyx":980 * dtype = arr.dtype * if arr.dtype == bool: * arr = arr.view(np.uint8) # <<<<<<<<<<<<<< * * if arr.ndim == 2: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 964, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 964, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 964, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -107712,13 +110454,13 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 964, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":963 + /* "fastremap.pyx":979 * * dtype = arr.dtype * if arr.dtype == bool: # <<<<<<<<<<<<<< @@ -107727,30 +110469,30 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ */ } - /* "fastremap.pyx":966 + /* "fastremap.pyx":982 * arr = arr.view(np.uint8) * * if arr.ndim == 2: # <<<<<<<<<<<<<< * arr = ipt2d(arr) * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, strides=(nbytes, shape[0] * nbytes)) */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 966, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_5, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_5, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 966, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 982, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":967 + /* "fastremap.pyx":983 * * if arr.ndim == 2: * arr = ipt2d(arr) # <<<<<<<<<<<<<< * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, strides=(nbytes, shape[0] * nbytes)) * return arr.view(dtype) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ipt2d); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 967, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ipt2d); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -107764,49 +110506,49 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_arr) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_arr); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 967, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":968 + /* "fastremap.pyx":984 * if arr.ndim == 2: * arr = ipt2d(arr) * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, strides=(nbytes, shape[0] * nbytes)) # <<<<<<<<<<<<<< * return arr.view(dtype) * elif arr.ndim == 3: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 968, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lib); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lib); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stride_tricks); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stride_tricks); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_as_strided); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_as_strided); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_arr); - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_v_shape) < 0) __PYX_ERR(0, 968, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 968, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_v_shape) < 0) __PYX_ERR(0, 984, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyNumber_Multiply(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_t_10 = PyNumber_Multiply(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); @@ -107814,9 +110556,9 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10); __pyx_t_1 = 0; __pyx_t_10 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_strides, __pyx_t_9) < 0) __PYX_ERR(0, 968, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_strides, __pyx_t_9) < 0) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -107824,7 +110566,7 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_9); __pyx_t_9 = 0; - /* "fastremap.pyx":969 + /* "fastremap.pyx":985 * arr = ipt2d(arr) * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, strides=(nbytes, shape[0] * nbytes)) * return arr.view(dtype) # <<<<<<<<<<<<<< @@ -107832,7 +110574,7 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ * arr = ipt3d(arr) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 969, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -107846,14 +110588,14 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ } __pyx_t_9 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_2, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_dtype); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 969, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L0; - /* "fastremap.pyx":966 + /* "fastremap.pyx":982 * arr = arr.view(np.uint8) * * if arr.ndim == 2: # <<<<<<<<<<<<<< @@ -107862,30 +110604,30 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ */ } - /* "fastremap.pyx":970 + /* "fastremap.pyx":986 * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, strides=(nbytes, shape[0] * nbytes)) * return arr.view(dtype) * elif arr.ndim == 3: # <<<<<<<<<<<<<< * arr = ipt3d(arr) * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, strides=(nbytes, shape[0] * nbytes, shape[0] * shape[1] * nbytes)) */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 970, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_t_9, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 970, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_t_9, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 970, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 986, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":971 + /* "fastremap.pyx":987 * return arr.view(dtype) * elif arr.ndim == 3: * arr = ipt3d(arr) # <<<<<<<<<<<<<< * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, strides=(nbytes, shape[0] * nbytes, shape[0] * shape[1] * nbytes)) * return arr.view(dtype) */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_ipt3d); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 971, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_ipt3d); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { @@ -107899,63 +110641,63 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ } __pyx_t_6 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_2, __pyx_v_arr) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_arr); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 971, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":972 + /* "fastremap.pyx":988 * elif arr.ndim == 3: * arr = ipt3d(arr) * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, strides=(nbytes, shape[0] * nbytes, shape[0] * shape[1] * nbytes)) # <<<<<<<<<<<<<< * return arr.view(dtype) * elif arr.ndim == 4: */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 972, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_lib); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 972, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_lib); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stride_tricks); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 972, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stride_tricks); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_as_strided); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 972, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_as_strided); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 972, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_arr); - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 972, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_shape, __pyx_v_shape) < 0) __PYX_ERR(0, 972, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 972, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_shape, __pyx_v_shape) < 0) __PYX_ERR(0, 988, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 972, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 972, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyNumber_Multiply(__pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 972, __pyx_L1_error) + __pyx_t_8 = PyNumber_Multiply(__pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 972, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 972, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = PyNumber_Multiply(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 972, __pyx_L1_error) + __pyx_t_11 = PyNumber_Multiply(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 972, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_11, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 972, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_t_11, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 972, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); @@ -107966,9 +110708,9 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ __pyx_t_5 = 0; __pyx_t_8 = 0; __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_strides, __pyx_t_10) < 0) __PYX_ERR(0, 972, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_strides, __pyx_t_10) < 0) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 972, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -107976,7 +110718,7 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_10); __pyx_t_10 = 0; - /* "fastremap.pyx":973 + /* "fastremap.pyx":989 * arr = ipt3d(arr) * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, strides=(nbytes, shape[0] * nbytes, shape[0] * shape[1] * nbytes)) * return arr.view(dtype) # <<<<<<<<<<<<<< @@ -107984,7 +110726,7 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ * arr = ipt4d(arr) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 973, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -107998,14 +110740,14 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ } __pyx_t_10 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_dtype); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 973, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L0; - /* "fastremap.pyx":970 + /* "fastremap.pyx":986 * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, strides=(nbytes, shape[0] * nbytes)) * return arr.view(dtype) * elif arr.ndim == 3: # <<<<<<<<<<<<<< @@ -108014,30 +110756,30 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ */ } - /* "fastremap.pyx":974 + /* "fastremap.pyx":990 * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, strides=(nbytes, shape[0] * nbytes, shape[0] * shape[1] * nbytes)) * return arr.view(dtype) * elif arr.ndim == 4: # <<<<<<<<<<<<<< * arr = ipt4d(arr) * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 974, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 990, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_10, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_10, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 990, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 974, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 990, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":975 + /* "fastremap.pyx":991 * return arr.view(dtype) * elif arr.ndim == 4: * arr = ipt4d(arr) # <<<<<<<<<<<<<< * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, * strides=( */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ipt4d); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 975, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ipt4d); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) { @@ -108051,123 +110793,123 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_6, __pyx_v_arr) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_arr); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 975, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":976 + /* "fastremap.pyx":992 * elif arr.ndim == 4: * arr = ipt4d(arr) * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, # <<<<<<<<<<<<<< * strides=( * nbytes, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lib); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 976, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lib); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stride_tricks); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stride_tricks); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_as_strided); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 976, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_as_strided); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_arr); - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 976, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_v_shape) < 0) __PYX_ERR(0, 976, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_v_shape) < 0) __PYX_ERR(0, 992, __pyx_L1_error) - /* "fastremap.pyx":978 + /* "fastremap.pyx":994 * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, * strides=( * nbytes, # <<<<<<<<<<<<<< * shape[0] * nbytes, * shape[0] * shape[1] * nbytes, */ - __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 978, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - /* "fastremap.pyx":979 + /* "fastremap.pyx":995 * strides=( * nbytes, * shape[0] * nbytes, # <<<<<<<<<<<<<< * shape[0] * shape[1] * nbytes, * shape[0] * shape[1] * shape[2] * nbytes */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 979, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 979, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = PyNumber_Multiply(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 979, __pyx_L1_error) + __pyx_t_5 = PyNumber_Multiply(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":980 + /* "fastremap.pyx":996 * nbytes, * shape[0] * nbytes, * shape[0] * shape[1] * nbytes, # <<<<<<<<<<<<<< * shape[0] * shape[1] * shape[2] * nbytes * )) */ - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 980, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = PyNumber_Multiply(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 980, __pyx_L1_error) + __pyx_t_11 = PyNumber_Multiply(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyNumber_Multiply(__pyx_t_11, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 980, __pyx_L1_error) + __pyx_t_8 = PyNumber_Multiply(__pyx_t_11, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":981 + /* "fastremap.pyx":997 * shape[0] * nbytes, * shape[0] * shape[1] * nbytes, * shape[0] * shape[1] * shape[2] * nbytes # <<<<<<<<<<<<<< * )) * return arr.view(dtype) */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 981, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = PyNumber_Multiply(__pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 981, __pyx_L1_error) + __pyx_t_12 = PyNumber_Multiply(__pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_shape, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 981, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_shape, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 981, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = PyNumber_Multiply(__pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 981, __pyx_L1_error) + __pyx_t_12 = PyNumber_Multiply(__pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "fastremap.pyx":978 + /* "fastremap.pyx":994 * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, * strides=( * nbytes, # <<<<<<<<<<<<<< * shape[0] * nbytes, * shape[0] * shape[1] * nbytes, */ - __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 978, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); @@ -108181,17 +110923,17 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ __pyx_t_5 = 0; __pyx_t_8 = 0; __pyx_t_12 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_strides, __pyx_t_11) < 0) __PYX_ERR(0, 976, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_strides, __pyx_t_11) < 0) __PYX_ERR(0, 992, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "fastremap.pyx":976 + /* "fastremap.pyx":992 * elif arr.ndim == 4: * arr = ipt4d(arr) * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, # <<<<<<<<<<<<<< * strides=( * nbytes, */ - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 976, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -108199,7 +110941,7 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_11); __pyx_t_11 = 0; - /* "fastremap.pyx":983 + /* "fastremap.pyx":999 * shape[0] * shape[1] * shape[2] * nbytes * )) * return arr.view(dtype) # <<<<<<<<<<<<<< @@ -108207,7 +110949,7 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ * return np.asfortranarray(arr) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 983, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -108221,14 +110963,14 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ } __pyx_t_11 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_2, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_dtype); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 983, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_11; __pyx_t_11 = 0; goto __pyx_L0; - /* "fastremap.pyx":974 + /* "fastremap.pyx":990 * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, strides=(nbytes, shape[0] * nbytes, shape[0] * shape[1] * nbytes)) * return arr.view(dtype) * elif arr.ndim == 4: # <<<<<<<<<<<<<< @@ -108237,7 +110979,7 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ */ } - /* "fastremap.pyx":985 + /* "fastremap.pyx":1001 * return arr.view(dtype) * else: * return np.asfortranarray(arr) # <<<<<<<<<<<<<< @@ -108246,9 +110988,9 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 985, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 985, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -108263,7 +111005,7 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ } __pyx_t_11 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_v_arr) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_arr); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 985, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_11; @@ -108271,7 +111013,7 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ goto __pyx_L0; } - /* "fastremap.pyx":939 + /* "fastremap.pyx":955 * return arr.T * * def asfortranarray(arr): # <<<<<<<<<<<<<< @@ -108302,7 +111044,7 @@ static PyObject *__pyx_pf_9fastremap_52asfortranarray(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "fastremap.pyx":987 +/* "fastremap.pyx":1003 * return np.asfortranarray(arr) * * def ascontiguousarray(arr): # <<<<<<<<<<<<<< @@ -108349,23 +111091,23 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject __Pyx_RefNannySetupContext("ascontiguousarray", 0); __Pyx_INCREF(__pyx_v_arr); - /* "fastremap.pyx":998 + /* "fastremap.pyx":1014 * Returns: transposed numpy array * """ * if arr.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<< * return arr * elif not arr.flags['F_CONTIGUOUS']: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 998, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1014, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 998, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1014, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "fastremap.pyx":999 + /* "fastremap.pyx":1015 * """ * if arr.flags['C_CONTIGUOUS']: * return arr # <<<<<<<<<<<<<< @@ -108377,7 +111119,7 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "fastremap.pyx":998 + /* "fastremap.pyx":1014 * Returns: transposed numpy array * """ * if arr.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -108386,24 +111128,24 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":1000 + /* "fastremap.pyx":1016 * if arr.flags['C_CONTIGUOUS']: * return arr * elif not arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * return np.ascontiguousarray(arr) * elif arr.ndim == 1: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1000, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1000, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1000, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1016, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = ((!__pyx_t_3) != 0); if (__pyx_t_4) { - /* "fastremap.pyx":1001 + /* "fastremap.pyx":1017 * return arr * elif not arr.flags['F_CONTIGUOUS']: * return np.ascontiguousarray(arr) # <<<<<<<<<<<<<< @@ -108411,9 +111153,9 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject * return arr */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1017, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1001, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1017, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -108428,14 +111170,14 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_v_arr) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_arr); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":1000 + /* "fastremap.pyx":1016 * if arr.flags['C_CONTIGUOUS']: * return arr * elif not arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -108444,23 +111186,23 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":1002 + /* "fastremap.pyx":1018 * elif not arr.flags['F_CONTIGUOUS']: * return np.ascontiguousarray(arr) * elif arr.ndim == 1: # <<<<<<<<<<<<<< * return arr * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1002, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1002, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1018, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1003 + /* "fastremap.pyx":1019 * return np.ascontiguousarray(arr) * elif arr.ndim == 1: * return arr # <<<<<<<<<<<<<< @@ -108472,7 +111214,7 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "fastremap.pyx":1002 + /* "fastremap.pyx":1018 * elif not arr.flags['F_CONTIGUOUS']: * return np.ascontiguousarray(arr) * elif arr.ndim == 1: # <<<<<<<<<<<<<< @@ -108481,43 +111223,43 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":1005 + /* "fastremap.pyx":1021 * return arr * * shape = arr.shape # <<<<<<<<<<<<<< * strides = arr.strides * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1005, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1021, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_shape = __pyx_t_5; __pyx_t_5 = 0; - /* "fastremap.pyx":1006 + /* "fastremap.pyx":1022 * * shape = arr.shape * strides = arr.strides # <<<<<<<<<<<<<< * * cdef int nbytes = np.dtype(arr.dtype).itemsize */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_strides); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1006, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_strides); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1022, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_strides = __pyx_t_5; __pyx_t_5 = 0; - /* "fastremap.pyx":1008 + /* "fastremap.pyx":1024 * strides = arr.strides * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * dtype = arr.dtype */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1008, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1024, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1008, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1024, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1008, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1024, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -108532,55 +111274,55 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1008, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1024, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1008, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1024, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1008, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1024, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1010 + /* "fastremap.pyx":1026 * cdef int nbytes = np.dtype(arr.dtype).itemsize * * dtype = arr.dtype # <<<<<<<<<<<<<< * if arr.dtype == bool: * arr = arr.view(np.uint8) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_dtype = __pyx_t_2; __pyx_t_2 = 0; - /* "fastremap.pyx":1011 + /* "fastremap.pyx":1027 * * dtype = arr.dtype * if arr.dtype == bool: # <<<<<<<<<<<<<< * arr = arr.view(np.uint8) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1011, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1011, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1012 + /* "fastremap.pyx":1028 * dtype = arr.dtype * if arr.dtype == bool: * arr = arr.view(np.uint8) # <<<<<<<<<<<<<< * * if arr.ndim == 2: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1012, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1028, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1028, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1012, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1028, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -108596,13 +111338,13 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1012, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1028, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":1011 + /* "fastremap.pyx":1027 * * dtype = arr.dtype * if arr.dtype == bool: # <<<<<<<<<<<<<< @@ -108611,30 +111353,30 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":1014 + /* "fastremap.pyx":1030 * arr = arr.view(np.uint8) * * if arr.ndim == 2: # <<<<<<<<<<<<<< * arr = ipt2d(arr) * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, strides=(shape[1] * nbytes, nbytes)) */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1014, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1030, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_5, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1014, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_5, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1030, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1014, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1030, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1015 + /* "fastremap.pyx":1031 * * if arr.ndim == 2: * arr = ipt2d(arr) # <<<<<<<<<<<<<< * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, strides=(shape[1] * nbytes, nbytes)) * return arr.view(dtype) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ipt2d); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1015, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ipt2d); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1031, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -108648,49 +111390,49 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_arr) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_arr); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1015, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1031, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":1016 + /* "fastremap.pyx":1032 * if arr.ndim == 2: * arr = ipt2d(arr) * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, strides=(shape[1] * nbytes, nbytes)) # <<<<<<<<<<<<<< * return arr.view(dtype) * elif arr.ndim == 3: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1016, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lib); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1016, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lib); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stride_tricks); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1016, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stride_tricks); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_as_strided); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1016, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_as_strided); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1016, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_arr); - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1016, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_v_shape) < 0) __PYX_ERR(0, 1016, __pyx_L1_error) - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_v_shape) < 0) __PYX_ERR(0, 1032, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1016, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyNumber_Multiply(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1016, __pyx_L1_error) + __pyx_t_9 = PyNumber_Multiply(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1016, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); @@ -108698,9 +111440,9 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8); __pyx_t_9 = 0; __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_strides, __pyx_t_1) < 0) __PYX_ERR(0, 1016, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_strides, __pyx_t_1) < 0) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -108708,7 +111450,7 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":1017 + /* "fastremap.pyx":1033 * arr = ipt2d(arr) * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, strides=(shape[1] * nbytes, nbytes)) * return arr.view(dtype) # <<<<<<<<<<<<<< @@ -108716,7 +111458,7 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject * arr = ipt3d(arr) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1017, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1033, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -108730,14 +111472,14 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_2, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_dtype); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1033, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":1014 + /* "fastremap.pyx":1030 * arr = arr.view(np.uint8) * * if arr.ndim == 2: # <<<<<<<<<<<<<< @@ -108746,30 +111488,30 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":1018 + /* "fastremap.pyx":1034 * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, strides=(shape[1] * nbytes, nbytes)) * return arr.view(dtype) * elif arr.ndim == 3: # <<<<<<<<<<<<<< * arr = ipt3d(arr) * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, strides=( */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1018, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1018, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1034, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1019 + /* "fastremap.pyx":1035 * return arr.view(dtype) * elif arr.ndim == 3: * arr = ipt3d(arr) # <<<<<<<<<<<<<< * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, strides=( * shape[2] * shape[1] * nbytes, */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ipt3d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1019, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ipt3d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { @@ -108783,95 +111525,95 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject } __pyx_t_6 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_arr) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_arr); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1019, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":1020 + /* "fastremap.pyx":1036 * elif arr.ndim == 3: * arr = ipt3d(arr) * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, strides=( # <<<<<<<<<<<<<< * shape[2] * shape[1] * nbytes, * shape[2] * nbytes, */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1020, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1036, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1020, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1036, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stride_tricks); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1020, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stride_tricks); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1036, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_as_strided); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1020, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_as_strided); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1036, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1020, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1036, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_arr); - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1020, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1036, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_shape, __pyx_v_shape) < 0) __PYX_ERR(0, 1020, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_shape, __pyx_v_shape) < 0) __PYX_ERR(0, 1036, __pyx_L1_error) - /* "fastremap.pyx":1021 + /* "fastremap.pyx":1037 * arr = ipt3d(arr) * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, strides=( * shape[2] * shape[1] * nbytes, # <<<<<<<<<<<<<< * shape[2] * nbytes, * nbytes, */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_shape, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1021, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_shape, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1021, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyNumber_Multiply(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1021, __pyx_L1_error) + __pyx_t_9 = PyNumber_Multiply(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1021, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = PyNumber_Multiply(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1021, __pyx_L1_error) + __pyx_t_5 = PyNumber_Multiply(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1022 + /* "fastremap.pyx":1038 * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, strides=( * shape[2] * shape[1] * nbytes, * shape[2] * nbytes, # <<<<<<<<<<<<<< * nbytes, * )) */ - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_shape, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1022, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_shape, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1022, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyNumber_Multiply(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1022, __pyx_L1_error) + __pyx_t_10 = PyNumber_Multiply(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "fastremap.pyx":1023 + /* "fastremap.pyx":1039 * shape[2] * shape[1] * nbytes, * shape[2] * nbytes, * nbytes, # <<<<<<<<<<<<<< * )) * return arr.view(dtype) */ - __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1023, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - /* "fastremap.pyx":1021 + /* "fastremap.pyx":1037 * arr = ipt3d(arr) * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, strides=( * shape[2] * shape[1] * nbytes, # <<<<<<<<<<<<<< * shape[2] * nbytes, * nbytes, */ - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1021, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); @@ -108882,17 +111624,17 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject __pyx_t_5 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_strides, __pyx_t_8) < 0) __PYX_ERR(0, 1020, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_strides, __pyx_t_8) < 0) __PYX_ERR(0, 1036, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1020 + /* "fastremap.pyx":1036 * elif arr.ndim == 3: * arr = ipt3d(arr) * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, strides=( # <<<<<<<<<<<<<< * shape[2] * shape[1] * nbytes, * shape[2] * nbytes, */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1020, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1036, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -108900,7 +111642,7 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1025 + /* "fastremap.pyx":1041 * nbytes, * )) * return arr.view(dtype) # <<<<<<<<<<<<<< @@ -108908,7 +111650,7 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject * arr = ipt4d(arr) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1025, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -108922,14 +111664,14 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject } __pyx_t_8 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_dtype); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1025, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; - /* "fastremap.pyx":1018 + /* "fastremap.pyx":1034 * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, strides=(shape[1] * nbytes, nbytes)) * return arr.view(dtype) * elif arr.ndim == 3: # <<<<<<<<<<<<<< @@ -108938,30 +111680,30 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":1026 + /* "fastremap.pyx":1042 * )) * return arr.view(dtype) * elif arr.ndim == 4: # <<<<<<<<<<<<<< * arr = ipt4d(arr) * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1026, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1042, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_8, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1026, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_8, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1042, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1026, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1042, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1027 + /* "fastremap.pyx":1043 * return arr.view(dtype) * elif arr.ndim == 4: * arr = ipt4d(arr) # <<<<<<<<<<<<<< * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, * strides=( */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ipt4d); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1027, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ipt4d); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { @@ -108975,123 +111717,123 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_6, __pyx_v_arr) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_arr); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1027, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":1028 + /* "fastremap.pyx":1044 * elif arr.ndim == 4: * arr = ipt4d(arr) * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, # <<<<<<<<<<<<<< * strides=( * shape[3] * shape[2] * shape[1] * nbytes, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1028, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lib); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1028, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lib); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stride_tricks); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1028, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stride_tricks); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_as_strided); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1028, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_as_strided); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1028, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_arr); - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1028, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_v_shape) < 0) __PYX_ERR(0, 1028, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_v_shape) < 0) __PYX_ERR(0, 1044, __pyx_L1_error) - /* "fastremap.pyx":1030 + /* "fastremap.pyx":1046 * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, * strides=( * shape[3] * shape[2] * shape[1] * nbytes, # <<<<<<<<<<<<<< * shape[3] * shape[2] * nbytes, * shape[3] * nbytes, */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_shape, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1030, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_shape, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_shape, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1030, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_shape, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyNumber_Multiply(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1030, __pyx_L1_error) + __pyx_t_10 = PyNumber_Multiply(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1030, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1030, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1030, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyNumber_Multiply(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1030, __pyx_L1_error) + __pyx_t_10 = PyNumber_Multiply(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "fastremap.pyx":1031 + /* "fastremap.pyx":1047 * strides=( * shape[3] * shape[2] * shape[1] * nbytes, * shape[3] * shape[2] * nbytes, # <<<<<<<<<<<<<< * shape[3] * nbytes, * nbytes, */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_shape, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1031, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_shape, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_shape, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_shape, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyNumber_Multiply(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1031, __pyx_L1_error) + __pyx_t_5 = PyNumber_Multiply(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = PyNumber_Multiply(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1031, __pyx_L1_error) + __pyx_t_9 = PyNumber_Multiply(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":1032 + /* "fastremap.pyx":1048 * shape[3] * shape[2] * shape[1] * nbytes, * shape[3] * shape[2] * nbytes, * shape[3] * nbytes, # <<<<<<<<<<<<<< * nbytes, * )) */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_shape, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_shape, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1032, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = PyNumber_Multiply(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1032, __pyx_L1_error) + __pyx_t_11 = PyNumber_Multiply(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fastremap.pyx":1033 + /* "fastremap.pyx":1049 * shape[3] * shape[2] * nbytes, * shape[3] * nbytes, * nbytes, # <<<<<<<<<<<<<< * )) * return arr.view(dtype) */ - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1033, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - /* "fastremap.pyx":1030 + /* "fastremap.pyx":1046 * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, * strides=( * shape[3] * shape[2] * shape[1] * nbytes, # <<<<<<<<<<<<<< * shape[3] * shape[2] * nbytes, * shape[3] * nbytes, */ - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1030, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10); @@ -109105,17 +111847,17 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject __pyx_t_9 = 0; __pyx_t_11 = 0; __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_strides, __pyx_t_1) < 0) __PYX_ERR(0, 1028, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_strides, __pyx_t_1) < 0) __PYX_ERR(0, 1044, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":1028 + /* "fastremap.pyx":1044 * elif arr.ndim == 4: * arr = ipt4d(arr) * arr = np.lib.stride_tricks.as_strided(arr, shape=shape, # <<<<<<<<<<<<<< * strides=( * shape[3] * shape[2] * shape[1] * nbytes, */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1028, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -109123,7 +111865,7 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":1035 + /* "fastremap.pyx":1051 * nbytes, * )) * return arr.view(dtype) # <<<<<<<<<<<<<< @@ -109131,7 +111873,7 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject * return np.ascontiguousarray(arr) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1035, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_view); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -109145,14 +111887,14 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_2, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_dtype); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1035, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":1026 + /* "fastremap.pyx":1042 * )) * return arr.view(dtype) * elif arr.ndim == 4: # <<<<<<<<<<<<<< @@ -109161,7 +111903,7 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject */ } - /* "fastremap.pyx":1037 + /* "fastremap.pyx":1053 * return arr.view(dtype) * else: * return np.ascontiguousarray(arr) # <<<<<<<<<<<<<< @@ -109170,9 +111912,9 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1037, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1037, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -109187,7 +111929,7 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject } __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_v_arr) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_arr); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1037, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; @@ -109195,7 +111937,7 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject goto __pyx_L0; } - /* "fastremap.pyx":987 + /* "fastremap.pyx":1003 * return np.asfortranarray(arr) * * def ascontiguousarray(arr): # <<<<<<<<<<<<<< @@ -109225,7 +111967,7 @@ static PyObject *__pyx_pf_9fastremap_54ascontiguousarray(CYTHON_UNUSED PyObject return __pyx_r; } -/* "fastremap.pyx":1039 +/* "fastremap.pyx":1055 * return np.ascontiguousarray(arr) * * def ipt2d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=2] arr): # <<<<<<<<<<<<<< @@ -109274,23 +112016,23 @@ static PyObject *__pyx_pw_9fastremap_57ipt2d(PyObject *__pyx_self, PyObject *__p case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 1039, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 1055, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 1039, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 1055, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 1039, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 1055, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 1039, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 1055, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -109307,7 +112049,7 @@ static PyObject *__pyx_pw_9fastremap_57ipt2d(PyObject *__pyx_self, PyObject *__p } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1039, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1055, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -109369,7 +112111,7 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ipt2d", 0); __Pyx_INCREF(__pyx_v_kwargs); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -109383,7 +112125,7 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) __pyx_t_3 = ((!__pyx_t_4) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; @@ -109391,7 +112133,7 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_kwargs, Py_None); } - __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -109406,16 +112148,16 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_v____pyx_int64_t_is_signed = (!((((int64_t)-1L) > 0) != 0)); if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 1039, __pyx_L1_error) + __PYX_ERR(0, 1055, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1055, __pyx_L1_error) __pyx_t_2 = ((0 < __pyx_t_5) != 0); if (__pyx_t_2) { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1039, __pyx_L1_error) + __PYX_ERR(0, 1055, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(((PyObject*)__pyx_v_args), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(((PyObject*)__pyx_v_args), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -109430,18 +112172,18 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 1039, __pyx_L1_error) + __PYX_ERR(0, 1055, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_arr, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_arr, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) __pyx_t_3 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_3; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1039, __pyx_L1_error) + __PYX_ERR(0, 1055, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -109450,12 +112192,12 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 1039, __pyx_L1_error) + __PYX_ERR(0, 1055, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1039, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1055, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); @@ -109466,15 +112208,15 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 1039, __pyx_L1_error) + __PYX_ERR(0, 1055, __pyx_L1_error) } __pyx_L6:; while (1) { @@ -109484,7 +112226,7 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -109493,14 +112235,14 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -109522,14 +112264,14 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_2 = (__pyx_v_dtype != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_itemsize = __pyx_t_5; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_kind = __pyx_t_7; __pyx_v_dtype_signed = (__pyx_v_kind == 'i'); @@ -109542,9 +112284,9 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 2) != 0); if (__pyx_t_2) { @@ -109556,7 +112298,7 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; __pyx_L16_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint16_t)) == __pyx_v_itemsize) != 0); @@ -109565,9 +112307,9 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L20_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 2) != 0); if (__pyx_t_2) { @@ -109579,7 +112321,7 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; __pyx_L20_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint32_t)) == __pyx_v_itemsize) != 0); @@ -109588,9 +112330,9 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L24_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 2) != 0); if (__pyx_t_2) { @@ -109602,7 +112344,7 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; __pyx_L24_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint64_t)) == __pyx_v_itemsize) != 0); @@ -109611,9 +112353,9 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L28_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 2) != 0); if (__pyx_t_2) { @@ -109625,7 +112367,7 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int8_t)) == __pyx_v_itemsize) != 0); @@ -109634,9 +112376,9 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L32_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 2) != 0); if (__pyx_t_2) { @@ -109648,7 +112390,7 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; __pyx_L32_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int16_t)) == __pyx_v_itemsize) != 0); @@ -109657,9 +112399,9 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L36_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 2) != 0); if (__pyx_t_2) { @@ -109671,7 +112413,7 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; __pyx_L36_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int32_t)) == __pyx_v_itemsize) != 0); @@ -109680,9 +112422,9 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L40_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 2) != 0); if (__pyx_t_2) { @@ -109694,7 +112436,7 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; __pyx_L40_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int64_t)) == __pyx_v_itemsize) != 0); @@ -109703,9 +112445,9 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L44_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 2) != 0); if (__pyx_t_2) { @@ -109717,7 +112459,7 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; __pyx_L44_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -109728,15 +112470,15 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L48_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 2) != 0); __pyx_t_3 = __pyx_t_2; __pyx_L48_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(double)) == __pyx_v_itemsize) != 0); @@ -109745,15 +112487,15 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L51_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 2) != 0); __pyx_t_3 = __pyx_t_2; __pyx_L51_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -109764,15 +112506,15 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L54_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 2) != 0); __pyx_t_3 = __pyx_t_2; __pyx_L54_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_float_complex, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_float_complex, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -109797,7 +112539,7 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -109819,7 +112561,7 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -109841,7 +112583,7 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -109863,7 +112605,7 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -109885,7 +112627,7 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -109907,7 +112649,7 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -109929,7 +112671,7 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -109951,7 +112693,7 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -109973,7 +112715,7 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -109995,7 +112737,7 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -110017,27 +112759,27 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_float_complex, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_float_complex, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); } } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) goto __pyx_L10_break; } __pyx_L10_break:; - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_candidates = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = 0; if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 1039, __pyx_L1_error) + __PYX_ERR(0, 1055, __pyx_L1_error) } - __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_1; @@ -110045,12 +112787,12 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, while (1) { __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_9, &__pyx_t_5, &__pyx_t_1, NULL, NULL, __pyx_t_10); if (unlikely(__pyx_t_11 == 0)) break; - if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_1); __pyx_t_1 = 0; __pyx_v_match_found = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { @@ -110064,10 +112806,10 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, } __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, __pyx_kp_s__2) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__2); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -110082,27 +112824,27 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, } __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_12, __pyx_kp_s__3) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__3); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_src_sig, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1055, __pyx_L1_error) __pyx_t_16 = __pyx_t_15; for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dest_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dest_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_v_dst_type != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_2) { __pyx_v_match_found = 1; @@ -110118,37 +112860,37 @@ static PyObject *__pyx_pf_9fastremap_56ipt2d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_L103_break:; __pyx_t_2 = (__pyx_v_match_found != 0); if (__pyx_t_2) { - __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1055, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_candidates) != 0); __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 1039, __pyx_L1_error) + __PYX_ERR(0, 1055, __pyx_L1_error) } - __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1055, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_9 > 1) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 1039, __pyx_L1_error) + __PYX_ERR(0, 1055, __pyx_L1_error) } /*else*/ { __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1039, __pyx_L1_error) + __PYX_ERR(0, 1055, __pyx_L1_error) } - __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_candidates, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_candidates, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_13 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), __pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), __pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_13; @@ -110191,7 +112933,7 @@ static PyObject *__pyx_fuse_0__pyx_pw_9fastremap_495ipt2d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt2d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1055, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_494ipt2d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -110231,39 +112973,39 @@ static PyObject *__pyx_pf_9fastremap_494ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1055, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; - /* "fastremap.pyx":1040 + /* "fastremap.pyx":1056 * * def ipt2d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=2] arr): * cdef COMPLEX_NUMBER[:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn_uint8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1040, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn_uint8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1056, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1045 + /* "fastremap.pyx":1061 * cdef size_t sy * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1046 + /* "fastremap.pyx":1062 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -110272,7 +113014,7 @@ static PyObject *__pyx_pf_9fastremap_494ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1047 + /* "fastremap.pyx":1063 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -110281,7 +113023,7 @@ static PyObject *__pyx_pf_9fastremap_494ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1045 + /* "fastremap.pyx":1061 * cdef size_t sy * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -110291,7 +113033,7 @@ static PyObject *__pyx_pf_9fastremap_494ipt2d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1049 + /* "fastremap.pyx":1065 * sy = arr.shape[1] * else: * sx = arr.shape[1] # <<<<<<<<<<<<<< @@ -110301,7 +113043,7 @@ static PyObject *__pyx_pf_9fastremap_494ipt2d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1050 + /* "fastremap.pyx":1066 * else: * sx = arr.shape[1] * sy = arr.shape[0] # <<<<<<<<<<<<<< @@ -110312,19 +113054,19 @@ static PyObject *__pyx_pf_9fastremap_494ipt2d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1052 + /* "fastremap.pyx":1068 * sy = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -110339,17 +113081,17 @@ static PyObject *__pyx_pf_9fastremap_494ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1052, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1057 + /* "fastremap.pyx":1073 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -110359,7 +113101,7 @@ static PyObject *__pyx_pf_9fastremap_494ipt2d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1059 + /* "fastremap.pyx":1075 * if nbytes == 1: * _ipt2d[uint8_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -110379,10 +113121,10 @@ static PyObject *__pyx_pf_9fastremap_494ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_9 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1059, __pyx_L1_error) + __PYX_ERR(0, 1075, __pyx_L1_error) } - /* "fastremap.pyx":1058 + /* "fastremap.pyx":1074 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt2d[uint8_t]( # <<<<<<<<<<<<<< @@ -110391,7 +113133,7 @@ static PyObject *__pyx_pf_9fastremap_494ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint8_t *)(&(*((uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1057 + /* "fastremap.pyx":1073 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -110401,7 +113143,7 @@ static PyObject *__pyx_pf_9fastremap_494ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1064 + /* "fastremap.pyx":1080 * elif nbytes == 2: * _ipt2d[uint16_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -110421,10 +113163,10 @@ static PyObject *__pyx_pf_9fastremap_494ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1064, __pyx_L1_error) + __PYX_ERR(0, 1080, __pyx_L1_error) } - /* "fastremap.pyx":1063 + /* "fastremap.pyx":1079 * ) * elif nbytes == 2: * _ipt2d[uint16_t]( # <<<<<<<<<<<<<< @@ -110433,7 +113175,7 @@ static PyObject *__pyx_pf_9fastremap_494ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint16_t *)(&(*((uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_9 * __pyx_v_arrview.strides[0]) ) + __pyx_t_8 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1062 + /* "fastremap.pyx":1078 * sx, sy * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -110443,7 +113185,7 @@ static PyObject *__pyx_pf_9fastremap_494ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1069 + /* "fastremap.pyx":1085 * elif nbytes == 4: * _ipt2d[uint32_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -110463,10 +113205,10 @@ static PyObject *__pyx_pf_9fastremap_494ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_9 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1069, __pyx_L1_error) + __PYX_ERR(0, 1085, __pyx_L1_error) } - /* "fastremap.pyx":1068 + /* "fastremap.pyx":1084 * ) * elif nbytes == 4: * _ipt2d[uint32_t]( # <<<<<<<<<<<<<< @@ -110475,7 +113217,7 @@ static PyObject *__pyx_pf_9fastremap_494ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint32_t *)(&(*((uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1067 + /* "fastremap.pyx":1083 * sx, sy * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -110485,7 +113227,7 @@ static PyObject *__pyx_pf_9fastremap_494ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1074 + /* "fastremap.pyx":1090 * else: * _ipt2d[uint64_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -110505,10 +113247,10 @@ static PyObject *__pyx_pf_9fastremap_494ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1074, __pyx_L1_error) + __PYX_ERR(0, 1090, __pyx_L1_error) } - /* "fastremap.pyx":1073 + /* "fastremap.pyx":1089 * ) * else: * _ipt2d[uint64_t]( # <<<<<<<<<<<<<< @@ -110519,7 +113261,7 @@ static PyObject *__pyx_pf_9fastremap_494ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1078 + /* "fastremap.pyx":1094 * ) * * return arr # <<<<<<<<<<<<<< @@ -110531,7 +113273,7 @@ static PyObject *__pyx_pf_9fastremap_494ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1039 + /* "fastremap.pyx":1055 * return np.ascontiguousarray(arr) * * def ipt2d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=2] arr): # <<<<<<<<<<<<<< @@ -110574,7 +113316,7 @@ static PyObject *__pyx_fuse_1__pyx_pw_9fastremap_497ipt2d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt2d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1055, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_496ipt2d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -110614,39 +113356,39 @@ static PyObject *__pyx_pf_9fastremap_496ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1055, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; - /* "fastremap.pyx":1040 + /* "fastremap.pyx":1056 * * def ipt2d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=2] arr): * cdef COMPLEX_NUMBER[:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn_uint16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1040, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn_uint16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1056, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1045 + /* "fastremap.pyx":1061 * cdef size_t sy * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1046 + /* "fastremap.pyx":1062 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -110655,7 +113397,7 @@ static PyObject *__pyx_pf_9fastremap_496ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1047 + /* "fastremap.pyx":1063 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -110664,7 +113406,7 @@ static PyObject *__pyx_pf_9fastremap_496ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1045 + /* "fastremap.pyx":1061 * cdef size_t sy * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -110674,7 +113416,7 @@ static PyObject *__pyx_pf_9fastremap_496ipt2d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1049 + /* "fastremap.pyx":1065 * sy = arr.shape[1] * else: * sx = arr.shape[1] # <<<<<<<<<<<<<< @@ -110684,7 +113426,7 @@ static PyObject *__pyx_pf_9fastremap_496ipt2d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1050 + /* "fastremap.pyx":1066 * else: * sx = arr.shape[1] * sy = arr.shape[0] # <<<<<<<<<<<<<< @@ -110695,19 +113437,19 @@ static PyObject *__pyx_pf_9fastremap_496ipt2d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1052 + /* "fastremap.pyx":1068 * sy = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -110722,17 +113464,17 @@ static PyObject *__pyx_pf_9fastremap_496ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1052, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1057 + /* "fastremap.pyx":1073 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -110742,7 +113484,7 @@ static PyObject *__pyx_pf_9fastremap_496ipt2d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1059 + /* "fastremap.pyx":1075 * if nbytes == 1: * _ipt2d[uint8_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -110762,10 +113504,10 @@ static PyObject *__pyx_pf_9fastremap_496ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_9 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1059, __pyx_L1_error) + __PYX_ERR(0, 1075, __pyx_L1_error) } - /* "fastremap.pyx":1058 + /* "fastremap.pyx":1074 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt2d[uint8_t]( # <<<<<<<<<<<<<< @@ -110774,7 +113516,7 @@ static PyObject *__pyx_pf_9fastremap_496ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint8_t *)(&(*((uint16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1057 + /* "fastremap.pyx":1073 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -110784,7 +113526,7 @@ static PyObject *__pyx_pf_9fastremap_496ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1064 + /* "fastremap.pyx":1080 * elif nbytes == 2: * _ipt2d[uint16_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -110804,10 +113546,10 @@ static PyObject *__pyx_pf_9fastremap_496ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1064, __pyx_L1_error) + __PYX_ERR(0, 1080, __pyx_L1_error) } - /* "fastremap.pyx":1063 + /* "fastremap.pyx":1079 * ) * elif nbytes == 2: * _ipt2d[uint16_t]( # <<<<<<<<<<<<<< @@ -110816,7 +113558,7 @@ static PyObject *__pyx_pf_9fastremap_496ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint16_t *)(&(*((uint16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_9 * __pyx_v_arrview.strides[0]) ) + __pyx_t_8 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1062 + /* "fastremap.pyx":1078 * sx, sy * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -110826,7 +113568,7 @@ static PyObject *__pyx_pf_9fastremap_496ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1069 + /* "fastremap.pyx":1085 * elif nbytes == 4: * _ipt2d[uint32_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -110846,10 +113588,10 @@ static PyObject *__pyx_pf_9fastremap_496ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_9 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1069, __pyx_L1_error) + __PYX_ERR(0, 1085, __pyx_L1_error) } - /* "fastremap.pyx":1068 + /* "fastremap.pyx":1084 * ) * elif nbytes == 4: * _ipt2d[uint32_t]( # <<<<<<<<<<<<<< @@ -110858,7 +113600,7 @@ static PyObject *__pyx_pf_9fastremap_496ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint32_t *)(&(*((uint16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1067 + /* "fastremap.pyx":1083 * sx, sy * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -110868,7 +113610,7 @@ static PyObject *__pyx_pf_9fastremap_496ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1074 + /* "fastremap.pyx":1090 * else: * _ipt2d[uint64_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -110888,10 +113630,10 @@ static PyObject *__pyx_pf_9fastremap_496ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1074, __pyx_L1_error) + __PYX_ERR(0, 1090, __pyx_L1_error) } - /* "fastremap.pyx":1073 + /* "fastremap.pyx":1089 * ) * else: * _ipt2d[uint64_t]( # <<<<<<<<<<<<<< @@ -110902,7 +113644,7 @@ static PyObject *__pyx_pf_9fastremap_496ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1078 + /* "fastremap.pyx":1094 * ) * * return arr # <<<<<<<<<<<<<< @@ -110914,7 +113656,7 @@ static PyObject *__pyx_pf_9fastremap_496ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1039 + /* "fastremap.pyx":1055 * return np.ascontiguousarray(arr) * * def ipt2d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=2] arr): # <<<<<<<<<<<<<< @@ -110957,7 +113699,7 @@ static PyObject *__pyx_fuse_2__pyx_pw_9fastremap_499ipt2d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt2d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1055, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_498ipt2d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -110997,39 +113739,39 @@ static PyObject *__pyx_pf_9fastremap_498ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1055, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; - /* "fastremap.pyx":1040 + /* "fastremap.pyx":1056 * * def ipt2d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=2] arr): * cdef COMPLEX_NUMBER[:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn_uint32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1040, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn_uint32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1056, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1045 + /* "fastremap.pyx":1061 * cdef size_t sy * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1046 + /* "fastremap.pyx":1062 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -111038,7 +113780,7 @@ static PyObject *__pyx_pf_9fastremap_498ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1047 + /* "fastremap.pyx":1063 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -111047,7 +113789,7 @@ static PyObject *__pyx_pf_9fastremap_498ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1045 + /* "fastremap.pyx":1061 * cdef size_t sy * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -111057,7 +113799,7 @@ static PyObject *__pyx_pf_9fastremap_498ipt2d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1049 + /* "fastremap.pyx":1065 * sy = arr.shape[1] * else: * sx = arr.shape[1] # <<<<<<<<<<<<<< @@ -111067,7 +113809,7 @@ static PyObject *__pyx_pf_9fastremap_498ipt2d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1050 + /* "fastremap.pyx":1066 * else: * sx = arr.shape[1] * sy = arr.shape[0] # <<<<<<<<<<<<<< @@ -111078,19 +113820,19 @@ static PyObject *__pyx_pf_9fastremap_498ipt2d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1052 + /* "fastremap.pyx":1068 * sy = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -111105,17 +113847,17 @@ static PyObject *__pyx_pf_9fastremap_498ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1052, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1057 + /* "fastremap.pyx":1073 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -111125,7 +113867,7 @@ static PyObject *__pyx_pf_9fastremap_498ipt2d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1059 + /* "fastremap.pyx":1075 * if nbytes == 1: * _ipt2d[uint8_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -111145,10 +113887,10 @@ static PyObject *__pyx_pf_9fastremap_498ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_9 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1059, __pyx_L1_error) + __PYX_ERR(0, 1075, __pyx_L1_error) } - /* "fastremap.pyx":1058 + /* "fastremap.pyx":1074 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt2d[uint8_t]( # <<<<<<<<<<<<<< @@ -111157,7 +113899,7 @@ static PyObject *__pyx_pf_9fastremap_498ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint8_t *)(&(*((uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1057 + /* "fastremap.pyx":1073 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -111167,7 +113909,7 @@ static PyObject *__pyx_pf_9fastremap_498ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1064 + /* "fastremap.pyx":1080 * elif nbytes == 2: * _ipt2d[uint16_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -111187,10 +113929,10 @@ static PyObject *__pyx_pf_9fastremap_498ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1064, __pyx_L1_error) + __PYX_ERR(0, 1080, __pyx_L1_error) } - /* "fastremap.pyx":1063 + /* "fastremap.pyx":1079 * ) * elif nbytes == 2: * _ipt2d[uint16_t]( # <<<<<<<<<<<<<< @@ -111199,7 +113941,7 @@ static PyObject *__pyx_pf_9fastremap_498ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint16_t *)(&(*((uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_9 * __pyx_v_arrview.strides[0]) ) + __pyx_t_8 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1062 + /* "fastremap.pyx":1078 * sx, sy * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -111209,7 +113951,7 @@ static PyObject *__pyx_pf_9fastremap_498ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1069 + /* "fastremap.pyx":1085 * elif nbytes == 4: * _ipt2d[uint32_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -111229,10 +113971,10 @@ static PyObject *__pyx_pf_9fastremap_498ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_9 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1069, __pyx_L1_error) + __PYX_ERR(0, 1085, __pyx_L1_error) } - /* "fastremap.pyx":1068 + /* "fastremap.pyx":1084 * ) * elif nbytes == 4: * _ipt2d[uint32_t]( # <<<<<<<<<<<<<< @@ -111241,7 +113983,7 @@ static PyObject *__pyx_pf_9fastremap_498ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint32_t *)(&(*((uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1067 + /* "fastremap.pyx":1083 * sx, sy * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -111251,7 +113993,7 @@ static PyObject *__pyx_pf_9fastremap_498ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1074 + /* "fastremap.pyx":1090 * else: * _ipt2d[uint64_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -111271,10 +114013,10 @@ static PyObject *__pyx_pf_9fastremap_498ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1074, __pyx_L1_error) + __PYX_ERR(0, 1090, __pyx_L1_error) } - /* "fastremap.pyx":1073 + /* "fastremap.pyx":1089 * ) * else: * _ipt2d[uint64_t]( # <<<<<<<<<<<<<< @@ -111285,7 +114027,7 @@ static PyObject *__pyx_pf_9fastremap_498ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1078 + /* "fastremap.pyx":1094 * ) * * return arr # <<<<<<<<<<<<<< @@ -111297,7 +114039,7 @@ static PyObject *__pyx_pf_9fastremap_498ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1039 + /* "fastremap.pyx":1055 * return np.ascontiguousarray(arr) * * def ipt2d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=2] arr): # <<<<<<<<<<<<<< @@ -111340,7 +114082,7 @@ static PyObject *__pyx_fuse_3__pyx_pw_9fastremap_501ipt2d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt2d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1055, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_500ipt2d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -111380,39 +114122,39 @@ static PyObject *__pyx_pf_9fastremap_500ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1055, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; - /* "fastremap.pyx":1040 + /* "fastremap.pyx":1056 * * def ipt2d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=2] arr): * cdef COMPLEX_NUMBER[:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn_uint64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1040, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn_uint64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1056, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1045 + /* "fastremap.pyx":1061 * cdef size_t sy * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1046 + /* "fastremap.pyx":1062 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -111421,7 +114163,7 @@ static PyObject *__pyx_pf_9fastremap_500ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1047 + /* "fastremap.pyx":1063 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -111430,7 +114172,7 @@ static PyObject *__pyx_pf_9fastremap_500ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1045 + /* "fastremap.pyx":1061 * cdef size_t sy * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -111440,7 +114182,7 @@ static PyObject *__pyx_pf_9fastremap_500ipt2d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1049 + /* "fastremap.pyx":1065 * sy = arr.shape[1] * else: * sx = arr.shape[1] # <<<<<<<<<<<<<< @@ -111450,7 +114192,7 @@ static PyObject *__pyx_pf_9fastremap_500ipt2d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1050 + /* "fastremap.pyx":1066 * else: * sx = arr.shape[1] * sy = arr.shape[0] # <<<<<<<<<<<<<< @@ -111461,19 +114203,19 @@ static PyObject *__pyx_pf_9fastremap_500ipt2d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1052 + /* "fastremap.pyx":1068 * sy = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -111488,17 +114230,17 @@ static PyObject *__pyx_pf_9fastremap_500ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1052, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1057 + /* "fastremap.pyx":1073 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -111508,7 +114250,7 @@ static PyObject *__pyx_pf_9fastremap_500ipt2d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1059 + /* "fastremap.pyx":1075 * if nbytes == 1: * _ipt2d[uint8_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -111528,10 +114270,10 @@ static PyObject *__pyx_pf_9fastremap_500ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_9 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1059, __pyx_L1_error) + __PYX_ERR(0, 1075, __pyx_L1_error) } - /* "fastremap.pyx":1058 + /* "fastremap.pyx":1074 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt2d[uint8_t]( # <<<<<<<<<<<<<< @@ -111540,7 +114282,7 @@ static PyObject *__pyx_pf_9fastremap_500ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint8_t *)(&(*((uint64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1057 + /* "fastremap.pyx":1073 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -111550,7 +114292,7 @@ static PyObject *__pyx_pf_9fastremap_500ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1064 + /* "fastremap.pyx":1080 * elif nbytes == 2: * _ipt2d[uint16_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -111570,10 +114312,10 @@ static PyObject *__pyx_pf_9fastremap_500ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1064, __pyx_L1_error) + __PYX_ERR(0, 1080, __pyx_L1_error) } - /* "fastremap.pyx":1063 + /* "fastremap.pyx":1079 * ) * elif nbytes == 2: * _ipt2d[uint16_t]( # <<<<<<<<<<<<<< @@ -111582,7 +114324,7 @@ static PyObject *__pyx_pf_9fastremap_500ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint16_t *)(&(*((uint64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_9 * __pyx_v_arrview.strides[0]) ) + __pyx_t_8 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1062 + /* "fastremap.pyx":1078 * sx, sy * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -111592,7 +114334,7 @@ static PyObject *__pyx_pf_9fastremap_500ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1069 + /* "fastremap.pyx":1085 * elif nbytes == 4: * _ipt2d[uint32_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -111612,10 +114354,10 @@ static PyObject *__pyx_pf_9fastremap_500ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_9 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1069, __pyx_L1_error) + __PYX_ERR(0, 1085, __pyx_L1_error) } - /* "fastremap.pyx":1068 + /* "fastremap.pyx":1084 * ) * elif nbytes == 4: * _ipt2d[uint32_t]( # <<<<<<<<<<<<<< @@ -111624,7 +114366,7 @@ static PyObject *__pyx_pf_9fastremap_500ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint32_t *)(&(*((uint64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1067 + /* "fastremap.pyx":1083 * sx, sy * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -111634,7 +114376,7 @@ static PyObject *__pyx_pf_9fastremap_500ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1074 + /* "fastremap.pyx":1090 * else: * _ipt2d[uint64_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -111654,10 +114396,10 @@ static PyObject *__pyx_pf_9fastremap_500ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1074, __pyx_L1_error) + __PYX_ERR(0, 1090, __pyx_L1_error) } - /* "fastremap.pyx":1073 + /* "fastremap.pyx":1089 * ) * else: * _ipt2d[uint64_t]( # <<<<<<<<<<<<<< @@ -111668,7 +114410,7 @@ static PyObject *__pyx_pf_9fastremap_500ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1078 + /* "fastremap.pyx":1094 * ) * * return arr # <<<<<<<<<<<<<< @@ -111680,7 +114422,7 @@ static PyObject *__pyx_pf_9fastremap_500ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1039 + /* "fastremap.pyx":1055 * return np.ascontiguousarray(arr) * * def ipt2d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=2] arr): # <<<<<<<<<<<<<< @@ -111723,7 +114465,7 @@ static PyObject *__pyx_fuse_4__pyx_pw_9fastremap_503ipt2d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt2d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1055, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_502ipt2d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -111763,39 +114505,39 @@ static PyObject *__pyx_pf_9fastremap_502ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1055, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; - /* "fastremap.pyx":1040 + /* "fastremap.pyx":1056 * * def ipt2d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=2] arr): * cdef COMPLEX_NUMBER[:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn_int8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1040, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn_int8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1056, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1045 + /* "fastremap.pyx":1061 * cdef size_t sy * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1046 + /* "fastremap.pyx":1062 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -111804,7 +114546,7 @@ static PyObject *__pyx_pf_9fastremap_502ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1047 + /* "fastremap.pyx":1063 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -111813,7 +114555,7 @@ static PyObject *__pyx_pf_9fastremap_502ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1045 + /* "fastremap.pyx":1061 * cdef size_t sy * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -111823,7 +114565,7 @@ static PyObject *__pyx_pf_9fastremap_502ipt2d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1049 + /* "fastremap.pyx":1065 * sy = arr.shape[1] * else: * sx = arr.shape[1] # <<<<<<<<<<<<<< @@ -111833,7 +114575,7 @@ static PyObject *__pyx_pf_9fastremap_502ipt2d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1050 + /* "fastremap.pyx":1066 * else: * sx = arr.shape[1] * sy = arr.shape[0] # <<<<<<<<<<<<<< @@ -111844,19 +114586,19 @@ static PyObject *__pyx_pf_9fastremap_502ipt2d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1052 + /* "fastremap.pyx":1068 * sy = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -111871,17 +114613,17 @@ static PyObject *__pyx_pf_9fastremap_502ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1052, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1057 + /* "fastremap.pyx":1073 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -111891,7 +114633,7 @@ static PyObject *__pyx_pf_9fastremap_502ipt2d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1059 + /* "fastremap.pyx":1075 * if nbytes == 1: * _ipt2d[uint8_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -111911,10 +114653,10 @@ static PyObject *__pyx_pf_9fastremap_502ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_9 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1059, __pyx_L1_error) + __PYX_ERR(0, 1075, __pyx_L1_error) } - /* "fastremap.pyx":1058 + /* "fastremap.pyx":1074 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt2d[uint8_t]( # <<<<<<<<<<<<<< @@ -111923,7 +114665,7 @@ static PyObject *__pyx_pf_9fastremap_502ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint8_t *)(&(*((int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1057 + /* "fastremap.pyx":1073 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -111933,7 +114675,7 @@ static PyObject *__pyx_pf_9fastremap_502ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1064 + /* "fastremap.pyx":1080 * elif nbytes == 2: * _ipt2d[uint16_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -111953,10 +114695,10 @@ static PyObject *__pyx_pf_9fastremap_502ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1064, __pyx_L1_error) + __PYX_ERR(0, 1080, __pyx_L1_error) } - /* "fastremap.pyx":1063 + /* "fastremap.pyx":1079 * ) * elif nbytes == 2: * _ipt2d[uint16_t]( # <<<<<<<<<<<<<< @@ -111965,7 +114707,7 @@ static PyObject *__pyx_pf_9fastremap_502ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint16_t *)(&(*((int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_9 * __pyx_v_arrview.strides[0]) ) + __pyx_t_8 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1062 + /* "fastremap.pyx":1078 * sx, sy * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -111975,7 +114717,7 @@ static PyObject *__pyx_pf_9fastremap_502ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1069 + /* "fastremap.pyx":1085 * elif nbytes == 4: * _ipt2d[uint32_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -111995,10 +114737,10 @@ static PyObject *__pyx_pf_9fastremap_502ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_9 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1069, __pyx_L1_error) + __PYX_ERR(0, 1085, __pyx_L1_error) } - /* "fastremap.pyx":1068 + /* "fastremap.pyx":1084 * ) * elif nbytes == 4: * _ipt2d[uint32_t]( # <<<<<<<<<<<<<< @@ -112007,7 +114749,7 @@ static PyObject *__pyx_pf_9fastremap_502ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint32_t *)(&(*((int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1067 + /* "fastremap.pyx":1083 * sx, sy * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -112017,7 +114759,7 @@ static PyObject *__pyx_pf_9fastremap_502ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1074 + /* "fastremap.pyx":1090 * else: * _ipt2d[uint64_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -112037,10 +114779,10 @@ static PyObject *__pyx_pf_9fastremap_502ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1074, __pyx_L1_error) + __PYX_ERR(0, 1090, __pyx_L1_error) } - /* "fastremap.pyx":1073 + /* "fastremap.pyx":1089 * ) * else: * _ipt2d[uint64_t]( # <<<<<<<<<<<<<< @@ -112051,7 +114793,7 @@ static PyObject *__pyx_pf_9fastremap_502ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1078 + /* "fastremap.pyx":1094 * ) * * return arr # <<<<<<<<<<<<<< @@ -112063,7 +114805,7 @@ static PyObject *__pyx_pf_9fastremap_502ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1039 + /* "fastremap.pyx":1055 * return np.ascontiguousarray(arr) * * def ipt2d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=2] arr): # <<<<<<<<<<<<<< @@ -112106,7 +114848,7 @@ static PyObject *__pyx_fuse_5__pyx_pw_9fastremap_505ipt2d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt2d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1055, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_504ipt2d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -112146,39 +114888,39 @@ static PyObject *__pyx_pf_9fastremap_504ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1055, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; - /* "fastremap.pyx":1040 + /* "fastremap.pyx":1056 * * def ipt2d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=2] arr): * cdef COMPLEX_NUMBER[:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn_int16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1040, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn_int16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1056, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1045 + /* "fastremap.pyx":1061 * cdef size_t sy * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1046 + /* "fastremap.pyx":1062 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -112187,7 +114929,7 @@ static PyObject *__pyx_pf_9fastremap_504ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1047 + /* "fastremap.pyx":1063 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -112196,7 +114938,7 @@ static PyObject *__pyx_pf_9fastremap_504ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1045 + /* "fastremap.pyx":1061 * cdef size_t sy * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -112206,7 +114948,7 @@ static PyObject *__pyx_pf_9fastremap_504ipt2d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1049 + /* "fastremap.pyx":1065 * sy = arr.shape[1] * else: * sx = arr.shape[1] # <<<<<<<<<<<<<< @@ -112216,7 +114958,7 @@ static PyObject *__pyx_pf_9fastremap_504ipt2d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1050 + /* "fastremap.pyx":1066 * else: * sx = arr.shape[1] * sy = arr.shape[0] # <<<<<<<<<<<<<< @@ -112227,19 +114969,19 @@ static PyObject *__pyx_pf_9fastremap_504ipt2d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1052 + /* "fastremap.pyx":1068 * sy = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -112254,17 +114996,17 @@ static PyObject *__pyx_pf_9fastremap_504ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1052, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1057 + /* "fastremap.pyx":1073 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -112274,7 +115016,7 @@ static PyObject *__pyx_pf_9fastremap_504ipt2d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1059 + /* "fastremap.pyx":1075 * if nbytes == 1: * _ipt2d[uint8_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -112294,10 +115036,10 @@ static PyObject *__pyx_pf_9fastremap_504ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_9 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1059, __pyx_L1_error) + __PYX_ERR(0, 1075, __pyx_L1_error) } - /* "fastremap.pyx":1058 + /* "fastremap.pyx":1074 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt2d[uint8_t]( # <<<<<<<<<<<<<< @@ -112306,7 +115048,7 @@ static PyObject *__pyx_pf_9fastremap_504ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint8_t *)(&(*((int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1057 + /* "fastremap.pyx":1073 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -112316,7 +115058,7 @@ static PyObject *__pyx_pf_9fastremap_504ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1064 + /* "fastremap.pyx":1080 * elif nbytes == 2: * _ipt2d[uint16_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -112336,10 +115078,10 @@ static PyObject *__pyx_pf_9fastremap_504ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1064, __pyx_L1_error) + __PYX_ERR(0, 1080, __pyx_L1_error) } - /* "fastremap.pyx":1063 + /* "fastremap.pyx":1079 * ) * elif nbytes == 2: * _ipt2d[uint16_t]( # <<<<<<<<<<<<<< @@ -112348,7 +115090,7 @@ static PyObject *__pyx_pf_9fastremap_504ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint16_t *)(&(*((int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_9 * __pyx_v_arrview.strides[0]) ) + __pyx_t_8 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1062 + /* "fastremap.pyx":1078 * sx, sy * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -112358,7 +115100,7 @@ static PyObject *__pyx_pf_9fastremap_504ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1069 + /* "fastremap.pyx":1085 * elif nbytes == 4: * _ipt2d[uint32_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -112378,10 +115120,10 @@ static PyObject *__pyx_pf_9fastremap_504ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_9 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1069, __pyx_L1_error) + __PYX_ERR(0, 1085, __pyx_L1_error) } - /* "fastremap.pyx":1068 + /* "fastremap.pyx":1084 * ) * elif nbytes == 4: * _ipt2d[uint32_t]( # <<<<<<<<<<<<<< @@ -112390,7 +115132,7 @@ static PyObject *__pyx_pf_9fastremap_504ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint32_t *)(&(*((int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1067 + /* "fastremap.pyx":1083 * sx, sy * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -112400,7 +115142,7 @@ static PyObject *__pyx_pf_9fastremap_504ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1074 + /* "fastremap.pyx":1090 * else: * _ipt2d[uint64_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -112420,10 +115162,10 @@ static PyObject *__pyx_pf_9fastremap_504ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1074, __pyx_L1_error) + __PYX_ERR(0, 1090, __pyx_L1_error) } - /* "fastremap.pyx":1073 + /* "fastremap.pyx":1089 * ) * else: * _ipt2d[uint64_t]( # <<<<<<<<<<<<<< @@ -112434,7 +115176,7 @@ static PyObject *__pyx_pf_9fastremap_504ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1078 + /* "fastremap.pyx":1094 * ) * * return arr # <<<<<<<<<<<<<< @@ -112446,7 +115188,7 @@ static PyObject *__pyx_pf_9fastremap_504ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1039 + /* "fastremap.pyx":1055 * return np.ascontiguousarray(arr) * * def ipt2d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=2] arr): # <<<<<<<<<<<<<< @@ -112489,7 +115231,7 @@ static PyObject *__pyx_fuse_6__pyx_pw_9fastremap_507ipt2d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt2d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1055, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_506ipt2d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -112529,39 +115271,39 @@ static PyObject *__pyx_pf_9fastremap_506ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1055, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; - /* "fastremap.pyx":1040 + /* "fastremap.pyx":1056 * * def ipt2d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=2] arr): * cdef COMPLEX_NUMBER[:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn_int32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1040, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn_int32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1056, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1045 + /* "fastremap.pyx":1061 * cdef size_t sy * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1046 + /* "fastremap.pyx":1062 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -112570,7 +115312,7 @@ static PyObject *__pyx_pf_9fastremap_506ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1047 + /* "fastremap.pyx":1063 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -112579,7 +115321,7 @@ static PyObject *__pyx_pf_9fastremap_506ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1045 + /* "fastremap.pyx":1061 * cdef size_t sy * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -112589,7 +115331,7 @@ static PyObject *__pyx_pf_9fastremap_506ipt2d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1049 + /* "fastremap.pyx":1065 * sy = arr.shape[1] * else: * sx = arr.shape[1] # <<<<<<<<<<<<<< @@ -112599,7 +115341,7 @@ static PyObject *__pyx_pf_9fastremap_506ipt2d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1050 + /* "fastremap.pyx":1066 * else: * sx = arr.shape[1] * sy = arr.shape[0] # <<<<<<<<<<<<<< @@ -112610,19 +115352,19 @@ static PyObject *__pyx_pf_9fastremap_506ipt2d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1052 + /* "fastremap.pyx":1068 * sy = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -112637,17 +115379,17 @@ static PyObject *__pyx_pf_9fastremap_506ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1052, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1057 + /* "fastremap.pyx":1073 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -112657,7 +115399,7 @@ static PyObject *__pyx_pf_9fastremap_506ipt2d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1059 + /* "fastremap.pyx":1075 * if nbytes == 1: * _ipt2d[uint8_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -112677,10 +115419,10 @@ static PyObject *__pyx_pf_9fastremap_506ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_9 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1059, __pyx_L1_error) + __PYX_ERR(0, 1075, __pyx_L1_error) } - /* "fastremap.pyx":1058 + /* "fastremap.pyx":1074 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt2d[uint8_t]( # <<<<<<<<<<<<<< @@ -112689,7 +115431,7 @@ static PyObject *__pyx_pf_9fastremap_506ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint8_t *)(&(*((int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1057 + /* "fastremap.pyx":1073 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -112699,7 +115441,7 @@ static PyObject *__pyx_pf_9fastremap_506ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1064 + /* "fastremap.pyx":1080 * elif nbytes == 2: * _ipt2d[uint16_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -112719,10 +115461,10 @@ static PyObject *__pyx_pf_9fastremap_506ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1064, __pyx_L1_error) + __PYX_ERR(0, 1080, __pyx_L1_error) } - /* "fastremap.pyx":1063 + /* "fastremap.pyx":1079 * ) * elif nbytes == 2: * _ipt2d[uint16_t]( # <<<<<<<<<<<<<< @@ -112731,7 +115473,7 @@ static PyObject *__pyx_pf_9fastremap_506ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint16_t *)(&(*((int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_9 * __pyx_v_arrview.strides[0]) ) + __pyx_t_8 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1062 + /* "fastremap.pyx":1078 * sx, sy * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -112741,7 +115483,7 @@ static PyObject *__pyx_pf_9fastremap_506ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1069 + /* "fastremap.pyx":1085 * elif nbytes == 4: * _ipt2d[uint32_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -112761,10 +115503,10 @@ static PyObject *__pyx_pf_9fastremap_506ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_9 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1069, __pyx_L1_error) + __PYX_ERR(0, 1085, __pyx_L1_error) } - /* "fastremap.pyx":1068 + /* "fastremap.pyx":1084 * ) * elif nbytes == 4: * _ipt2d[uint32_t]( # <<<<<<<<<<<<<< @@ -112773,7 +115515,7 @@ static PyObject *__pyx_pf_9fastremap_506ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint32_t *)(&(*((int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1067 + /* "fastremap.pyx":1083 * sx, sy * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -112783,7 +115525,7 @@ static PyObject *__pyx_pf_9fastremap_506ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1074 + /* "fastremap.pyx":1090 * else: * _ipt2d[uint64_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -112803,10 +115545,10 @@ static PyObject *__pyx_pf_9fastremap_506ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1074, __pyx_L1_error) + __PYX_ERR(0, 1090, __pyx_L1_error) } - /* "fastremap.pyx":1073 + /* "fastremap.pyx":1089 * ) * else: * _ipt2d[uint64_t]( # <<<<<<<<<<<<<< @@ -112817,7 +115559,7 @@ static PyObject *__pyx_pf_9fastremap_506ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1078 + /* "fastremap.pyx":1094 * ) * * return arr # <<<<<<<<<<<<<< @@ -112829,7 +115571,7 @@ static PyObject *__pyx_pf_9fastremap_506ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1039 + /* "fastremap.pyx":1055 * return np.ascontiguousarray(arr) * * def ipt2d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=2] arr): # <<<<<<<<<<<<<< @@ -112872,7 +115614,7 @@ static PyObject *__pyx_fuse_7__pyx_pw_9fastremap_509ipt2d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt2d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1055, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_508ipt2d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -112912,39 +115654,39 @@ static PyObject *__pyx_pf_9fastremap_508ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1055, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; - /* "fastremap.pyx":1040 + /* "fastremap.pyx":1056 * * def ipt2d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=2] arr): * cdef COMPLEX_NUMBER[:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn_int64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1040, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn_int64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1056, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1045 + /* "fastremap.pyx":1061 * cdef size_t sy * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1046 + /* "fastremap.pyx":1062 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -112953,7 +115695,7 @@ static PyObject *__pyx_pf_9fastremap_508ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1047 + /* "fastremap.pyx":1063 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -112962,7 +115704,7 @@ static PyObject *__pyx_pf_9fastremap_508ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1045 + /* "fastremap.pyx":1061 * cdef size_t sy * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -112972,7 +115714,7 @@ static PyObject *__pyx_pf_9fastremap_508ipt2d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1049 + /* "fastremap.pyx":1065 * sy = arr.shape[1] * else: * sx = arr.shape[1] # <<<<<<<<<<<<<< @@ -112982,7 +115724,7 @@ static PyObject *__pyx_pf_9fastremap_508ipt2d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1050 + /* "fastremap.pyx":1066 * else: * sx = arr.shape[1] * sy = arr.shape[0] # <<<<<<<<<<<<<< @@ -112993,19 +115735,19 @@ static PyObject *__pyx_pf_9fastremap_508ipt2d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1052 + /* "fastremap.pyx":1068 * sy = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -113020,17 +115762,17 @@ static PyObject *__pyx_pf_9fastremap_508ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1052, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1057 + /* "fastremap.pyx":1073 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -113040,7 +115782,7 @@ static PyObject *__pyx_pf_9fastremap_508ipt2d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1059 + /* "fastremap.pyx":1075 * if nbytes == 1: * _ipt2d[uint8_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -113060,10 +115802,10 @@ static PyObject *__pyx_pf_9fastremap_508ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_9 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1059, __pyx_L1_error) + __PYX_ERR(0, 1075, __pyx_L1_error) } - /* "fastremap.pyx":1058 + /* "fastremap.pyx":1074 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt2d[uint8_t]( # <<<<<<<<<<<<<< @@ -113072,7 +115814,7 @@ static PyObject *__pyx_pf_9fastremap_508ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint8_t *)(&(*((int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1057 + /* "fastremap.pyx":1073 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -113082,7 +115824,7 @@ static PyObject *__pyx_pf_9fastremap_508ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1064 + /* "fastremap.pyx":1080 * elif nbytes == 2: * _ipt2d[uint16_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -113102,10 +115844,10 @@ static PyObject *__pyx_pf_9fastremap_508ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1064, __pyx_L1_error) + __PYX_ERR(0, 1080, __pyx_L1_error) } - /* "fastremap.pyx":1063 + /* "fastremap.pyx":1079 * ) * elif nbytes == 2: * _ipt2d[uint16_t]( # <<<<<<<<<<<<<< @@ -113114,7 +115856,7 @@ static PyObject *__pyx_pf_9fastremap_508ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint16_t *)(&(*((int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_9 * __pyx_v_arrview.strides[0]) ) + __pyx_t_8 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1062 + /* "fastremap.pyx":1078 * sx, sy * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -113124,7 +115866,7 @@ static PyObject *__pyx_pf_9fastremap_508ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1069 + /* "fastremap.pyx":1085 * elif nbytes == 4: * _ipt2d[uint32_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -113144,10 +115886,10 @@ static PyObject *__pyx_pf_9fastremap_508ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_9 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1069, __pyx_L1_error) + __PYX_ERR(0, 1085, __pyx_L1_error) } - /* "fastremap.pyx":1068 + /* "fastremap.pyx":1084 * ) * elif nbytes == 4: * _ipt2d[uint32_t]( # <<<<<<<<<<<<<< @@ -113156,7 +115898,7 @@ static PyObject *__pyx_pf_9fastremap_508ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint32_t *)(&(*((int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1067 + /* "fastremap.pyx":1083 * sx, sy * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -113166,7 +115908,7 @@ static PyObject *__pyx_pf_9fastremap_508ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1074 + /* "fastremap.pyx":1090 * else: * _ipt2d[uint64_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -113186,10 +115928,10 @@ static PyObject *__pyx_pf_9fastremap_508ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1074, __pyx_L1_error) + __PYX_ERR(0, 1090, __pyx_L1_error) } - /* "fastremap.pyx":1073 + /* "fastremap.pyx":1089 * ) * else: * _ipt2d[uint64_t]( # <<<<<<<<<<<<<< @@ -113200,7 +115942,7 @@ static PyObject *__pyx_pf_9fastremap_508ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1078 + /* "fastremap.pyx":1094 * ) * * return arr # <<<<<<<<<<<<<< @@ -113212,7 +115954,7 @@ static PyObject *__pyx_pf_9fastremap_508ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1039 + /* "fastremap.pyx":1055 * return np.ascontiguousarray(arr) * * def ipt2d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=2] arr): # <<<<<<<<<<<<<< @@ -113255,7 +115997,7 @@ static PyObject *__pyx_fuse_8__pyx_pw_9fastremap_511ipt2d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt2d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1055, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_510ipt2d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -113295,39 +116037,39 @@ static PyObject *__pyx_pf_9fastremap_510ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1055, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; - /* "fastremap.pyx":1040 + /* "fastremap.pyx":1056 * * def ipt2d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=2] arr): * cdef COMPLEX_NUMBER[:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1040, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1056, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1045 + /* "fastremap.pyx":1061 * cdef size_t sy * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1046 + /* "fastremap.pyx":1062 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -113336,7 +116078,7 @@ static PyObject *__pyx_pf_9fastremap_510ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1047 + /* "fastremap.pyx":1063 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -113345,7 +116087,7 @@ static PyObject *__pyx_pf_9fastremap_510ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1045 + /* "fastremap.pyx":1061 * cdef size_t sy * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -113355,7 +116097,7 @@ static PyObject *__pyx_pf_9fastremap_510ipt2d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1049 + /* "fastremap.pyx":1065 * sy = arr.shape[1] * else: * sx = arr.shape[1] # <<<<<<<<<<<<<< @@ -113365,7 +116107,7 @@ static PyObject *__pyx_pf_9fastremap_510ipt2d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1050 + /* "fastremap.pyx":1066 * else: * sx = arr.shape[1] * sy = arr.shape[0] # <<<<<<<<<<<<<< @@ -113376,19 +116118,19 @@ static PyObject *__pyx_pf_9fastremap_510ipt2d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1052 + /* "fastremap.pyx":1068 * sy = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -113403,17 +116145,17 @@ static PyObject *__pyx_pf_9fastremap_510ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1052, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1057 + /* "fastremap.pyx":1073 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -113423,7 +116165,7 @@ static PyObject *__pyx_pf_9fastremap_510ipt2d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1059 + /* "fastremap.pyx":1075 * if nbytes == 1: * _ipt2d[uint8_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -113443,10 +116185,10 @@ static PyObject *__pyx_pf_9fastremap_510ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_9 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1059, __pyx_L1_error) + __PYX_ERR(0, 1075, __pyx_L1_error) } - /* "fastremap.pyx":1058 + /* "fastremap.pyx":1074 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt2d[uint8_t]( # <<<<<<<<<<<<<< @@ -113455,7 +116197,7 @@ static PyObject *__pyx_pf_9fastremap_510ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint8_t *)(&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1057 + /* "fastremap.pyx":1073 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -113465,7 +116207,7 @@ static PyObject *__pyx_pf_9fastremap_510ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1064 + /* "fastremap.pyx":1080 * elif nbytes == 2: * _ipt2d[uint16_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -113485,10 +116227,10 @@ static PyObject *__pyx_pf_9fastremap_510ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1064, __pyx_L1_error) + __PYX_ERR(0, 1080, __pyx_L1_error) } - /* "fastremap.pyx":1063 + /* "fastremap.pyx":1079 * ) * elif nbytes == 2: * _ipt2d[uint16_t]( # <<<<<<<<<<<<<< @@ -113497,7 +116239,7 @@ static PyObject *__pyx_pf_9fastremap_510ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint16_t *)(&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_9 * __pyx_v_arrview.strides[0]) ) + __pyx_t_8 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1062 + /* "fastremap.pyx":1078 * sx, sy * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -113507,7 +116249,7 @@ static PyObject *__pyx_pf_9fastremap_510ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1069 + /* "fastremap.pyx":1085 * elif nbytes == 4: * _ipt2d[uint32_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -113527,10 +116269,10 @@ static PyObject *__pyx_pf_9fastremap_510ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_9 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1069, __pyx_L1_error) + __PYX_ERR(0, 1085, __pyx_L1_error) } - /* "fastremap.pyx":1068 + /* "fastremap.pyx":1084 * ) * elif nbytes == 4: * _ipt2d[uint32_t]( # <<<<<<<<<<<<<< @@ -113539,7 +116281,7 @@ static PyObject *__pyx_pf_9fastremap_510ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint32_t *)(&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1067 + /* "fastremap.pyx":1083 * sx, sy * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -113549,7 +116291,7 @@ static PyObject *__pyx_pf_9fastremap_510ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1074 + /* "fastremap.pyx":1090 * else: * _ipt2d[uint64_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -113569,10 +116311,10 @@ static PyObject *__pyx_pf_9fastremap_510ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1074, __pyx_L1_error) + __PYX_ERR(0, 1090, __pyx_L1_error) } - /* "fastremap.pyx":1073 + /* "fastremap.pyx":1089 * ) * else: * _ipt2d[uint64_t]( # <<<<<<<<<<<<<< @@ -113583,7 +116325,7 @@ static PyObject *__pyx_pf_9fastremap_510ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1078 + /* "fastremap.pyx":1094 * ) * * return arr # <<<<<<<<<<<<<< @@ -113595,7 +116337,7 @@ static PyObject *__pyx_pf_9fastremap_510ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1039 + /* "fastremap.pyx":1055 * return np.ascontiguousarray(arr) * * def ipt2d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=2] arr): # <<<<<<<<<<<<<< @@ -113638,7 +116380,7 @@ static PyObject *__pyx_fuse_9__pyx_pw_9fastremap_513ipt2d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt2d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1055, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_512ipt2d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -113678,39 +116420,39 @@ static PyObject *__pyx_pf_9fastremap_512ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1055, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; - /* "fastremap.pyx":1040 + /* "fastremap.pyx":1056 * * def ipt2d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=2] arr): * cdef COMPLEX_NUMBER[:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1040, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1056, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1045 + /* "fastremap.pyx":1061 * cdef size_t sy * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1046 + /* "fastremap.pyx":1062 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -113719,7 +116461,7 @@ static PyObject *__pyx_pf_9fastremap_512ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1047 + /* "fastremap.pyx":1063 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -113728,7 +116470,7 @@ static PyObject *__pyx_pf_9fastremap_512ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1045 + /* "fastremap.pyx":1061 * cdef size_t sy * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -113738,7 +116480,7 @@ static PyObject *__pyx_pf_9fastremap_512ipt2d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1049 + /* "fastremap.pyx":1065 * sy = arr.shape[1] * else: * sx = arr.shape[1] # <<<<<<<<<<<<<< @@ -113748,7 +116490,7 @@ static PyObject *__pyx_pf_9fastremap_512ipt2d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1050 + /* "fastremap.pyx":1066 * else: * sx = arr.shape[1] * sy = arr.shape[0] # <<<<<<<<<<<<<< @@ -113759,19 +116501,19 @@ static PyObject *__pyx_pf_9fastremap_512ipt2d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1052 + /* "fastremap.pyx":1068 * sy = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -113786,17 +116528,17 @@ static PyObject *__pyx_pf_9fastremap_512ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1052, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1057 + /* "fastremap.pyx":1073 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -113806,7 +116548,7 @@ static PyObject *__pyx_pf_9fastremap_512ipt2d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1059 + /* "fastremap.pyx":1075 * if nbytes == 1: * _ipt2d[uint8_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -113826,10 +116568,10 @@ static PyObject *__pyx_pf_9fastremap_512ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_9 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1059, __pyx_L1_error) + __PYX_ERR(0, 1075, __pyx_L1_error) } - /* "fastremap.pyx":1058 + /* "fastremap.pyx":1074 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt2d[uint8_t]( # <<<<<<<<<<<<<< @@ -113838,7 +116580,7 @@ static PyObject *__pyx_pf_9fastremap_512ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint8_t *)(&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1057 + /* "fastremap.pyx":1073 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -113848,7 +116590,7 @@ static PyObject *__pyx_pf_9fastremap_512ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1064 + /* "fastremap.pyx":1080 * elif nbytes == 2: * _ipt2d[uint16_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -113868,10 +116610,10 @@ static PyObject *__pyx_pf_9fastremap_512ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1064, __pyx_L1_error) + __PYX_ERR(0, 1080, __pyx_L1_error) } - /* "fastremap.pyx":1063 + /* "fastremap.pyx":1079 * ) * elif nbytes == 2: * _ipt2d[uint16_t]( # <<<<<<<<<<<<<< @@ -113880,7 +116622,7 @@ static PyObject *__pyx_pf_9fastremap_512ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint16_t *)(&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_9 * __pyx_v_arrview.strides[0]) ) + __pyx_t_8 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1062 + /* "fastremap.pyx":1078 * sx, sy * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -113890,7 +116632,7 @@ static PyObject *__pyx_pf_9fastremap_512ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1069 + /* "fastremap.pyx":1085 * elif nbytes == 4: * _ipt2d[uint32_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -113910,10 +116652,10 @@ static PyObject *__pyx_pf_9fastremap_512ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_9 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1069, __pyx_L1_error) + __PYX_ERR(0, 1085, __pyx_L1_error) } - /* "fastremap.pyx":1068 + /* "fastremap.pyx":1084 * ) * elif nbytes == 4: * _ipt2d[uint32_t]( # <<<<<<<<<<<<<< @@ -113922,7 +116664,7 @@ static PyObject *__pyx_pf_9fastremap_512ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint32_t *)(&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1067 + /* "fastremap.pyx":1083 * sx, sy * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -113932,7 +116674,7 @@ static PyObject *__pyx_pf_9fastremap_512ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1074 + /* "fastremap.pyx":1090 * else: * _ipt2d[uint64_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -113952,10 +116694,10 @@ static PyObject *__pyx_pf_9fastremap_512ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1074, __pyx_L1_error) + __PYX_ERR(0, 1090, __pyx_L1_error) } - /* "fastremap.pyx":1073 + /* "fastremap.pyx":1089 * ) * else: * _ipt2d[uint64_t]( # <<<<<<<<<<<<<< @@ -113966,7 +116708,7 @@ static PyObject *__pyx_pf_9fastremap_512ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1078 + /* "fastremap.pyx":1094 * ) * * return arr # <<<<<<<<<<<<<< @@ -113978,7 +116720,7 @@ static PyObject *__pyx_pf_9fastremap_512ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1039 + /* "fastremap.pyx":1055 * return np.ascontiguousarray(arr) * * def ipt2d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=2] arr): # <<<<<<<<<<<<<< @@ -114021,7 +116763,7 @@ static PyObject *__pyx_fuse_10__pyx_pw_9fastremap_515ipt2d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt2d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1055, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_514ipt2d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -114061,39 +116803,39 @@ static PyObject *__pyx_pf_9fastremap_514ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo___pyx_t_float_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo___pyx_t_float_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1055, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; - /* "fastremap.pyx":1040 + /* "fastremap.pyx":1056 * * def ipt2d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=2] arr): * cdef COMPLEX_NUMBER[:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsds___pyx_t_float_complex(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1040, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsds___pyx_t_float_complex(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1056, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1045 + /* "fastremap.pyx":1061 * cdef size_t sy * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1046 + /* "fastremap.pyx":1062 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -114102,7 +116844,7 @@ static PyObject *__pyx_pf_9fastremap_514ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1047 + /* "fastremap.pyx":1063 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -114111,7 +116853,7 @@ static PyObject *__pyx_pf_9fastremap_514ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1045 + /* "fastremap.pyx":1061 * cdef size_t sy * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -114121,7 +116863,7 @@ static PyObject *__pyx_pf_9fastremap_514ipt2d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1049 + /* "fastremap.pyx":1065 * sy = arr.shape[1] * else: * sx = arr.shape[1] # <<<<<<<<<<<<<< @@ -114131,7 +116873,7 @@ static PyObject *__pyx_pf_9fastremap_514ipt2d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1050 + /* "fastremap.pyx":1066 * else: * sx = arr.shape[1] * sy = arr.shape[0] # <<<<<<<<<<<<<< @@ -114142,19 +116884,19 @@ static PyObject *__pyx_pf_9fastremap_514ipt2d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1052 + /* "fastremap.pyx":1068 * sy = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -114169,17 +116911,17 @@ static PyObject *__pyx_pf_9fastremap_514ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1052, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1057 + /* "fastremap.pyx":1073 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -114189,7 +116931,7 @@ static PyObject *__pyx_pf_9fastremap_514ipt2d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1059 + /* "fastremap.pyx":1075 * if nbytes == 1: * _ipt2d[uint8_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -114209,10 +116951,10 @@ static PyObject *__pyx_pf_9fastremap_514ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_9 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1059, __pyx_L1_error) + __PYX_ERR(0, 1075, __pyx_L1_error) } - /* "fastremap.pyx":1058 + /* "fastremap.pyx":1074 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt2d[uint8_t]( # <<<<<<<<<<<<<< @@ -114221,7 +116963,7 @@ static PyObject *__pyx_pf_9fastremap_514ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint8_t *)(&(*((__pyx_t_float_complex *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1057 + /* "fastremap.pyx":1073 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -114231,7 +116973,7 @@ static PyObject *__pyx_pf_9fastremap_514ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1064 + /* "fastremap.pyx":1080 * elif nbytes == 2: * _ipt2d[uint16_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -114251,10 +116993,10 @@ static PyObject *__pyx_pf_9fastremap_514ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1064, __pyx_L1_error) + __PYX_ERR(0, 1080, __pyx_L1_error) } - /* "fastremap.pyx":1063 + /* "fastremap.pyx":1079 * ) * elif nbytes == 2: * _ipt2d[uint16_t]( # <<<<<<<<<<<<<< @@ -114263,7 +117005,7 @@ static PyObject *__pyx_pf_9fastremap_514ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint16_t *)(&(*((__pyx_t_float_complex *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_9 * __pyx_v_arrview.strides[0]) ) + __pyx_t_8 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1062 + /* "fastremap.pyx":1078 * sx, sy * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -114273,7 +117015,7 @@ static PyObject *__pyx_pf_9fastremap_514ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1069 + /* "fastremap.pyx":1085 * elif nbytes == 4: * _ipt2d[uint32_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -114293,10 +117035,10 @@ static PyObject *__pyx_pf_9fastremap_514ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_9 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1069, __pyx_L1_error) + __PYX_ERR(0, 1085, __pyx_L1_error) } - /* "fastremap.pyx":1068 + /* "fastremap.pyx":1084 * ) * elif nbytes == 4: * _ipt2d[uint32_t]( # <<<<<<<<<<<<<< @@ -114305,7 +117047,7 @@ static PyObject *__pyx_pf_9fastremap_514ipt2d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt2d(((uint32_t *)(&(*((__pyx_t_float_complex *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ))))), __pyx_v_sx, __pyx_v_sy); - /* "fastremap.pyx":1067 + /* "fastremap.pyx":1083 * sx, sy * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -114315,7 +117057,7 @@ static PyObject *__pyx_pf_9fastremap_514ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1074 + /* "fastremap.pyx":1090 * else: * _ipt2d[uint64_t]( * &arrview[0,0], # <<<<<<<<<<<<<< @@ -114335,10 +117077,10 @@ static PyObject *__pyx_pf_9fastremap_514ipt2d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[1])) __pyx_t_7 = 1; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1074, __pyx_L1_error) + __PYX_ERR(0, 1090, __pyx_L1_error) } - /* "fastremap.pyx":1073 + /* "fastremap.pyx":1089 * ) * else: * _ipt2d[uint64_t]( # <<<<<<<<<<<<<< @@ -114349,7 +117091,7 @@ static PyObject *__pyx_pf_9fastremap_514ipt2d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1078 + /* "fastremap.pyx":1094 * ) * * return arr # <<<<<<<<<<<<<< @@ -114361,7 +117103,7 @@ static PyObject *__pyx_pf_9fastremap_514ipt2d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1039 + /* "fastremap.pyx":1055 * return np.ascontiguousarray(arr) * * def ipt2d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=2] arr): # <<<<<<<<<<<<<< @@ -114394,7 +117136,7 @@ static PyObject *__pyx_pf_9fastremap_514ipt2d(CYTHON_UNUSED PyObject *__pyx_self return __pyx_r; } -/* "fastremap.pyx":1080 +/* "fastremap.pyx":1096 * return arr * * def ipt3d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=3] arr): # <<<<<<<<<<<<<< @@ -114443,23 +117185,23 @@ static PyObject *__pyx_pw_9fastremap_59ipt3d(PyObject *__pyx_self, PyObject *__p case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 1080, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 1096, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 1080, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 1096, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 1080, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 1096, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 1080, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 1096, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -114476,7 +117218,7 @@ static PyObject *__pyx_pw_9fastremap_59ipt3d(PyObject *__pyx_self, PyObject *__p } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1080, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1096, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -114538,7 +117280,7 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ipt3d", 0); __Pyx_INCREF(__pyx_v_kwargs); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -114552,7 +117294,7 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) __pyx_t_3 = ((!__pyx_t_4) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; @@ -114560,7 +117302,7 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_kwargs, Py_None); } - __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -114575,16 +117317,16 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_v____pyx_int64_t_is_signed = (!((((int64_t)-1L) > 0) != 0)); if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 1080, __pyx_L1_error) + __PYX_ERR(0, 1096, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1096, __pyx_L1_error) __pyx_t_2 = ((0 < __pyx_t_5) != 0); if (__pyx_t_2) { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1080, __pyx_L1_error) + __PYX_ERR(0, 1096, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(((PyObject*)__pyx_v_args), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(((PyObject*)__pyx_v_args), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -114599,18 +117341,18 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 1080, __pyx_L1_error) + __PYX_ERR(0, 1096, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_arr, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_arr, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) __pyx_t_3 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_3; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1080, __pyx_L1_error) + __PYX_ERR(0, 1096, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -114619,12 +117361,12 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 1080, __pyx_L1_error) + __PYX_ERR(0, 1096, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1080, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); @@ -114635,15 +117377,15 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 1080, __pyx_L1_error) + __PYX_ERR(0, 1096, __pyx_L1_error) } __pyx_L6:; while (1) { @@ -114653,7 +117395,7 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -114662,14 +117404,14 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -114691,14 +117433,14 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_2 = (__pyx_v_dtype != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_itemsize = __pyx_t_5; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_kind = __pyx_t_7; __pyx_v_dtype_signed = (__pyx_v_kind == 'i'); @@ -114711,9 +117453,9 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 3) != 0); if (__pyx_t_2) { @@ -114725,7 +117467,7 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; __pyx_L16_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint16_t)) == __pyx_v_itemsize) != 0); @@ -114734,9 +117476,9 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L20_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 3) != 0); if (__pyx_t_2) { @@ -114748,7 +117490,7 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; __pyx_L20_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint32_t)) == __pyx_v_itemsize) != 0); @@ -114757,9 +117499,9 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L24_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 3) != 0); if (__pyx_t_2) { @@ -114771,7 +117513,7 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; __pyx_L24_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint64_t)) == __pyx_v_itemsize) != 0); @@ -114780,9 +117522,9 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L28_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 3) != 0); if (__pyx_t_2) { @@ -114794,7 +117536,7 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int8_t)) == __pyx_v_itemsize) != 0); @@ -114803,9 +117545,9 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L32_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 3) != 0); if (__pyx_t_2) { @@ -114817,7 +117559,7 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; __pyx_L32_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int16_t)) == __pyx_v_itemsize) != 0); @@ -114826,9 +117568,9 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L36_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 3) != 0); if (__pyx_t_2) { @@ -114840,7 +117582,7 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; __pyx_L36_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int32_t)) == __pyx_v_itemsize) != 0); @@ -114849,9 +117591,9 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L40_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 3) != 0); if (__pyx_t_2) { @@ -114863,7 +117605,7 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; __pyx_L40_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int64_t)) == __pyx_v_itemsize) != 0); @@ -114872,9 +117614,9 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L44_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 3) != 0); if (__pyx_t_2) { @@ -114886,7 +117628,7 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; __pyx_L44_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -114897,15 +117639,15 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L48_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 3) != 0); __pyx_t_3 = __pyx_t_2; __pyx_L48_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(double)) == __pyx_v_itemsize) != 0); @@ -114914,15 +117656,15 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L51_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 3) != 0); __pyx_t_3 = __pyx_t_2; __pyx_L51_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -114933,15 +117675,15 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L54_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 3) != 0); __pyx_t_3 = __pyx_t_2; __pyx_L54_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_float_complex, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_float_complex, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -114966,7 +117708,7 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -114988,7 +117730,7 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -115010,7 +117752,7 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -115032,7 +117774,7 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -115054,7 +117796,7 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -115076,7 +117818,7 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -115098,7 +117840,7 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -115120,7 +117862,7 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -115142,7 +117884,7 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -115164,7 +117906,7 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -115186,27 +117928,27 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_float_complex, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_float_complex, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); } } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) goto __pyx_L10_break; } __pyx_L10_break:; - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_candidates = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = 0; if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 1080, __pyx_L1_error) + __PYX_ERR(0, 1096, __pyx_L1_error) } - __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_1; @@ -115214,12 +117956,12 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, while (1) { __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_9, &__pyx_t_5, &__pyx_t_1, NULL, NULL, __pyx_t_10); if (unlikely(__pyx_t_11 == 0)) break; - if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_1); __pyx_t_1 = 0; __pyx_v_match_found = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { @@ -115233,10 +117975,10 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, } __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, __pyx_kp_s__2) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__2); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -115251,27 +117993,27 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, } __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_12, __pyx_kp_s__3) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__3); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_src_sig, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1096, __pyx_L1_error) __pyx_t_16 = __pyx_t_15; for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dest_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dest_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_v_dst_type != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_2) { __pyx_v_match_found = 1; @@ -115287,37 +118029,37 @@ static PyObject *__pyx_pf_9fastremap_58ipt3d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_L103_break:; __pyx_t_2 = (__pyx_v_match_found != 0); if (__pyx_t_2) { - __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1096, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_candidates) != 0); __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 1080, __pyx_L1_error) + __PYX_ERR(0, 1096, __pyx_L1_error) } - __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1096, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_9 > 1) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 1080, __pyx_L1_error) + __PYX_ERR(0, 1096, __pyx_L1_error) } /*else*/ { __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1080, __pyx_L1_error) + __PYX_ERR(0, 1096, __pyx_L1_error) } - __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_candidates, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_candidates, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_13 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), __pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), __pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_13; @@ -115360,7 +118102,7 @@ static PyObject *__pyx_fuse_0__pyx_pw_9fastremap_519ipt3d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt3d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1096, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_518ipt3d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -115402,39 +118144,39 @@ static PyObject *__pyx_pf_9fastremap_518ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1096, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; - /* "fastremap.pyx":1081 + /* "fastremap.pyx":1097 * * def ipt3d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=3] arr): * cdef COMPLEX_NUMBER[:,:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1081, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1097, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1087 + /* "fastremap.pyx":1103 * cdef size_t sz * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1088 + /* "fastremap.pyx":1104 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -115443,7 +118185,7 @@ static PyObject *__pyx_pf_9fastremap_518ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1089 + /* "fastremap.pyx":1105 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -115452,7 +118194,7 @@ static PyObject *__pyx_pf_9fastremap_518ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1090 + /* "fastremap.pyx":1106 * sx = arr.shape[0] * sy = arr.shape[1] * sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -115461,7 +118203,7 @@ static PyObject *__pyx_pf_9fastremap_518ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1087 + /* "fastremap.pyx":1103 * cdef size_t sz * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -115471,7 +118213,7 @@ static PyObject *__pyx_pf_9fastremap_518ipt3d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1092 + /* "fastremap.pyx":1108 * sz = arr.shape[2] * else: * sx = arr.shape[2] # <<<<<<<<<<<<<< @@ -115481,7 +118223,7 @@ static PyObject *__pyx_pf_9fastremap_518ipt3d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1093 + /* "fastremap.pyx":1109 * else: * sx = arr.shape[2] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -115490,7 +118232,7 @@ static PyObject *__pyx_pf_9fastremap_518ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1094 + /* "fastremap.pyx":1110 * sx = arr.shape[2] * sy = arr.shape[1] * sz = arr.shape[0] # <<<<<<<<<<<<<< @@ -115501,19 +118243,19 @@ static PyObject *__pyx_pf_9fastremap_518ipt3d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1096 + /* "fastremap.pyx":1112 * sz = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -115528,17 +118270,17 @@ static PyObject *__pyx_pf_9fastremap_518ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1096, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1101 + /* "fastremap.pyx":1117 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -115548,7 +118290,7 @@ static PyObject *__pyx_pf_9fastremap_518ipt3d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1103 + /* "fastremap.pyx":1119 * if nbytes == 1: * _ipt3d[uint8_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -115573,10 +118315,10 @@ static PyObject *__pyx_pf_9fastremap_518ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_10 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1103, __pyx_L1_error) + __PYX_ERR(0, 1119, __pyx_L1_error) } - /* "fastremap.pyx":1102 + /* "fastremap.pyx":1118 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt3d[uint8_t]( # <<<<<<<<<<<<<< @@ -115585,7 +118327,7 @@ static PyObject *__pyx_pf_9fastremap_518ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint8_t *)(&(*((uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1101 + /* "fastremap.pyx":1117 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -115595,7 +118337,7 @@ static PyObject *__pyx_pf_9fastremap_518ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1108 + /* "fastremap.pyx":1124 * elif nbytes == 2: * _ipt3d[uint16_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -115620,10 +118362,10 @@ static PyObject *__pyx_pf_9fastremap_518ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1108, __pyx_L1_error) + __PYX_ERR(0, 1124, __pyx_L1_error) } - /* "fastremap.pyx":1107 + /* "fastremap.pyx":1123 * ) * elif nbytes == 2: * _ipt3d[uint16_t]( # <<<<<<<<<<<<<< @@ -115632,7 +118374,7 @@ static PyObject *__pyx_pf_9fastremap_518ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint16_t *)(&(*((uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_10 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_8 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1106 + /* "fastremap.pyx":1122 * sx, sy, sz * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -115642,7 +118384,7 @@ static PyObject *__pyx_pf_9fastremap_518ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1113 + /* "fastremap.pyx":1129 * elif nbytes == 4: * _ipt3d[uint32_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -115667,10 +118409,10 @@ static PyObject *__pyx_pf_9fastremap_518ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_10 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1113, __pyx_L1_error) + __PYX_ERR(0, 1129, __pyx_L1_error) } - /* "fastremap.pyx":1112 + /* "fastremap.pyx":1128 * ) * elif nbytes == 4: * _ipt3d[uint32_t]( # <<<<<<<<<<<<<< @@ -115679,7 +118421,7 @@ static PyObject *__pyx_pf_9fastremap_518ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint32_t *)(&(*((uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1111 + /* "fastremap.pyx":1127 * sx, sy, sz * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -115689,7 +118431,7 @@ static PyObject *__pyx_pf_9fastremap_518ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1118 + /* "fastremap.pyx":1134 * else: * _ipt3d[uint64_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -115714,10 +118456,10 @@ static PyObject *__pyx_pf_9fastremap_518ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1118, __pyx_L1_error) + __PYX_ERR(0, 1134, __pyx_L1_error) } - /* "fastremap.pyx":1117 + /* "fastremap.pyx":1133 * ) * else: * _ipt3d[uint64_t]( # <<<<<<<<<<<<<< @@ -115728,7 +118470,7 @@ static PyObject *__pyx_pf_9fastremap_518ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1122 + /* "fastremap.pyx":1138 * ) * * return arr # <<<<<<<<<<<<<< @@ -115740,7 +118482,7 @@ static PyObject *__pyx_pf_9fastremap_518ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1080 + /* "fastremap.pyx":1096 * return arr * * def ipt3d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=3] arr): # <<<<<<<<<<<<<< @@ -115783,7 +118525,7 @@ static PyObject *__pyx_fuse_1__pyx_pw_9fastremap_521ipt3d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt3d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1096, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_520ipt3d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -115825,39 +118567,39 @@ static PyObject *__pyx_pf_9fastremap_520ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1096, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; - /* "fastremap.pyx":1081 + /* "fastremap.pyx":1097 * * def ipt3d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=3] arr): * cdef COMPLEX_NUMBER[:,:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1081, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1097, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1087 + /* "fastremap.pyx":1103 * cdef size_t sz * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1088 + /* "fastremap.pyx":1104 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -115866,7 +118608,7 @@ static PyObject *__pyx_pf_9fastremap_520ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1089 + /* "fastremap.pyx":1105 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -115875,7 +118617,7 @@ static PyObject *__pyx_pf_9fastremap_520ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1090 + /* "fastremap.pyx":1106 * sx = arr.shape[0] * sy = arr.shape[1] * sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -115884,7 +118626,7 @@ static PyObject *__pyx_pf_9fastremap_520ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1087 + /* "fastremap.pyx":1103 * cdef size_t sz * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -115894,7 +118636,7 @@ static PyObject *__pyx_pf_9fastremap_520ipt3d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1092 + /* "fastremap.pyx":1108 * sz = arr.shape[2] * else: * sx = arr.shape[2] # <<<<<<<<<<<<<< @@ -115904,7 +118646,7 @@ static PyObject *__pyx_pf_9fastremap_520ipt3d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1093 + /* "fastremap.pyx":1109 * else: * sx = arr.shape[2] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -115913,7 +118655,7 @@ static PyObject *__pyx_pf_9fastremap_520ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1094 + /* "fastremap.pyx":1110 * sx = arr.shape[2] * sy = arr.shape[1] * sz = arr.shape[0] # <<<<<<<<<<<<<< @@ -115924,19 +118666,19 @@ static PyObject *__pyx_pf_9fastremap_520ipt3d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1096 + /* "fastremap.pyx":1112 * sz = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -115951,17 +118693,17 @@ static PyObject *__pyx_pf_9fastremap_520ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1096, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1101 + /* "fastremap.pyx":1117 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -115971,7 +118713,7 @@ static PyObject *__pyx_pf_9fastremap_520ipt3d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1103 + /* "fastremap.pyx":1119 * if nbytes == 1: * _ipt3d[uint8_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -115996,10 +118738,10 @@ static PyObject *__pyx_pf_9fastremap_520ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_10 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1103, __pyx_L1_error) + __PYX_ERR(0, 1119, __pyx_L1_error) } - /* "fastremap.pyx":1102 + /* "fastremap.pyx":1118 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt3d[uint8_t]( # <<<<<<<<<<<<<< @@ -116008,7 +118750,7 @@ static PyObject *__pyx_pf_9fastremap_520ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint8_t *)(&(*((uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1101 + /* "fastremap.pyx":1117 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -116018,7 +118760,7 @@ static PyObject *__pyx_pf_9fastremap_520ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1108 + /* "fastremap.pyx":1124 * elif nbytes == 2: * _ipt3d[uint16_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -116043,10 +118785,10 @@ static PyObject *__pyx_pf_9fastremap_520ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1108, __pyx_L1_error) + __PYX_ERR(0, 1124, __pyx_L1_error) } - /* "fastremap.pyx":1107 + /* "fastremap.pyx":1123 * ) * elif nbytes == 2: * _ipt3d[uint16_t]( # <<<<<<<<<<<<<< @@ -116055,7 +118797,7 @@ static PyObject *__pyx_pf_9fastremap_520ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint16_t *)(&(*((uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_10 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_8 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1106 + /* "fastremap.pyx":1122 * sx, sy, sz * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -116065,7 +118807,7 @@ static PyObject *__pyx_pf_9fastremap_520ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1113 + /* "fastremap.pyx":1129 * elif nbytes == 4: * _ipt3d[uint32_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -116090,10 +118832,10 @@ static PyObject *__pyx_pf_9fastremap_520ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_10 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1113, __pyx_L1_error) + __PYX_ERR(0, 1129, __pyx_L1_error) } - /* "fastremap.pyx":1112 + /* "fastremap.pyx":1128 * ) * elif nbytes == 4: * _ipt3d[uint32_t]( # <<<<<<<<<<<<<< @@ -116102,7 +118844,7 @@ static PyObject *__pyx_pf_9fastremap_520ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint32_t *)(&(*((uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1111 + /* "fastremap.pyx":1127 * sx, sy, sz * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -116112,7 +118854,7 @@ static PyObject *__pyx_pf_9fastremap_520ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1118 + /* "fastremap.pyx":1134 * else: * _ipt3d[uint64_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -116137,10 +118879,10 @@ static PyObject *__pyx_pf_9fastremap_520ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1118, __pyx_L1_error) + __PYX_ERR(0, 1134, __pyx_L1_error) } - /* "fastremap.pyx":1117 + /* "fastremap.pyx":1133 * ) * else: * _ipt3d[uint64_t]( # <<<<<<<<<<<<<< @@ -116151,7 +118893,7 @@ static PyObject *__pyx_pf_9fastremap_520ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1122 + /* "fastremap.pyx":1138 * ) * * return arr # <<<<<<<<<<<<<< @@ -116163,7 +118905,7 @@ static PyObject *__pyx_pf_9fastremap_520ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1080 + /* "fastremap.pyx":1096 * return arr * * def ipt3d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=3] arr): # <<<<<<<<<<<<<< @@ -116206,7 +118948,7 @@ static PyObject *__pyx_fuse_2__pyx_pw_9fastremap_523ipt3d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt3d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1096, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_522ipt3d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -116248,39 +118990,39 @@ static PyObject *__pyx_pf_9fastremap_522ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1096, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; - /* "fastremap.pyx":1081 + /* "fastremap.pyx":1097 * * def ipt3d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=3] arr): * cdef COMPLEX_NUMBER[:,:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1081, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1097, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1087 + /* "fastremap.pyx":1103 * cdef size_t sz * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1088 + /* "fastremap.pyx":1104 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -116289,7 +119031,7 @@ static PyObject *__pyx_pf_9fastremap_522ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1089 + /* "fastremap.pyx":1105 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -116298,7 +119040,7 @@ static PyObject *__pyx_pf_9fastremap_522ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1090 + /* "fastremap.pyx":1106 * sx = arr.shape[0] * sy = arr.shape[1] * sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -116307,7 +119049,7 @@ static PyObject *__pyx_pf_9fastremap_522ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1087 + /* "fastremap.pyx":1103 * cdef size_t sz * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -116317,7 +119059,7 @@ static PyObject *__pyx_pf_9fastremap_522ipt3d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1092 + /* "fastremap.pyx":1108 * sz = arr.shape[2] * else: * sx = arr.shape[2] # <<<<<<<<<<<<<< @@ -116327,7 +119069,7 @@ static PyObject *__pyx_pf_9fastremap_522ipt3d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1093 + /* "fastremap.pyx":1109 * else: * sx = arr.shape[2] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -116336,7 +119078,7 @@ static PyObject *__pyx_pf_9fastremap_522ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1094 + /* "fastremap.pyx":1110 * sx = arr.shape[2] * sy = arr.shape[1] * sz = arr.shape[0] # <<<<<<<<<<<<<< @@ -116347,19 +119089,19 @@ static PyObject *__pyx_pf_9fastremap_522ipt3d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1096 + /* "fastremap.pyx":1112 * sz = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -116374,17 +119116,17 @@ static PyObject *__pyx_pf_9fastremap_522ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1096, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1101 + /* "fastremap.pyx":1117 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -116394,7 +119136,7 @@ static PyObject *__pyx_pf_9fastremap_522ipt3d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1103 + /* "fastremap.pyx":1119 * if nbytes == 1: * _ipt3d[uint8_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -116419,10 +119161,10 @@ static PyObject *__pyx_pf_9fastremap_522ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_10 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1103, __pyx_L1_error) + __PYX_ERR(0, 1119, __pyx_L1_error) } - /* "fastremap.pyx":1102 + /* "fastremap.pyx":1118 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt3d[uint8_t]( # <<<<<<<<<<<<<< @@ -116431,7 +119173,7 @@ static PyObject *__pyx_pf_9fastremap_522ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint8_t *)(&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1101 + /* "fastremap.pyx":1117 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -116441,7 +119183,7 @@ static PyObject *__pyx_pf_9fastremap_522ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1108 + /* "fastremap.pyx":1124 * elif nbytes == 2: * _ipt3d[uint16_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -116466,10 +119208,10 @@ static PyObject *__pyx_pf_9fastremap_522ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1108, __pyx_L1_error) + __PYX_ERR(0, 1124, __pyx_L1_error) } - /* "fastremap.pyx":1107 + /* "fastremap.pyx":1123 * ) * elif nbytes == 2: * _ipt3d[uint16_t]( # <<<<<<<<<<<<<< @@ -116478,7 +119220,7 @@ static PyObject *__pyx_pf_9fastremap_522ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint16_t *)(&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_10 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_8 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1106 + /* "fastremap.pyx":1122 * sx, sy, sz * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -116488,7 +119230,7 @@ static PyObject *__pyx_pf_9fastremap_522ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1113 + /* "fastremap.pyx":1129 * elif nbytes == 4: * _ipt3d[uint32_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -116513,10 +119255,10 @@ static PyObject *__pyx_pf_9fastremap_522ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_10 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1113, __pyx_L1_error) + __PYX_ERR(0, 1129, __pyx_L1_error) } - /* "fastremap.pyx":1112 + /* "fastremap.pyx":1128 * ) * elif nbytes == 4: * _ipt3d[uint32_t]( # <<<<<<<<<<<<<< @@ -116525,7 +119267,7 @@ static PyObject *__pyx_pf_9fastremap_522ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint32_t *)(&(*((uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1111 + /* "fastremap.pyx":1127 * sx, sy, sz * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -116535,7 +119277,7 @@ static PyObject *__pyx_pf_9fastremap_522ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1118 + /* "fastremap.pyx":1134 * else: * _ipt3d[uint64_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -116560,10 +119302,10 @@ static PyObject *__pyx_pf_9fastremap_522ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1118, __pyx_L1_error) + __PYX_ERR(0, 1134, __pyx_L1_error) } - /* "fastremap.pyx":1117 + /* "fastremap.pyx":1133 * ) * else: * _ipt3d[uint64_t]( # <<<<<<<<<<<<<< @@ -116574,7 +119316,7 @@ static PyObject *__pyx_pf_9fastremap_522ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1122 + /* "fastremap.pyx":1138 * ) * * return arr # <<<<<<<<<<<<<< @@ -116586,7 +119328,7 @@ static PyObject *__pyx_pf_9fastremap_522ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1080 + /* "fastremap.pyx":1096 * return arr * * def ipt3d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=3] arr): # <<<<<<<<<<<<<< @@ -116629,7 +119371,7 @@ static PyObject *__pyx_fuse_3__pyx_pw_9fastremap_525ipt3d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt3d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1096, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_524ipt3d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -116671,39 +119413,39 @@ static PyObject *__pyx_pf_9fastremap_524ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1096, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; - /* "fastremap.pyx":1081 + /* "fastremap.pyx":1097 * * def ipt3d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=3] arr): * cdef COMPLEX_NUMBER[:,:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1081, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_uint64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1097, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1087 + /* "fastremap.pyx":1103 * cdef size_t sz * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1088 + /* "fastremap.pyx":1104 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -116712,7 +119454,7 @@ static PyObject *__pyx_pf_9fastremap_524ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1089 + /* "fastremap.pyx":1105 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -116721,7 +119463,7 @@ static PyObject *__pyx_pf_9fastremap_524ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1090 + /* "fastremap.pyx":1106 * sx = arr.shape[0] * sy = arr.shape[1] * sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -116730,7 +119472,7 @@ static PyObject *__pyx_pf_9fastremap_524ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1087 + /* "fastremap.pyx":1103 * cdef size_t sz * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -116740,7 +119482,7 @@ static PyObject *__pyx_pf_9fastremap_524ipt3d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1092 + /* "fastremap.pyx":1108 * sz = arr.shape[2] * else: * sx = arr.shape[2] # <<<<<<<<<<<<<< @@ -116750,7 +119492,7 @@ static PyObject *__pyx_pf_9fastremap_524ipt3d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1093 + /* "fastremap.pyx":1109 * else: * sx = arr.shape[2] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -116759,7 +119501,7 @@ static PyObject *__pyx_pf_9fastremap_524ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1094 + /* "fastremap.pyx":1110 * sx = arr.shape[2] * sy = arr.shape[1] * sz = arr.shape[0] # <<<<<<<<<<<<<< @@ -116770,19 +119512,19 @@ static PyObject *__pyx_pf_9fastremap_524ipt3d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1096 + /* "fastremap.pyx":1112 * sz = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -116797,17 +119539,17 @@ static PyObject *__pyx_pf_9fastremap_524ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1096, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1101 + /* "fastremap.pyx":1117 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -116817,7 +119559,7 @@ static PyObject *__pyx_pf_9fastremap_524ipt3d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1103 + /* "fastremap.pyx":1119 * if nbytes == 1: * _ipt3d[uint8_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -116842,10 +119584,10 @@ static PyObject *__pyx_pf_9fastremap_524ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_10 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1103, __pyx_L1_error) + __PYX_ERR(0, 1119, __pyx_L1_error) } - /* "fastremap.pyx":1102 + /* "fastremap.pyx":1118 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt3d[uint8_t]( # <<<<<<<<<<<<<< @@ -116854,7 +119596,7 @@ static PyObject *__pyx_pf_9fastremap_524ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint8_t *)(&(*((uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1101 + /* "fastremap.pyx":1117 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -116864,7 +119606,7 @@ static PyObject *__pyx_pf_9fastremap_524ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1108 + /* "fastremap.pyx":1124 * elif nbytes == 2: * _ipt3d[uint16_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -116889,10 +119631,10 @@ static PyObject *__pyx_pf_9fastremap_524ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1108, __pyx_L1_error) + __PYX_ERR(0, 1124, __pyx_L1_error) } - /* "fastremap.pyx":1107 + /* "fastremap.pyx":1123 * ) * elif nbytes == 2: * _ipt3d[uint16_t]( # <<<<<<<<<<<<<< @@ -116901,7 +119643,7 @@ static PyObject *__pyx_pf_9fastremap_524ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint16_t *)(&(*((uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_10 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_8 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1106 + /* "fastremap.pyx":1122 * sx, sy, sz * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -116911,7 +119653,7 @@ static PyObject *__pyx_pf_9fastremap_524ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1113 + /* "fastremap.pyx":1129 * elif nbytes == 4: * _ipt3d[uint32_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -116936,10 +119678,10 @@ static PyObject *__pyx_pf_9fastremap_524ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_10 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1113, __pyx_L1_error) + __PYX_ERR(0, 1129, __pyx_L1_error) } - /* "fastremap.pyx":1112 + /* "fastremap.pyx":1128 * ) * elif nbytes == 4: * _ipt3d[uint32_t]( # <<<<<<<<<<<<<< @@ -116948,7 +119690,7 @@ static PyObject *__pyx_pf_9fastremap_524ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint32_t *)(&(*((uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1111 + /* "fastremap.pyx":1127 * sx, sy, sz * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -116958,7 +119700,7 @@ static PyObject *__pyx_pf_9fastremap_524ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1118 + /* "fastremap.pyx":1134 * else: * _ipt3d[uint64_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -116983,10 +119725,10 @@ static PyObject *__pyx_pf_9fastremap_524ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1118, __pyx_L1_error) + __PYX_ERR(0, 1134, __pyx_L1_error) } - /* "fastremap.pyx":1117 + /* "fastremap.pyx":1133 * ) * else: * _ipt3d[uint64_t]( # <<<<<<<<<<<<<< @@ -116997,7 +119739,7 @@ static PyObject *__pyx_pf_9fastremap_524ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1122 + /* "fastremap.pyx":1138 * ) * * return arr # <<<<<<<<<<<<<< @@ -117009,7 +119751,7 @@ static PyObject *__pyx_pf_9fastremap_524ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1080 + /* "fastremap.pyx":1096 * return arr * * def ipt3d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=3] arr): # <<<<<<<<<<<<<< @@ -117052,7 +119794,7 @@ static PyObject *__pyx_fuse_4__pyx_pw_9fastremap_527ipt3d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt3d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1096, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_526ipt3d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -117094,39 +119836,39 @@ static PyObject *__pyx_pf_9fastremap_526ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1096, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; - /* "fastremap.pyx":1081 + /* "fastremap.pyx":1097 * * def ipt3d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=3] arr): * cdef COMPLEX_NUMBER[:,:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_int8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1081, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_int8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1097, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1087 + /* "fastremap.pyx":1103 * cdef size_t sz * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1088 + /* "fastremap.pyx":1104 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -117135,7 +119877,7 @@ static PyObject *__pyx_pf_9fastremap_526ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1089 + /* "fastremap.pyx":1105 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -117144,7 +119886,7 @@ static PyObject *__pyx_pf_9fastremap_526ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1090 + /* "fastremap.pyx":1106 * sx = arr.shape[0] * sy = arr.shape[1] * sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -117153,7 +119895,7 @@ static PyObject *__pyx_pf_9fastremap_526ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1087 + /* "fastremap.pyx":1103 * cdef size_t sz * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -117163,7 +119905,7 @@ static PyObject *__pyx_pf_9fastremap_526ipt3d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1092 + /* "fastremap.pyx":1108 * sz = arr.shape[2] * else: * sx = arr.shape[2] # <<<<<<<<<<<<<< @@ -117173,7 +119915,7 @@ static PyObject *__pyx_pf_9fastremap_526ipt3d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1093 + /* "fastremap.pyx":1109 * else: * sx = arr.shape[2] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -117182,7 +119924,7 @@ static PyObject *__pyx_pf_9fastremap_526ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1094 + /* "fastremap.pyx":1110 * sx = arr.shape[2] * sy = arr.shape[1] * sz = arr.shape[0] # <<<<<<<<<<<<<< @@ -117193,19 +119935,19 @@ static PyObject *__pyx_pf_9fastremap_526ipt3d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1096 + /* "fastremap.pyx":1112 * sz = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -117220,17 +119962,17 @@ static PyObject *__pyx_pf_9fastremap_526ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1096, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1101 + /* "fastremap.pyx":1117 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -117240,7 +119982,7 @@ static PyObject *__pyx_pf_9fastremap_526ipt3d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1103 + /* "fastremap.pyx":1119 * if nbytes == 1: * _ipt3d[uint8_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -117265,10 +120007,10 @@ static PyObject *__pyx_pf_9fastremap_526ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_10 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1103, __pyx_L1_error) + __PYX_ERR(0, 1119, __pyx_L1_error) } - /* "fastremap.pyx":1102 + /* "fastremap.pyx":1118 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt3d[uint8_t]( # <<<<<<<<<<<<<< @@ -117277,7 +120019,7 @@ static PyObject *__pyx_pf_9fastremap_526ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint8_t *)(&(*((int8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1101 + /* "fastremap.pyx":1117 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -117287,7 +120029,7 @@ static PyObject *__pyx_pf_9fastremap_526ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1108 + /* "fastremap.pyx":1124 * elif nbytes == 2: * _ipt3d[uint16_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -117312,10 +120054,10 @@ static PyObject *__pyx_pf_9fastremap_526ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1108, __pyx_L1_error) + __PYX_ERR(0, 1124, __pyx_L1_error) } - /* "fastremap.pyx":1107 + /* "fastremap.pyx":1123 * ) * elif nbytes == 2: * _ipt3d[uint16_t]( # <<<<<<<<<<<<<< @@ -117324,7 +120066,7 @@ static PyObject *__pyx_pf_9fastremap_526ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint16_t *)(&(*((int8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_10 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_8 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1106 + /* "fastremap.pyx":1122 * sx, sy, sz * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -117334,7 +120076,7 @@ static PyObject *__pyx_pf_9fastremap_526ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1113 + /* "fastremap.pyx":1129 * elif nbytes == 4: * _ipt3d[uint32_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -117359,10 +120101,10 @@ static PyObject *__pyx_pf_9fastremap_526ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_10 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1113, __pyx_L1_error) + __PYX_ERR(0, 1129, __pyx_L1_error) } - /* "fastremap.pyx":1112 + /* "fastremap.pyx":1128 * ) * elif nbytes == 4: * _ipt3d[uint32_t]( # <<<<<<<<<<<<<< @@ -117371,7 +120113,7 @@ static PyObject *__pyx_pf_9fastremap_526ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint32_t *)(&(*((int8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1111 + /* "fastremap.pyx":1127 * sx, sy, sz * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -117381,7 +120123,7 @@ static PyObject *__pyx_pf_9fastremap_526ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1118 + /* "fastremap.pyx":1134 * else: * _ipt3d[uint64_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -117406,10 +120148,10 @@ static PyObject *__pyx_pf_9fastremap_526ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1118, __pyx_L1_error) + __PYX_ERR(0, 1134, __pyx_L1_error) } - /* "fastremap.pyx":1117 + /* "fastremap.pyx":1133 * ) * else: * _ipt3d[uint64_t]( # <<<<<<<<<<<<<< @@ -117420,7 +120162,7 @@ static PyObject *__pyx_pf_9fastremap_526ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1122 + /* "fastremap.pyx":1138 * ) * * return arr # <<<<<<<<<<<<<< @@ -117432,7 +120174,7 @@ static PyObject *__pyx_pf_9fastremap_526ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1080 + /* "fastremap.pyx":1096 * return arr * * def ipt3d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=3] arr): # <<<<<<<<<<<<<< @@ -117475,7 +120217,7 @@ static PyObject *__pyx_fuse_5__pyx_pw_9fastremap_529ipt3d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt3d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1096, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_528ipt3d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -117517,39 +120259,39 @@ static PyObject *__pyx_pf_9fastremap_528ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1096, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; - /* "fastremap.pyx":1081 + /* "fastremap.pyx":1097 * * def ipt3d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=3] arr): * cdef COMPLEX_NUMBER[:,:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_int16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1081, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_int16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1097, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1087 + /* "fastremap.pyx":1103 * cdef size_t sz * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1088 + /* "fastremap.pyx":1104 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -117558,7 +120300,7 @@ static PyObject *__pyx_pf_9fastremap_528ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1089 + /* "fastremap.pyx":1105 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -117567,7 +120309,7 @@ static PyObject *__pyx_pf_9fastremap_528ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1090 + /* "fastremap.pyx":1106 * sx = arr.shape[0] * sy = arr.shape[1] * sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -117576,7 +120318,7 @@ static PyObject *__pyx_pf_9fastremap_528ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1087 + /* "fastremap.pyx":1103 * cdef size_t sz * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -117586,7 +120328,7 @@ static PyObject *__pyx_pf_9fastremap_528ipt3d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1092 + /* "fastremap.pyx":1108 * sz = arr.shape[2] * else: * sx = arr.shape[2] # <<<<<<<<<<<<<< @@ -117596,7 +120338,7 @@ static PyObject *__pyx_pf_9fastremap_528ipt3d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1093 + /* "fastremap.pyx":1109 * else: * sx = arr.shape[2] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -117605,7 +120347,7 @@ static PyObject *__pyx_pf_9fastremap_528ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1094 + /* "fastremap.pyx":1110 * sx = arr.shape[2] * sy = arr.shape[1] * sz = arr.shape[0] # <<<<<<<<<<<<<< @@ -117616,19 +120358,19 @@ static PyObject *__pyx_pf_9fastremap_528ipt3d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1096 + /* "fastremap.pyx":1112 * sz = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -117643,17 +120385,17 @@ static PyObject *__pyx_pf_9fastremap_528ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1096, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1101 + /* "fastremap.pyx":1117 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -117663,7 +120405,7 @@ static PyObject *__pyx_pf_9fastremap_528ipt3d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1103 + /* "fastremap.pyx":1119 * if nbytes == 1: * _ipt3d[uint8_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -117688,10 +120430,10 @@ static PyObject *__pyx_pf_9fastremap_528ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_10 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1103, __pyx_L1_error) + __PYX_ERR(0, 1119, __pyx_L1_error) } - /* "fastremap.pyx":1102 + /* "fastremap.pyx":1118 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt3d[uint8_t]( # <<<<<<<<<<<<<< @@ -117700,7 +120442,7 @@ static PyObject *__pyx_pf_9fastremap_528ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint8_t *)(&(*((int16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1101 + /* "fastremap.pyx":1117 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -117710,7 +120452,7 @@ static PyObject *__pyx_pf_9fastremap_528ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1108 + /* "fastremap.pyx":1124 * elif nbytes == 2: * _ipt3d[uint16_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -117735,10 +120477,10 @@ static PyObject *__pyx_pf_9fastremap_528ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1108, __pyx_L1_error) + __PYX_ERR(0, 1124, __pyx_L1_error) } - /* "fastremap.pyx":1107 + /* "fastremap.pyx":1123 * ) * elif nbytes == 2: * _ipt3d[uint16_t]( # <<<<<<<<<<<<<< @@ -117747,7 +120489,7 @@ static PyObject *__pyx_pf_9fastremap_528ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint16_t *)(&(*((int16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_10 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_8 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1106 + /* "fastremap.pyx":1122 * sx, sy, sz * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -117757,7 +120499,7 @@ static PyObject *__pyx_pf_9fastremap_528ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1113 + /* "fastremap.pyx":1129 * elif nbytes == 4: * _ipt3d[uint32_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -117782,10 +120524,10 @@ static PyObject *__pyx_pf_9fastremap_528ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_10 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1113, __pyx_L1_error) + __PYX_ERR(0, 1129, __pyx_L1_error) } - /* "fastremap.pyx":1112 + /* "fastremap.pyx":1128 * ) * elif nbytes == 4: * _ipt3d[uint32_t]( # <<<<<<<<<<<<<< @@ -117794,7 +120536,7 @@ static PyObject *__pyx_pf_9fastremap_528ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint32_t *)(&(*((int16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1111 + /* "fastremap.pyx":1127 * sx, sy, sz * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -117804,7 +120546,7 @@ static PyObject *__pyx_pf_9fastremap_528ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1118 + /* "fastremap.pyx":1134 * else: * _ipt3d[uint64_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -117829,10 +120571,10 @@ static PyObject *__pyx_pf_9fastremap_528ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1118, __pyx_L1_error) + __PYX_ERR(0, 1134, __pyx_L1_error) } - /* "fastremap.pyx":1117 + /* "fastremap.pyx":1133 * ) * else: * _ipt3d[uint64_t]( # <<<<<<<<<<<<<< @@ -117843,7 +120585,7 @@ static PyObject *__pyx_pf_9fastremap_528ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1122 + /* "fastremap.pyx":1138 * ) * * return arr # <<<<<<<<<<<<<< @@ -117855,7 +120597,7 @@ static PyObject *__pyx_pf_9fastremap_528ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1080 + /* "fastremap.pyx":1096 * return arr * * def ipt3d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=3] arr): # <<<<<<<<<<<<<< @@ -117898,7 +120640,7 @@ static PyObject *__pyx_fuse_6__pyx_pw_9fastremap_531ipt3d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt3d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1096, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_530ipt3d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -117940,39 +120682,39 @@ static PyObject *__pyx_pf_9fastremap_530ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1096, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; - /* "fastremap.pyx":1081 + /* "fastremap.pyx":1097 * * def ipt3d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=3] arr): * cdef COMPLEX_NUMBER[:,:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_int32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1081, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_int32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1097, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1087 + /* "fastremap.pyx":1103 * cdef size_t sz * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1088 + /* "fastremap.pyx":1104 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -117981,7 +120723,7 @@ static PyObject *__pyx_pf_9fastremap_530ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1089 + /* "fastremap.pyx":1105 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -117990,7 +120732,7 @@ static PyObject *__pyx_pf_9fastremap_530ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1090 + /* "fastremap.pyx":1106 * sx = arr.shape[0] * sy = arr.shape[1] * sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -117999,7 +120741,7 @@ static PyObject *__pyx_pf_9fastremap_530ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1087 + /* "fastremap.pyx":1103 * cdef size_t sz * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -118009,7 +120751,7 @@ static PyObject *__pyx_pf_9fastremap_530ipt3d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1092 + /* "fastremap.pyx":1108 * sz = arr.shape[2] * else: * sx = arr.shape[2] # <<<<<<<<<<<<<< @@ -118019,7 +120761,7 @@ static PyObject *__pyx_pf_9fastremap_530ipt3d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1093 + /* "fastremap.pyx":1109 * else: * sx = arr.shape[2] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -118028,7 +120770,7 @@ static PyObject *__pyx_pf_9fastremap_530ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1094 + /* "fastremap.pyx":1110 * sx = arr.shape[2] * sy = arr.shape[1] * sz = arr.shape[0] # <<<<<<<<<<<<<< @@ -118039,19 +120781,19 @@ static PyObject *__pyx_pf_9fastremap_530ipt3d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1096 + /* "fastremap.pyx":1112 * sz = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -118066,17 +120808,17 @@ static PyObject *__pyx_pf_9fastremap_530ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1096, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1101 + /* "fastremap.pyx":1117 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -118086,7 +120828,7 @@ static PyObject *__pyx_pf_9fastremap_530ipt3d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1103 + /* "fastremap.pyx":1119 * if nbytes == 1: * _ipt3d[uint8_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -118111,10 +120853,10 @@ static PyObject *__pyx_pf_9fastremap_530ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_10 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1103, __pyx_L1_error) + __PYX_ERR(0, 1119, __pyx_L1_error) } - /* "fastremap.pyx":1102 + /* "fastremap.pyx":1118 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt3d[uint8_t]( # <<<<<<<<<<<<<< @@ -118123,7 +120865,7 @@ static PyObject *__pyx_pf_9fastremap_530ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint8_t *)(&(*((int32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1101 + /* "fastremap.pyx":1117 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -118133,7 +120875,7 @@ static PyObject *__pyx_pf_9fastremap_530ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1108 + /* "fastremap.pyx":1124 * elif nbytes == 2: * _ipt3d[uint16_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -118158,10 +120900,10 @@ static PyObject *__pyx_pf_9fastremap_530ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1108, __pyx_L1_error) + __PYX_ERR(0, 1124, __pyx_L1_error) } - /* "fastremap.pyx":1107 + /* "fastremap.pyx":1123 * ) * elif nbytes == 2: * _ipt3d[uint16_t]( # <<<<<<<<<<<<<< @@ -118170,7 +120912,7 @@ static PyObject *__pyx_pf_9fastremap_530ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint16_t *)(&(*((int32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_10 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_8 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1106 + /* "fastremap.pyx":1122 * sx, sy, sz * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -118180,7 +120922,7 @@ static PyObject *__pyx_pf_9fastremap_530ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1113 + /* "fastremap.pyx":1129 * elif nbytes == 4: * _ipt3d[uint32_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -118205,10 +120947,10 @@ static PyObject *__pyx_pf_9fastremap_530ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_10 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1113, __pyx_L1_error) + __PYX_ERR(0, 1129, __pyx_L1_error) } - /* "fastremap.pyx":1112 + /* "fastremap.pyx":1128 * ) * elif nbytes == 4: * _ipt3d[uint32_t]( # <<<<<<<<<<<<<< @@ -118217,7 +120959,7 @@ static PyObject *__pyx_pf_9fastremap_530ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint32_t *)(&(*((int32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1111 + /* "fastremap.pyx":1127 * sx, sy, sz * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -118227,7 +120969,7 @@ static PyObject *__pyx_pf_9fastremap_530ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1118 + /* "fastremap.pyx":1134 * else: * _ipt3d[uint64_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -118252,10 +120994,10 @@ static PyObject *__pyx_pf_9fastremap_530ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1118, __pyx_L1_error) + __PYX_ERR(0, 1134, __pyx_L1_error) } - /* "fastremap.pyx":1117 + /* "fastremap.pyx":1133 * ) * else: * _ipt3d[uint64_t]( # <<<<<<<<<<<<<< @@ -118266,7 +121008,7 @@ static PyObject *__pyx_pf_9fastremap_530ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1122 + /* "fastremap.pyx":1138 * ) * * return arr # <<<<<<<<<<<<<< @@ -118278,7 +121020,7 @@ static PyObject *__pyx_pf_9fastremap_530ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1080 + /* "fastremap.pyx":1096 * return arr * * def ipt3d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=3] arr): # <<<<<<<<<<<<<< @@ -118321,7 +121063,7 @@ static PyObject *__pyx_fuse_7__pyx_pw_9fastremap_533ipt3d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt3d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1096, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_532ipt3d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -118363,39 +121105,39 @@ static PyObject *__pyx_pf_9fastremap_532ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1096, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; - /* "fastremap.pyx":1081 + /* "fastremap.pyx":1097 * * def ipt3d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=3] arr): * cdef COMPLEX_NUMBER[:,:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_int64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1081, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn_int64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1097, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1087 + /* "fastremap.pyx":1103 * cdef size_t sz * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1088 + /* "fastremap.pyx":1104 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -118404,7 +121146,7 @@ static PyObject *__pyx_pf_9fastremap_532ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1089 + /* "fastremap.pyx":1105 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -118413,7 +121155,7 @@ static PyObject *__pyx_pf_9fastremap_532ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1090 + /* "fastremap.pyx":1106 * sx = arr.shape[0] * sy = arr.shape[1] * sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -118422,7 +121164,7 @@ static PyObject *__pyx_pf_9fastremap_532ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1087 + /* "fastremap.pyx":1103 * cdef size_t sz * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -118432,7 +121174,7 @@ static PyObject *__pyx_pf_9fastremap_532ipt3d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1092 + /* "fastremap.pyx":1108 * sz = arr.shape[2] * else: * sx = arr.shape[2] # <<<<<<<<<<<<<< @@ -118442,7 +121184,7 @@ static PyObject *__pyx_pf_9fastremap_532ipt3d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1093 + /* "fastremap.pyx":1109 * else: * sx = arr.shape[2] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -118451,7 +121193,7 @@ static PyObject *__pyx_pf_9fastremap_532ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1094 + /* "fastremap.pyx":1110 * sx = arr.shape[2] * sy = arr.shape[1] * sz = arr.shape[0] # <<<<<<<<<<<<<< @@ -118462,19 +121204,19 @@ static PyObject *__pyx_pf_9fastremap_532ipt3d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1096 + /* "fastremap.pyx":1112 * sz = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -118489,17 +121231,17 @@ static PyObject *__pyx_pf_9fastremap_532ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1096, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1101 + /* "fastremap.pyx":1117 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -118509,7 +121251,7 @@ static PyObject *__pyx_pf_9fastremap_532ipt3d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1103 + /* "fastremap.pyx":1119 * if nbytes == 1: * _ipt3d[uint8_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -118534,10 +121276,10 @@ static PyObject *__pyx_pf_9fastremap_532ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_10 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1103, __pyx_L1_error) + __PYX_ERR(0, 1119, __pyx_L1_error) } - /* "fastremap.pyx":1102 + /* "fastremap.pyx":1118 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt3d[uint8_t]( # <<<<<<<<<<<<<< @@ -118546,7 +121288,7 @@ static PyObject *__pyx_pf_9fastremap_532ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint8_t *)(&(*((int64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1101 + /* "fastremap.pyx":1117 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -118556,7 +121298,7 @@ static PyObject *__pyx_pf_9fastremap_532ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1108 + /* "fastremap.pyx":1124 * elif nbytes == 2: * _ipt3d[uint16_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -118581,10 +121323,10 @@ static PyObject *__pyx_pf_9fastremap_532ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1108, __pyx_L1_error) + __PYX_ERR(0, 1124, __pyx_L1_error) } - /* "fastremap.pyx":1107 + /* "fastremap.pyx":1123 * ) * elif nbytes == 2: * _ipt3d[uint16_t]( # <<<<<<<<<<<<<< @@ -118593,7 +121335,7 @@ static PyObject *__pyx_pf_9fastremap_532ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint16_t *)(&(*((int64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_10 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_8 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1106 + /* "fastremap.pyx":1122 * sx, sy, sz * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -118603,7 +121345,7 @@ static PyObject *__pyx_pf_9fastremap_532ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1113 + /* "fastremap.pyx":1129 * elif nbytes == 4: * _ipt3d[uint32_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -118628,10 +121370,10 @@ static PyObject *__pyx_pf_9fastremap_532ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_10 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1113, __pyx_L1_error) + __PYX_ERR(0, 1129, __pyx_L1_error) } - /* "fastremap.pyx":1112 + /* "fastremap.pyx":1128 * ) * elif nbytes == 4: * _ipt3d[uint32_t]( # <<<<<<<<<<<<<< @@ -118640,7 +121382,7 @@ static PyObject *__pyx_pf_9fastremap_532ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint32_t *)(&(*((int64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1111 + /* "fastremap.pyx":1127 * sx, sy, sz * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -118650,7 +121392,7 @@ static PyObject *__pyx_pf_9fastremap_532ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1118 + /* "fastremap.pyx":1134 * else: * _ipt3d[uint64_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -118675,10 +121417,10 @@ static PyObject *__pyx_pf_9fastremap_532ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1118, __pyx_L1_error) + __PYX_ERR(0, 1134, __pyx_L1_error) } - /* "fastremap.pyx":1117 + /* "fastremap.pyx":1133 * ) * else: * _ipt3d[uint64_t]( # <<<<<<<<<<<<<< @@ -118689,7 +121431,7 @@ static PyObject *__pyx_pf_9fastremap_532ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1122 + /* "fastremap.pyx":1138 * ) * * return arr # <<<<<<<<<<<<<< @@ -118701,7 +121443,7 @@ static PyObject *__pyx_pf_9fastremap_532ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1080 + /* "fastremap.pyx":1096 * return arr * * def ipt3d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=3] arr): # <<<<<<<<<<<<<< @@ -118744,7 +121486,7 @@ static PyObject *__pyx_fuse_8__pyx_pw_9fastremap_535ipt3d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt3d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1096, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_534ipt3d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -118786,39 +121528,39 @@ static PyObject *__pyx_pf_9fastremap_534ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1096, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; - /* "fastremap.pyx":1081 + /* "fastremap.pyx":1097 * * def ipt3d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=3] arr): * cdef COMPLEX_NUMBER[:,:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_float(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1081, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_float(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1097, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1087 + /* "fastremap.pyx":1103 * cdef size_t sz * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1088 + /* "fastremap.pyx":1104 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -118827,7 +121569,7 @@ static PyObject *__pyx_pf_9fastremap_534ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1089 + /* "fastremap.pyx":1105 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -118836,7 +121578,7 @@ static PyObject *__pyx_pf_9fastremap_534ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1090 + /* "fastremap.pyx":1106 * sx = arr.shape[0] * sy = arr.shape[1] * sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -118845,7 +121587,7 @@ static PyObject *__pyx_pf_9fastremap_534ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1087 + /* "fastremap.pyx":1103 * cdef size_t sz * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -118855,7 +121597,7 @@ static PyObject *__pyx_pf_9fastremap_534ipt3d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1092 + /* "fastremap.pyx":1108 * sz = arr.shape[2] * else: * sx = arr.shape[2] # <<<<<<<<<<<<<< @@ -118865,7 +121607,7 @@ static PyObject *__pyx_pf_9fastremap_534ipt3d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1093 + /* "fastremap.pyx":1109 * else: * sx = arr.shape[2] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -118874,7 +121616,7 @@ static PyObject *__pyx_pf_9fastremap_534ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1094 + /* "fastremap.pyx":1110 * sx = arr.shape[2] * sy = arr.shape[1] * sz = arr.shape[0] # <<<<<<<<<<<<<< @@ -118885,19 +121627,19 @@ static PyObject *__pyx_pf_9fastremap_534ipt3d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1096 + /* "fastremap.pyx":1112 * sz = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -118912,17 +121654,17 @@ static PyObject *__pyx_pf_9fastremap_534ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1096, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1101 + /* "fastremap.pyx":1117 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -118932,7 +121674,7 @@ static PyObject *__pyx_pf_9fastremap_534ipt3d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1103 + /* "fastremap.pyx":1119 * if nbytes == 1: * _ipt3d[uint8_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -118957,10 +121699,10 @@ static PyObject *__pyx_pf_9fastremap_534ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_10 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1103, __pyx_L1_error) + __PYX_ERR(0, 1119, __pyx_L1_error) } - /* "fastremap.pyx":1102 + /* "fastremap.pyx":1118 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt3d[uint8_t]( # <<<<<<<<<<<<<< @@ -118969,7 +121711,7 @@ static PyObject *__pyx_pf_9fastremap_534ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint8_t *)(&(*((float *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1101 + /* "fastremap.pyx":1117 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -118979,7 +121721,7 @@ static PyObject *__pyx_pf_9fastremap_534ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1108 + /* "fastremap.pyx":1124 * elif nbytes == 2: * _ipt3d[uint16_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -119004,10 +121746,10 @@ static PyObject *__pyx_pf_9fastremap_534ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1108, __pyx_L1_error) + __PYX_ERR(0, 1124, __pyx_L1_error) } - /* "fastremap.pyx":1107 + /* "fastremap.pyx":1123 * ) * elif nbytes == 2: * _ipt3d[uint16_t]( # <<<<<<<<<<<<<< @@ -119016,7 +121758,7 @@ static PyObject *__pyx_pf_9fastremap_534ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint16_t *)(&(*((float *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_10 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_8 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1106 + /* "fastremap.pyx":1122 * sx, sy, sz * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -119026,7 +121768,7 @@ static PyObject *__pyx_pf_9fastremap_534ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1113 + /* "fastremap.pyx":1129 * elif nbytes == 4: * _ipt3d[uint32_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -119051,10 +121793,10 @@ static PyObject *__pyx_pf_9fastremap_534ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_10 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1113, __pyx_L1_error) + __PYX_ERR(0, 1129, __pyx_L1_error) } - /* "fastremap.pyx":1112 + /* "fastremap.pyx":1128 * ) * elif nbytes == 4: * _ipt3d[uint32_t]( # <<<<<<<<<<<<<< @@ -119063,7 +121805,7 @@ static PyObject *__pyx_pf_9fastremap_534ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint32_t *)(&(*((float *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1111 + /* "fastremap.pyx":1127 * sx, sy, sz * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -119073,7 +121815,7 @@ static PyObject *__pyx_pf_9fastremap_534ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1118 + /* "fastremap.pyx":1134 * else: * _ipt3d[uint64_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -119098,10 +121840,10 @@ static PyObject *__pyx_pf_9fastremap_534ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1118, __pyx_L1_error) + __PYX_ERR(0, 1134, __pyx_L1_error) } - /* "fastremap.pyx":1117 + /* "fastremap.pyx":1133 * ) * else: * _ipt3d[uint64_t]( # <<<<<<<<<<<<<< @@ -119112,7 +121854,7 @@ static PyObject *__pyx_pf_9fastremap_534ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1122 + /* "fastremap.pyx":1138 * ) * * return arr # <<<<<<<<<<<<<< @@ -119124,7 +121866,7 @@ static PyObject *__pyx_pf_9fastremap_534ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1080 + /* "fastremap.pyx":1096 * return arr * * def ipt3d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=3] arr): # <<<<<<<<<<<<<< @@ -119167,7 +121909,7 @@ static PyObject *__pyx_fuse_9__pyx_pw_9fastremap_537ipt3d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt3d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1096, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_536ipt3d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -119209,39 +121951,39 @@ static PyObject *__pyx_pf_9fastremap_536ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1096, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; - /* "fastremap.pyx":1081 + /* "fastremap.pyx":1097 * * def ipt3d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=3] arr): * cdef COMPLEX_NUMBER[:,:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1081, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1097, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1087 + /* "fastremap.pyx":1103 * cdef size_t sz * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1088 + /* "fastremap.pyx":1104 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -119250,7 +121992,7 @@ static PyObject *__pyx_pf_9fastremap_536ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1089 + /* "fastremap.pyx":1105 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -119259,7 +122001,7 @@ static PyObject *__pyx_pf_9fastremap_536ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1090 + /* "fastremap.pyx":1106 * sx = arr.shape[0] * sy = arr.shape[1] * sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -119268,7 +122010,7 @@ static PyObject *__pyx_pf_9fastremap_536ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1087 + /* "fastremap.pyx":1103 * cdef size_t sz * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -119278,7 +122020,7 @@ static PyObject *__pyx_pf_9fastremap_536ipt3d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1092 + /* "fastremap.pyx":1108 * sz = arr.shape[2] * else: * sx = arr.shape[2] # <<<<<<<<<<<<<< @@ -119288,7 +122030,7 @@ static PyObject *__pyx_pf_9fastremap_536ipt3d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1093 + /* "fastremap.pyx":1109 * else: * sx = arr.shape[2] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -119297,7 +122039,7 @@ static PyObject *__pyx_pf_9fastremap_536ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1094 + /* "fastremap.pyx":1110 * sx = arr.shape[2] * sy = arr.shape[1] * sz = arr.shape[0] # <<<<<<<<<<<<<< @@ -119308,19 +122050,19 @@ static PyObject *__pyx_pf_9fastremap_536ipt3d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1096 + /* "fastremap.pyx":1112 * sz = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -119335,17 +122077,17 @@ static PyObject *__pyx_pf_9fastremap_536ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1096, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1101 + /* "fastremap.pyx":1117 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -119355,7 +122097,7 @@ static PyObject *__pyx_pf_9fastremap_536ipt3d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1103 + /* "fastremap.pyx":1119 * if nbytes == 1: * _ipt3d[uint8_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -119380,10 +122122,10 @@ static PyObject *__pyx_pf_9fastremap_536ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_10 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1103, __pyx_L1_error) + __PYX_ERR(0, 1119, __pyx_L1_error) } - /* "fastremap.pyx":1102 + /* "fastremap.pyx":1118 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt3d[uint8_t]( # <<<<<<<<<<<<<< @@ -119392,7 +122134,7 @@ static PyObject *__pyx_pf_9fastremap_536ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint8_t *)(&(*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1101 + /* "fastremap.pyx":1117 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -119402,7 +122144,7 @@ static PyObject *__pyx_pf_9fastremap_536ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1108 + /* "fastremap.pyx":1124 * elif nbytes == 2: * _ipt3d[uint16_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -119427,10 +122169,10 @@ static PyObject *__pyx_pf_9fastremap_536ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1108, __pyx_L1_error) + __PYX_ERR(0, 1124, __pyx_L1_error) } - /* "fastremap.pyx":1107 + /* "fastremap.pyx":1123 * ) * elif nbytes == 2: * _ipt3d[uint16_t]( # <<<<<<<<<<<<<< @@ -119439,7 +122181,7 @@ static PyObject *__pyx_pf_9fastremap_536ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint16_t *)(&(*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_10 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_8 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1106 + /* "fastremap.pyx":1122 * sx, sy, sz * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -119449,7 +122191,7 @@ static PyObject *__pyx_pf_9fastremap_536ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1113 + /* "fastremap.pyx":1129 * elif nbytes == 4: * _ipt3d[uint32_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -119474,10 +122216,10 @@ static PyObject *__pyx_pf_9fastremap_536ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_10 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1113, __pyx_L1_error) + __PYX_ERR(0, 1129, __pyx_L1_error) } - /* "fastremap.pyx":1112 + /* "fastremap.pyx":1128 * ) * elif nbytes == 4: * _ipt3d[uint32_t]( # <<<<<<<<<<<<<< @@ -119486,7 +122228,7 @@ static PyObject *__pyx_pf_9fastremap_536ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint32_t *)(&(*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1111 + /* "fastremap.pyx":1127 * sx, sy, sz * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -119496,7 +122238,7 @@ static PyObject *__pyx_pf_9fastremap_536ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1118 + /* "fastremap.pyx":1134 * else: * _ipt3d[uint64_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -119521,10 +122263,10 @@ static PyObject *__pyx_pf_9fastremap_536ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1118, __pyx_L1_error) + __PYX_ERR(0, 1134, __pyx_L1_error) } - /* "fastremap.pyx":1117 + /* "fastremap.pyx":1133 * ) * else: * _ipt3d[uint64_t]( # <<<<<<<<<<<<<< @@ -119535,7 +122277,7 @@ static PyObject *__pyx_pf_9fastremap_536ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1122 + /* "fastremap.pyx":1138 * ) * * return arr # <<<<<<<<<<<<<< @@ -119547,7 +122289,7 @@ static PyObject *__pyx_pf_9fastremap_536ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1080 + /* "fastremap.pyx":1096 * return arr * * def ipt3d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=3] arr): # <<<<<<<<<<<<<< @@ -119590,7 +122332,7 @@ static PyObject *__pyx_fuse_10__pyx_pw_9fastremap_539ipt3d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt3d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1096, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_538ipt3d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -119632,39 +122374,39 @@ static PyObject *__pyx_pf_9fastremap_538ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo___pyx_t_float_complex, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo___pyx_t_float_complex, PyBUF_FORMAT| PyBUF_STRIDES, 3, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1096, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; - /* "fastremap.pyx":1081 + /* "fastremap.pyx":1097 * * def ipt3d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=3] arr): * cdef COMPLEX_NUMBER[:,:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds___pyx_t_float_complex(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1081, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds___pyx_t_float_complex(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1097, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1087 + /* "fastremap.pyx":1103 * cdef size_t sz * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1088 + /* "fastremap.pyx":1104 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -119673,7 +122415,7 @@ static PyObject *__pyx_pf_9fastremap_538ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1089 + /* "fastremap.pyx":1105 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -119682,7 +122424,7 @@ static PyObject *__pyx_pf_9fastremap_538ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1090 + /* "fastremap.pyx":1106 * sx = arr.shape[0] * sy = arr.shape[1] * sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -119691,7 +122433,7 @@ static PyObject *__pyx_pf_9fastremap_538ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1087 + /* "fastremap.pyx":1103 * cdef size_t sz * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -119701,7 +122443,7 @@ static PyObject *__pyx_pf_9fastremap_538ipt3d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1092 + /* "fastremap.pyx":1108 * sz = arr.shape[2] * else: * sx = arr.shape[2] # <<<<<<<<<<<<<< @@ -119711,7 +122453,7 @@ static PyObject *__pyx_pf_9fastremap_538ipt3d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1093 + /* "fastremap.pyx":1109 * else: * sx = arr.shape[2] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -119720,7 +122462,7 @@ static PyObject *__pyx_pf_9fastremap_538ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1094 + /* "fastremap.pyx":1110 * sx = arr.shape[2] * sy = arr.shape[1] * sz = arr.shape[0] # <<<<<<<<<<<<<< @@ -119731,19 +122473,19 @@ static PyObject *__pyx_pf_9fastremap_538ipt3d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1096 + /* "fastremap.pyx":1112 * sz = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -119758,17 +122500,17 @@ static PyObject *__pyx_pf_9fastremap_538ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1096, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1101 + /* "fastremap.pyx":1117 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -119778,7 +122520,7 @@ static PyObject *__pyx_pf_9fastremap_538ipt3d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1103 + /* "fastremap.pyx":1119 * if nbytes == 1: * _ipt3d[uint8_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -119803,10 +122545,10 @@ static PyObject *__pyx_pf_9fastremap_538ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_10 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1103, __pyx_L1_error) + __PYX_ERR(0, 1119, __pyx_L1_error) } - /* "fastremap.pyx":1102 + /* "fastremap.pyx":1118 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt3d[uint8_t]( # <<<<<<<<<<<<<< @@ -119815,7 +122557,7 @@ static PyObject *__pyx_pf_9fastremap_538ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint8_t *)(&(*((__pyx_t_float_complex *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1101 + /* "fastremap.pyx":1117 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -119825,7 +122567,7 @@ static PyObject *__pyx_pf_9fastremap_538ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1108 + /* "fastremap.pyx":1124 * elif nbytes == 2: * _ipt3d[uint16_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -119850,10 +122592,10 @@ static PyObject *__pyx_pf_9fastremap_538ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1108, __pyx_L1_error) + __PYX_ERR(0, 1124, __pyx_L1_error) } - /* "fastremap.pyx":1107 + /* "fastremap.pyx":1123 * ) * elif nbytes == 2: * _ipt3d[uint16_t]( # <<<<<<<<<<<<<< @@ -119862,7 +122604,7 @@ static PyObject *__pyx_pf_9fastremap_538ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint16_t *)(&(*((__pyx_t_float_complex *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_10 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_8 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1106 + /* "fastremap.pyx":1122 * sx, sy, sz * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -119872,7 +122614,7 @@ static PyObject *__pyx_pf_9fastremap_538ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1113 + /* "fastremap.pyx":1129 * elif nbytes == 4: * _ipt3d[uint32_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -119897,10 +122639,10 @@ static PyObject *__pyx_pf_9fastremap_538ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_10 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1113, __pyx_L1_error) + __PYX_ERR(0, 1129, __pyx_L1_error) } - /* "fastremap.pyx":1112 + /* "fastremap.pyx":1128 * ) * elif nbytes == 4: * _ipt3d[uint32_t]( # <<<<<<<<<<<<<< @@ -119909,7 +122651,7 @@ static PyObject *__pyx_pf_9fastremap_538ipt3d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt3d(((uint32_t *)(&(*((__pyx_t_float_complex *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz); - /* "fastremap.pyx":1111 + /* "fastremap.pyx":1127 * sx, sy, sz * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -119919,7 +122661,7 @@ static PyObject *__pyx_pf_9fastremap_538ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1118 + /* "fastremap.pyx":1134 * else: * _ipt3d[uint64_t]( * &arrview[0,0,0], # <<<<<<<<<<<<<< @@ -119944,10 +122686,10 @@ static PyObject *__pyx_pf_9fastremap_538ipt3d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[2])) __pyx_t_7 = 2; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1118, __pyx_L1_error) + __PYX_ERR(0, 1134, __pyx_L1_error) } - /* "fastremap.pyx":1117 + /* "fastremap.pyx":1133 * ) * else: * _ipt3d[uint64_t]( # <<<<<<<<<<<<<< @@ -119958,7 +122700,7 @@ static PyObject *__pyx_pf_9fastremap_538ipt3d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1122 + /* "fastremap.pyx":1138 * ) * * return arr # <<<<<<<<<<<<<< @@ -119970,7 +122712,7 @@ static PyObject *__pyx_pf_9fastremap_538ipt3d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1080 + /* "fastremap.pyx":1096 * return arr * * def ipt3d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=3] arr): # <<<<<<<<<<<<<< @@ -120003,7 +122745,7 @@ static PyObject *__pyx_pf_9fastremap_538ipt3d(CYTHON_UNUSED PyObject *__pyx_self return __pyx_r; } -/* "fastremap.pyx":1124 +/* "fastremap.pyx":1140 * return arr * * def ipt4d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=4] arr): # <<<<<<<<<<<<<< @@ -120052,23 +122794,23 @@ static PyObject *__pyx_pw_9fastremap_61ipt4d(PyObject *__pyx_self, PyObject *__p case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 1124, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 1140, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 1124, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 1140, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 1124, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 1140, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 1124, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 1140, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -120085,7 +122827,7 @@ static PyObject *__pyx_pw_9fastremap_61ipt4d(PyObject *__pyx_self, PyObject *__p } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1124, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1140, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -120147,7 +122889,7 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ipt4d", 0); __Pyx_INCREF(__pyx_v_kwargs); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -120161,7 +122903,7 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) __pyx_t_3 = ((!__pyx_t_4) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; @@ -120169,7 +122911,7 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_kwargs, Py_None); } - __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -120184,16 +122926,16 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_v____pyx_int64_t_is_signed = (!((((int64_t)-1L) > 0) != 0)); if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 1124, __pyx_L1_error) + __PYX_ERR(0, 1140, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1140, __pyx_L1_error) __pyx_t_2 = ((0 < __pyx_t_5) != 0); if (__pyx_t_2) { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1124, __pyx_L1_error) + __PYX_ERR(0, 1140, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(((PyObject*)__pyx_v_args), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(((PyObject*)__pyx_v_args), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -120208,18 +122950,18 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 1124, __pyx_L1_error) + __PYX_ERR(0, 1140, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_arr, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_arr, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) __pyx_t_3 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_3; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1124, __pyx_L1_error) + __PYX_ERR(0, 1140, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -120228,12 +122970,12 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 1124, __pyx_L1_error) + __PYX_ERR(0, 1140, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1124, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1140, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); @@ -120244,15 +122986,15 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 1124, __pyx_L1_error) + __PYX_ERR(0, 1140, __pyx_L1_error) } __pyx_L6:; while (1) { @@ -120262,7 +123004,7 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -120271,14 +123013,14 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -120300,14 +123042,14 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_2 = (__pyx_v_dtype != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_itemsize = __pyx_t_5; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_kind = __pyx_t_7; __pyx_v_dtype_signed = (__pyx_v_kind == 'i'); @@ -120320,9 +123062,9 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 4) != 0); if (__pyx_t_2) { @@ -120334,7 +123076,7 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; __pyx_L16_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint16_t)) == __pyx_v_itemsize) != 0); @@ -120343,9 +123085,9 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L20_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 4) != 0); if (__pyx_t_2) { @@ -120357,7 +123099,7 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; __pyx_L20_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint32_t)) == __pyx_v_itemsize) != 0); @@ -120366,9 +123108,9 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L24_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 4) != 0); if (__pyx_t_2) { @@ -120380,7 +123122,7 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; __pyx_L24_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint64_t)) == __pyx_v_itemsize) != 0); @@ -120389,9 +123131,9 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L28_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 4) != 0); if (__pyx_t_2) { @@ -120403,7 +123145,7 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int8_t)) == __pyx_v_itemsize) != 0); @@ -120412,9 +123154,9 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L32_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 4) != 0); if (__pyx_t_2) { @@ -120426,7 +123168,7 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; __pyx_L32_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int16_t)) == __pyx_v_itemsize) != 0); @@ -120435,9 +123177,9 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L36_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 4) != 0); if (__pyx_t_2) { @@ -120449,7 +123191,7 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; __pyx_L36_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int32_t)) == __pyx_v_itemsize) != 0); @@ -120458,9 +123200,9 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L40_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 4) != 0); if (__pyx_t_2) { @@ -120472,7 +123214,7 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; __pyx_L40_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int64_t)) == __pyx_v_itemsize) != 0); @@ -120481,9 +123223,9 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L44_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 4) != 0); if (__pyx_t_2) { @@ -120495,7 +123237,7 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; __pyx_L44_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -120506,15 +123248,15 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L48_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 4) != 0); __pyx_t_3 = __pyx_t_2; __pyx_L48_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(double)) == __pyx_v_itemsize) != 0); @@ -120523,15 +123265,15 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L51_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 4) != 0); __pyx_t_3 = __pyx_t_2; __pyx_L51_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -120542,15 +123284,15 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = __pyx_t_2; goto __pyx_L54_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 4) != 0); __pyx_t_3 = __pyx_t_2; __pyx_L54_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_float_complex, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_float_complex, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -120575,7 +123317,7 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -120597,7 +123339,7 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -120619,7 +123361,7 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -120641,7 +123383,7 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -120663,7 +123405,7 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -120685,7 +123427,7 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -120707,7 +123449,7 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -120729,7 +123471,7 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -120751,7 +123493,7 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -120773,7 +123515,7 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -120795,27 +123537,27 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_float_complex, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_float_complex, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); } } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) goto __pyx_L10_break; } __pyx_L10_break:; - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_candidates = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = 0; if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 1124, __pyx_L1_error) + __PYX_ERR(0, 1140, __pyx_L1_error) } - __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_1; @@ -120823,12 +123565,12 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, while (1) { __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_9, &__pyx_t_5, &__pyx_t_1, NULL, NULL, __pyx_t_10); if (unlikely(__pyx_t_11 == 0)) break; - if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_1); __pyx_t_1 = 0; __pyx_v_match_found = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { @@ -120842,10 +123584,10 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, } __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, __pyx_kp_s__2) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__2); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -120860,27 +123602,27 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, } __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_12, __pyx_kp_s__3) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__3); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_src_sig, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1140, __pyx_L1_error) __pyx_t_16 = __pyx_t_15; for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dest_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dest_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_v_dst_type != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_2) { __pyx_v_match_found = 1; @@ -120896,37 +123638,37 @@ static PyObject *__pyx_pf_9fastremap_60ipt4d(CYTHON_UNUSED PyObject *__pyx_self, __pyx_L103_break:; __pyx_t_2 = (__pyx_v_match_found != 0); if (__pyx_t_2) { - __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1140, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_candidates) != 0); __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 1124, __pyx_L1_error) + __PYX_ERR(0, 1140, __pyx_L1_error) } - __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1140, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_9 > 1) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 1124, __pyx_L1_error) + __PYX_ERR(0, 1140, __pyx_L1_error) } /*else*/ { __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1124, __pyx_L1_error) + __PYX_ERR(0, 1140, __pyx_L1_error) } - __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_candidates, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_candidates, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_13 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), __pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), __pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_13; @@ -120969,7 +123711,7 @@ static PyObject *__pyx_fuse_0__pyx_pw_9fastremap_543ipt4d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt4d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1140, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_542ipt4d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -121013,39 +123755,39 @@ static PyObject *__pyx_pf_9fastremap_542ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1140, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_arr.diminfo[3].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_arr.diminfo[3].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[3]; - /* "fastremap.pyx":1125 + /* "fastremap.pyx":1141 * * def ipt4d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=4] arr): * cdef COMPLEX_NUMBER[:,:,:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn_uint8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1125, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn_uint8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1141, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1132 + /* "fastremap.pyx":1148 * cdef size_t sw * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1133 + /* "fastremap.pyx":1149 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -121054,7 +123796,7 @@ static PyObject *__pyx_pf_9fastremap_542ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1134 + /* "fastremap.pyx":1150 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -121063,7 +123805,7 @@ static PyObject *__pyx_pf_9fastremap_542ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1135 + /* "fastremap.pyx":1151 * sx = arr.shape[0] * sy = arr.shape[1] * sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -121072,7 +123814,7 @@ static PyObject *__pyx_pf_9fastremap_542ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1136 + /* "fastremap.pyx":1152 * sy = arr.shape[1] * sz = arr.shape[2] * sw = arr.shape[3] # <<<<<<<<<<<<<< @@ -121081,7 +123823,7 @@ static PyObject *__pyx_pf_9fastremap_542ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sw = (__pyx_v_arr->dimensions[3]); - /* "fastremap.pyx":1132 + /* "fastremap.pyx":1148 * cdef size_t sw * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -121091,7 +123833,7 @@ static PyObject *__pyx_pf_9fastremap_542ipt4d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1138 + /* "fastremap.pyx":1154 * sw = arr.shape[3] * else: * sx = arr.shape[3] # <<<<<<<<<<<<<< @@ -121101,7 +123843,7 @@ static PyObject *__pyx_pf_9fastremap_542ipt4d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[3]); - /* "fastremap.pyx":1139 + /* "fastremap.pyx":1155 * else: * sx = arr.shape[3] * sy = arr.shape[2] # <<<<<<<<<<<<<< @@ -121110,7 +123852,7 @@ static PyObject *__pyx_pf_9fastremap_542ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1140 + /* "fastremap.pyx":1156 * sx = arr.shape[3] * sy = arr.shape[2] * sz = arr.shape[1] # <<<<<<<<<<<<<< @@ -121119,7 +123861,7 @@ static PyObject *__pyx_pf_9fastremap_542ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1141 + /* "fastremap.pyx":1157 * sy = arr.shape[2] * sz = arr.shape[1] * sw = arr.shape[0] # <<<<<<<<<<<<<< @@ -121130,19 +123872,19 @@ static PyObject *__pyx_pf_9fastremap_542ipt4d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1143 + /* "fastremap.pyx":1159 * sw = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -121157,17 +123899,17 @@ static PyObject *__pyx_pf_9fastremap_542ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1143, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1148 + /* "fastremap.pyx":1164 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -121177,7 +123919,7 @@ static PyObject *__pyx_pf_9fastremap_542ipt4d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1150 + /* "fastremap.pyx":1166 * if nbytes == 1: * _ipt4d[uint8_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -121207,10 +123949,10 @@ static PyObject *__pyx_pf_9fastremap_542ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_11 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1150, __pyx_L1_error) + __PYX_ERR(0, 1166, __pyx_L1_error) } - /* "fastremap.pyx":1149 + /* "fastremap.pyx":1165 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt4d[uint8_t]( # <<<<<<<<<<<<<< @@ -121219,7 +123961,7 @@ static PyObject *__pyx_pf_9fastremap_542ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint8_t *)(&(*((uint8_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ) + __pyx_t_11 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1148 + /* "fastremap.pyx":1164 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -121229,7 +123971,7 @@ static PyObject *__pyx_pf_9fastremap_542ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1155 + /* "fastremap.pyx":1171 * elif nbytes == 2: * _ipt4d[uint16_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -121259,10 +124001,10 @@ static PyObject *__pyx_pf_9fastremap_542ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1155, __pyx_L1_error) + __PYX_ERR(0, 1171, __pyx_L1_error) } - /* "fastremap.pyx":1154 + /* "fastremap.pyx":1170 * ) * elif nbytes == 2: * _ipt4d[uint16_t]( # <<<<<<<<<<<<<< @@ -121271,7 +124013,7 @@ static PyObject *__pyx_pf_9fastremap_542ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint16_t *)(&(*((uint8_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ) + __pyx_t_10 * __pyx_v_arrview.strides[1]) ) + __pyx_t_9 * __pyx_v_arrview.strides[2]) ) + __pyx_t_8 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1153 + /* "fastremap.pyx":1169 * sx, sy, sz, sw * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -121281,7 +124023,7 @@ static PyObject *__pyx_pf_9fastremap_542ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1160 + /* "fastremap.pyx":1176 * elif nbytes == 4: * _ipt4d[uint32_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -121311,10 +124053,10 @@ static PyObject *__pyx_pf_9fastremap_542ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_11 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1160, __pyx_L1_error) + __PYX_ERR(0, 1176, __pyx_L1_error) } - /* "fastremap.pyx":1159 + /* "fastremap.pyx":1175 * ) * elif nbytes == 4: * _ipt4d[uint32_t]( # <<<<<<<<<<<<<< @@ -121323,7 +124065,7 @@ static PyObject *__pyx_pf_9fastremap_542ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint32_t *)(&(*((uint8_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ) + __pyx_t_11 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1158 + /* "fastremap.pyx":1174 * sx, sy, sz, sw * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -121333,7 +124075,7 @@ static PyObject *__pyx_pf_9fastremap_542ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1165 + /* "fastremap.pyx":1181 * else: * _ipt4d[uint64_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -121363,10 +124105,10 @@ static PyObject *__pyx_pf_9fastremap_542ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1165, __pyx_L1_error) + __PYX_ERR(0, 1181, __pyx_L1_error) } - /* "fastremap.pyx":1164 + /* "fastremap.pyx":1180 * ) * else: * _ipt4d[uint64_t]( # <<<<<<<<<<<<<< @@ -121377,7 +124119,7 @@ static PyObject *__pyx_pf_9fastremap_542ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1169 + /* "fastremap.pyx":1185 * ) * * return arr # <<<<<<<<<<<<<< @@ -121389,7 +124131,7 @@ static PyObject *__pyx_pf_9fastremap_542ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1124 + /* "fastremap.pyx":1140 * return arr * * def ipt4d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=4] arr): # <<<<<<<<<<<<<< @@ -121432,7 +124174,7 @@ static PyObject *__pyx_fuse_1__pyx_pw_9fastremap_545ipt4d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt4d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1140, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_544ipt4d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -121476,39 +124218,39 @@ static PyObject *__pyx_pf_9fastremap_544ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1140, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_arr.diminfo[3].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_arr.diminfo[3].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[3]; - /* "fastremap.pyx":1125 + /* "fastremap.pyx":1141 * * def ipt4d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=4] arr): * cdef COMPLEX_NUMBER[:,:,:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn_uint16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1125, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn_uint16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1141, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1132 + /* "fastremap.pyx":1148 * cdef size_t sw * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1133 + /* "fastremap.pyx":1149 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -121517,7 +124259,7 @@ static PyObject *__pyx_pf_9fastremap_544ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1134 + /* "fastremap.pyx":1150 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -121526,7 +124268,7 @@ static PyObject *__pyx_pf_9fastremap_544ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1135 + /* "fastremap.pyx":1151 * sx = arr.shape[0] * sy = arr.shape[1] * sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -121535,7 +124277,7 @@ static PyObject *__pyx_pf_9fastremap_544ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1136 + /* "fastremap.pyx":1152 * sy = arr.shape[1] * sz = arr.shape[2] * sw = arr.shape[3] # <<<<<<<<<<<<<< @@ -121544,7 +124286,7 @@ static PyObject *__pyx_pf_9fastremap_544ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sw = (__pyx_v_arr->dimensions[3]); - /* "fastremap.pyx":1132 + /* "fastremap.pyx":1148 * cdef size_t sw * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -121554,7 +124296,7 @@ static PyObject *__pyx_pf_9fastremap_544ipt4d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1138 + /* "fastremap.pyx":1154 * sw = arr.shape[3] * else: * sx = arr.shape[3] # <<<<<<<<<<<<<< @@ -121564,7 +124306,7 @@ static PyObject *__pyx_pf_9fastremap_544ipt4d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[3]); - /* "fastremap.pyx":1139 + /* "fastremap.pyx":1155 * else: * sx = arr.shape[3] * sy = arr.shape[2] # <<<<<<<<<<<<<< @@ -121573,7 +124315,7 @@ static PyObject *__pyx_pf_9fastremap_544ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1140 + /* "fastremap.pyx":1156 * sx = arr.shape[3] * sy = arr.shape[2] * sz = arr.shape[1] # <<<<<<<<<<<<<< @@ -121582,7 +124324,7 @@ static PyObject *__pyx_pf_9fastremap_544ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1141 + /* "fastremap.pyx":1157 * sy = arr.shape[2] * sz = arr.shape[1] * sw = arr.shape[0] # <<<<<<<<<<<<<< @@ -121593,19 +124335,19 @@ static PyObject *__pyx_pf_9fastremap_544ipt4d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1143 + /* "fastremap.pyx":1159 * sw = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -121620,17 +124362,17 @@ static PyObject *__pyx_pf_9fastremap_544ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1143, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1148 + /* "fastremap.pyx":1164 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -121640,7 +124382,7 @@ static PyObject *__pyx_pf_9fastremap_544ipt4d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1150 + /* "fastremap.pyx":1166 * if nbytes == 1: * _ipt4d[uint8_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -121670,10 +124412,10 @@ static PyObject *__pyx_pf_9fastremap_544ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_11 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1150, __pyx_L1_error) + __PYX_ERR(0, 1166, __pyx_L1_error) } - /* "fastremap.pyx":1149 + /* "fastremap.pyx":1165 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt4d[uint8_t]( # <<<<<<<<<<<<<< @@ -121682,7 +124424,7 @@ static PyObject *__pyx_pf_9fastremap_544ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint8_t *)(&(*((uint16_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ) + __pyx_t_11 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1148 + /* "fastremap.pyx":1164 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -121692,7 +124434,7 @@ static PyObject *__pyx_pf_9fastremap_544ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1155 + /* "fastremap.pyx":1171 * elif nbytes == 2: * _ipt4d[uint16_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -121722,10 +124464,10 @@ static PyObject *__pyx_pf_9fastremap_544ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1155, __pyx_L1_error) + __PYX_ERR(0, 1171, __pyx_L1_error) } - /* "fastremap.pyx":1154 + /* "fastremap.pyx":1170 * ) * elif nbytes == 2: * _ipt4d[uint16_t]( # <<<<<<<<<<<<<< @@ -121734,7 +124476,7 @@ static PyObject *__pyx_pf_9fastremap_544ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint16_t *)(&(*((uint16_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ) + __pyx_t_10 * __pyx_v_arrview.strides[1]) ) + __pyx_t_9 * __pyx_v_arrview.strides[2]) ) + __pyx_t_8 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1153 + /* "fastremap.pyx":1169 * sx, sy, sz, sw * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -121744,7 +124486,7 @@ static PyObject *__pyx_pf_9fastremap_544ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1160 + /* "fastremap.pyx":1176 * elif nbytes == 4: * _ipt4d[uint32_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -121774,10 +124516,10 @@ static PyObject *__pyx_pf_9fastremap_544ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_11 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1160, __pyx_L1_error) + __PYX_ERR(0, 1176, __pyx_L1_error) } - /* "fastremap.pyx":1159 + /* "fastremap.pyx":1175 * ) * elif nbytes == 4: * _ipt4d[uint32_t]( # <<<<<<<<<<<<<< @@ -121786,7 +124528,7 @@ static PyObject *__pyx_pf_9fastremap_544ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint32_t *)(&(*((uint16_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ) + __pyx_t_11 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1158 + /* "fastremap.pyx":1174 * sx, sy, sz, sw * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -121796,7 +124538,7 @@ static PyObject *__pyx_pf_9fastremap_544ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1165 + /* "fastremap.pyx":1181 * else: * _ipt4d[uint64_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -121826,10 +124568,10 @@ static PyObject *__pyx_pf_9fastremap_544ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1165, __pyx_L1_error) + __PYX_ERR(0, 1181, __pyx_L1_error) } - /* "fastremap.pyx":1164 + /* "fastremap.pyx":1180 * ) * else: * _ipt4d[uint64_t]( # <<<<<<<<<<<<<< @@ -121840,7 +124582,7 @@ static PyObject *__pyx_pf_9fastremap_544ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1169 + /* "fastremap.pyx":1185 * ) * * return arr # <<<<<<<<<<<<<< @@ -121852,7 +124594,7 @@ static PyObject *__pyx_pf_9fastremap_544ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1124 + /* "fastremap.pyx":1140 * return arr * * def ipt4d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=4] arr): # <<<<<<<<<<<<<< @@ -121895,7 +124637,7 @@ static PyObject *__pyx_fuse_2__pyx_pw_9fastremap_547ipt4d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt4d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1140, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_546ipt4d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -121939,39 +124681,39 @@ static PyObject *__pyx_pf_9fastremap_546ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1140, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_arr.diminfo[3].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_arr.diminfo[3].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[3]; - /* "fastremap.pyx":1125 + /* "fastremap.pyx":1141 * * def ipt4d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=4] arr): * cdef COMPLEX_NUMBER[:,:,:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn_uint32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1125, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn_uint32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1141, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1132 + /* "fastremap.pyx":1148 * cdef size_t sw * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1133 + /* "fastremap.pyx":1149 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -121980,7 +124722,7 @@ static PyObject *__pyx_pf_9fastremap_546ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1134 + /* "fastremap.pyx":1150 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -121989,7 +124731,7 @@ static PyObject *__pyx_pf_9fastremap_546ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1135 + /* "fastremap.pyx":1151 * sx = arr.shape[0] * sy = arr.shape[1] * sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -121998,7 +124740,7 @@ static PyObject *__pyx_pf_9fastremap_546ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1136 + /* "fastremap.pyx":1152 * sy = arr.shape[1] * sz = arr.shape[2] * sw = arr.shape[3] # <<<<<<<<<<<<<< @@ -122007,7 +124749,7 @@ static PyObject *__pyx_pf_9fastremap_546ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sw = (__pyx_v_arr->dimensions[3]); - /* "fastremap.pyx":1132 + /* "fastremap.pyx":1148 * cdef size_t sw * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -122017,7 +124759,7 @@ static PyObject *__pyx_pf_9fastremap_546ipt4d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1138 + /* "fastremap.pyx":1154 * sw = arr.shape[3] * else: * sx = arr.shape[3] # <<<<<<<<<<<<<< @@ -122027,7 +124769,7 @@ static PyObject *__pyx_pf_9fastremap_546ipt4d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[3]); - /* "fastremap.pyx":1139 + /* "fastremap.pyx":1155 * else: * sx = arr.shape[3] * sy = arr.shape[2] # <<<<<<<<<<<<<< @@ -122036,7 +124778,7 @@ static PyObject *__pyx_pf_9fastremap_546ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1140 + /* "fastremap.pyx":1156 * sx = arr.shape[3] * sy = arr.shape[2] * sz = arr.shape[1] # <<<<<<<<<<<<<< @@ -122045,7 +124787,7 @@ static PyObject *__pyx_pf_9fastremap_546ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1141 + /* "fastremap.pyx":1157 * sy = arr.shape[2] * sz = arr.shape[1] * sw = arr.shape[0] # <<<<<<<<<<<<<< @@ -122056,19 +124798,19 @@ static PyObject *__pyx_pf_9fastremap_546ipt4d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1143 + /* "fastremap.pyx":1159 * sw = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -122083,17 +124825,17 @@ static PyObject *__pyx_pf_9fastremap_546ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1143, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1148 + /* "fastremap.pyx":1164 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -122103,7 +124845,7 @@ static PyObject *__pyx_pf_9fastremap_546ipt4d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1150 + /* "fastremap.pyx":1166 * if nbytes == 1: * _ipt4d[uint8_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -122133,10 +124875,10 @@ static PyObject *__pyx_pf_9fastremap_546ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_11 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1150, __pyx_L1_error) + __PYX_ERR(0, 1166, __pyx_L1_error) } - /* "fastremap.pyx":1149 + /* "fastremap.pyx":1165 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt4d[uint8_t]( # <<<<<<<<<<<<<< @@ -122145,7 +124887,7 @@ static PyObject *__pyx_pf_9fastremap_546ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint8_t *)(&(*((uint32_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ) + __pyx_t_11 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1148 + /* "fastremap.pyx":1164 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -122155,7 +124897,7 @@ static PyObject *__pyx_pf_9fastremap_546ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1155 + /* "fastremap.pyx":1171 * elif nbytes == 2: * _ipt4d[uint16_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -122185,10 +124927,10 @@ static PyObject *__pyx_pf_9fastremap_546ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1155, __pyx_L1_error) + __PYX_ERR(0, 1171, __pyx_L1_error) } - /* "fastremap.pyx":1154 + /* "fastremap.pyx":1170 * ) * elif nbytes == 2: * _ipt4d[uint16_t]( # <<<<<<<<<<<<<< @@ -122197,7 +124939,7 @@ static PyObject *__pyx_pf_9fastremap_546ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint16_t *)(&(*((uint32_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ) + __pyx_t_10 * __pyx_v_arrview.strides[1]) ) + __pyx_t_9 * __pyx_v_arrview.strides[2]) ) + __pyx_t_8 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1153 + /* "fastremap.pyx":1169 * sx, sy, sz, sw * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -122207,7 +124949,7 @@ static PyObject *__pyx_pf_9fastremap_546ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1160 + /* "fastremap.pyx":1176 * elif nbytes == 4: * _ipt4d[uint32_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -122237,10 +124979,10 @@ static PyObject *__pyx_pf_9fastremap_546ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_11 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1160, __pyx_L1_error) + __PYX_ERR(0, 1176, __pyx_L1_error) } - /* "fastremap.pyx":1159 + /* "fastremap.pyx":1175 * ) * elif nbytes == 4: * _ipt4d[uint32_t]( # <<<<<<<<<<<<<< @@ -122249,7 +124991,7 @@ static PyObject *__pyx_pf_9fastremap_546ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint32_t *)(&(*((uint32_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ) + __pyx_t_11 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1158 + /* "fastremap.pyx":1174 * sx, sy, sz, sw * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -122259,7 +125001,7 @@ static PyObject *__pyx_pf_9fastremap_546ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1165 + /* "fastremap.pyx":1181 * else: * _ipt4d[uint64_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -122289,10 +125031,10 @@ static PyObject *__pyx_pf_9fastremap_546ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1165, __pyx_L1_error) + __PYX_ERR(0, 1181, __pyx_L1_error) } - /* "fastremap.pyx":1164 + /* "fastremap.pyx":1180 * ) * else: * _ipt4d[uint64_t]( # <<<<<<<<<<<<<< @@ -122303,7 +125045,7 @@ static PyObject *__pyx_pf_9fastremap_546ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1169 + /* "fastremap.pyx":1185 * ) * * return arr # <<<<<<<<<<<<<< @@ -122315,7 +125057,7 @@ static PyObject *__pyx_pf_9fastremap_546ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1124 + /* "fastremap.pyx":1140 * return arr * * def ipt4d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=4] arr): # <<<<<<<<<<<<<< @@ -122358,7 +125100,7 @@ static PyObject *__pyx_fuse_3__pyx_pw_9fastremap_549ipt4d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt4d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1140, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_548ipt4d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -122402,39 +125144,39 @@ static PyObject *__pyx_pf_9fastremap_548ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1140, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_arr.diminfo[3].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_arr.diminfo[3].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[3]; - /* "fastremap.pyx":1125 + /* "fastremap.pyx":1141 * * def ipt4d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=4] arr): * cdef COMPLEX_NUMBER[:,:,:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn_uint64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1125, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn_uint64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1141, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1132 + /* "fastremap.pyx":1148 * cdef size_t sw * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1133 + /* "fastremap.pyx":1149 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -122443,7 +125185,7 @@ static PyObject *__pyx_pf_9fastremap_548ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1134 + /* "fastremap.pyx":1150 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -122452,7 +125194,7 @@ static PyObject *__pyx_pf_9fastremap_548ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1135 + /* "fastremap.pyx":1151 * sx = arr.shape[0] * sy = arr.shape[1] * sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -122461,7 +125203,7 @@ static PyObject *__pyx_pf_9fastremap_548ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1136 + /* "fastremap.pyx":1152 * sy = arr.shape[1] * sz = arr.shape[2] * sw = arr.shape[3] # <<<<<<<<<<<<<< @@ -122470,7 +125212,7 @@ static PyObject *__pyx_pf_9fastremap_548ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sw = (__pyx_v_arr->dimensions[3]); - /* "fastremap.pyx":1132 + /* "fastremap.pyx":1148 * cdef size_t sw * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -122480,7 +125222,7 @@ static PyObject *__pyx_pf_9fastremap_548ipt4d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1138 + /* "fastremap.pyx":1154 * sw = arr.shape[3] * else: * sx = arr.shape[3] # <<<<<<<<<<<<<< @@ -122490,7 +125232,7 @@ static PyObject *__pyx_pf_9fastremap_548ipt4d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[3]); - /* "fastremap.pyx":1139 + /* "fastremap.pyx":1155 * else: * sx = arr.shape[3] * sy = arr.shape[2] # <<<<<<<<<<<<<< @@ -122499,7 +125241,7 @@ static PyObject *__pyx_pf_9fastremap_548ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1140 + /* "fastremap.pyx":1156 * sx = arr.shape[3] * sy = arr.shape[2] * sz = arr.shape[1] # <<<<<<<<<<<<<< @@ -122508,7 +125250,7 @@ static PyObject *__pyx_pf_9fastremap_548ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1141 + /* "fastremap.pyx":1157 * sy = arr.shape[2] * sz = arr.shape[1] * sw = arr.shape[0] # <<<<<<<<<<<<<< @@ -122519,19 +125261,19 @@ static PyObject *__pyx_pf_9fastremap_548ipt4d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1143 + /* "fastremap.pyx":1159 * sw = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -122546,17 +125288,17 @@ static PyObject *__pyx_pf_9fastremap_548ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1143, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1148 + /* "fastremap.pyx":1164 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -122566,7 +125308,7 @@ static PyObject *__pyx_pf_9fastremap_548ipt4d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1150 + /* "fastremap.pyx":1166 * if nbytes == 1: * _ipt4d[uint8_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -122596,10 +125338,10 @@ static PyObject *__pyx_pf_9fastremap_548ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_11 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1150, __pyx_L1_error) + __PYX_ERR(0, 1166, __pyx_L1_error) } - /* "fastremap.pyx":1149 + /* "fastremap.pyx":1165 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt4d[uint8_t]( # <<<<<<<<<<<<<< @@ -122608,7 +125350,7 @@ static PyObject *__pyx_pf_9fastremap_548ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint8_t *)(&(*((uint64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ) + __pyx_t_11 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1148 + /* "fastremap.pyx":1164 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -122618,7 +125360,7 @@ static PyObject *__pyx_pf_9fastremap_548ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1155 + /* "fastremap.pyx":1171 * elif nbytes == 2: * _ipt4d[uint16_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -122648,10 +125390,10 @@ static PyObject *__pyx_pf_9fastremap_548ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1155, __pyx_L1_error) + __PYX_ERR(0, 1171, __pyx_L1_error) } - /* "fastremap.pyx":1154 + /* "fastremap.pyx":1170 * ) * elif nbytes == 2: * _ipt4d[uint16_t]( # <<<<<<<<<<<<<< @@ -122660,7 +125402,7 @@ static PyObject *__pyx_pf_9fastremap_548ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint16_t *)(&(*((uint64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ) + __pyx_t_10 * __pyx_v_arrview.strides[1]) ) + __pyx_t_9 * __pyx_v_arrview.strides[2]) ) + __pyx_t_8 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1153 + /* "fastremap.pyx":1169 * sx, sy, sz, sw * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -122670,7 +125412,7 @@ static PyObject *__pyx_pf_9fastremap_548ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1160 + /* "fastremap.pyx":1176 * elif nbytes == 4: * _ipt4d[uint32_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -122700,10 +125442,10 @@ static PyObject *__pyx_pf_9fastremap_548ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_11 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1160, __pyx_L1_error) + __PYX_ERR(0, 1176, __pyx_L1_error) } - /* "fastremap.pyx":1159 + /* "fastremap.pyx":1175 * ) * elif nbytes == 4: * _ipt4d[uint32_t]( # <<<<<<<<<<<<<< @@ -122712,7 +125454,7 @@ static PyObject *__pyx_pf_9fastremap_548ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint32_t *)(&(*((uint64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ) + __pyx_t_11 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1158 + /* "fastremap.pyx":1174 * sx, sy, sz, sw * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -122722,7 +125464,7 @@ static PyObject *__pyx_pf_9fastremap_548ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1165 + /* "fastremap.pyx":1181 * else: * _ipt4d[uint64_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -122752,10 +125494,10 @@ static PyObject *__pyx_pf_9fastremap_548ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1165, __pyx_L1_error) + __PYX_ERR(0, 1181, __pyx_L1_error) } - /* "fastremap.pyx":1164 + /* "fastremap.pyx":1180 * ) * else: * _ipt4d[uint64_t]( # <<<<<<<<<<<<<< @@ -122766,7 +125508,7 @@ static PyObject *__pyx_pf_9fastremap_548ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1169 + /* "fastremap.pyx":1185 * ) * * return arr # <<<<<<<<<<<<<< @@ -122778,7 +125520,7 @@ static PyObject *__pyx_pf_9fastremap_548ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1124 + /* "fastremap.pyx":1140 * return arr * * def ipt4d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=4] arr): # <<<<<<<<<<<<<< @@ -122821,7 +125563,7 @@ static PyObject *__pyx_fuse_4__pyx_pw_9fastremap_551ipt4d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt4d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1140, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_550ipt4d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -122865,39 +125607,39 @@ static PyObject *__pyx_pf_9fastremap_550ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1140, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_arr.diminfo[3].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_arr.diminfo[3].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[3]; - /* "fastremap.pyx":1125 + /* "fastremap.pyx":1141 * * def ipt4d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=4] arr): * cdef COMPLEX_NUMBER[:,:,:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn_int8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1125, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn_int8_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1141, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1132 + /* "fastremap.pyx":1148 * cdef size_t sw * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1133 + /* "fastremap.pyx":1149 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -122906,7 +125648,7 @@ static PyObject *__pyx_pf_9fastremap_550ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1134 + /* "fastremap.pyx":1150 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -122915,7 +125657,7 @@ static PyObject *__pyx_pf_9fastremap_550ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1135 + /* "fastremap.pyx":1151 * sx = arr.shape[0] * sy = arr.shape[1] * sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -122924,7 +125666,7 @@ static PyObject *__pyx_pf_9fastremap_550ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1136 + /* "fastremap.pyx":1152 * sy = arr.shape[1] * sz = arr.shape[2] * sw = arr.shape[3] # <<<<<<<<<<<<<< @@ -122933,7 +125675,7 @@ static PyObject *__pyx_pf_9fastremap_550ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sw = (__pyx_v_arr->dimensions[3]); - /* "fastremap.pyx":1132 + /* "fastremap.pyx":1148 * cdef size_t sw * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -122943,7 +125685,7 @@ static PyObject *__pyx_pf_9fastremap_550ipt4d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1138 + /* "fastremap.pyx":1154 * sw = arr.shape[3] * else: * sx = arr.shape[3] # <<<<<<<<<<<<<< @@ -122953,7 +125695,7 @@ static PyObject *__pyx_pf_9fastremap_550ipt4d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[3]); - /* "fastremap.pyx":1139 + /* "fastremap.pyx":1155 * else: * sx = arr.shape[3] * sy = arr.shape[2] # <<<<<<<<<<<<<< @@ -122962,7 +125704,7 @@ static PyObject *__pyx_pf_9fastremap_550ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1140 + /* "fastremap.pyx":1156 * sx = arr.shape[3] * sy = arr.shape[2] * sz = arr.shape[1] # <<<<<<<<<<<<<< @@ -122971,7 +125713,7 @@ static PyObject *__pyx_pf_9fastremap_550ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1141 + /* "fastremap.pyx":1157 * sy = arr.shape[2] * sz = arr.shape[1] * sw = arr.shape[0] # <<<<<<<<<<<<<< @@ -122982,19 +125724,19 @@ static PyObject *__pyx_pf_9fastremap_550ipt4d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1143 + /* "fastremap.pyx":1159 * sw = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -123009,17 +125751,17 @@ static PyObject *__pyx_pf_9fastremap_550ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1143, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1148 + /* "fastremap.pyx":1164 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -123029,7 +125771,7 @@ static PyObject *__pyx_pf_9fastremap_550ipt4d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1150 + /* "fastremap.pyx":1166 * if nbytes == 1: * _ipt4d[uint8_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -123059,10 +125801,10 @@ static PyObject *__pyx_pf_9fastremap_550ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_11 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1150, __pyx_L1_error) + __PYX_ERR(0, 1166, __pyx_L1_error) } - /* "fastremap.pyx":1149 + /* "fastremap.pyx":1165 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt4d[uint8_t]( # <<<<<<<<<<<<<< @@ -123071,7 +125813,7 @@ static PyObject *__pyx_pf_9fastremap_550ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint8_t *)(&(*((int8_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ) + __pyx_t_11 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1148 + /* "fastremap.pyx":1164 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -123081,7 +125823,7 @@ static PyObject *__pyx_pf_9fastremap_550ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1155 + /* "fastremap.pyx":1171 * elif nbytes == 2: * _ipt4d[uint16_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -123111,10 +125853,10 @@ static PyObject *__pyx_pf_9fastremap_550ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1155, __pyx_L1_error) + __PYX_ERR(0, 1171, __pyx_L1_error) } - /* "fastremap.pyx":1154 + /* "fastremap.pyx":1170 * ) * elif nbytes == 2: * _ipt4d[uint16_t]( # <<<<<<<<<<<<<< @@ -123123,7 +125865,7 @@ static PyObject *__pyx_pf_9fastremap_550ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint16_t *)(&(*((int8_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ) + __pyx_t_10 * __pyx_v_arrview.strides[1]) ) + __pyx_t_9 * __pyx_v_arrview.strides[2]) ) + __pyx_t_8 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1153 + /* "fastremap.pyx":1169 * sx, sy, sz, sw * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -123133,7 +125875,7 @@ static PyObject *__pyx_pf_9fastremap_550ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1160 + /* "fastremap.pyx":1176 * elif nbytes == 4: * _ipt4d[uint32_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -123163,10 +125905,10 @@ static PyObject *__pyx_pf_9fastremap_550ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_11 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1160, __pyx_L1_error) + __PYX_ERR(0, 1176, __pyx_L1_error) } - /* "fastremap.pyx":1159 + /* "fastremap.pyx":1175 * ) * elif nbytes == 4: * _ipt4d[uint32_t]( # <<<<<<<<<<<<<< @@ -123175,7 +125917,7 @@ static PyObject *__pyx_pf_9fastremap_550ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint32_t *)(&(*((int8_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ) + __pyx_t_11 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1158 + /* "fastremap.pyx":1174 * sx, sy, sz, sw * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -123185,7 +125927,7 @@ static PyObject *__pyx_pf_9fastremap_550ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1165 + /* "fastremap.pyx":1181 * else: * _ipt4d[uint64_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -123215,10 +125957,10 @@ static PyObject *__pyx_pf_9fastremap_550ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1165, __pyx_L1_error) + __PYX_ERR(0, 1181, __pyx_L1_error) } - /* "fastremap.pyx":1164 + /* "fastremap.pyx":1180 * ) * else: * _ipt4d[uint64_t]( # <<<<<<<<<<<<<< @@ -123229,7 +125971,7 @@ static PyObject *__pyx_pf_9fastremap_550ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1169 + /* "fastremap.pyx":1185 * ) * * return arr # <<<<<<<<<<<<<< @@ -123241,7 +125983,7 @@ static PyObject *__pyx_pf_9fastremap_550ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1124 + /* "fastremap.pyx":1140 * return arr * * def ipt4d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=4] arr): # <<<<<<<<<<<<<< @@ -123284,7 +126026,7 @@ static PyObject *__pyx_fuse_5__pyx_pw_9fastremap_553ipt4d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt4d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1140, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_552ipt4d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -123328,39 +126070,39 @@ static PyObject *__pyx_pf_9fastremap_552ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1140, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_arr.diminfo[3].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_arr.diminfo[3].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[3]; - /* "fastremap.pyx":1125 + /* "fastremap.pyx":1141 * * def ipt4d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=4] arr): * cdef COMPLEX_NUMBER[:,:,:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn_int16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1125, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn_int16_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1141, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1132 + /* "fastremap.pyx":1148 * cdef size_t sw * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1133 + /* "fastremap.pyx":1149 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -123369,7 +126111,7 @@ static PyObject *__pyx_pf_9fastremap_552ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1134 + /* "fastremap.pyx":1150 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -123378,7 +126120,7 @@ static PyObject *__pyx_pf_9fastremap_552ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1135 + /* "fastremap.pyx":1151 * sx = arr.shape[0] * sy = arr.shape[1] * sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -123387,7 +126129,7 @@ static PyObject *__pyx_pf_9fastremap_552ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1136 + /* "fastremap.pyx":1152 * sy = arr.shape[1] * sz = arr.shape[2] * sw = arr.shape[3] # <<<<<<<<<<<<<< @@ -123396,7 +126138,7 @@ static PyObject *__pyx_pf_9fastremap_552ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sw = (__pyx_v_arr->dimensions[3]); - /* "fastremap.pyx":1132 + /* "fastremap.pyx":1148 * cdef size_t sw * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -123406,7 +126148,7 @@ static PyObject *__pyx_pf_9fastremap_552ipt4d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1138 + /* "fastremap.pyx":1154 * sw = arr.shape[3] * else: * sx = arr.shape[3] # <<<<<<<<<<<<<< @@ -123416,7 +126158,7 @@ static PyObject *__pyx_pf_9fastremap_552ipt4d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[3]); - /* "fastremap.pyx":1139 + /* "fastremap.pyx":1155 * else: * sx = arr.shape[3] * sy = arr.shape[2] # <<<<<<<<<<<<<< @@ -123425,7 +126167,7 @@ static PyObject *__pyx_pf_9fastremap_552ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1140 + /* "fastremap.pyx":1156 * sx = arr.shape[3] * sy = arr.shape[2] * sz = arr.shape[1] # <<<<<<<<<<<<<< @@ -123434,7 +126176,7 @@ static PyObject *__pyx_pf_9fastremap_552ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1141 + /* "fastremap.pyx":1157 * sy = arr.shape[2] * sz = arr.shape[1] * sw = arr.shape[0] # <<<<<<<<<<<<<< @@ -123445,19 +126187,19 @@ static PyObject *__pyx_pf_9fastremap_552ipt4d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1143 + /* "fastremap.pyx":1159 * sw = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -123472,17 +126214,17 @@ static PyObject *__pyx_pf_9fastremap_552ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1143, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1148 + /* "fastremap.pyx":1164 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -123492,7 +126234,7 @@ static PyObject *__pyx_pf_9fastremap_552ipt4d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1150 + /* "fastremap.pyx":1166 * if nbytes == 1: * _ipt4d[uint8_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -123522,10 +126264,10 @@ static PyObject *__pyx_pf_9fastremap_552ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_11 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1150, __pyx_L1_error) + __PYX_ERR(0, 1166, __pyx_L1_error) } - /* "fastremap.pyx":1149 + /* "fastremap.pyx":1165 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt4d[uint8_t]( # <<<<<<<<<<<<<< @@ -123534,7 +126276,7 @@ static PyObject *__pyx_pf_9fastremap_552ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint8_t *)(&(*((int16_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ) + __pyx_t_11 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1148 + /* "fastremap.pyx":1164 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -123544,7 +126286,7 @@ static PyObject *__pyx_pf_9fastremap_552ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1155 + /* "fastremap.pyx":1171 * elif nbytes == 2: * _ipt4d[uint16_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -123574,10 +126316,10 @@ static PyObject *__pyx_pf_9fastremap_552ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1155, __pyx_L1_error) + __PYX_ERR(0, 1171, __pyx_L1_error) } - /* "fastremap.pyx":1154 + /* "fastremap.pyx":1170 * ) * elif nbytes == 2: * _ipt4d[uint16_t]( # <<<<<<<<<<<<<< @@ -123586,7 +126328,7 @@ static PyObject *__pyx_pf_9fastremap_552ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint16_t *)(&(*((int16_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ) + __pyx_t_10 * __pyx_v_arrview.strides[1]) ) + __pyx_t_9 * __pyx_v_arrview.strides[2]) ) + __pyx_t_8 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1153 + /* "fastremap.pyx":1169 * sx, sy, sz, sw * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -123596,7 +126338,7 @@ static PyObject *__pyx_pf_9fastremap_552ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1160 + /* "fastremap.pyx":1176 * elif nbytes == 4: * _ipt4d[uint32_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -123626,10 +126368,10 @@ static PyObject *__pyx_pf_9fastremap_552ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_11 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1160, __pyx_L1_error) + __PYX_ERR(0, 1176, __pyx_L1_error) } - /* "fastremap.pyx":1159 + /* "fastremap.pyx":1175 * ) * elif nbytes == 4: * _ipt4d[uint32_t]( # <<<<<<<<<<<<<< @@ -123638,7 +126380,7 @@ static PyObject *__pyx_pf_9fastremap_552ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint32_t *)(&(*((int16_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ) + __pyx_t_11 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1158 + /* "fastremap.pyx":1174 * sx, sy, sz, sw * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -123648,7 +126390,7 @@ static PyObject *__pyx_pf_9fastremap_552ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1165 + /* "fastremap.pyx":1181 * else: * _ipt4d[uint64_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -123678,10 +126420,10 @@ static PyObject *__pyx_pf_9fastremap_552ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1165, __pyx_L1_error) + __PYX_ERR(0, 1181, __pyx_L1_error) } - /* "fastremap.pyx":1164 + /* "fastremap.pyx":1180 * ) * else: * _ipt4d[uint64_t]( # <<<<<<<<<<<<<< @@ -123692,7 +126434,7 @@ static PyObject *__pyx_pf_9fastremap_552ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1169 + /* "fastremap.pyx":1185 * ) * * return arr # <<<<<<<<<<<<<< @@ -123704,7 +126446,7 @@ static PyObject *__pyx_pf_9fastremap_552ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1124 + /* "fastremap.pyx":1140 * return arr * * def ipt4d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=4] arr): # <<<<<<<<<<<<<< @@ -123747,7 +126489,7 @@ static PyObject *__pyx_fuse_6__pyx_pw_9fastremap_555ipt4d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt4d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1140, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_554ipt4d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -123791,39 +126533,39 @@ static PyObject *__pyx_pf_9fastremap_554ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1140, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_arr.diminfo[3].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_arr.diminfo[3].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[3]; - /* "fastremap.pyx":1125 + /* "fastremap.pyx":1141 * * def ipt4d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=4] arr): * cdef COMPLEX_NUMBER[:,:,:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn_int32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1125, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn_int32_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1141, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1132 + /* "fastremap.pyx":1148 * cdef size_t sw * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1133 + /* "fastremap.pyx":1149 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -123832,7 +126574,7 @@ static PyObject *__pyx_pf_9fastremap_554ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1134 + /* "fastremap.pyx":1150 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -123841,7 +126583,7 @@ static PyObject *__pyx_pf_9fastremap_554ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1135 + /* "fastremap.pyx":1151 * sx = arr.shape[0] * sy = arr.shape[1] * sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -123850,7 +126592,7 @@ static PyObject *__pyx_pf_9fastremap_554ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1136 + /* "fastremap.pyx":1152 * sy = arr.shape[1] * sz = arr.shape[2] * sw = arr.shape[3] # <<<<<<<<<<<<<< @@ -123859,7 +126601,7 @@ static PyObject *__pyx_pf_9fastremap_554ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sw = (__pyx_v_arr->dimensions[3]); - /* "fastremap.pyx":1132 + /* "fastremap.pyx":1148 * cdef size_t sw * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -123869,7 +126611,7 @@ static PyObject *__pyx_pf_9fastremap_554ipt4d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1138 + /* "fastremap.pyx":1154 * sw = arr.shape[3] * else: * sx = arr.shape[3] # <<<<<<<<<<<<<< @@ -123879,7 +126621,7 @@ static PyObject *__pyx_pf_9fastremap_554ipt4d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[3]); - /* "fastremap.pyx":1139 + /* "fastremap.pyx":1155 * else: * sx = arr.shape[3] * sy = arr.shape[2] # <<<<<<<<<<<<<< @@ -123888,7 +126630,7 @@ static PyObject *__pyx_pf_9fastremap_554ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1140 + /* "fastremap.pyx":1156 * sx = arr.shape[3] * sy = arr.shape[2] * sz = arr.shape[1] # <<<<<<<<<<<<<< @@ -123897,7 +126639,7 @@ static PyObject *__pyx_pf_9fastremap_554ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1141 + /* "fastremap.pyx":1157 * sy = arr.shape[2] * sz = arr.shape[1] * sw = arr.shape[0] # <<<<<<<<<<<<<< @@ -123908,19 +126650,19 @@ static PyObject *__pyx_pf_9fastremap_554ipt4d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1143 + /* "fastremap.pyx":1159 * sw = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -123935,17 +126677,17 @@ static PyObject *__pyx_pf_9fastremap_554ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1143, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1148 + /* "fastremap.pyx":1164 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -123955,7 +126697,7 @@ static PyObject *__pyx_pf_9fastremap_554ipt4d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1150 + /* "fastremap.pyx":1166 * if nbytes == 1: * _ipt4d[uint8_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -123985,10 +126727,10 @@ static PyObject *__pyx_pf_9fastremap_554ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_11 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1150, __pyx_L1_error) + __PYX_ERR(0, 1166, __pyx_L1_error) } - /* "fastremap.pyx":1149 + /* "fastremap.pyx":1165 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt4d[uint8_t]( # <<<<<<<<<<<<<< @@ -123997,7 +126739,7 @@ static PyObject *__pyx_pf_9fastremap_554ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint8_t *)(&(*((int32_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ) + __pyx_t_11 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1148 + /* "fastremap.pyx":1164 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -124007,7 +126749,7 @@ static PyObject *__pyx_pf_9fastremap_554ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1155 + /* "fastremap.pyx":1171 * elif nbytes == 2: * _ipt4d[uint16_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -124037,10 +126779,10 @@ static PyObject *__pyx_pf_9fastremap_554ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1155, __pyx_L1_error) + __PYX_ERR(0, 1171, __pyx_L1_error) } - /* "fastremap.pyx":1154 + /* "fastremap.pyx":1170 * ) * elif nbytes == 2: * _ipt4d[uint16_t]( # <<<<<<<<<<<<<< @@ -124049,7 +126791,7 @@ static PyObject *__pyx_pf_9fastremap_554ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint16_t *)(&(*((int32_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ) + __pyx_t_10 * __pyx_v_arrview.strides[1]) ) + __pyx_t_9 * __pyx_v_arrview.strides[2]) ) + __pyx_t_8 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1153 + /* "fastremap.pyx":1169 * sx, sy, sz, sw * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -124059,7 +126801,7 @@ static PyObject *__pyx_pf_9fastremap_554ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1160 + /* "fastremap.pyx":1176 * elif nbytes == 4: * _ipt4d[uint32_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -124089,10 +126831,10 @@ static PyObject *__pyx_pf_9fastremap_554ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_11 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1160, __pyx_L1_error) + __PYX_ERR(0, 1176, __pyx_L1_error) } - /* "fastremap.pyx":1159 + /* "fastremap.pyx":1175 * ) * elif nbytes == 4: * _ipt4d[uint32_t]( # <<<<<<<<<<<<<< @@ -124101,7 +126843,7 @@ static PyObject *__pyx_pf_9fastremap_554ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint32_t *)(&(*((int32_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ) + __pyx_t_11 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1158 + /* "fastremap.pyx":1174 * sx, sy, sz, sw * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -124111,7 +126853,7 @@ static PyObject *__pyx_pf_9fastremap_554ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1165 + /* "fastremap.pyx":1181 * else: * _ipt4d[uint64_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -124141,10 +126883,10 @@ static PyObject *__pyx_pf_9fastremap_554ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1165, __pyx_L1_error) + __PYX_ERR(0, 1181, __pyx_L1_error) } - /* "fastremap.pyx":1164 + /* "fastremap.pyx":1180 * ) * else: * _ipt4d[uint64_t]( # <<<<<<<<<<<<<< @@ -124155,7 +126897,7 @@ static PyObject *__pyx_pf_9fastremap_554ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1169 + /* "fastremap.pyx":1185 * ) * * return arr # <<<<<<<<<<<<<< @@ -124167,7 +126909,7 @@ static PyObject *__pyx_pf_9fastremap_554ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1124 + /* "fastremap.pyx":1140 * return arr * * def ipt4d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=4] arr): # <<<<<<<<<<<<<< @@ -124210,7 +126952,7 @@ static PyObject *__pyx_fuse_7__pyx_pw_9fastremap_557ipt4d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt4d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1140, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_556ipt4d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -124254,39 +126996,39 @@ static PyObject *__pyx_pf_9fastremap_556ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1140, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_arr.diminfo[3].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_arr.diminfo[3].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[3]; - /* "fastremap.pyx":1125 + /* "fastremap.pyx":1141 * * def ipt4d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=4] arr): * cdef COMPLEX_NUMBER[:,:,:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn_int64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1125, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn_int64_t(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1141, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1132 + /* "fastremap.pyx":1148 * cdef size_t sw * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1133 + /* "fastremap.pyx":1149 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -124295,7 +127037,7 @@ static PyObject *__pyx_pf_9fastremap_556ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1134 + /* "fastremap.pyx":1150 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -124304,7 +127046,7 @@ static PyObject *__pyx_pf_9fastremap_556ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1135 + /* "fastremap.pyx":1151 * sx = arr.shape[0] * sy = arr.shape[1] * sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -124313,7 +127055,7 @@ static PyObject *__pyx_pf_9fastremap_556ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1136 + /* "fastremap.pyx":1152 * sy = arr.shape[1] * sz = arr.shape[2] * sw = arr.shape[3] # <<<<<<<<<<<<<< @@ -124322,7 +127064,7 @@ static PyObject *__pyx_pf_9fastremap_556ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sw = (__pyx_v_arr->dimensions[3]); - /* "fastremap.pyx":1132 + /* "fastremap.pyx":1148 * cdef size_t sw * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -124332,7 +127074,7 @@ static PyObject *__pyx_pf_9fastremap_556ipt4d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1138 + /* "fastremap.pyx":1154 * sw = arr.shape[3] * else: * sx = arr.shape[3] # <<<<<<<<<<<<<< @@ -124342,7 +127084,7 @@ static PyObject *__pyx_pf_9fastremap_556ipt4d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[3]); - /* "fastremap.pyx":1139 + /* "fastremap.pyx":1155 * else: * sx = arr.shape[3] * sy = arr.shape[2] # <<<<<<<<<<<<<< @@ -124351,7 +127093,7 @@ static PyObject *__pyx_pf_9fastremap_556ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1140 + /* "fastremap.pyx":1156 * sx = arr.shape[3] * sy = arr.shape[2] * sz = arr.shape[1] # <<<<<<<<<<<<<< @@ -124360,7 +127102,7 @@ static PyObject *__pyx_pf_9fastremap_556ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1141 + /* "fastremap.pyx":1157 * sy = arr.shape[2] * sz = arr.shape[1] * sw = arr.shape[0] # <<<<<<<<<<<<<< @@ -124371,19 +127113,19 @@ static PyObject *__pyx_pf_9fastremap_556ipt4d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1143 + /* "fastremap.pyx":1159 * sw = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -124398,17 +127140,17 @@ static PyObject *__pyx_pf_9fastremap_556ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1143, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1148 + /* "fastremap.pyx":1164 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -124418,7 +127160,7 @@ static PyObject *__pyx_pf_9fastremap_556ipt4d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1150 + /* "fastremap.pyx":1166 * if nbytes == 1: * _ipt4d[uint8_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -124448,10 +127190,10 @@ static PyObject *__pyx_pf_9fastremap_556ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_11 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1150, __pyx_L1_error) + __PYX_ERR(0, 1166, __pyx_L1_error) } - /* "fastremap.pyx":1149 + /* "fastremap.pyx":1165 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt4d[uint8_t]( # <<<<<<<<<<<<<< @@ -124460,7 +127202,7 @@ static PyObject *__pyx_pf_9fastremap_556ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint8_t *)(&(*((int64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ) + __pyx_t_11 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1148 + /* "fastremap.pyx":1164 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -124470,7 +127212,7 @@ static PyObject *__pyx_pf_9fastremap_556ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1155 + /* "fastremap.pyx":1171 * elif nbytes == 2: * _ipt4d[uint16_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -124500,10 +127242,10 @@ static PyObject *__pyx_pf_9fastremap_556ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1155, __pyx_L1_error) + __PYX_ERR(0, 1171, __pyx_L1_error) } - /* "fastremap.pyx":1154 + /* "fastremap.pyx":1170 * ) * elif nbytes == 2: * _ipt4d[uint16_t]( # <<<<<<<<<<<<<< @@ -124512,7 +127254,7 @@ static PyObject *__pyx_pf_9fastremap_556ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint16_t *)(&(*((int64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ) + __pyx_t_10 * __pyx_v_arrview.strides[1]) ) + __pyx_t_9 * __pyx_v_arrview.strides[2]) ) + __pyx_t_8 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1153 + /* "fastremap.pyx":1169 * sx, sy, sz, sw * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -124522,7 +127264,7 @@ static PyObject *__pyx_pf_9fastremap_556ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1160 + /* "fastremap.pyx":1176 * elif nbytes == 4: * _ipt4d[uint32_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -124552,10 +127294,10 @@ static PyObject *__pyx_pf_9fastremap_556ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_11 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1160, __pyx_L1_error) + __PYX_ERR(0, 1176, __pyx_L1_error) } - /* "fastremap.pyx":1159 + /* "fastremap.pyx":1175 * ) * elif nbytes == 4: * _ipt4d[uint32_t]( # <<<<<<<<<<<<<< @@ -124564,7 +127306,7 @@ static PyObject *__pyx_pf_9fastremap_556ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint32_t *)(&(*((int64_t *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ) + __pyx_t_11 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1158 + /* "fastremap.pyx":1174 * sx, sy, sz, sw * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -124574,7 +127316,7 @@ static PyObject *__pyx_pf_9fastremap_556ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1165 + /* "fastremap.pyx":1181 * else: * _ipt4d[uint64_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -124604,10 +127346,10 @@ static PyObject *__pyx_pf_9fastremap_556ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1165, __pyx_L1_error) + __PYX_ERR(0, 1181, __pyx_L1_error) } - /* "fastremap.pyx":1164 + /* "fastremap.pyx":1180 * ) * else: * _ipt4d[uint64_t]( # <<<<<<<<<<<<<< @@ -124618,7 +127360,7 @@ static PyObject *__pyx_pf_9fastremap_556ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1169 + /* "fastremap.pyx":1185 * ) * * return arr # <<<<<<<<<<<<<< @@ -124630,7 +127372,7 @@ static PyObject *__pyx_pf_9fastremap_556ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1124 + /* "fastremap.pyx":1140 * return arr * * def ipt4d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=4] arr): # <<<<<<<<<<<<<< @@ -124673,7 +127415,7 @@ static PyObject *__pyx_fuse_8__pyx_pw_9fastremap_559ipt4d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt4d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1140, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_558ipt4d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -124717,39 +127459,39 @@ static PyObject *__pyx_pf_9fastremap_558ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 4, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 4, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1140, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_arr.diminfo[3].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_arr.diminfo[3].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[3]; - /* "fastremap.pyx":1125 + /* "fastremap.pyx":1141 * * def ipt4d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=4] arr): * cdef COMPLEX_NUMBER[:,:,:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_float(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1125, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_float(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1141, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1132 + /* "fastremap.pyx":1148 * cdef size_t sw * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1133 + /* "fastremap.pyx":1149 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -124758,7 +127500,7 @@ static PyObject *__pyx_pf_9fastremap_558ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1134 + /* "fastremap.pyx":1150 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -124767,7 +127509,7 @@ static PyObject *__pyx_pf_9fastremap_558ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1135 + /* "fastremap.pyx":1151 * sx = arr.shape[0] * sy = arr.shape[1] * sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -124776,7 +127518,7 @@ static PyObject *__pyx_pf_9fastremap_558ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1136 + /* "fastremap.pyx":1152 * sy = arr.shape[1] * sz = arr.shape[2] * sw = arr.shape[3] # <<<<<<<<<<<<<< @@ -124785,7 +127527,7 @@ static PyObject *__pyx_pf_9fastremap_558ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sw = (__pyx_v_arr->dimensions[3]); - /* "fastremap.pyx":1132 + /* "fastremap.pyx":1148 * cdef size_t sw * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -124795,7 +127537,7 @@ static PyObject *__pyx_pf_9fastremap_558ipt4d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1138 + /* "fastremap.pyx":1154 * sw = arr.shape[3] * else: * sx = arr.shape[3] # <<<<<<<<<<<<<< @@ -124805,7 +127547,7 @@ static PyObject *__pyx_pf_9fastremap_558ipt4d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[3]); - /* "fastremap.pyx":1139 + /* "fastremap.pyx":1155 * else: * sx = arr.shape[3] * sy = arr.shape[2] # <<<<<<<<<<<<<< @@ -124814,7 +127556,7 @@ static PyObject *__pyx_pf_9fastremap_558ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1140 + /* "fastremap.pyx":1156 * sx = arr.shape[3] * sy = arr.shape[2] * sz = arr.shape[1] # <<<<<<<<<<<<<< @@ -124823,7 +127565,7 @@ static PyObject *__pyx_pf_9fastremap_558ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1141 + /* "fastremap.pyx":1157 * sy = arr.shape[2] * sz = arr.shape[1] * sw = arr.shape[0] # <<<<<<<<<<<<<< @@ -124834,19 +127576,19 @@ static PyObject *__pyx_pf_9fastremap_558ipt4d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1143 + /* "fastremap.pyx":1159 * sw = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -124861,17 +127603,17 @@ static PyObject *__pyx_pf_9fastremap_558ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1143, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1148 + /* "fastremap.pyx":1164 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -124881,7 +127623,7 @@ static PyObject *__pyx_pf_9fastremap_558ipt4d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1150 + /* "fastremap.pyx":1166 * if nbytes == 1: * _ipt4d[uint8_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -124911,10 +127653,10 @@ static PyObject *__pyx_pf_9fastremap_558ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_11 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1150, __pyx_L1_error) + __PYX_ERR(0, 1166, __pyx_L1_error) } - /* "fastremap.pyx":1149 + /* "fastremap.pyx":1165 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt4d[uint8_t]( # <<<<<<<<<<<<<< @@ -124923,7 +127665,7 @@ static PyObject *__pyx_pf_9fastremap_558ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint8_t *)(&(*((float *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ) + __pyx_t_11 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1148 + /* "fastremap.pyx":1164 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -124933,7 +127675,7 @@ static PyObject *__pyx_pf_9fastremap_558ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1155 + /* "fastremap.pyx":1171 * elif nbytes == 2: * _ipt4d[uint16_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -124963,10 +127705,10 @@ static PyObject *__pyx_pf_9fastremap_558ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1155, __pyx_L1_error) + __PYX_ERR(0, 1171, __pyx_L1_error) } - /* "fastremap.pyx":1154 + /* "fastremap.pyx":1170 * ) * elif nbytes == 2: * _ipt4d[uint16_t]( # <<<<<<<<<<<<<< @@ -124975,7 +127717,7 @@ static PyObject *__pyx_pf_9fastremap_558ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint16_t *)(&(*((float *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ) + __pyx_t_10 * __pyx_v_arrview.strides[1]) ) + __pyx_t_9 * __pyx_v_arrview.strides[2]) ) + __pyx_t_8 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1153 + /* "fastremap.pyx":1169 * sx, sy, sz, sw * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -124985,7 +127727,7 @@ static PyObject *__pyx_pf_9fastremap_558ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1160 + /* "fastremap.pyx":1176 * elif nbytes == 4: * _ipt4d[uint32_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -125015,10 +127757,10 @@ static PyObject *__pyx_pf_9fastremap_558ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_11 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1160, __pyx_L1_error) + __PYX_ERR(0, 1176, __pyx_L1_error) } - /* "fastremap.pyx":1159 + /* "fastremap.pyx":1175 * ) * elif nbytes == 4: * _ipt4d[uint32_t]( # <<<<<<<<<<<<<< @@ -125027,7 +127769,7 @@ static PyObject *__pyx_pf_9fastremap_558ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint32_t *)(&(*((float *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ) + __pyx_t_11 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1158 + /* "fastremap.pyx":1174 * sx, sy, sz, sw * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -125037,7 +127779,7 @@ static PyObject *__pyx_pf_9fastremap_558ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1165 + /* "fastremap.pyx":1181 * else: * _ipt4d[uint64_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -125067,10 +127809,10 @@ static PyObject *__pyx_pf_9fastremap_558ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1165, __pyx_L1_error) + __PYX_ERR(0, 1181, __pyx_L1_error) } - /* "fastremap.pyx":1164 + /* "fastremap.pyx":1180 * ) * else: * _ipt4d[uint64_t]( # <<<<<<<<<<<<<< @@ -125081,7 +127823,7 @@ static PyObject *__pyx_pf_9fastremap_558ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1169 + /* "fastremap.pyx":1185 * ) * * return arr # <<<<<<<<<<<<<< @@ -125093,7 +127835,7 @@ static PyObject *__pyx_pf_9fastremap_558ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1124 + /* "fastremap.pyx":1140 * return arr * * def ipt4d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=4] arr): # <<<<<<<<<<<<<< @@ -125136,7 +127878,7 @@ static PyObject *__pyx_fuse_9__pyx_pw_9fastremap_561ipt4d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt4d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1140, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_560ipt4d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -125180,39 +127922,39 @@ static PyObject *__pyx_pf_9fastremap_560ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 4, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 4, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1140, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_arr.diminfo[3].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_arr.diminfo[3].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[3]; - /* "fastremap.pyx":1125 + /* "fastremap.pyx":1141 * * def ipt4d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=4] arr): * cdef COMPLEX_NUMBER[:,:,:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_double(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1125, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_double(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1141, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1132 + /* "fastremap.pyx":1148 * cdef size_t sw * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1133 + /* "fastremap.pyx":1149 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -125221,7 +127963,7 @@ static PyObject *__pyx_pf_9fastremap_560ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1134 + /* "fastremap.pyx":1150 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -125230,7 +127972,7 @@ static PyObject *__pyx_pf_9fastremap_560ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1135 + /* "fastremap.pyx":1151 * sx = arr.shape[0] * sy = arr.shape[1] * sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -125239,7 +127981,7 @@ static PyObject *__pyx_pf_9fastremap_560ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1136 + /* "fastremap.pyx":1152 * sy = arr.shape[1] * sz = arr.shape[2] * sw = arr.shape[3] # <<<<<<<<<<<<<< @@ -125248,7 +127990,7 @@ static PyObject *__pyx_pf_9fastremap_560ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sw = (__pyx_v_arr->dimensions[3]); - /* "fastremap.pyx":1132 + /* "fastremap.pyx":1148 * cdef size_t sw * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -125258,7 +128000,7 @@ static PyObject *__pyx_pf_9fastremap_560ipt4d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1138 + /* "fastremap.pyx":1154 * sw = arr.shape[3] * else: * sx = arr.shape[3] # <<<<<<<<<<<<<< @@ -125268,7 +128010,7 @@ static PyObject *__pyx_pf_9fastremap_560ipt4d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[3]); - /* "fastremap.pyx":1139 + /* "fastremap.pyx":1155 * else: * sx = arr.shape[3] * sy = arr.shape[2] # <<<<<<<<<<<<<< @@ -125277,7 +128019,7 @@ static PyObject *__pyx_pf_9fastremap_560ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1140 + /* "fastremap.pyx":1156 * sx = arr.shape[3] * sy = arr.shape[2] * sz = arr.shape[1] # <<<<<<<<<<<<<< @@ -125286,7 +128028,7 @@ static PyObject *__pyx_pf_9fastremap_560ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1141 + /* "fastremap.pyx":1157 * sy = arr.shape[2] * sz = arr.shape[1] * sw = arr.shape[0] # <<<<<<<<<<<<<< @@ -125297,19 +128039,19 @@ static PyObject *__pyx_pf_9fastremap_560ipt4d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1143 + /* "fastremap.pyx":1159 * sw = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -125324,17 +128066,17 @@ static PyObject *__pyx_pf_9fastremap_560ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1143, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1148 + /* "fastremap.pyx":1164 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -125344,7 +128086,7 @@ static PyObject *__pyx_pf_9fastremap_560ipt4d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1150 + /* "fastremap.pyx":1166 * if nbytes == 1: * _ipt4d[uint8_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -125374,10 +128116,10 @@ static PyObject *__pyx_pf_9fastremap_560ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_11 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1150, __pyx_L1_error) + __PYX_ERR(0, 1166, __pyx_L1_error) } - /* "fastremap.pyx":1149 + /* "fastremap.pyx":1165 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt4d[uint8_t]( # <<<<<<<<<<<<<< @@ -125386,7 +128128,7 @@ static PyObject *__pyx_pf_9fastremap_560ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint8_t *)(&(*((double *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ) + __pyx_t_11 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1148 + /* "fastremap.pyx":1164 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -125396,7 +128138,7 @@ static PyObject *__pyx_pf_9fastremap_560ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1155 + /* "fastremap.pyx":1171 * elif nbytes == 2: * _ipt4d[uint16_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -125426,10 +128168,10 @@ static PyObject *__pyx_pf_9fastremap_560ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1155, __pyx_L1_error) + __PYX_ERR(0, 1171, __pyx_L1_error) } - /* "fastremap.pyx":1154 + /* "fastremap.pyx":1170 * ) * elif nbytes == 2: * _ipt4d[uint16_t]( # <<<<<<<<<<<<<< @@ -125438,7 +128180,7 @@ static PyObject *__pyx_pf_9fastremap_560ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint16_t *)(&(*((double *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ) + __pyx_t_10 * __pyx_v_arrview.strides[1]) ) + __pyx_t_9 * __pyx_v_arrview.strides[2]) ) + __pyx_t_8 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1153 + /* "fastremap.pyx":1169 * sx, sy, sz, sw * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -125448,7 +128190,7 @@ static PyObject *__pyx_pf_9fastremap_560ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1160 + /* "fastremap.pyx":1176 * elif nbytes == 4: * _ipt4d[uint32_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -125478,10 +128220,10 @@ static PyObject *__pyx_pf_9fastremap_560ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_11 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1160, __pyx_L1_error) + __PYX_ERR(0, 1176, __pyx_L1_error) } - /* "fastremap.pyx":1159 + /* "fastremap.pyx":1175 * ) * elif nbytes == 4: * _ipt4d[uint32_t]( # <<<<<<<<<<<<<< @@ -125490,7 +128232,7 @@ static PyObject *__pyx_pf_9fastremap_560ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint32_t *)(&(*((double *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ) + __pyx_t_11 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1158 + /* "fastremap.pyx":1174 * sx, sy, sz, sw * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -125500,7 +128242,7 @@ static PyObject *__pyx_pf_9fastremap_560ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1165 + /* "fastremap.pyx":1181 * else: * _ipt4d[uint64_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -125530,10 +128272,10 @@ static PyObject *__pyx_pf_9fastremap_560ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1165, __pyx_L1_error) + __PYX_ERR(0, 1181, __pyx_L1_error) } - /* "fastremap.pyx":1164 + /* "fastremap.pyx":1180 * ) * else: * _ipt4d[uint64_t]( # <<<<<<<<<<<<<< @@ -125544,7 +128286,7 @@ static PyObject *__pyx_pf_9fastremap_560ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1169 + /* "fastremap.pyx":1185 * ) * * return arr # <<<<<<<<<<<<<< @@ -125556,7 +128298,7 @@ static PyObject *__pyx_pf_9fastremap_560ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1124 + /* "fastremap.pyx":1140 * return arr * * def ipt4d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=4] arr): # <<<<<<<<<<<<<< @@ -125599,7 +128341,7 @@ static PyObject *__pyx_fuse_10__pyx_pw_9fastremap_563ipt4d(PyObject *__pyx_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ipt4d (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1140, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_562ipt4d(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -125643,39 +128385,39 @@ static PyObject *__pyx_pf_9fastremap_562ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo___pyx_t_float_complex, PyBUF_FORMAT| PyBUF_STRIDES, 4, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo___pyx_t_float_complex, PyBUF_FORMAT| PyBUF_STRIDES, 4, 1, __pyx_stack) == -1)) __PYX_ERR(0, 1140, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_arr.diminfo[3].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_arr.diminfo[3].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[3]; - /* "fastremap.pyx":1125 + /* "fastremap.pyx":1141 * * def ipt4d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=4] arr): * cdef COMPLEX_NUMBER[:,:,:,:] arrview = arr # <<<<<<<<<<<<<< * * cdef size_t sx */ - __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds___pyx_t_float_complex(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1125, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds___pyx_t_float_complex(((PyObject *)__pyx_v_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1141, __pyx_L1_error) __pyx_v_arrview = __pyx_t_1; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "fastremap.pyx":1132 + /* "fastremap.pyx":1148 * cdef size_t sw * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< * sx = arr.shape[0] * sy = arr.shape[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "fastremap.pyx":1133 + /* "fastremap.pyx":1149 * * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -125684,7 +128426,7 @@ static PyObject *__pyx_pf_9fastremap_562ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1134 + /* "fastremap.pyx":1150 * if arr.flags['F_CONTIGUOUS']: * sx = arr.shape[0] * sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -125693,7 +128435,7 @@ static PyObject *__pyx_pf_9fastremap_562ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1135 + /* "fastremap.pyx":1151 * sx = arr.shape[0] * sy = arr.shape[1] * sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -125702,7 +128444,7 @@ static PyObject *__pyx_pf_9fastremap_562ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1136 + /* "fastremap.pyx":1152 * sy = arr.shape[1] * sz = arr.shape[2] * sw = arr.shape[3] # <<<<<<<<<<<<<< @@ -125711,7 +128453,7 @@ static PyObject *__pyx_pf_9fastremap_562ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sw = (__pyx_v_arr->dimensions[3]); - /* "fastremap.pyx":1132 + /* "fastremap.pyx":1148 * cdef size_t sw * * if arr.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<< @@ -125721,7 +128463,7 @@ static PyObject *__pyx_pf_9fastremap_562ipt4d(CYTHON_UNUSED PyObject *__pyx_self goto __pyx_L3; } - /* "fastremap.pyx":1138 + /* "fastremap.pyx":1154 * sw = arr.shape[3] * else: * sx = arr.shape[3] # <<<<<<<<<<<<<< @@ -125731,7 +128473,7 @@ static PyObject *__pyx_pf_9fastremap_562ipt4d(CYTHON_UNUSED PyObject *__pyx_self /*else*/ { __pyx_v_sx = (__pyx_v_arr->dimensions[3]); - /* "fastremap.pyx":1139 + /* "fastremap.pyx":1155 * else: * sx = arr.shape[3] * sy = arr.shape[2] # <<<<<<<<<<<<<< @@ -125740,7 +128482,7 @@ static PyObject *__pyx_pf_9fastremap_562ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sy = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1140 + /* "fastremap.pyx":1156 * sx = arr.shape[3] * sy = arr.shape[2] * sz = arr.shape[1] # <<<<<<<<<<<<<< @@ -125749,7 +128491,7 @@ static PyObject *__pyx_pf_9fastremap_562ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ __pyx_v_sz = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1141 + /* "fastremap.pyx":1157 * sy = arr.shape[2] * sz = arr.shape[1] * sw = arr.shape[0] # <<<<<<<<<<<<<< @@ -125760,19 +128502,19 @@ static PyObject *__pyx_pf_9fastremap_562ipt4d(CYTHON_UNUSED PyObject *__pyx_self } __pyx_L3:; - /* "fastremap.pyx":1143 + /* "fastremap.pyx":1159 * sw = arr.shape[0] * * cdef int nbytes = np.dtype(arr.dtype).itemsize # <<<<<<<<<<<<<< * * # ipt doesn't do anything with values, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -125787,17 +128529,17 @@ static PyObject *__pyx_pf_9fastremap_562ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1143, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_nbytes = __pyx_t_7; - /* "fastremap.pyx":1148 + /* "fastremap.pyx":1164 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -125807,7 +128549,7 @@ static PyObject *__pyx_pf_9fastremap_562ipt4d(CYTHON_UNUSED PyObject *__pyx_self switch (__pyx_v_nbytes) { case 1: - /* "fastremap.pyx":1150 + /* "fastremap.pyx":1166 * if nbytes == 1: * _ipt4d[uint8_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -125837,10 +128579,10 @@ static PyObject *__pyx_pf_9fastremap_562ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_11 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1150, __pyx_L1_error) + __PYX_ERR(0, 1166, __pyx_L1_error) } - /* "fastremap.pyx":1149 + /* "fastremap.pyx":1165 * # int, uint, float, bool who cares * if nbytes == 1: * _ipt4d[uint8_t]( # <<<<<<<<<<<<<< @@ -125849,7 +128591,7 @@ static PyObject *__pyx_pf_9fastremap_562ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint8_t *)(&(*((__pyx_t_float_complex *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ) + __pyx_t_11 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1148 + /* "fastremap.pyx":1164 * # just moves them around, so only bit width matters * # int, uint, float, bool who cares * if nbytes == 1: # <<<<<<<<<<<<<< @@ -125859,7 +128601,7 @@ static PyObject *__pyx_pf_9fastremap_562ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; case 2: - /* "fastremap.pyx":1155 + /* "fastremap.pyx":1171 * elif nbytes == 2: * _ipt4d[uint16_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -125889,10 +128631,10 @@ static PyObject *__pyx_pf_9fastremap_562ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1155, __pyx_L1_error) + __PYX_ERR(0, 1171, __pyx_L1_error) } - /* "fastremap.pyx":1154 + /* "fastremap.pyx":1170 * ) * elif nbytes == 2: * _ipt4d[uint16_t]( # <<<<<<<<<<<<<< @@ -125901,7 +128643,7 @@ static PyObject *__pyx_pf_9fastremap_562ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint16_t *)(&(*((__pyx_t_float_complex *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_11 * __pyx_v_arrview.strides[0]) ) + __pyx_t_10 * __pyx_v_arrview.strides[1]) ) + __pyx_t_9 * __pyx_v_arrview.strides[2]) ) + __pyx_t_8 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1153 + /* "fastremap.pyx":1169 * sx, sy, sz, sw * ) * elif nbytes == 2: # <<<<<<<<<<<<<< @@ -125911,7 +128653,7 @@ static PyObject *__pyx_pf_9fastremap_562ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; case 4: - /* "fastremap.pyx":1160 + /* "fastremap.pyx":1176 * elif nbytes == 4: * _ipt4d[uint32_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -125941,10 +128683,10 @@ static PyObject *__pyx_pf_9fastremap_562ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_11 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1160, __pyx_L1_error) + __PYX_ERR(0, 1176, __pyx_L1_error) } - /* "fastremap.pyx":1159 + /* "fastremap.pyx":1175 * ) * elif nbytes == 4: * _ipt4d[uint32_t]( # <<<<<<<<<<<<<< @@ -125953,7 +128695,7 @@ static PyObject *__pyx_pf_9fastremap_562ipt4d(CYTHON_UNUSED PyObject *__pyx_self */ pyipt::_ipt4d(((uint32_t *)(&(*((__pyx_t_float_complex *) ( /* dim=3 */ (( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_arrview.data + __pyx_t_8 * __pyx_v_arrview.strides[0]) ) + __pyx_t_9 * __pyx_v_arrview.strides[1]) ) + __pyx_t_10 * __pyx_v_arrview.strides[2]) ) + __pyx_t_11 * __pyx_v_arrview.strides[3]) ))))), __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_sw); - /* "fastremap.pyx":1158 + /* "fastremap.pyx":1174 * sx, sy, sz, sw * ) * elif nbytes == 4: # <<<<<<<<<<<<<< @@ -125963,7 +128705,7 @@ static PyObject *__pyx_pf_9fastremap_562ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; default: - /* "fastremap.pyx":1165 + /* "fastremap.pyx":1181 * else: * _ipt4d[uint64_t]( * &arrview[0,0,0,0], # <<<<<<<<<<<<<< @@ -125993,10 +128735,10 @@ static PyObject *__pyx_pf_9fastremap_562ipt4d(CYTHON_UNUSED PyObject *__pyx_self } else if (unlikely(__pyx_t_8 >= __pyx_v_arrview.shape[3])) __pyx_t_7 = 3; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - __PYX_ERR(0, 1165, __pyx_L1_error) + __PYX_ERR(0, 1181, __pyx_L1_error) } - /* "fastremap.pyx":1164 + /* "fastremap.pyx":1180 * ) * else: * _ipt4d[uint64_t]( # <<<<<<<<<<<<<< @@ -126007,7 +128749,7 @@ static PyObject *__pyx_pf_9fastremap_562ipt4d(CYTHON_UNUSED PyObject *__pyx_self break; } - /* "fastremap.pyx":1169 + /* "fastremap.pyx":1185 * ) * * return arr # <<<<<<<<<<<<<< @@ -126019,7 +128761,7 @@ static PyObject *__pyx_pf_9fastremap_562ipt4d(CYTHON_UNUSED PyObject *__pyx_self __pyx_r = ((PyObject *)__pyx_v_arr); goto __pyx_L0; - /* "fastremap.pyx":1124 + /* "fastremap.pyx":1140 * return arr * * def ipt4d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=4] arr): # <<<<<<<<<<<<<< @@ -126052,7 +128794,7 @@ static PyObject *__pyx_pf_9fastremap_562ipt4d(CYTHON_UNUSED PyObject *__pyx_self return __pyx_r; } -/* "fastremap.pyx":1171 +/* "fastremap.pyx":1187 * return arr * * def foreground(arr): # <<<<<<<<<<<<<< @@ -126090,18 +128832,18 @@ static PyObject *__pyx_pf_9fastremap_62foreground(CYTHON_UNUSED PyObject *__pyx_ __Pyx_RefNannySetupContext("foreground", 0); __Pyx_INCREF(__pyx_v_arr); - /* "fastremap.pyx":1173 + /* "fastremap.pyx":1189 * def foreground(arr): * """Returns the number of non-zero voxels in an array.""" * arr = reshape(arr, (arr.size,)) # <<<<<<<<<<<<<< * return _foreground(arr) * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1173, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1173, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1173, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); @@ -126121,7 +128863,7 @@ static PyObject *__pyx_pf_9fastremap_62foreground(CYTHON_UNUSED PyObject *__pyx_ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_arr, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1173, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1189, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -126130,14 +128872,14 @@ static PyObject *__pyx_pf_9fastremap_62foreground(CYTHON_UNUSED PyObject *__pyx_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_arr, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1173, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1189, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1173, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; @@ -126148,7 +128890,7 @@ static PyObject *__pyx_pf_9fastremap_62foreground(CYTHON_UNUSED PyObject *__pyx_ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1173, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -126156,7 +128898,7 @@ static PyObject *__pyx_pf_9fastremap_62foreground(CYTHON_UNUSED PyObject *__pyx_ __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":1174 + /* "fastremap.pyx":1190 * """Returns the number of non-zero voxels in an array.""" * arr = reshape(arr, (arr.size,)) * return _foreground(arr) # <<<<<<<<<<<<<< @@ -126164,7 +128906,7 @@ static PyObject *__pyx_pf_9fastremap_62foreground(CYTHON_UNUSED PyObject *__pyx_ * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_foreground); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1174, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_foreground); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -126178,14 +128920,14 @@ static PyObject *__pyx_pf_9fastremap_62foreground(CYTHON_UNUSED PyObject *__pyx_ } __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_v_arr) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_arr); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1174, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":1171 + /* "fastremap.pyx":1187 * return arr * * def foreground(arr): # <<<<<<<<<<<<<< @@ -126209,7 +128951,7 @@ static PyObject *__pyx_pf_9fastremap_62foreground(CYTHON_UNUSED PyObject *__pyx_ return __pyx_r; } -/* "fastremap.pyx":1179 +/* "fastremap.pyx":1195 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): # <<<<<<<<<<<<<< @@ -126258,23 +129000,23 @@ static PyObject *__pyx_pw_9fastremap_65_foreground(PyObject *__pyx_self, PyObjec case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 1179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 1195, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 1179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 1195, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 1179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 1195, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 1179, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 1195, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -126291,7 +129033,7 @@ static PyObject *__pyx_pw_9fastremap_65_foreground(PyObject *__pyx_self, PyObjec } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1195, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -126353,7 +129095,7 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_foreground", 0); __Pyx_INCREF(__pyx_v_kwargs); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -126367,7 +129109,7 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1195, __pyx_L1_error) __pyx_t_3 = ((!__pyx_t_4) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; @@ -126375,7 +129117,7 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_kwargs, Py_None); } - __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -126390,14 +129132,14 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_v____pyx_int64_t_is_signed = (!((((int64_t)-1L) > 0) != 0)); if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 1179, __pyx_L1_error) + __PYX_ERR(0, 1195, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1195, __pyx_L1_error) __pyx_t_2 = ((0 < __pyx_t_5) != 0); if (__pyx_t_2) { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1179, __pyx_L1_error) + __PYX_ERR(0, 1195, __pyx_L1_error) } __pyx_t_1 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0); __Pyx_INCREF(__pyx_t_1); @@ -126414,18 +129156,18 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 1179, __pyx_L1_error) + __PYX_ERR(0, 1195, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_arr, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_arr, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1195, __pyx_L1_error) __pyx_t_3 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_3; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1179, __pyx_L1_error) + __PYX_ERR(0, 1195, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -126434,12 +129176,12 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 1179, __pyx_L1_error) + __PYX_ERR(0, 1195, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1179, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1195, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); @@ -126450,15 +129192,15 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 1179, __pyx_L1_error) + __PYX_ERR(0, 1195, __pyx_L1_error) } __pyx_L6:; while (1) { @@ -126468,7 +129210,7 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -126477,14 +129219,14 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -126506,14 +129248,14 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_2 = (__pyx_v_dtype != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_itemsize = __pyx_t_5; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_kind = __pyx_t_7; __pyx_v_dtype_signed = (__pyx_v_kind == 'i'); @@ -126526,9 +129268,9 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -126540,7 +129282,7 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; __pyx_L16_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1195, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint16_t)) == __pyx_v_itemsize) != 0); @@ -126549,9 +129291,9 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; goto __pyx_L20_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -126563,7 +129305,7 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; __pyx_L20_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1195, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint32_t)) == __pyx_v_itemsize) != 0); @@ -126572,9 +129314,9 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; goto __pyx_L24_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -126586,7 +129328,7 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; __pyx_L24_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1195, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint64_t)) == __pyx_v_itemsize) != 0); @@ -126595,9 +129337,9 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; goto __pyx_L28_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -126609,7 +129351,7 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1195, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int8_t)) == __pyx_v_itemsize) != 0); @@ -126618,9 +129360,9 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; goto __pyx_L32_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -126632,7 +129374,7 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; __pyx_L32_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1195, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int16_t)) == __pyx_v_itemsize) != 0); @@ -126641,9 +129383,9 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; goto __pyx_L36_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -126655,7 +129397,7 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; __pyx_L36_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1195, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int32_t)) == __pyx_v_itemsize) != 0); @@ -126664,9 +129406,9 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; goto __pyx_L40_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -126678,7 +129420,7 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; __pyx_L40_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1195, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int64_t)) == __pyx_v_itemsize) != 0); @@ -126687,9 +129429,9 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; goto __pyx_L44_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); if (__pyx_t_2) { @@ -126701,7 +129443,7 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; __pyx_L44_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1195, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -126730,7 +129472,7 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1195, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -126752,7 +129494,7 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1195, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -126774,7 +129516,7 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1195, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -126796,7 +129538,7 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1195, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -126818,7 +129560,7 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1195, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -126840,7 +129582,7 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1195, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -126862,7 +129604,7 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1195, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -126884,27 +129626,27 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1195, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); } } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1195, __pyx_L1_error) goto __pyx_L10_break; } __pyx_L10_break:; - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_candidates = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = 0; if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 1179, __pyx_L1_error) + __PYX_ERR(0, 1195, __pyx_L1_error) } - __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_1; @@ -126912,12 +129654,12 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx while (1) { __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_9, &__pyx_t_5, &__pyx_t_1, NULL, NULL, __pyx_t_10); if (unlikely(__pyx_t_11 == 0)) break; - if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_1); __pyx_t_1 = 0; __pyx_v_match_found = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { @@ -126931,10 +129673,10 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx } __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, __pyx_kp_s__2) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__2); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -126949,12 +129691,12 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx } __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_12, __pyx_kp_s__3) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__3); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_src_sig, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1195, __pyx_L1_error) __pyx_t_16 = __pyx_t_15; for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; @@ -126965,11 +129707,11 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = (__pyx_v_dst_type != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_2) { __pyx_v_match_found = 1; @@ -126985,35 +129727,35 @@ static PyObject *__pyx_pf_9fastremap_64_foreground(CYTHON_UNUSED PyObject *__pyx __pyx_L82_break:; __pyx_t_2 = (__pyx_v_match_found != 0); if (__pyx_t_2) { - __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1195, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_candidates) != 0); __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 1179, __pyx_L1_error) + __PYX_ERR(0, 1195, __pyx_L1_error) } - __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1195, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_9 > 1) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 1179, __pyx_L1_error) + __PYX_ERR(0, 1195, __pyx_L1_error) } /*else*/ { __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1179, __pyx_L1_error) + __PYX_ERR(0, 1195, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; @@ -127055,7 +129797,7 @@ static PyObject *__pyx_fuse_0__pyx_pw_9fastremap_567_foreground(PyObject *__pyx_ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_foreground (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1195, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_566_foreground(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -127090,11 +129832,11 @@ static PyObject *__pyx_pf_9fastremap_566_foreground(CYTHON_UNUSED PyObject *__py __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1195, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":1180 + /* "fastremap.pyx":1196 * @cython.nonecheck(False) * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -127103,20 +129845,20 @@ static PyObject *__pyx_pf_9fastremap_566_foreground(CYTHON_UNUSED PyObject *__py */ __pyx_v_i = 0; - /* "fastremap.pyx":1181 + /* "fastremap.pyx":1197 * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): * cdef size_t i = 0 * cdef size_t sz = arr.size # <<<<<<<<<<<<<< * cdef size_t n_foreground = 0 * for i in range(sz): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1181, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sz = __pyx_t_2; - /* "fastremap.pyx":1182 + /* "fastremap.pyx":1198 * cdef size_t i = 0 * cdef size_t sz = arr.size * cdef size_t n_foreground = 0 # <<<<<<<<<<<<<< @@ -127125,7 +129867,7 @@ static PyObject *__pyx_pf_9fastremap_566_foreground(CYTHON_UNUSED PyObject *__py */ __pyx_v_n_foreground = 0; - /* "fastremap.pyx":1183 + /* "fastremap.pyx":1199 * cdef size_t sz = arr.size * cdef size_t n_foreground = 0 * for i in range(sz): # <<<<<<<<<<<<<< @@ -127137,7 +129879,7 @@ static PyObject *__pyx_pf_9fastremap_566_foreground(CYTHON_UNUSED PyObject *__py for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "fastremap.pyx":1184 + /* "fastremap.pyx":1200 * cdef size_t n_foreground = 0 * for i in range(sz): * n_foreground += (arr[i] != 0) # <<<<<<<<<<<<<< @@ -127148,7 +129890,7 @@ static PyObject *__pyx_pf_9fastremap_566_foreground(CYTHON_UNUSED PyObject *__py __pyx_v_n_foreground = (__pyx_v_n_foreground + ((size_t)((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_arr.diminfo[0].strides)) != 0))); } - /* "fastremap.pyx":1185 + /* "fastremap.pyx":1201 * for i in range(sz): * n_foreground += (arr[i] != 0) * return n_foreground # <<<<<<<<<<<<<< @@ -127156,13 +129898,13 @@ static PyObject *__pyx_pf_9fastremap_566_foreground(CYTHON_UNUSED PyObject *__py * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":1179 + /* "fastremap.pyx":1195 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): # <<<<<<<<<<<<<< @@ -127200,7 +129942,7 @@ static PyObject *__pyx_fuse_1__pyx_pw_9fastremap_569_foreground(PyObject *__pyx_ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_foreground (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1195, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_568_foreground(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -127235,11 +129977,11 @@ static PyObject *__pyx_pf_9fastremap_568_foreground(CYTHON_UNUSED PyObject *__py __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1195, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":1180 + /* "fastremap.pyx":1196 * @cython.nonecheck(False) * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -127248,20 +129990,20 @@ static PyObject *__pyx_pf_9fastremap_568_foreground(CYTHON_UNUSED PyObject *__py */ __pyx_v_i = 0; - /* "fastremap.pyx":1181 + /* "fastremap.pyx":1197 * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): * cdef size_t i = 0 * cdef size_t sz = arr.size # <<<<<<<<<<<<<< * cdef size_t n_foreground = 0 * for i in range(sz): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1181, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sz = __pyx_t_2; - /* "fastremap.pyx":1182 + /* "fastremap.pyx":1198 * cdef size_t i = 0 * cdef size_t sz = arr.size * cdef size_t n_foreground = 0 # <<<<<<<<<<<<<< @@ -127270,7 +130012,7 @@ static PyObject *__pyx_pf_9fastremap_568_foreground(CYTHON_UNUSED PyObject *__py */ __pyx_v_n_foreground = 0; - /* "fastremap.pyx":1183 + /* "fastremap.pyx":1199 * cdef size_t sz = arr.size * cdef size_t n_foreground = 0 * for i in range(sz): # <<<<<<<<<<<<<< @@ -127282,7 +130024,7 @@ static PyObject *__pyx_pf_9fastremap_568_foreground(CYTHON_UNUSED PyObject *__py for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "fastremap.pyx":1184 + /* "fastremap.pyx":1200 * cdef size_t n_foreground = 0 * for i in range(sz): * n_foreground += (arr[i] != 0) # <<<<<<<<<<<<<< @@ -127293,7 +130035,7 @@ static PyObject *__pyx_pf_9fastremap_568_foreground(CYTHON_UNUSED PyObject *__py __pyx_v_n_foreground = (__pyx_v_n_foreground + ((size_t)((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_arr.diminfo[0].strides)) != 0))); } - /* "fastremap.pyx":1185 + /* "fastremap.pyx":1201 * for i in range(sz): * n_foreground += (arr[i] != 0) * return n_foreground # <<<<<<<<<<<<<< @@ -127301,13 +130043,13 @@ static PyObject *__pyx_pf_9fastremap_568_foreground(CYTHON_UNUSED PyObject *__py * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":1179 + /* "fastremap.pyx":1195 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): # <<<<<<<<<<<<<< @@ -127345,7 +130087,7 @@ static PyObject *__pyx_fuse_2__pyx_pw_9fastremap_571_foreground(PyObject *__pyx_ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_foreground (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1195, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_570_foreground(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -127380,11 +130122,11 @@ static PyObject *__pyx_pf_9fastremap_570_foreground(CYTHON_UNUSED PyObject *__py __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1195, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":1180 + /* "fastremap.pyx":1196 * @cython.nonecheck(False) * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -127393,20 +130135,20 @@ static PyObject *__pyx_pf_9fastremap_570_foreground(CYTHON_UNUSED PyObject *__py */ __pyx_v_i = 0; - /* "fastremap.pyx":1181 + /* "fastremap.pyx":1197 * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): * cdef size_t i = 0 * cdef size_t sz = arr.size # <<<<<<<<<<<<<< * cdef size_t n_foreground = 0 * for i in range(sz): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1181, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sz = __pyx_t_2; - /* "fastremap.pyx":1182 + /* "fastremap.pyx":1198 * cdef size_t i = 0 * cdef size_t sz = arr.size * cdef size_t n_foreground = 0 # <<<<<<<<<<<<<< @@ -127415,7 +130157,7 @@ static PyObject *__pyx_pf_9fastremap_570_foreground(CYTHON_UNUSED PyObject *__py */ __pyx_v_n_foreground = 0; - /* "fastremap.pyx":1183 + /* "fastremap.pyx":1199 * cdef size_t sz = arr.size * cdef size_t n_foreground = 0 * for i in range(sz): # <<<<<<<<<<<<<< @@ -127427,7 +130169,7 @@ static PyObject *__pyx_pf_9fastremap_570_foreground(CYTHON_UNUSED PyObject *__py for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "fastremap.pyx":1184 + /* "fastremap.pyx":1200 * cdef size_t n_foreground = 0 * for i in range(sz): * n_foreground += (arr[i] != 0) # <<<<<<<<<<<<<< @@ -127438,7 +130180,7 @@ static PyObject *__pyx_pf_9fastremap_570_foreground(CYTHON_UNUSED PyObject *__py __pyx_v_n_foreground = (__pyx_v_n_foreground + ((size_t)((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_arr.diminfo[0].strides)) != 0))); } - /* "fastremap.pyx":1185 + /* "fastremap.pyx":1201 * for i in range(sz): * n_foreground += (arr[i] != 0) * return n_foreground # <<<<<<<<<<<<<< @@ -127446,13 +130188,13 @@ static PyObject *__pyx_pf_9fastremap_570_foreground(CYTHON_UNUSED PyObject *__py * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":1179 + /* "fastremap.pyx":1195 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): # <<<<<<<<<<<<<< @@ -127490,7 +130232,7 @@ static PyObject *__pyx_fuse_3__pyx_pw_9fastremap_573_foreground(PyObject *__pyx_ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_foreground (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1195, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_572_foreground(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -127525,11 +130267,11 @@ static PyObject *__pyx_pf_9fastremap_572_foreground(CYTHON_UNUSED PyObject *__py __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1195, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":1180 + /* "fastremap.pyx":1196 * @cython.nonecheck(False) * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -127538,20 +130280,20 @@ static PyObject *__pyx_pf_9fastremap_572_foreground(CYTHON_UNUSED PyObject *__py */ __pyx_v_i = 0; - /* "fastremap.pyx":1181 + /* "fastremap.pyx":1197 * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): * cdef size_t i = 0 * cdef size_t sz = arr.size # <<<<<<<<<<<<<< * cdef size_t n_foreground = 0 * for i in range(sz): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1181, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sz = __pyx_t_2; - /* "fastremap.pyx":1182 + /* "fastremap.pyx":1198 * cdef size_t i = 0 * cdef size_t sz = arr.size * cdef size_t n_foreground = 0 # <<<<<<<<<<<<<< @@ -127560,7 +130302,7 @@ static PyObject *__pyx_pf_9fastremap_572_foreground(CYTHON_UNUSED PyObject *__py */ __pyx_v_n_foreground = 0; - /* "fastremap.pyx":1183 + /* "fastremap.pyx":1199 * cdef size_t sz = arr.size * cdef size_t n_foreground = 0 * for i in range(sz): # <<<<<<<<<<<<<< @@ -127572,7 +130314,7 @@ static PyObject *__pyx_pf_9fastremap_572_foreground(CYTHON_UNUSED PyObject *__py for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "fastremap.pyx":1184 + /* "fastremap.pyx":1200 * cdef size_t n_foreground = 0 * for i in range(sz): * n_foreground += (arr[i] != 0) # <<<<<<<<<<<<<< @@ -127583,7 +130325,7 @@ static PyObject *__pyx_pf_9fastremap_572_foreground(CYTHON_UNUSED PyObject *__py __pyx_v_n_foreground = (__pyx_v_n_foreground + ((size_t)((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_arr.diminfo[0].strides)) != 0))); } - /* "fastremap.pyx":1185 + /* "fastremap.pyx":1201 * for i in range(sz): * n_foreground += (arr[i] != 0) * return n_foreground # <<<<<<<<<<<<<< @@ -127591,13 +130333,13 @@ static PyObject *__pyx_pf_9fastremap_572_foreground(CYTHON_UNUSED PyObject *__py * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":1179 + /* "fastremap.pyx":1195 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): # <<<<<<<<<<<<<< @@ -127635,7 +130377,7 @@ static PyObject *__pyx_fuse_4__pyx_pw_9fastremap_575_foreground(PyObject *__pyx_ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_foreground (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1195, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_574_foreground(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -127670,11 +130412,11 @@ static PyObject *__pyx_pf_9fastremap_574_foreground(CYTHON_UNUSED PyObject *__py __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1195, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":1180 + /* "fastremap.pyx":1196 * @cython.nonecheck(False) * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -127683,20 +130425,20 @@ static PyObject *__pyx_pf_9fastremap_574_foreground(CYTHON_UNUSED PyObject *__py */ __pyx_v_i = 0; - /* "fastremap.pyx":1181 + /* "fastremap.pyx":1197 * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): * cdef size_t i = 0 * cdef size_t sz = arr.size # <<<<<<<<<<<<<< * cdef size_t n_foreground = 0 * for i in range(sz): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1181, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sz = __pyx_t_2; - /* "fastremap.pyx":1182 + /* "fastremap.pyx":1198 * cdef size_t i = 0 * cdef size_t sz = arr.size * cdef size_t n_foreground = 0 # <<<<<<<<<<<<<< @@ -127705,7 +130447,7 @@ static PyObject *__pyx_pf_9fastremap_574_foreground(CYTHON_UNUSED PyObject *__py */ __pyx_v_n_foreground = 0; - /* "fastremap.pyx":1183 + /* "fastremap.pyx":1199 * cdef size_t sz = arr.size * cdef size_t n_foreground = 0 * for i in range(sz): # <<<<<<<<<<<<<< @@ -127717,7 +130459,7 @@ static PyObject *__pyx_pf_9fastremap_574_foreground(CYTHON_UNUSED PyObject *__py for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "fastremap.pyx":1184 + /* "fastremap.pyx":1200 * cdef size_t n_foreground = 0 * for i in range(sz): * n_foreground += (arr[i] != 0) # <<<<<<<<<<<<<< @@ -127728,7 +130470,7 @@ static PyObject *__pyx_pf_9fastremap_574_foreground(CYTHON_UNUSED PyObject *__py __pyx_v_n_foreground = (__pyx_v_n_foreground + ((size_t)((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_arr.diminfo[0].strides)) != 0))); } - /* "fastremap.pyx":1185 + /* "fastremap.pyx":1201 * for i in range(sz): * n_foreground += (arr[i] != 0) * return n_foreground # <<<<<<<<<<<<<< @@ -127736,13 +130478,13 @@ static PyObject *__pyx_pf_9fastremap_574_foreground(CYTHON_UNUSED PyObject *__py * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":1179 + /* "fastremap.pyx":1195 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): # <<<<<<<<<<<<<< @@ -127780,7 +130522,7 @@ static PyObject *__pyx_fuse_5__pyx_pw_9fastremap_577_foreground(PyObject *__pyx_ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_foreground (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1195, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_576_foreground(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -127815,11 +130557,11 @@ static PyObject *__pyx_pf_9fastremap_576_foreground(CYTHON_UNUSED PyObject *__py __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1195, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":1180 + /* "fastremap.pyx":1196 * @cython.nonecheck(False) * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -127828,20 +130570,20 @@ static PyObject *__pyx_pf_9fastremap_576_foreground(CYTHON_UNUSED PyObject *__py */ __pyx_v_i = 0; - /* "fastremap.pyx":1181 + /* "fastremap.pyx":1197 * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): * cdef size_t i = 0 * cdef size_t sz = arr.size # <<<<<<<<<<<<<< * cdef size_t n_foreground = 0 * for i in range(sz): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1181, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sz = __pyx_t_2; - /* "fastremap.pyx":1182 + /* "fastremap.pyx":1198 * cdef size_t i = 0 * cdef size_t sz = arr.size * cdef size_t n_foreground = 0 # <<<<<<<<<<<<<< @@ -127850,7 +130592,7 @@ static PyObject *__pyx_pf_9fastremap_576_foreground(CYTHON_UNUSED PyObject *__py */ __pyx_v_n_foreground = 0; - /* "fastremap.pyx":1183 + /* "fastremap.pyx":1199 * cdef size_t sz = arr.size * cdef size_t n_foreground = 0 * for i in range(sz): # <<<<<<<<<<<<<< @@ -127862,7 +130604,7 @@ static PyObject *__pyx_pf_9fastremap_576_foreground(CYTHON_UNUSED PyObject *__py for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "fastremap.pyx":1184 + /* "fastremap.pyx":1200 * cdef size_t n_foreground = 0 * for i in range(sz): * n_foreground += (arr[i] != 0) # <<<<<<<<<<<<<< @@ -127873,7 +130615,7 @@ static PyObject *__pyx_pf_9fastremap_576_foreground(CYTHON_UNUSED PyObject *__py __pyx_v_n_foreground = (__pyx_v_n_foreground + ((size_t)((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_arr.diminfo[0].strides)) != 0))); } - /* "fastremap.pyx":1185 + /* "fastremap.pyx":1201 * for i in range(sz): * n_foreground += (arr[i] != 0) * return n_foreground # <<<<<<<<<<<<<< @@ -127881,13 +130623,13 @@ static PyObject *__pyx_pf_9fastremap_576_foreground(CYTHON_UNUSED PyObject *__py * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":1179 + /* "fastremap.pyx":1195 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): # <<<<<<<<<<<<<< @@ -127925,7 +130667,7 @@ static PyObject *__pyx_fuse_6__pyx_pw_9fastremap_579_foreground(PyObject *__pyx_ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_foreground (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1195, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_578_foreground(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -127960,11 +130702,11 @@ static PyObject *__pyx_pf_9fastremap_578_foreground(CYTHON_UNUSED PyObject *__py __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1195, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":1180 + /* "fastremap.pyx":1196 * @cython.nonecheck(False) * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -127973,20 +130715,20 @@ static PyObject *__pyx_pf_9fastremap_578_foreground(CYTHON_UNUSED PyObject *__py */ __pyx_v_i = 0; - /* "fastremap.pyx":1181 + /* "fastremap.pyx":1197 * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): * cdef size_t i = 0 * cdef size_t sz = arr.size # <<<<<<<<<<<<<< * cdef size_t n_foreground = 0 * for i in range(sz): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1181, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sz = __pyx_t_2; - /* "fastremap.pyx":1182 + /* "fastremap.pyx":1198 * cdef size_t i = 0 * cdef size_t sz = arr.size * cdef size_t n_foreground = 0 # <<<<<<<<<<<<<< @@ -127995,7 +130737,7 @@ static PyObject *__pyx_pf_9fastremap_578_foreground(CYTHON_UNUSED PyObject *__py */ __pyx_v_n_foreground = 0; - /* "fastremap.pyx":1183 + /* "fastremap.pyx":1199 * cdef size_t sz = arr.size * cdef size_t n_foreground = 0 * for i in range(sz): # <<<<<<<<<<<<<< @@ -128007,7 +130749,7 @@ static PyObject *__pyx_pf_9fastremap_578_foreground(CYTHON_UNUSED PyObject *__py for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "fastremap.pyx":1184 + /* "fastremap.pyx":1200 * cdef size_t n_foreground = 0 * for i in range(sz): * n_foreground += (arr[i] != 0) # <<<<<<<<<<<<<< @@ -128018,7 +130760,7 @@ static PyObject *__pyx_pf_9fastremap_578_foreground(CYTHON_UNUSED PyObject *__py __pyx_v_n_foreground = (__pyx_v_n_foreground + ((size_t)((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_arr.diminfo[0].strides)) != 0))); } - /* "fastremap.pyx":1185 + /* "fastremap.pyx":1201 * for i in range(sz): * n_foreground += (arr[i] != 0) * return n_foreground # <<<<<<<<<<<<<< @@ -128026,13 +130768,13 @@ static PyObject *__pyx_pf_9fastremap_578_foreground(CYTHON_UNUSED PyObject *__py * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":1179 + /* "fastremap.pyx":1195 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): # <<<<<<<<<<<<<< @@ -128070,7 +130812,7 @@ static PyObject *__pyx_fuse_7__pyx_pw_9fastremap_581_foreground(PyObject *__pyx_ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_foreground (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1195, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_580_foreground(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -128105,11 +130847,11 @@ static PyObject *__pyx_pf_9fastremap_580_foreground(CYTHON_UNUSED PyObject *__py __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1195, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; - /* "fastremap.pyx":1180 + /* "fastremap.pyx":1196 * @cython.nonecheck(False) * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -128118,20 +130860,20 @@ static PyObject *__pyx_pf_9fastremap_580_foreground(CYTHON_UNUSED PyObject *__py */ __pyx_v_i = 0; - /* "fastremap.pyx":1181 + /* "fastremap.pyx":1197 * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): * cdef size_t i = 0 * cdef size_t sz = arr.size # <<<<<<<<<<<<<< * cdef size_t n_foreground = 0 * for i in range(sz): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1181, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sz = __pyx_t_2; - /* "fastremap.pyx":1182 + /* "fastremap.pyx":1198 * cdef size_t i = 0 * cdef size_t sz = arr.size * cdef size_t n_foreground = 0 # <<<<<<<<<<<<<< @@ -128140,7 +130882,7 @@ static PyObject *__pyx_pf_9fastremap_580_foreground(CYTHON_UNUSED PyObject *__py */ __pyx_v_n_foreground = 0; - /* "fastremap.pyx":1183 + /* "fastremap.pyx":1199 * cdef size_t sz = arr.size * cdef size_t n_foreground = 0 * for i in range(sz): # <<<<<<<<<<<<<< @@ -128152,7 +130894,7 @@ static PyObject *__pyx_pf_9fastremap_580_foreground(CYTHON_UNUSED PyObject *__py for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "fastremap.pyx":1184 + /* "fastremap.pyx":1200 * cdef size_t n_foreground = 0 * for i in range(sz): * n_foreground += (arr[i] != 0) # <<<<<<<<<<<<<< @@ -128163,7 +130905,7 @@ static PyObject *__pyx_pf_9fastremap_580_foreground(CYTHON_UNUSED PyObject *__py __pyx_v_n_foreground = (__pyx_v_n_foreground + ((size_t)((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_arr.diminfo[0].strides)) != 0))); } - /* "fastremap.pyx":1185 + /* "fastremap.pyx":1201 * for i in range(sz): * n_foreground += (arr[i] != 0) * return n_foreground # <<<<<<<<<<<<<< @@ -128171,13 +130913,13 @@ static PyObject *__pyx_pf_9fastremap_580_foreground(CYTHON_UNUSED PyObject *__py * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":1179 + /* "fastremap.pyx":1195 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): # <<<<<<<<<<<<<< @@ -128205,7 +130947,7 @@ static PyObject *__pyx_pf_9fastremap_580_foreground(CYTHON_UNUSED PyObject *__py return __pyx_r; } -/* "fastremap.pyx":1190 +/* "fastremap.pyx":1206 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def point_cloud(cnp.ndarray[ALLINT, ndim=3] arr): # <<<<<<<<<<<<<< @@ -128255,23 +130997,23 @@ static PyObject *__pyx_pw_9fastremap_67point_cloud(PyObject *__pyx_self, PyObjec case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 1190, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 1206, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 1190, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 1206, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 1190, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 1206, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 1190, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 1206, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -128288,7 +131030,7 @@ static PyObject *__pyx_pw_9fastremap_67point_cloud(PyObject *__pyx_self, PyObjec } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1190, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1206, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fastremap.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -128350,7 +131092,7 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("point_cloud", 0); __Pyx_INCREF(__pyx_v_kwargs); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -128364,7 +131106,7 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1206, __pyx_L1_error) __pyx_t_3 = ((!__pyx_t_4) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; @@ -128372,7 +131114,7 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_kwargs, Py_None); } - __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -128387,14 +131129,14 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_v____pyx_int64_t_is_signed = (!((((int64_t)-1L) > 0) != 0)); if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 1190, __pyx_L1_error) + __PYX_ERR(0, 1206, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1206, __pyx_L1_error) __pyx_t_2 = ((0 < __pyx_t_5) != 0); if (__pyx_t_2) { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1190, __pyx_L1_error) + __PYX_ERR(0, 1206, __pyx_L1_error) } __pyx_t_1 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0); __Pyx_INCREF(__pyx_t_1); @@ -128411,18 +131153,18 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx } if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 1190, __pyx_L1_error) + __PYX_ERR(0, 1206, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_arr, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_arr, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1206, __pyx_L1_error) __pyx_t_3 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_3; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1190, __pyx_L1_error) + __PYX_ERR(0, 1206, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arg = __pyx_t_1; __pyx_t_1 = 0; @@ -128431,12 +131173,12 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx /*else*/ { if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 1190, __pyx_L1_error) + __PYX_ERR(0, 1206, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1190, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1206, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); @@ -128447,15 +131189,15 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 1190, __pyx_L1_error) + __PYX_ERR(0, 1206, __pyx_L1_error) } __pyx_L6:; while (1) { @@ -128465,7 +131207,7 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -128474,14 +131216,14 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_dtype = __pyx_t_6; __pyx_t_6 = 0; @@ -128503,14 +131245,14 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_2 = (__pyx_v_dtype != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_itemsize = __pyx_t_5; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_kind = __pyx_t_7; __pyx_v_dtype_signed = (__pyx_v_kind == 'i'); @@ -128523,9 +131265,9 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 3) != 0); if (__pyx_t_2) { @@ -128537,7 +131279,7 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; __pyx_L16_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1206, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint16_t)) == __pyx_v_itemsize) != 0); @@ -128546,9 +131288,9 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; goto __pyx_L20_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 3) != 0); if (__pyx_t_2) { @@ -128560,7 +131302,7 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; __pyx_L20_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1206, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint32_t)) == __pyx_v_itemsize) != 0); @@ -128569,9 +131311,9 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; goto __pyx_L24_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 3) != 0); if (__pyx_t_2) { @@ -128583,7 +131325,7 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; __pyx_L24_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1206, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(uint64_t)) == __pyx_v_itemsize) != 0); @@ -128592,9 +131334,9 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; goto __pyx_L28_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 3) != 0); if (__pyx_t_2) { @@ -128606,7 +131348,7 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1206, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int8_t)) == __pyx_v_itemsize) != 0); @@ -128615,9 +131357,9 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; goto __pyx_L32_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 3) != 0); if (__pyx_t_2) { @@ -128629,7 +131371,7 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; __pyx_L32_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1206, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int16_t)) == __pyx_v_itemsize) != 0); @@ -128638,9 +131380,9 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; goto __pyx_L36_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 3) != 0); if (__pyx_t_2) { @@ -128652,7 +131394,7 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; __pyx_L36_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1206, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int32_t)) == __pyx_v_itemsize) != 0); @@ -128661,9 +131403,9 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; goto __pyx_L40_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 3) != 0); if (__pyx_t_2) { @@ -128675,7 +131417,7 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; __pyx_L40_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1206, __pyx_L1_error) goto __pyx_L10_break; } __pyx_t_2 = (((sizeof(int64_t)) == __pyx_v_itemsize) != 0); @@ -128684,9 +131426,9 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; goto __pyx_L44_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 3) != 0); if (__pyx_t_2) { @@ -128698,7 +131440,7 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = __pyx_t_2; __pyx_L44_bool_binop_done:; if (__pyx_t_3) { - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1206, __pyx_L1_error) goto __pyx_L10_break; } break; @@ -128727,7 +131469,7 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1206, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -128749,7 +131491,7 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1206, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -128771,7 +131513,7 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1206, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -128793,7 +131535,7 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1206, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -128815,7 +131557,7 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1206, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -128837,7 +131579,7 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1206, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -128859,7 +131601,7 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1206, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { @@ -128881,27 +131623,27 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1206, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { PyErr_Clear(); } } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1206, __pyx_L1_error) goto __pyx_L10_break; } __pyx_L10_break:; - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_candidates = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = 0; if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 1190, __pyx_L1_error) + __PYX_ERR(0, 1206, __pyx_L1_error) } - __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_1; @@ -128909,12 +131651,12 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx while (1) { __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_9, &__pyx_t_5, &__pyx_t_1, NULL, NULL, __pyx_t_10); if (unlikely(__pyx_t_11 == 0)) break; - if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_1); __pyx_t_1 = 0; __pyx_v_match_found = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { @@ -128928,10 +131670,10 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx } __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, __pyx_kp_s__2) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__2); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -128946,12 +131688,12 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx } __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_12, __pyx_kp_s__3) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_kp_s__3); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF_SET(__pyx_v_src_sig, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_15 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1206, __pyx_L1_error) __pyx_t_16 = __pyx_t_15; for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; @@ -128962,11 +131704,11 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = (__pyx_v_dst_type != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_2) { __pyx_v_match_found = 1; @@ -128982,35 +131724,35 @@ static PyObject *__pyx_pf_9fastremap_66point_cloud(CYTHON_UNUSED PyObject *__pyx __pyx_L82_break:; __pyx_t_2 = (__pyx_v_match_found != 0); if (__pyx_t_2) { - __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1206, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_candidates) != 0); __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 1190, __pyx_L1_error) + __PYX_ERR(0, 1206, __pyx_L1_error) } - __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1206, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_9 > 1) != 0); if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 1190, __pyx_L1_error) + __PYX_ERR(0, 1206, __pyx_L1_error) } /*else*/ { __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_signatures == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1190, __pyx_L1_error) + __PYX_ERR(0, 1206, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; @@ -129052,7 +131794,7 @@ static PyObject *__pyx_fuse_0__pyx_pw_9fastremap_585point_cloud(PyObject *__pyx_ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("point_cloud (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1206, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_584point_cloud(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -129131,18 +131873,18 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1206, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; - /* "fastremap.pyx":1201 + /* "fastremap.pyx":1217 * Returns: ndarray(N, 3, dtype=uint16) * """ * cdef size_t n_foreground = foreground(arr) # <<<<<<<<<<<<<< * * cdef size_t sx = arr.shape[0] */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_foreground_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_foreground_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -129156,14 +131898,14 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_arr)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_arr)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1201, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_n_foreground = __pyx_t_4; - /* "fastremap.pyx":1203 + /* "fastremap.pyx":1219 * cdef size_t n_foreground = foreground(arr) * * cdef size_t sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -129172,7 +131914,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1204 + /* "fastremap.pyx":1220 * * cdef size_t sx = arr.shape[0] * cdef size_t sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -129181,7 +131923,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1205 + /* "fastremap.pyx":1221 * cdef size_t sx = arr.shape[0] * cdef size_t sy = arr.shape[1] * cdef size_t sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -129190,7 +131932,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1207 + /* "fastremap.pyx":1223 * cdef size_t sz = arr.shape[2] * * if n_foreground == 0: # <<<<<<<<<<<<<< @@ -129200,7 +131942,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = ((__pyx_v_n_foreground == 0) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1208 + /* "fastremap.pyx":1224 * * if n_foreground == 0: * return {} # <<<<<<<<<<<<<< @@ -129208,13 +131950,13 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py * cdef cnp.ndarray[ALLINT, ndim=1] ptlabel = np.zeros((n_foreground,), dtype=arr.dtype) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1208, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":1207 + /* "fastremap.pyx":1223 * cdef size_t sz = arr.shape[2] * * if n_foreground == 0: # <<<<<<<<<<<<<< @@ -129223,48 +131965,48 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py */ } - /* "fastremap.pyx":1210 + /* "fastremap.pyx":1226 * return {} * * cdef cnp.ndarray[ALLINT, ndim=1] ptlabel = np.zeros((n_foreground,), dtype=arr.dtype) # <<<<<<<<<<<<<< * cdef cnp.ndarray[uint16_t, ndim=2] ptcloud = np.zeros((n_foreground, 3), dtype=np.uint16) * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1210, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1210, __pyx_L1_error) + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1226, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ptlabel.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_ptlabel = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 1210, __pyx_L1_error) + __PYX_ERR(0, 1226, __pyx_L1_error) } else {__pyx_pybuffernd_ptlabel.diminfo[0].strides = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptlabel.diminfo[0].shape = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.shape[0]; } } @@ -129272,21 +132014,21 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py __pyx_v_ptlabel = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":1211 + /* "fastremap.pyx":1227 * * cdef cnp.ndarray[ALLINT, ndim=1] ptlabel = np.zeros((n_foreground,), dtype=arr.dtype) * cdef cnp.ndarray[uint16_t, ndim=2] ptcloud = np.zeros((n_foreground, 3), dtype=np.uint16) # <<<<<<<<<<<<<< * * cdef size_t i = 0 */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); @@ -129294,32 +132036,32 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1211, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 1211, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1211, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1227, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ptcloud.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_ptcloud = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 1211, __pyx_L1_error) + __PYX_ERR(0, 1227, __pyx_L1_error) } else {__pyx_pybuffernd_ptcloud.diminfo[0].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptcloud.diminfo[0].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ptcloud.diminfo[1].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ptcloud.diminfo[1].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[1]; } } @@ -129327,7 +132069,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py __pyx_v_ptcloud = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1213 + /* "fastremap.pyx":1229 * cdef cnp.ndarray[uint16_t, ndim=2] ptcloud = np.zeros((n_foreground, 3), dtype=np.uint16) * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -129336,7 +132078,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_i = 0; - /* "fastremap.pyx":1214 + /* "fastremap.pyx":1230 * * cdef size_t i = 0 * cdef size_t j = 0 # <<<<<<<<<<<<<< @@ -129345,7 +132087,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_j = 0; - /* "fastremap.pyx":1215 + /* "fastremap.pyx":1231 * cdef size_t i = 0 * cdef size_t j = 0 * cdef size_t k = 0 # <<<<<<<<<<<<<< @@ -129354,7 +132096,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_k = 0; - /* "fastremap.pyx":1217 + /* "fastremap.pyx":1233 * cdef size_t k = 0 * * cdef size_t idx = 0 # <<<<<<<<<<<<<< @@ -129363,7 +132105,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_idx = 0; - /* "fastremap.pyx":1218 + /* "fastremap.pyx":1234 * * cdef size_t idx = 0 * for i in range(sx): # <<<<<<<<<<<<<< @@ -129375,7 +132117,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "fastremap.pyx":1219 + /* "fastremap.pyx":1235 * cdef size_t idx = 0 * for i in range(sx): * for j in range(sy): # <<<<<<<<<<<<<< @@ -129387,7 +132129,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_j = __pyx_t_14; - /* "fastremap.pyx":1220 + /* "fastremap.pyx":1236 * for i in range(sx): * for j in range(sy): * for k in range(sz): # <<<<<<<<<<<<<< @@ -129399,7 +132141,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_k = __pyx_t_17; - /* "fastremap.pyx":1221 + /* "fastremap.pyx":1237 * for j in range(sy): * for k in range(sz): * if arr[i,j,k] != 0: # <<<<<<<<<<<<<< @@ -129412,7 +132154,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = (((*__Pyx_BufPtrStrided3d(uint8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[2].strides)) != 0) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1222 + /* "fastremap.pyx":1238 * for k in range(sz): * if arr[i,j,k] != 0: * ptlabel[idx] = arr[i,j,k] # <<<<<<<<<<<<<< @@ -129425,7 +132167,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_21 = __pyx_v_idx; *__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_ptlabel.diminfo[0].strides) = (*__Pyx_BufPtrStrided3d(uint8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[2].strides)); - /* "fastremap.pyx":1223 + /* "fastremap.pyx":1239 * if arr[i,j,k] != 0: * ptlabel[idx] = arr[i,j,k] * ptcloud[idx,0] = i # <<<<<<<<<<<<<< @@ -129436,7 +132178,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_22 = 0; *__Pyx_BufPtrStrided2d(uint16_t *, __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ptcloud.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ptcloud.diminfo[1].strides) = __pyx_v_i; - /* "fastremap.pyx":1224 + /* "fastremap.pyx":1240 * ptlabel[idx] = arr[i,j,k] * ptcloud[idx,0] = i * ptcloud[idx,1] = j # <<<<<<<<<<<<<< @@ -129447,7 +132189,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_22 = 1; *__Pyx_BufPtrStrided2d(uint16_t *, __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ptcloud.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ptcloud.diminfo[1].strides) = __pyx_v_j; - /* "fastremap.pyx":1225 + /* "fastremap.pyx":1241 * ptcloud[idx,0] = i * ptcloud[idx,1] = j * ptcloud[idx,2] = k # <<<<<<<<<<<<<< @@ -129458,7 +132200,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_22 = 2; *__Pyx_BufPtrStrided2d(uint16_t *, __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ptcloud.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ptcloud.diminfo[1].strides) = __pyx_v_k; - /* "fastremap.pyx":1226 + /* "fastremap.pyx":1242 * ptcloud[idx,1] = j * ptcloud[idx,2] = k * idx += 1 # <<<<<<<<<<<<<< @@ -129467,7 +132209,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_idx = (__pyx_v_idx + 1); - /* "fastremap.pyx":1221 + /* "fastremap.pyx":1237 * for j in range(sy): * for k in range(sz): * if arr[i,j,k] != 0: # <<<<<<<<<<<<<< @@ -129479,14 +132221,14 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py } } - /* "fastremap.pyx":1228 + /* "fastremap.pyx":1244 * idx += 1 * * sortidx = ptlabel.argsort() # <<<<<<<<<<<<<< * ptlabel = ptlabel[sortidx] * ptcloud = ptcloud[sortidx] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ptlabel), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1228, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ptlabel), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -129500,22 +132242,22 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py } __pyx_t_8 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1228, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sortidx = __pyx_t_8; __pyx_t_8 = 0; - /* "fastremap.pyx":1229 + /* "fastremap.pyx":1245 * * sortidx = ptlabel.argsort() * ptlabel = ptlabel[sortidx] # <<<<<<<<<<<<<< * ptcloud = ptcloud[sortidx] * del sortidx */ - __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptlabel), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1229, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptlabel), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1229, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1245, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -129532,22 +132274,22 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_24 = __pyx_t_25 = __pyx_t_26 = 0; } __pyx_pybuffernd_ptlabel.diminfo[0].strides = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptlabel.diminfo[0].shape = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1229, __pyx_L1_error) + if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1245, __pyx_L1_error) } __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_ptlabel, ((PyArrayObject *)__pyx_t_8)); __pyx_t_8 = 0; - /* "fastremap.pyx":1230 + /* "fastremap.pyx":1246 * sortidx = ptlabel.argsort() * ptlabel = ptlabel[sortidx] * ptcloud = ptcloud[sortidx] # <<<<<<<<<<<<<< * del sortidx * */ - __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1230, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1230, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1246, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -129564,13 +132306,13 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_26 = __pyx_t_25 = __pyx_t_24 = 0; } __pyx_pybuffernd_ptcloud.diminfo[0].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptcloud.diminfo[0].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ptcloud.diminfo[1].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ptcloud.diminfo[1].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1230, __pyx_L1_error) + if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1246, __pyx_L1_error) } __pyx_t_9 = 0; __Pyx_DECREF_SET(__pyx_v_ptcloud, ((PyArrayObject *)__pyx_t_8)); __pyx_t_8 = 0; - /* "fastremap.pyx":1231 + /* "fastremap.pyx":1247 * ptlabel = ptlabel[sortidx] * ptcloud = ptcloud[sortidx] * del sortidx # <<<<<<<<<<<<<< @@ -129580,19 +132322,19 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_DECREF(__pyx_v_sortidx); __pyx_v_sortidx = NULL; - /* "fastremap.pyx":1233 + /* "fastremap.pyx":1249 * del sortidx * * ptcloud_by_label = {} # <<<<<<<<<<<<<< * if n_foreground == 1: * ptcloud_by_label[ptlabel[0]] = ptcloud */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1233, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_ptcloud_by_label = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1234 + /* "fastremap.pyx":1250 * * ptcloud_by_label = {} * if n_foreground == 1: # <<<<<<<<<<<<<< @@ -129602,7 +132344,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = ((__pyx_v_n_foreground == 1) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1235 + /* "fastremap.pyx":1251 * ptcloud_by_label = {} * if n_foreground == 1: * ptcloud_by_label[ptlabel[0]] = ptcloud # <<<<<<<<<<<<<< @@ -129610,12 +132352,12 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py * */ __pyx_t_22 = 0; - __pyx_t_8 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1235, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_8, ((PyObject *)__pyx_v_ptcloud)) < 0)) __PYX_ERR(0, 1235, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_8, ((PyObject *)__pyx_v_ptcloud)) < 0)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1236 + /* "fastremap.pyx":1252 * if n_foreground == 1: * ptcloud_by_label[ptlabel[0]] = ptcloud * return ptcloud_by_label # <<<<<<<<<<<<<< @@ -129627,7 +132369,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py __pyx_r = __pyx_v_ptcloud_by_label; goto __pyx_L0; - /* "fastremap.pyx":1234 + /* "fastremap.pyx":1250 * * ptcloud_by_label = {} * if n_foreground == 1: # <<<<<<<<<<<<<< @@ -129636,7 +132378,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py */ } - /* "fastremap.pyx":1238 + /* "fastremap.pyx":1254 * return ptcloud_by_label * * cdef size_t start = 0 # <<<<<<<<<<<<<< @@ -129645,7 +132387,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_start = 0; - /* "fastremap.pyx":1239 + /* "fastremap.pyx":1255 * * cdef size_t start = 0 * cdef size_t end = 0 # <<<<<<<<<<<<<< @@ -129654,7 +132396,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_end = 0; - /* "fastremap.pyx":1240 + /* "fastremap.pyx":1256 * cdef size_t start = 0 * cdef size_t end = 0 * for end in range(1, n_foreground): # <<<<<<<<<<<<<< @@ -129666,7 +132408,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_11 = 1; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_end = __pyx_t_11; - /* "fastremap.pyx":1241 + /* "fastremap.pyx":1257 * cdef size_t end = 0 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: # <<<<<<<<<<<<<< @@ -129678,22 +132420,22 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_ptlabel.diminfo[0].strides)) != (*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ptlabel.diminfo[0].strides))) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1242 + /* "fastremap.pyx":1258 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: * ptcloud_by_label[ptlabel[end - 1]] = ptcloud[start:end,:] # <<<<<<<<<<<<<< * start = end * */ - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PySlice_New(__pyx_t_8, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_6 = PySlice_New(__pyx_t_8, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); @@ -129701,17 +132443,17 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_slice__24); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__24); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_13 = (__pyx_v_end - 1); - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_1, __pyx_t_6) < 0)) __PYX_ERR(0, 1242, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_1, __pyx_t_6) < 0)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":1243 + /* "fastremap.pyx":1259 * if ptlabel[end] != ptlabel[end - 1]: * ptcloud_by_label[ptlabel[end - 1]] = ptcloud[start:end,:] * start = end # <<<<<<<<<<<<<< @@ -129720,7 +132462,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_start = __pyx_v_end; - /* "fastremap.pyx":1241 + /* "fastremap.pyx":1257 * cdef size_t end = 0 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: # <<<<<<<<<<<<<< @@ -129730,19 +132472,19 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py } } - /* "fastremap.pyx":1245 + /* "fastremap.pyx":1261 * start = end * * ptcloud_by_label[ptlabel[end]] = ptcloud[start:,:] # <<<<<<<<<<<<<< * * return ptcloud_by_label */ - __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PySlice_New(__pyx_t_6, Py_None, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_1 = PySlice_New(__pyx_t_6, Py_None, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); @@ -129750,17 +132492,17 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_slice__25); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__25); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = __pyx_v_end; - __pyx_t_6 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_uint8_t((*__Pyx_BufPtrStrided1d(uint8_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_6, __pyx_t_1) < 0)) __PYX_ERR(0, 1245, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_6, __pyx_t_1) < 0)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":1247 + /* "fastremap.pyx":1263 * ptcloud_by_label[ptlabel[end]] = ptcloud[start:,:] * * return ptcloud_by_label # <<<<<<<<<<<<<< @@ -129772,7 +132514,7 @@ static PyObject *__pyx_pf_9fastremap_584point_cloud(CYTHON_UNUSED PyObject *__py __pyx_r = __pyx_v_ptcloud_by_label; goto __pyx_L0; - /* "fastremap.pyx":1190 + /* "fastremap.pyx":1206 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def point_cloud(cnp.ndarray[ALLINT, ndim=3] arr): # <<<<<<<<<<<<<< @@ -129822,7 +132564,7 @@ static PyObject *__pyx_fuse_1__pyx_pw_9fastremap_587point_cloud(PyObject *__pyx_ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("point_cloud (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1206, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_586point_cloud(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -129901,18 +132643,18 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1206, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; - /* "fastremap.pyx":1201 + /* "fastremap.pyx":1217 * Returns: ndarray(N, 3, dtype=uint16) * """ * cdef size_t n_foreground = foreground(arr) # <<<<<<<<<<<<<< * * cdef size_t sx = arr.shape[0] */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_foreground_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_foreground_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -129926,14 +132668,14 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_arr)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_arr)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1201, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_n_foreground = __pyx_t_4; - /* "fastremap.pyx":1203 + /* "fastremap.pyx":1219 * cdef size_t n_foreground = foreground(arr) * * cdef size_t sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -129942,7 +132684,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1204 + /* "fastremap.pyx":1220 * * cdef size_t sx = arr.shape[0] * cdef size_t sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -129951,7 +132693,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1205 + /* "fastremap.pyx":1221 * cdef size_t sx = arr.shape[0] * cdef size_t sy = arr.shape[1] * cdef size_t sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -129960,7 +132702,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1207 + /* "fastremap.pyx":1223 * cdef size_t sz = arr.shape[2] * * if n_foreground == 0: # <<<<<<<<<<<<<< @@ -129970,7 +132712,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = ((__pyx_v_n_foreground == 0) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1208 + /* "fastremap.pyx":1224 * * if n_foreground == 0: * return {} # <<<<<<<<<<<<<< @@ -129978,13 +132720,13 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py * cdef cnp.ndarray[ALLINT, ndim=1] ptlabel = np.zeros((n_foreground,), dtype=arr.dtype) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1208, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":1207 + /* "fastremap.pyx":1223 * cdef size_t sz = arr.shape[2] * * if n_foreground == 0: # <<<<<<<<<<<<<< @@ -129993,48 +132735,48 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py */ } - /* "fastremap.pyx":1210 + /* "fastremap.pyx":1226 * return {} * * cdef cnp.ndarray[ALLINT, ndim=1] ptlabel = np.zeros((n_foreground,), dtype=arr.dtype) # <<<<<<<<<<<<<< * cdef cnp.ndarray[uint16_t, ndim=2] ptcloud = np.zeros((n_foreground, 3), dtype=np.uint16) * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1210, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1210, __pyx_L1_error) + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1226, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ptlabel.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_ptlabel = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 1210, __pyx_L1_error) + __PYX_ERR(0, 1226, __pyx_L1_error) } else {__pyx_pybuffernd_ptlabel.diminfo[0].strides = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptlabel.diminfo[0].shape = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.shape[0]; } } @@ -130042,21 +132784,21 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py __pyx_v_ptlabel = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":1211 + /* "fastremap.pyx":1227 * * cdef cnp.ndarray[ALLINT, ndim=1] ptlabel = np.zeros((n_foreground,), dtype=arr.dtype) * cdef cnp.ndarray[uint16_t, ndim=2] ptcloud = np.zeros((n_foreground, 3), dtype=np.uint16) # <<<<<<<<<<<<<< * * cdef size_t i = 0 */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); @@ -130064,32 +132806,32 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1211, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 1211, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1211, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1227, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ptcloud.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_ptcloud = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 1211, __pyx_L1_error) + __PYX_ERR(0, 1227, __pyx_L1_error) } else {__pyx_pybuffernd_ptcloud.diminfo[0].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptcloud.diminfo[0].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ptcloud.diminfo[1].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ptcloud.diminfo[1].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[1]; } } @@ -130097,7 +132839,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py __pyx_v_ptcloud = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1213 + /* "fastremap.pyx":1229 * cdef cnp.ndarray[uint16_t, ndim=2] ptcloud = np.zeros((n_foreground, 3), dtype=np.uint16) * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -130106,7 +132848,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_i = 0; - /* "fastremap.pyx":1214 + /* "fastremap.pyx":1230 * * cdef size_t i = 0 * cdef size_t j = 0 # <<<<<<<<<<<<<< @@ -130115,7 +132857,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_j = 0; - /* "fastremap.pyx":1215 + /* "fastremap.pyx":1231 * cdef size_t i = 0 * cdef size_t j = 0 * cdef size_t k = 0 # <<<<<<<<<<<<<< @@ -130124,7 +132866,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_k = 0; - /* "fastremap.pyx":1217 + /* "fastremap.pyx":1233 * cdef size_t k = 0 * * cdef size_t idx = 0 # <<<<<<<<<<<<<< @@ -130133,7 +132875,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_idx = 0; - /* "fastremap.pyx":1218 + /* "fastremap.pyx":1234 * * cdef size_t idx = 0 * for i in range(sx): # <<<<<<<<<<<<<< @@ -130145,7 +132887,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "fastremap.pyx":1219 + /* "fastremap.pyx":1235 * cdef size_t idx = 0 * for i in range(sx): * for j in range(sy): # <<<<<<<<<<<<<< @@ -130157,7 +132899,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_j = __pyx_t_14; - /* "fastremap.pyx":1220 + /* "fastremap.pyx":1236 * for i in range(sx): * for j in range(sy): * for k in range(sz): # <<<<<<<<<<<<<< @@ -130169,7 +132911,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_k = __pyx_t_17; - /* "fastremap.pyx":1221 + /* "fastremap.pyx":1237 * for j in range(sy): * for k in range(sz): * if arr[i,j,k] != 0: # <<<<<<<<<<<<<< @@ -130182,7 +132924,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = (((*__Pyx_BufPtrStrided3d(uint16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[2].strides)) != 0) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1222 + /* "fastremap.pyx":1238 * for k in range(sz): * if arr[i,j,k] != 0: * ptlabel[idx] = arr[i,j,k] # <<<<<<<<<<<<<< @@ -130195,7 +132937,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_21 = __pyx_v_idx; *__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_ptlabel.diminfo[0].strides) = (*__Pyx_BufPtrStrided3d(uint16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[2].strides)); - /* "fastremap.pyx":1223 + /* "fastremap.pyx":1239 * if arr[i,j,k] != 0: * ptlabel[idx] = arr[i,j,k] * ptcloud[idx,0] = i # <<<<<<<<<<<<<< @@ -130206,7 +132948,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_22 = 0; *__Pyx_BufPtrStrided2d(uint16_t *, __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ptcloud.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ptcloud.diminfo[1].strides) = __pyx_v_i; - /* "fastremap.pyx":1224 + /* "fastremap.pyx":1240 * ptlabel[idx] = arr[i,j,k] * ptcloud[idx,0] = i * ptcloud[idx,1] = j # <<<<<<<<<<<<<< @@ -130217,7 +132959,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_22 = 1; *__Pyx_BufPtrStrided2d(uint16_t *, __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ptcloud.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ptcloud.diminfo[1].strides) = __pyx_v_j; - /* "fastremap.pyx":1225 + /* "fastremap.pyx":1241 * ptcloud[idx,0] = i * ptcloud[idx,1] = j * ptcloud[idx,2] = k # <<<<<<<<<<<<<< @@ -130228,7 +132970,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_22 = 2; *__Pyx_BufPtrStrided2d(uint16_t *, __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ptcloud.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ptcloud.diminfo[1].strides) = __pyx_v_k; - /* "fastremap.pyx":1226 + /* "fastremap.pyx":1242 * ptcloud[idx,1] = j * ptcloud[idx,2] = k * idx += 1 # <<<<<<<<<<<<<< @@ -130237,7 +132979,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_idx = (__pyx_v_idx + 1); - /* "fastremap.pyx":1221 + /* "fastremap.pyx":1237 * for j in range(sy): * for k in range(sz): * if arr[i,j,k] != 0: # <<<<<<<<<<<<<< @@ -130249,14 +132991,14 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py } } - /* "fastremap.pyx":1228 + /* "fastremap.pyx":1244 * idx += 1 * * sortidx = ptlabel.argsort() # <<<<<<<<<<<<<< * ptlabel = ptlabel[sortidx] * ptcloud = ptcloud[sortidx] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ptlabel), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1228, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ptlabel), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -130270,22 +133012,22 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py } __pyx_t_8 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1228, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sortidx = __pyx_t_8; __pyx_t_8 = 0; - /* "fastremap.pyx":1229 + /* "fastremap.pyx":1245 * * sortidx = ptlabel.argsort() * ptlabel = ptlabel[sortidx] # <<<<<<<<<<<<<< * ptcloud = ptcloud[sortidx] * del sortidx */ - __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptlabel), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1229, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptlabel), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1229, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1245, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -130302,22 +133044,22 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_24 = __pyx_t_25 = __pyx_t_26 = 0; } __pyx_pybuffernd_ptlabel.diminfo[0].strides = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptlabel.diminfo[0].shape = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1229, __pyx_L1_error) + if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1245, __pyx_L1_error) } __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_ptlabel, ((PyArrayObject *)__pyx_t_8)); __pyx_t_8 = 0; - /* "fastremap.pyx":1230 + /* "fastremap.pyx":1246 * sortidx = ptlabel.argsort() * ptlabel = ptlabel[sortidx] * ptcloud = ptcloud[sortidx] # <<<<<<<<<<<<<< * del sortidx * */ - __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1230, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1230, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1246, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -130334,13 +133076,13 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_26 = __pyx_t_25 = __pyx_t_24 = 0; } __pyx_pybuffernd_ptcloud.diminfo[0].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptcloud.diminfo[0].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ptcloud.diminfo[1].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ptcloud.diminfo[1].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1230, __pyx_L1_error) + if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1246, __pyx_L1_error) } __pyx_t_9 = 0; __Pyx_DECREF_SET(__pyx_v_ptcloud, ((PyArrayObject *)__pyx_t_8)); __pyx_t_8 = 0; - /* "fastremap.pyx":1231 + /* "fastremap.pyx":1247 * ptlabel = ptlabel[sortidx] * ptcloud = ptcloud[sortidx] * del sortidx # <<<<<<<<<<<<<< @@ -130350,19 +133092,19 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_DECREF(__pyx_v_sortidx); __pyx_v_sortidx = NULL; - /* "fastremap.pyx":1233 + /* "fastremap.pyx":1249 * del sortidx * * ptcloud_by_label = {} # <<<<<<<<<<<<<< * if n_foreground == 1: * ptcloud_by_label[ptlabel[0]] = ptcloud */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1233, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_ptcloud_by_label = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1234 + /* "fastremap.pyx":1250 * * ptcloud_by_label = {} * if n_foreground == 1: # <<<<<<<<<<<<<< @@ -130372,7 +133114,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = ((__pyx_v_n_foreground == 1) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1235 + /* "fastremap.pyx":1251 * ptcloud_by_label = {} * if n_foreground == 1: * ptcloud_by_label[ptlabel[0]] = ptcloud # <<<<<<<<<<<<<< @@ -130380,12 +133122,12 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py * */ __pyx_t_22 = 0; - __pyx_t_8 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1235, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_8, ((PyObject *)__pyx_v_ptcloud)) < 0)) __PYX_ERR(0, 1235, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_8, ((PyObject *)__pyx_v_ptcloud)) < 0)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1236 + /* "fastremap.pyx":1252 * if n_foreground == 1: * ptcloud_by_label[ptlabel[0]] = ptcloud * return ptcloud_by_label # <<<<<<<<<<<<<< @@ -130397,7 +133139,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py __pyx_r = __pyx_v_ptcloud_by_label; goto __pyx_L0; - /* "fastremap.pyx":1234 + /* "fastremap.pyx":1250 * * ptcloud_by_label = {} * if n_foreground == 1: # <<<<<<<<<<<<<< @@ -130406,7 +133148,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py */ } - /* "fastremap.pyx":1238 + /* "fastremap.pyx":1254 * return ptcloud_by_label * * cdef size_t start = 0 # <<<<<<<<<<<<<< @@ -130415,7 +133157,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_start = 0; - /* "fastremap.pyx":1239 + /* "fastremap.pyx":1255 * * cdef size_t start = 0 * cdef size_t end = 0 # <<<<<<<<<<<<<< @@ -130424,7 +133166,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_end = 0; - /* "fastremap.pyx":1240 + /* "fastremap.pyx":1256 * cdef size_t start = 0 * cdef size_t end = 0 * for end in range(1, n_foreground): # <<<<<<<<<<<<<< @@ -130436,7 +133178,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_11 = 1; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_end = __pyx_t_11; - /* "fastremap.pyx":1241 + /* "fastremap.pyx":1257 * cdef size_t end = 0 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: # <<<<<<<<<<<<<< @@ -130448,22 +133190,22 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_ptlabel.diminfo[0].strides)) != (*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ptlabel.diminfo[0].strides))) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1242 + /* "fastremap.pyx":1258 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: * ptcloud_by_label[ptlabel[end - 1]] = ptcloud[start:end,:] # <<<<<<<<<<<<<< * start = end * */ - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PySlice_New(__pyx_t_8, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_6 = PySlice_New(__pyx_t_8, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); @@ -130471,17 +133213,17 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_slice__26); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__26); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_13 = (__pyx_v_end - 1); - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_1, __pyx_t_6) < 0)) __PYX_ERR(0, 1242, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_1, __pyx_t_6) < 0)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":1243 + /* "fastremap.pyx":1259 * if ptlabel[end] != ptlabel[end - 1]: * ptcloud_by_label[ptlabel[end - 1]] = ptcloud[start:end,:] * start = end # <<<<<<<<<<<<<< @@ -130490,7 +133232,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_start = __pyx_v_end; - /* "fastremap.pyx":1241 + /* "fastremap.pyx":1257 * cdef size_t end = 0 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: # <<<<<<<<<<<<<< @@ -130500,19 +133242,19 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py } } - /* "fastremap.pyx":1245 + /* "fastremap.pyx":1261 * start = end * * ptcloud_by_label[ptlabel[end]] = ptcloud[start:,:] # <<<<<<<<<<<<<< * * return ptcloud_by_label */ - __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PySlice_New(__pyx_t_6, Py_None, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_1 = PySlice_New(__pyx_t_6, Py_None, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); @@ -130520,17 +133262,17 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_slice__25); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__25); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = __pyx_v_end; - __pyx_t_6 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_uint16_t((*__Pyx_BufPtrStrided1d(uint16_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_6, __pyx_t_1) < 0)) __PYX_ERR(0, 1245, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_6, __pyx_t_1) < 0)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":1247 + /* "fastremap.pyx":1263 * ptcloud_by_label[ptlabel[end]] = ptcloud[start:,:] * * return ptcloud_by_label # <<<<<<<<<<<<<< @@ -130542,7 +133284,7 @@ static PyObject *__pyx_pf_9fastremap_586point_cloud(CYTHON_UNUSED PyObject *__py __pyx_r = __pyx_v_ptcloud_by_label; goto __pyx_L0; - /* "fastremap.pyx":1190 + /* "fastremap.pyx":1206 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def point_cloud(cnp.ndarray[ALLINT, ndim=3] arr): # <<<<<<<<<<<<<< @@ -130592,7 +133334,7 @@ static PyObject *__pyx_fuse_2__pyx_pw_9fastremap_589point_cloud(PyObject *__pyx_ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("point_cloud (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1206, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_588point_cloud(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -130671,18 +133413,18 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1206, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; - /* "fastremap.pyx":1201 + /* "fastremap.pyx":1217 * Returns: ndarray(N, 3, dtype=uint16) * """ * cdef size_t n_foreground = foreground(arr) # <<<<<<<<<<<<<< * * cdef size_t sx = arr.shape[0] */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_foreground_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_foreground_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -130696,14 +133438,14 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_arr)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_arr)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1201, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_n_foreground = __pyx_t_4; - /* "fastremap.pyx":1203 + /* "fastremap.pyx":1219 * cdef size_t n_foreground = foreground(arr) * * cdef size_t sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -130712,7 +133454,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1204 + /* "fastremap.pyx":1220 * * cdef size_t sx = arr.shape[0] * cdef size_t sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -130721,7 +133463,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1205 + /* "fastremap.pyx":1221 * cdef size_t sx = arr.shape[0] * cdef size_t sy = arr.shape[1] * cdef size_t sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -130730,7 +133472,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1207 + /* "fastremap.pyx":1223 * cdef size_t sz = arr.shape[2] * * if n_foreground == 0: # <<<<<<<<<<<<<< @@ -130740,7 +133482,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = ((__pyx_v_n_foreground == 0) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1208 + /* "fastremap.pyx":1224 * * if n_foreground == 0: * return {} # <<<<<<<<<<<<<< @@ -130748,13 +133490,13 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py * cdef cnp.ndarray[ALLINT, ndim=1] ptlabel = np.zeros((n_foreground,), dtype=arr.dtype) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1208, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":1207 + /* "fastremap.pyx":1223 * cdef size_t sz = arr.shape[2] * * if n_foreground == 0: # <<<<<<<<<<<<<< @@ -130763,48 +133505,48 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py */ } - /* "fastremap.pyx":1210 + /* "fastremap.pyx":1226 * return {} * * cdef cnp.ndarray[ALLINT, ndim=1] ptlabel = np.zeros((n_foreground,), dtype=arr.dtype) # <<<<<<<<<<<<<< * cdef cnp.ndarray[uint16_t, ndim=2] ptcloud = np.zeros((n_foreground, 3), dtype=np.uint16) * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1210, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1210, __pyx_L1_error) + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1226, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ptlabel.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_ptlabel = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 1210, __pyx_L1_error) + __PYX_ERR(0, 1226, __pyx_L1_error) } else {__pyx_pybuffernd_ptlabel.diminfo[0].strides = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptlabel.diminfo[0].shape = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.shape[0]; } } @@ -130812,21 +133554,21 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py __pyx_v_ptlabel = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":1211 + /* "fastremap.pyx":1227 * * cdef cnp.ndarray[ALLINT, ndim=1] ptlabel = np.zeros((n_foreground,), dtype=arr.dtype) * cdef cnp.ndarray[uint16_t, ndim=2] ptcloud = np.zeros((n_foreground, 3), dtype=np.uint16) # <<<<<<<<<<<<<< * * cdef size_t i = 0 */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); @@ -130834,32 +133576,32 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1211, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 1211, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1211, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1227, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ptcloud.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_ptcloud = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 1211, __pyx_L1_error) + __PYX_ERR(0, 1227, __pyx_L1_error) } else {__pyx_pybuffernd_ptcloud.diminfo[0].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptcloud.diminfo[0].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ptcloud.diminfo[1].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ptcloud.diminfo[1].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[1]; } } @@ -130867,7 +133609,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py __pyx_v_ptcloud = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1213 + /* "fastremap.pyx":1229 * cdef cnp.ndarray[uint16_t, ndim=2] ptcloud = np.zeros((n_foreground, 3), dtype=np.uint16) * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -130876,7 +133618,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_i = 0; - /* "fastremap.pyx":1214 + /* "fastremap.pyx":1230 * * cdef size_t i = 0 * cdef size_t j = 0 # <<<<<<<<<<<<<< @@ -130885,7 +133627,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_j = 0; - /* "fastremap.pyx":1215 + /* "fastremap.pyx":1231 * cdef size_t i = 0 * cdef size_t j = 0 * cdef size_t k = 0 # <<<<<<<<<<<<<< @@ -130894,7 +133636,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_k = 0; - /* "fastremap.pyx":1217 + /* "fastremap.pyx":1233 * cdef size_t k = 0 * * cdef size_t idx = 0 # <<<<<<<<<<<<<< @@ -130903,7 +133645,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_idx = 0; - /* "fastremap.pyx":1218 + /* "fastremap.pyx":1234 * * cdef size_t idx = 0 * for i in range(sx): # <<<<<<<<<<<<<< @@ -130915,7 +133657,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "fastremap.pyx":1219 + /* "fastremap.pyx":1235 * cdef size_t idx = 0 * for i in range(sx): * for j in range(sy): # <<<<<<<<<<<<<< @@ -130927,7 +133669,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_j = __pyx_t_14; - /* "fastremap.pyx":1220 + /* "fastremap.pyx":1236 * for i in range(sx): * for j in range(sy): * for k in range(sz): # <<<<<<<<<<<<<< @@ -130939,7 +133681,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_k = __pyx_t_17; - /* "fastremap.pyx":1221 + /* "fastremap.pyx":1237 * for j in range(sy): * for k in range(sz): * if arr[i,j,k] != 0: # <<<<<<<<<<<<<< @@ -130952,7 +133694,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = (((*__Pyx_BufPtrStrided3d(uint32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[2].strides)) != 0) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1222 + /* "fastremap.pyx":1238 * for k in range(sz): * if arr[i,j,k] != 0: * ptlabel[idx] = arr[i,j,k] # <<<<<<<<<<<<<< @@ -130965,7 +133707,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_21 = __pyx_v_idx; *__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_ptlabel.diminfo[0].strides) = (*__Pyx_BufPtrStrided3d(uint32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[2].strides)); - /* "fastremap.pyx":1223 + /* "fastremap.pyx":1239 * if arr[i,j,k] != 0: * ptlabel[idx] = arr[i,j,k] * ptcloud[idx,0] = i # <<<<<<<<<<<<<< @@ -130976,7 +133718,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_22 = 0; *__Pyx_BufPtrStrided2d(uint16_t *, __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ptcloud.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ptcloud.diminfo[1].strides) = __pyx_v_i; - /* "fastremap.pyx":1224 + /* "fastremap.pyx":1240 * ptlabel[idx] = arr[i,j,k] * ptcloud[idx,0] = i * ptcloud[idx,1] = j # <<<<<<<<<<<<<< @@ -130987,7 +133729,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_22 = 1; *__Pyx_BufPtrStrided2d(uint16_t *, __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ptcloud.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ptcloud.diminfo[1].strides) = __pyx_v_j; - /* "fastremap.pyx":1225 + /* "fastremap.pyx":1241 * ptcloud[idx,0] = i * ptcloud[idx,1] = j * ptcloud[idx,2] = k # <<<<<<<<<<<<<< @@ -130998,7 +133740,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_22 = 2; *__Pyx_BufPtrStrided2d(uint16_t *, __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ptcloud.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ptcloud.diminfo[1].strides) = __pyx_v_k; - /* "fastremap.pyx":1226 + /* "fastremap.pyx":1242 * ptcloud[idx,1] = j * ptcloud[idx,2] = k * idx += 1 # <<<<<<<<<<<<<< @@ -131007,7 +133749,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_idx = (__pyx_v_idx + 1); - /* "fastremap.pyx":1221 + /* "fastremap.pyx":1237 * for j in range(sy): * for k in range(sz): * if arr[i,j,k] != 0: # <<<<<<<<<<<<<< @@ -131019,14 +133761,14 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py } } - /* "fastremap.pyx":1228 + /* "fastremap.pyx":1244 * idx += 1 * * sortidx = ptlabel.argsort() # <<<<<<<<<<<<<< * ptlabel = ptlabel[sortidx] * ptcloud = ptcloud[sortidx] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ptlabel), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1228, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ptlabel), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -131040,22 +133782,22 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py } __pyx_t_8 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1228, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sortidx = __pyx_t_8; __pyx_t_8 = 0; - /* "fastremap.pyx":1229 + /* "fastremap.pyx":1245 * * sortidx = ptlabel.argsort() * ptlabel = ptlabel[sortidx] # <<<<<<<<<<<<<< * ptcloud = ptcloud[sortidx] * del sortidx */ - __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptlabel), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1229, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptlabel), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1229, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1245, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -131072,22 +133814,22 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_24 = __pyx_t_25 = __pyx_t_26 = 0; } __pyx_pybuffernd_ptlabel.diminfo[0].strides = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptlabel.diminfo[0].shape = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1229, __pyx_L1_error) + if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1245, __pyx_L1_error) } __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_ptlabel, ((PyArrayObject *)__pyx_t_8)); __pyx_t_8 = 0; - /* "fastremap.pyx":1230 + /* "fastremap.pyx":1246 * sortidx = ptlabel.argsort() * ptlabel = ptlabel[sortidx] * ptcloud = ptcloud[sortidx] # <<<<<<<<<<<<<< * del sortidx * */ - __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1230, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1230, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1246, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -131104,13 +133846,13 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_26 = __pyx_t_25 = __pyx_t_24 = 0; } __pyx_pybuffernd_ptcloud.diminfo[0].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptcloud.diminfo[0].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ptcloud.diminfo[1].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ptcloud.diminfo[1].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1230, __pyx_L1_error) + if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1246, __pyx_L1_error) } __pyx_t_9 = 0; __Pyx_DECREF_SET(__pyx_v_ptcloud, ((PyArrayObject *)__pyx_t_8)); __pyx_t_8 = 0; - /* "fastremap.pyx":1231 + /* "fastremap.pyx":1247 * ptlabel = ptlabel[sortidx] * ptcloud = ptcloud[sortidx] * del sortidx # <<<<<<<<<<<<<< @@ -131120,19 +133862,19 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_DECREF(__pyx_v_sortidx); __pyx_v_sortidx = NULL; - /* "fastremap.pyx":1233 + /* "fastremap.pyx":1249 * del sortidx * * ptcloud_by_label = {} # <<<<<<<<<<<<<< * if n_foreground == 1: * ptcloud_by_label[ptlabel[0]] = ptcloud */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1233, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_ptcloud_by_label = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1234 + /* "fastremap.pyx":1250 * * ptcloud_by_label = {} * if n_foreground == 1: # <<<<<<<<<<<<<< @@ -131142,7 +133884,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = ((__pyx_v_n_foreground == 1) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1235 + /* "fastremap.pyx":1251 * ptcloud_by_label = {} * if n_foreground == 1: * ptcloud_by_label[ptlabel[0]] = ptcloud # <<<<<<<<<<<<<< @@ -131150,12 +133892,12 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py * */ __pyx_t_22 = 0; - __pyx_t_8 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1235, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_8, ((PyObject *)__pyx_v_ptcloud)) < 0)) __PYX_ERR(0, 1235, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_8, ((PyObject *)__pyx_v_ptcloud)) < 0)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1236 + /* "fastremap.pyx":1252 * if n_foreground == 1: * ptcloud_by_label[ptlabel[0]] = ptcloud * return ptcloud_by_label # <<<<<<<<<<<<<< @@ -131167,7 +133909,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py __pyx_r = __pyx_v_ptcloud_by_label; goto __pyx_L0; - /* "fastremap.pyx":1234 + /* "fastremap.pyx":1250 * * ptcloud_by_label = {} * if n_foreground == 1: # <<<<<<<<<<<<<< @@ -131176,7 +133918,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py */ } - /* "fastremap.pyx":1238 + /* "fastremap.pyx":1254 * return ptcloud_by_label * * cdef size_t start = 0 # <<<<<<<<<<<<<< @@ -131185,7 +133927,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_start = 0; - /* "fastremap.pyx":1239 + /* "fastremap.pyx":1255 * * cdef size_t start = 0 * cdef size_t end = 0 # <<<<<<<<<<<<<< @@ -131194,7 +133936,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_end = 0; - /* "fastremap.pyx":1240 + /* "fastremap.pyx":1256 * cdef size_t start = 0 * cdef size_t end = 0 * for end in range(1, n_foreground): # <<<<<<<<<<<<<< @@ -131206,7 +133948,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_11 = 1; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_end = __pyx_t_11; - /* "fastremap.pyx":1241 + /* "fastremap.pyx":1257 * cdef size_t end = 0 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: # <<<<<<<<<<<<<< @@ -131218,22 +133960,22 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_ptlabel.diminfo[0].strides)) != (*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ptlabel.diminfo[0].strides))) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1242 + /* "fastremap.pyx":1258 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: * ptcloud_by_label[ptlabel[end - 1]] = ptcloud[start:end,:] # <<<<<<<<<<<<<< * start = end * */ - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PySlice_New(__pyx_t_8, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_6 = PySlice_New(__pyx_t_8, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); @@ -131241,17 +133983,17 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_slice__27); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__27); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_13 = (__pyx_v_end - 1); - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_1, __pyx_t_6) < 0)) __PYX_ERR(0, 1242, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_1, __pyx_t_6) < 0)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":1243 + /* "fastremap.pyx":1259 * if ptlabel[end] != ptlabel[end - 1]: * ptcloud_by_label[ptlabel[end - 1]] = ptcloud[start:end,:] * start = end # <<<<<<<<<<<<<< @@ -131260,7 +134002,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_start = __pyx_v_end; - /* "fastremap.pyx":1241 + /* "fastremap.pyx":1257 * cdef size_t end = 0 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: # <<<<<<<<<<<<<< @@ -131270,19 +134012,19 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py } } - /* "fastremap.pyx":1245 + /* "fastremap.pyx":1261 * start = end * * ptcloud_by_label[ptlabel[end]] = ptcloud[start:,:] # <<<<<<<<<<<<<< * * return ptcloud_by_label */ - __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PySlice_New(__pyx_t_6, Py_None, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_1 = PySlice_New(__pyx_t_6, Py_None, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); @@ -131290,17 +134032,17 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_slice__25); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__25); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = __pyx_v_end; - __pyx_t_6 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_uint32_t((*__Pyx_BufPtrStrided1d(uint32_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_6, __pyx_t_1) < 0)) __PYX_ERR(0, 1245, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_6, __pyx_t_1) < 0)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":1247 + /* "fastremap.pyx":1263 * ptcloud_by_label[ptlabel[end]] = ptcloud[start:,:] * * return ptcloud_by_label # <<<<<<<<<<<<<< @@ -131312,7 +134054,7 @@ static PyObject *__pyx_pf_9fastremap_588point_cloud(CYTHON_UNUSED PyObject *__py __pyx_r = __pyx_v_ptcloud_by_label; goto __pyx_L0; - /* "fastremap.pyx":1190 + /* "fastremap.pyx":1206 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def point_cloud(cnp.ndarray[ALLINT, ndim=3] arr): # <<<<<<<<<<<<<< @@ -131362,7 +134104,7 @@ static PyObject *__pyx_fuse_3__pyx_pw_9fastremap_591point_cloud(PyObject *__pyx_ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("point_cloud (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1206, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_590point_cloud(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -131441,18 +134183,18 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1206, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; - /* "fastremap.pyx":1201 + /* "fastremap.pyx":1217 * Returns: ndarray(N, 3, dtype=uint16) * """ * cdef size_t n_foreground = foreground(arr) # <<<<<<<<<<<<<< * * cdef size_t sx = arr.shape[0] */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_foreground_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_foreground_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -131466,14 +134208,14 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_arr)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_arr)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1201, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_n_foreground = __pyx_t_4; - /* "fastremap.pyx":1203 + /* "fastremap.pyx":1219 * cdef size_t n_foreground = foreground(arr) * * cdef size_t sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -131482,7 +134224,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1204 + /* "fastremap.pyx":1220 * * cdef size_t sx = arr.shape[0] * cdef size_t sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -131491,7 +134233,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1205 + /* "fastremap.pyx":1221 * cdef size_t sx = arr.shape[0] * cdef size_t sy = arr.shape[1] * cdef size_t sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -131500,7 +134242,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1207 + /* "fastremap.pyx":1223 * cdef size_t sz = arr.shape[2] * * if n_foreground == 0: # <<<<<<<<<<<<<< @@ -131510,7 +134252,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = ((__pyx_v_n_foreground == 0) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1208 + /* "fastremap.pyx":1224 * * if n_foreground == 0: * return {} # <<<<<<<<<<<<<< @@ -131518,13 +134260,13 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py * cdef cnp.ndarray[ALLINT, ndim=1] ptlabel = np.zeros((n_foreground,), dtype=arr.dtype) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1208, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":1207 + /* "fastremap.pyx":1223 * cdef size_t sz = arr.shape[2] * * if n_foreground == 0: # <<<<<<<<<<<<<< @@ -131533,48 +134275,48 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py */ } - /* "fastremap.pyx":1210 + /* "fastremap.pyx":1226 * return {} * * cdef cnp.ndarray[ALLINT, ndim=1] ptlabel = np.zeros((n_foreground,), dtype=arr.dtype) # <<<<<<<<<<<<<< * cdef cnp.ndarray[uint16_t, ndim=2] ptcloud = np.zeros((n_foreground, 3), dtype=np.uint16) * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1210, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1210, __pyx_L1_error) + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1226, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ptlabel.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_ptlabel = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 1210, __pyx_L1_error) + __PYX_ERR(0, 1226, __pyx_L1_error) } else {__pyx_pybuffernd_ptlabel.diminfo[0].strides = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptlabel.diminfo[0].shape = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.shape[0]; } } @@ -131582,21 +134324,21 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py __pyx_v_ptlabel = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":1211 + /* "fastremap.pyx":1227 * * cdef cnp.ndarray[ALLINT, ndim=1] ptlabel = np.zeros((n_foreground,), dtype=arr.dtype) * cdef cnp.ndarray[uint16_t, ndim=2] ptcloud = np.zeros((n_foreground, 3), dtype=np.uint16) # <<<<<<<<<<<<<< * * cdef size_t i = 0 */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); @@ -131604,32 +134346,32 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1211, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 1211, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1211, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1227, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ptcloud.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_ptcloud = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 1211, __pyx_L1_error) + __PYX_ERR(0, 1227, __pyx_L1_error) } else {__pyx_pybuffernd_ptcloud.diminfo[0].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptcloud.diminfo[0].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ptcloud.diminfo[1].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ptcloud.diminfo[1].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[1]; } } @@ -131637,7 +134379,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py __pyx_v_ptcloud = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1213 + /* "fastremap.pyx":1229 * cdef cnp.ndarray[uint16_t, ndim=2] ptcloud = np.zeros((n_foreground, 3), dtype=np.uint16) * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -131646,7 +134388,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_i = 0; - /* "fastremap.pyx":1214 + /* "fastremap.pyx":1230 * * cdef size_t i = 0 * cdef size_t j = 0 # <<<<<<<<<<<<<< @@ -131655,7 +134397,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_j = 0; - /* "fastremap.pyx":1215 + /* "fastremap.pyx":1231 * cdef size_t i = 0 * cdef size_t j = 0 * cdef size_t k = 0 # <<<<<<<<<<<<<< @@ -131664,7 +134406,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_k = 0; - /* "fastremap.pyx":1217 + /* "fastremap.pyx":1233 * cdef size_t k = 0 * * cdef size_t idx = 0 # <<<<<<<<<<<<<< @@ -131673,7 +134415,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_idx = 0; - /* "fastremap.pyx":1218 + /* "fastremap.pyx":1234 * * cdef size_t idx = 0 * for i in range(sx): # <<<<<<<<<<<<<< @@ -131685,7 +134427,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "fastremap.pyx":1219 + /* "fastremap.pyx":1235 * cdef size_t idx = 0 * for i in range(sx): * for j in range(sy): # <<<<<<<<<<<<<< @@ -131697,7 +134439,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_j = __pyx_t_14; - /* "fastremap.pyx":1220 + /* "fastremap.pyx":1236 * for i in range(sx): * for j in range(sy): * for k in range(sz): # <<<<<<<<<<<<<< @@ -131709,7 +134451,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_k = __pyx_t_17; - /* "fastremap.pyx":1221 + /* "fastremap.pyx":1237 * for j in range(sy): * for k in range(sz): * if arr[i,j,k] != 0: # <<<<<<<<<<<<<< @@ -131722,7 +134464,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = (((*__Pyx_BufPtrStrided3d(uint64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[2].strides)) != 0) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1222 + /* "fastremap.pyx":1238 * for k in range(sz): * if arr[i,j,k] != 0: * ptlabel[idx] = arr[i,j,k] # <<<<<<<<<<<<<< @@ -131735,7 +134477,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_21 = __pyx_v_idx; *__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_ptlabel.diminfo[0].strides) = (*__Pyx_BufPtrStrided3d(uint64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[2].strides)); - /* "fastremap.pyx":1223 + /* "fastremap.pyx":1239 * if arr[i,j,k] != 0: * ptlabel[idx] = arr[i,j,k] * ptcloud[idx,0] = i # <<<<<<<<<<<<<< @@ -131746,7 +134488,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_22 = 0; *__Pyx_BufPtrStrided2d(uint16_t *, __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ptcloud.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ptcloud.diminfo[1].strides) = __pyx_v_i; - /* "fastremap.pyx":1224 + /* "fastremap.pyx":1240 * ptlabel[idx] = arr[i,j,k] * ptcloud[idx,0] = i * ptcloud[idx,1] = j # <<<<<<<<<<<<<< @@ -131757,7 +134499,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_22 = 1; *__Pyx_BufPtrStrided2d(uint16_t *, __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ptcloud.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ptcloud.diminfo[1].strides) = __pyx_v_j; - /* "fastremap.pyx":1225 + /* "fastremap.pyx":1241 * ptcloud[idx,0] = i * ptcloud[idx,1] = j * ptcloud[idx,2] = k # <<<<<<<<<<<<<< @@ -131768,7 +134510,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_22 = 2; *__Pyx_BufPtrStrided2d(uint16_t *, __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ptcloud.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ptcloud.diminfo[1].strides) = __pyx_v_k; - /* "fastremap.pyx":1226 + /* "fastremap.pyx":1242 * ptcloud[idx,1] = j * ptcloud[idx,2] = k * idx += 1 # <<<<<<<<<<<<<< @@ -131777,7 +134519,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_idx = (__pyx_v_idx + 1); - /* "fastremap.pyx":1221 + /* "fastremap.pyx":1237 * for j in range(sy): * for k in range(sz): * if arr[i,j,k] != 0: # <<<<<<<<<<<<<< @@ -131789,14 +134531,14 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py } } - /* "fastremap.pyx":1228 + /* "fastremap.pyx":1244 * idx += 1 * * sortidx = ptlabel.argsort() # <<<<<<<<<<<<<< * ptlabel = ptlabel[sortidx] * ptcloud = ptcloud[sortidx] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ptlabel), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1228, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ptlabel), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -131810,22 +134552,22 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py } __pyx_t_8 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1228, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sortidx = __pyx_t_8; __pyx_t_8 = 0; - /* "fastremap.pyx":1229 + /* "fastremap.pyx":1245 * * sortidx = ptlabel.argsort() * ptlabel = ptlabel[sortidx] # <<<<<<<<<<<<<< * ptcloud = ptcloud[sortidx] * del sortidx */ - __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptlabel), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1229, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptlabel), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1229, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1245, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -131842,22 +134584,22 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_24 = __pyx_t_25 = __pyx_t_26 = 0; } __pyx_pybuffernd_ptlabel.diminfo[0].strides = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptlabel.diminfo[0].shape = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1229, __pyx_L1_error) + if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1245, __pyx_L1_error) } __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_ptlabel, ((PyArrayObject *)__pyx_t_8)); __pyx_t_8 = 0; - /* "fastremap.pyx":1230 + /* "fastremap.pyx":1246 * sortidx = ptlabel.argsort() * ptlabel = ptlabel[sortidx] * ptcloud = ptcloud[sortidx] # <<<<<<<<<<<<<< * del sortidx * */ - __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1230, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1230, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1246, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -131874,13 +134616,13 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_26 = __pyx_t_25 = __pyx_t_24 = 0; } __pyx_pybuffernd_ptcloud.diminfo[0].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptcloud.diminfo[0].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ptcloud.diminfo[1].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ptcloud.diminfo[1].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1230, __pyx_L1_error) + if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1246, __pyx_L1_error) } __pyx_t_9 = 0; __Pyx_DECREF_SET(__pyx_v_ptcloud, ((PyArrayObject *)__pyx_t_8)); __pyx_t_8 = 0; - /* "fastremap.pyx":1231 + /* "fastremap.pyx":1247 * ptlabel = ptlabel[sortidx] * ptcloud = ptcloud[sortidx] * del sortidx # <<<<<<<<<<<<<< @@ -131890,19 +134632,19 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_DECREF(__pyx_v_sortidx); __pyx_v_sortidx = NULL; - /* "fastremap.pyx":1233 + /* "fastremap.pyx":1249 * del sortidx * * ptcloud_by_label = {} # <<<<<<<<<<<<<< * if n_foreground == 1: * ptcloud_by_label[ptlabel[0]] = ptcloud */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1233, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_ptcloud_by_label = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1234 + /* "fastremap.pyx":1250 * * ptcloud_by_label = {} * if n_foreground == 1: # <<<<<<<<<<<<<< @@ -131912,7 +134654,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = ((__pyx_v_n_foreground == 1) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1235 + /* "fastremap.pyx":1251 * ptcloud_by_label = {} * if n_foreground == 1: * ptcloud_by_label[ptlabel[0]] = ptcloud # <<<<<<<<<<<<<< @@ -131920,12 +134662,12 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py * */ __pyx_t_22 = 0; - __pyx_t_8 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1235, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_8, ((PyObject *)__pyx_v_ptcloud)) < 0)) __PYX_ERR(0, 1235, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_8, ((PyObject *)__pyx_v_ptcloud)) < 0)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1236 + /* "fastremap.pyx":1252 * if n_foreground == 1: * ptcloud_by_label[ptlabel[0]] = ptcloud * return ptcloud_by_label # <<<<<<<<<<<<<< @@ -131937,7 +134679,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py __pyx_r = __pyx_v_ptcloud_by_label; goto __pyx_L0; - /* "fastremap.pyx":1234 + /* "fastremap.pyx":1250 * * ptcloud_by_label = {} * if n_foreground == 1: # <<<<<<<<<<<<<< @@ -131946,7 +134688,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py */ } - /* "fastremap.pyx":1238 + /* "fastremap.pyx":1254 * return ptcloud_by_label * * cdef size_t start = 0 # <<<<<<<<<<<<<< @@ -131955,7 +134697,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_start = 0; - /* "fastremap.pyx":1239 + /* "fastremap.pyx":1255 * * cdef size_t start = 0 * cdef size_t end = 0 # <<<<<<<<<<<<<< @@ -131964,7 +134706,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_end = 0; - /* "fastremap.pyx":1240 + /* "fastremap.pyx":1256 * cdef size_t start = 0 * cdef size_t end = 0 * for end in range(1, n_foreground): # <<<<<<<<<<<<<< @@ -131976,7 +134718,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_11 = 1; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_end = __pyx_t_11; - /* "fastremap.pyx":1241 + /* "fastremap.pyx":1257 * cdef size_t end = 0 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: # <<<<<<<<<<<<<< @@ -131988,22 +134730,22 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_ptlabel.diminfo[0].strides)) != (*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ptlabel.diminfo[0].strides))) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1242 + /* "fastremap.pyx":1258 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: * ptcloud_by_label[ptlabel[end - 1]] = ptcloud[start:end,:] # <<<<<<<<<<<<<< * start = end * */ - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PySlice_New(__pyx_t_8, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_6 = PySlice_New(__pyx_t_8, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); @@ -132011,17 +134753,17 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_slice__28); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__28); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_13 = (__pyx_v_end - 1); - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_1, __pyx_t_6) < 0)) __PYX_ERR(0, 1242, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_1, __pyx_t_6) < 0)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":1243 + /* "fastremap.pyx":1259 * if ptlabel[end] != ptlabel[end - 1]: * ptcloud_by_label[ptlabel[end - 1]] = ptcloud[start:end,:] * start = end # <<<<<<<<<<<<<< @@ -132030,7 +134772,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_start = __pyx_v_end; - /* "fastremap.pyx":1241 + /* "fastremap.pyx":1257 * cdef size_t end = 0 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: # <<<<<<<<<<<<<< @@ -132040,19 +134782,19 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py } } - /* "fastremap.pyx":1245 + /* "fastremap.pyx":1261 * start = end * * ptcloud_by_label[ptlabel[end]] = ptcloud[start:,:] # <<<<<<<<<<<<<< * * return ptcloud_by_label */ - __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PySlice_New(__pyx_t_6, Py_None, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_1 = PySlice_New(__pyx_t_6, Py_None, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); @@ -132060,17 +134802,17 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_slice__25); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__25); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = __pyx_v_end; - __pyx_t_6 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_uint64_t((*__Pyx_BufPtrStrided1d(uint64_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_6, __pyx_t_1) < 0)) __PYX_ERR(0, 1245, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_6, __pyx_t_1) < 0)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":1247 + /* "fastremap.pyx":1263 * ptcloud_by_label[ptlabel[end]] = ptcloud[start:,:] * * return ptcloud_by_label # <<<<<<<<<<<<<< @@ -132082,7 +134824,7 @@ static PyObject *__pyx_pf_9fastremap_590point_cloud(CYTHON_UNUSED PyObject *__py __pyx_r = __pyx_v_ptcloud_by_label; goto __pyx_L0; - /* "fastremap.pyx":1190 + /* "fastremap.pyx":1206 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def point_cloud(cnp.ndarray[ALLINT, ndim=3] arr): # <<<<<<<<<<<<<< @@ -132132,7 +134874,7 @@ static PyObject *__pyx_fuse_4__pyx_pw_9fastremap_593point_cloud(PyObject *__pyx_ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("point_cloud (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1206, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_592point_cloud(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -132211,18 +134953,18 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1206, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; - /* "fastremap.pyx":1201 + /* "fastremap.pyx":1217 * Returns: ndarray(N, 3, dtype=uint16) * """ * cdef size_t n_foreground = foreground(arr) # <<<<<<<<<<<<<< * * cdef size_t sx = arr.shape[0] */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_foreground_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_foreground_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -132236,14 +134978,14 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_arr)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_arr)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1201, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_n_foreground = __pyx_t_4; - /* "fastremap.pyx":1203 + /* "fastremap.pyx":1219 * cdef size_t n_foreground = foreground(arr) * * cdef size_t sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -132252,7 +134994,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1204 + /* "fastremap.pyx":1220 * * cdef size_t sx = arr.shape[0] * cdef size_t sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -132261,7 +135003,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1205 + /* "fastremap.pyx":1221 * cdef size_t sx = arr.shape[0] * cdef size_t sy = arr.shape[1] * cdef size_t sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -132270,7 +135012,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1207 + /* "fastremap.pyx":1223 * cdef size_t sz = arr.shape[2] * * if n_foreground == 0: # <<<<<<<<<<<<<< @@ -132280,7 +135022,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = ((__pyx_v_n_foreground == 0) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1208 + /* "fastremap.pyx":1224 * * if n_foreground == 0: * return {} # <<<<<<<<<<<<<< @@ -132288,13 +135030,13 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py * cdef cnp.ndarray[ALLINT, ndim=1] ptlabel = np.zeros((n_foreground,), dtype=arr.dtype) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1208, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":1207 + /* "fastremap.pyx":1223 * cdef size_t sz = arr.shape[2] * * if n_foreground == 0: # <<<<<<<<<<<<<< @@ -132303,48 +135045,48 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py */ } - /* "fastremap.pyx":1210 + /* "fastremap.pyx":1226 * return {} * * cdef cnp.ndarray[ALLINT, ndim=1] ptlabel = np.zeros((n_foreground,), dtype=arr.dtype) # <<<<<<<<<<<<<< * cdef cnp.ndarray[uint16_t, ndim=2] ptcloud = np.zeros((n_foreground, 3), dtype=np.uint16) * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1210, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1210, __pyx_L1_error) + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1226, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ptlabel.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn_int8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_ptlabel = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 1210, __pyx_L1_error) + __PYX_ERR(0, 1226, __pyx_L1_error) } else {__pyx_pybuffernd_ptlabel.diminfo[0].strides = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptlabel.diminfo[0].shape = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.shape[0]; } } @@ -132352,21 +135094,21 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py __pyx_v_ptlabel = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":1211 + /* "fastremap.pyx":1227 * * cdef cnp.ndarray[ALLINT, ndim=1] ptlabel = np.zeros((n_foreground,), dtype=arr.dtype) * cdef cnp.ndarray[uint16_t, ndim=2] ptcloud = np.zeros((n_foreground, 3), dtype=np.uint16) # <<<<<<<<<<<<<< * * cdef size_t i = 0 */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); @@ -132374,32 +135116,32 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1211, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 1211, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1211, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1227, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ptcloud.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_ptcloud = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 1211, __pyx_L1_error) + __PYX_ERR(0, 1227, __pyx_L1_error) } else {__pyx_pybuffernd_ptcloud.diminfo[0].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptcloud.diminfo[0].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ptcloud.diminfo[1].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ptcloud.diminfo[1].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[1]; } } @@ -132407,7 +135149,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py __pyx_v_ptcloud = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1213 + /* "fastremap.pyx":1229 * cdef cnp.ndarray[uint16_t, ndim=2] ptcloud = np.zeros((n_foreground, 3), dtype=np.uint16) * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -132416,7 +135158,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_i = 0; - /* "fastremap.pyx":1214 + /* "fastremap.pyx":1230 * * cdef size_t i = 0 * cdef size_t j = 0 # <<<<<<<<<<<<<< @@ -132425,7 +135167,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_j = 0; - /* "fastremap.pyx":1215 + /* "fastremap.pyx":1231 * cdef size_t i = 0 * cdef size_t j = 0 * cdef size_t k = 0 # <<<<<<<<<<<<<< @@ -132434,7 +135176,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_k = 0; - /* "fastremap.pyx":1217 + /* "fastremap.pyx":1233 * cdef size_t k = 0 * * cdef size_t idx = 0 # <<<<<<<<<<<<<< @@ -132443,7 +135185,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_idx = 0; - /* "fastremap.pyx":1218 + /* "fastremap.pyx":1234 * * cdef size_t idx = 0 * for i in range(sx): # <<<<<<<<<<<<<< @@ -132455,7 +135197,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "fastremap.pyx":1219 + /* "fastremap.pyx":1235 * cdef size_t idx = 0 * for i in range(sx): * for j in range(sy): # <<<<<<<<<<<<<< @@ -132467,7 +135209,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_j = __pyx_t_14; - /* "fastremap.pyx":1220 + /* "fastremap.pyx":1236 * for i in range(sx): * for j in range(sy): * for k in range(sz): # <<<<<<<<<<<<<< @@ -132479,7 +135221,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_k = __pyx_t_17; - /* "fastremap.pyx":1221 + /* "fastremap.pyx":1237 * for j in range(sy): * for k in range(sz): * if arr[i,j,k] != 0: # <<<<<<<<<<<<<< @@ -132492,7 +135234,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = (((*__Pyx_BufPtrStrided3d(int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[2].strides)) != 0) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1222 + /* "fastremap.pyx":1238 * for k in range(sz): * if arr[i,j,k] != 0: * ptlabel[idx] = arr[i,j,k] # <<<<<<<<<<<<<< @@ -132505,7 +135247,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_21 = __pyx_v_idx; *__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_ptlabel.diminfo[0].strides) = (*__Pyx_BufPtrStrided3d(int8_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[2].strides)); - /* "fastremap.pyx":1223 + /* "fastremap.pyx":1239 * if arr[i,j,k] != 0: * ptlabel[idx] = arr[i,j,k] * ptcloud[idx,0] = i # <<<<<<<<<<<<<< @@ -132516,7 +135258,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_22 = 0; *__Pyx_BufPtrStrided2d(uint16_t *, __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ptcloud.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ptcloud.diminfo[1].strides) = __pyx_v_i; - /* "fastremap.pyx":1224 + /* "fastremap.pyx":1240 * ptlabel[idx] = arr[i,j,k] * ptcloud[idx,0] = i * ptcloud[idx,1] = j # <<<<<<<<<<<<<< @@ -132527,7 +135269,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_22 = 1; *__Pyx_BufPtrStrided2d(uint16_t *, __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ptcloud.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ptcloud.diminfo[1].strides) = __pyx_v_j; - /* "fastremap.pyx":1225 + /* "fastremap.pyx":1241 * ptcloud[idx,0] = i * ptcloud[idx,1] = j * ptcloud[idx,2] = k # <<<<<<<<<<<<<< @@ -132538,7 +135280,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_22 = 2; *__Pyx_BufPtrStrided2d(uint16_t *, __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ptcloud.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ptcloud.diminfo[1].strides) = __pyx_v_k; - /* "fastremap.pyx":1226 + /* "fastremap.pyx":1242 * ptcloud[idx,1] = j * ptcloud[idx,2] = k * idx += 1 # <<<<<<<<<<<<<< @@ -132547,7 +135289,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_idx = (__pyx_v_idx + 1); - /* "fastremap.pyx":1221 + /* "fastremap.pyx":1237 * for j in range(sy): * for k in range(sz): * if arr[i,j,k] != 0: # <<<<<<<<<<<<<< @@ -132559,14 +135301,14 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py } } - /* "fastremap.pyx":1228 + /* "fastremap.pyx":1244 * idx += 1 * * sortidx = ptlabel.argsort() # <<<<<<<<<<<<<< * ptlabel = ptlabel[sortidx] * ptcloud = ptcloud[sortidx] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ptlabel), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1228, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ptlabel), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -132580,22 +135322,22 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py } __pyx_t_8 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1228, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sortidx = __pyx_t_8; __pyx_t_8 = 0; - /* "fastremap.pyx":1229 + /* "fastremap.pyx":1245 * * sortidx = ptlabel.argsort() * ptlabel = ptlabel[sortidx] # <<<<<<<<<<<<<< * ptcloud = ptcloud[sortidx] * del sortidx */ - __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptlabel), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1229, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptlabel), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1229, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1245, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -132612,22 +135354,22 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_24 = __pyx_t_25 = __pyx_t_26 = 0; } __pyx_pybuffernd_ptlabel.diminfo[0].strides = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptlabel.diminfo[0].shape = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1229, __pyx_L1_error) + if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1245, __pyx_L1_error) } __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_ptlabel, ((PyArrayObject *)__pyx_t_8)); __pyx_t_8 = 0; - /* "fastremap.pyx":1230 + /* "fastremap.pyx":1246 * sortidx = ptlabel.argsort() * ptlabel = ptlabel[sortidx] * ptcloud = ptcloud[sortidx] # <<<<<<<<<<<<<< * del sortidx * */ - __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1230, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1230, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1246, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -132644,13 +135386,13 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_26 = __pyx_t_25 = __pyx_t_24 = 0; } __pyx_pybuffernd_ptcloud.diminfo[0].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptcloud.diminfo[0].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ptcloud.diminfo[1].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ptcloud.diminfo[1].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1230, __pyx_L1_error) + if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1246, __pyx_L1_error) } __pyx_t_9 = 0; __Pyx_DECREF_SET(__pyx_v_ptcloud, ((PyArrayObject *)__pyx_t_8)); __pyx_t_8 = 0; - /* "fastremap.pyx":1231 + /* "fastremap.pyx":1247 * ptlabel = ptlabel[sortidx] * ptcloud = ptcloud[sortidx] * del sortidx # <<<<<<<<<<<<<< @@ -132660,19 +135402,19 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_DECREF(__pyx_v_sortidx); __pyx_v_sortidx = NULL; - /* "fastremap.pyx":1233 + /* "fastremap.pyx":1249 * del sortidx * * ptcloud_by_label = {} # <<<<<<<<<<<<<< * if n_foreground == 1: * ptcloud_by_label[ptlabel[0]] = ptcloud */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1233, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_ptcloud_by_label = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1234 + /* "fastremap.pyx":1250 * * ptcloud_by_label = {} * if n_foreground == 1: # <<<<<<<<<<<<<< @@ -132682,7 +135424,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = ((__pyx_v_n_foreground == 1) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1235 + /* "fastremap.pyx":1251 * ptcloud_by_label = {} * if n_foreground == 1: * ptcloud_by_label[ptlabel[0]] = ptcloud # <<<<<<<<<<<<<< @@ -132690,12 +135432,12 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py * */ __pyx_t_22 = 0; - __pyx_t_8 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1235, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_8, ((PyObject *)__pyx_v_ptcloud)) < 0)) __PYX_ERR(0, 1235, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_8, ((PyObject *)__pyx_v_ptcloud)) < 0)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1236 + /* "fastremap.pyx":1252 * if n_foreground == 1: * ptcloud_by_label[ptlabel[0]] = ptcloud * return ptcloud_by_label # <<<<<<<<<<<<<< @@ -132707,7 +135449,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py __pyx_r = __pyx_v_ptcloud_by_label; goto __pyx_L0; - /* "fastremap.pyx":1234 + /* "fastremap.pyx":1250 * * ptcloud_by_label = {} * if n_foreground == 1: # <<<<<<<<<<<<<< @@ -132716,7 +135458,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py */ } - /* "fastremap.pyx":1238 + /* "fastremap.pyx":1254 * return ptcloud_by_label * * cdef size_t start = 0 # <<<<<<<<<<<<<< @@ -132725,7 +135467,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_start = 0; - /* "fastremap.pyx":1239 + /* "fastremap.pyx":1255 * * cdef size_t start = 0 * cdef size_t end = 0 # <<<<<<<<<<<<<< @@ -132734,7 +135476,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_end = 0; - /* "fastremap.pyx":1240 + /* "fastremap.pyx":1256 * cdef size_t start = 0 * cdef size_t end = 0 * for end in range(1, n_foreground): # <<<<<<<<<<<<<< @@ -132746,7 +135488,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_11 = 1; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_end = __pyx_t_11; - /* "fastremap.pyx":1241 + /* "fastremap.pyx":1257 * cdef size_t end = 0 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: # <<<<<<<<<<<<<< @@ -132758,22 +135500,22 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_ptlabel.diminfo[0].strides)) != (*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ptlabel.diminfo[0].strides))) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1242 + /* "fastremap.pyx":1258 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: * ptcloud_by_label[ptlabel[end - 1]] = ptcloud[start:end,:] # <<<<<<<<<<<<<< * start = end * */ - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PySlice_New(__pyx_t_8, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_6 = PySlice_New(__pyx_t_8, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); @@ -132781,17 +135523,17 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_slice__29); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__29); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_13 = (__pyx_v_end - 1); - __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_1, __pyx_t_6) < 0)) __PYX_ERR(0, 1242, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_1, __pyx_t_6) < 0)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":1243 + /* "fastremap.pyx":1259 * if ptlabel[end] != ptlabel[end - 1]: * ptcloud_by_label[ptlabel[end - 1]] = ptcloud[start:end,:] * start = end # <<<<<<<<<<<<<< @@ -132800,7 +135542,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_start = __pyx_v_end; - /* "fastremap.pyx":1241 + /* "fastremap.pyx":1257 * cdef size_t end = 0 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: # <<<<<<<<<<<<<< @@ -132810,19 +135552,19 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py } } - /* "fastremap.pyx":1245 + /* "fastremap.pyx":1261 * start = end * * ptcloud_by_label[ptlabel[end]] = ptcloud[start:,:] # <<<<<<<<<<<<<< * * return ptcloud_by_label */ - __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PySlice_New(__pyx_t_6, Py_None, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_1 = PySlice_New(__pyx_t_6, Py_None, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); @@ -132830,17 +135572,17 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_slice__25); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__25); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = __pyx_v_end; - __pyx_t_6 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int8_t((*__Pyx_BufPtrStrided1d(int8_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_6, __pyx_t_1) < 0)) __PYX_ERR(0, 1245, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_6, __pyx_t_1) < 0)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":1247 + /* "fastremap.pyx":1263 * ptcloud_by_label[ptlabel[end]] = ptcloud[start:,:] * * return ptcloud_by_label # <<<<<<<<<<<<<< @@ -132852,7 +135594,7 @@ static PyObject *__pyx_pf_9fastremap_592point_cloud(CYTHON_UNUSED PyObject *__py __pyx_r = __pyx_v_ptcloud_by_label; goto __pyx_L0; - /* "fastremap.pyx":1190 + /* "fastremap.pyx":1206 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def point_cloud(cnp.ndarray[ALLINT, ndim=3] arr): # <<<<<<<<<<<<<< @@ -132902,7 +135644,7 @@ static PyObject *__pyx_fuse_5__pyx_pw_9fastremap_595point_cloud(PyObject *__pyx_ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("point_cloud (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1206, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_594point_cloud(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -132981,18 +135723,18 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1206, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; - /* "fastremap.pyx":1201 + /* "fastremap.pyx":1217 * Returns: ndarray(N, 3, dtype=uint16) * """ * cdef size_t n_foreground = foreground(arr) # <<<<<<<<<<<<<< * * cdef size_t sx = arr.shape[0] */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_foreground_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_foreground_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -133006,14 +135748,14 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_arr)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_arr)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1201, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_n_foreground = __pyx_t_4; - /* "fastremap.pyx":1203 + /* "fastremap.pyx":1219 * cdef size_t n_foreground = foreground(arr) * * cdef size_t sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -133022,7 +135764,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1204 + /* "fastremap.pyx":1220 * * cdef size_t sx = arr.shape[0] * cdef size_t sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -133031,7 +135773,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1205 + /* "fastremap.pyx":1221 * cdef size_t sx = arr.shape[0] * cdef size_t sy = arr.shape[1] * cdef size_t sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -133040,7 +135782,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1207 + /* "fastremap.pyx":1223 * cdef size_t sz = arr.shape[2] * * if n_foreground == 0: # <<<<<<<<<<<<<< @@ -133050,7 +135792,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = ((__pyx_v_n_foreground == 0) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1208 + /* "fastremap.pyx":1224 * * if n_foreground == 0: * return {} # <<<<<<<<<<<<<< @@ -133058,13 +135800,13 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py * cdef cnp.ndarray[ALLINT, ndim=1] ptlabel = np.zeros((n_foreground,), dtype=arr.dtype) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1208, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":1207 + /* "fastremap.pyx":1223 * cdef size_t sz = arr.shape[2] * * if n_foreground == 0: # <<<<<<<<<<<<<< @@ -133073,48 +135815,48 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py */ } - /* "fastremap.pyx":1210 + /* "fastremap.pyx":1226 * return {} * * cdef cnp.ndarray[ALLINT, ndim=1] ptlabel = np.zeros((n_foreground,), dtype=arr.dtype) # <<<<<<<<<<<<<< * cdef cnp.ndarray[uint16_t, ndim=2] ptcloud = np.zeros((n_foreground, 3), dtype=np.uint16) * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1210, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1210, __pyx_L1_error) + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1226, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ptlabel.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn_int16_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_ptlabel = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 1210, __pyx_L1_error) + __PYX_ERR(0, 1226, __pyx_L1_error) } else {__pyx_pybuffernd_ptlabel.diminfo[0].strides = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptlabel.diminfo[0].shape = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.shape[0]; } } @@ -133122,21 +135864,21 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py __pyx_v_ptlabel = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":1211 + /* "fastremap.pyx":1227 * * cdef cnp.ndarray[ALLINT, ndim=1] ptlabel = np.zeros((n_foreground,), dtype=arr.dtype) * cdef cnp.ndarray[uint16_t, ndim=2] ptcloud = np.zeros((n_foreground, 3), dtype=np.uint16) # <<<<<<<<<<<<<< * * cdef size_t i = 0 */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); @@ -133144,32 +135886,32 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1211, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 1211, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1211, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1227, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ptcloud.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_ptcloud = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 1211, __pyx_L1_error) + __PYX_ERR(0, 1227, __pyx_L1_error) } else {__pyx_pybuffernd_ptcloud.diminfo[0].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptcloud.diminfo[0].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ptcloud.diminfo[1].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ptcloud.diminfo[1].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[1]; } } @@ -133177,7 +135919,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py __pyx_v_ptcloud = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1213 + /* "fastremap.pyx":1229 * cdef cnp.ndarray[uint16_t, ndim=2] ptcloud = np.zeros((n_foreground, 3), dtype=np.uint16) * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -133186,7 +135928,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_i = 0; - /* "fastremap.pyx":1214 + /* "fastremap.pyx":1230 * * cdef size_t i = 0 * cdef size_t j = 0 # <<<<<<<<<<<<<< @@ -133195,7 +135937,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_j = 0; - /* "fastremap.pyx":1215 + /* "fastremap.pyx":1231 * cdef size_t i = 0 * cdef size_t j = 0 * cdef size_t k = 0 # <<<<<<<<<<<<<< @@ -133204,7 +135946,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_k = 0; - /* "fastremap.pyx":1217 + /* "fastremap.pyx":1233 * cdef size_t k = 0 * * cdef size_t idx = 0 # <<<<<<<<<<<<<< @@ -133213,7 +135955,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_idx = 0; - /* "fastremap.pyx":1218 + /* "fastremap.pyx":1234 * * cdef size_t idx = 0 * for i in range(sx): # <<<<<<<<<<<<<< @@ -133225,7 +135967,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "fastremap.pyx":1219 + /* "fastremap.pyx":1235 * cdef size_t idx = 0 * for i in range(sx): * for j in range(sy): # <<<<<<<<<<<<<< @@ -133237,7 +135979,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_j = __pyx_t_14; - /* "fastremap.pyx":1220 + /* "fastremap.pyx":1236 * for i in range(sx): * for j in range(sy): * for k in range(sz): # <<<<<<<<<<<<<< @@ -133249,7 +135991,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_k = __pyx_t_17; - /* "fastremap.pyx":1221 + /* "fastremap.pyx":1237 * for j in range(sy): * for k in range(sz): * if arr[i,j,k] != 0: # <<<<<<<<<<<<<< @@ -133262,7 +136004,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = (((*__Pyx_BufPtrStrided3d(int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[2].strides)) != 0) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1222 + /* "fastremap.pyx":1238 * for k in range(sz): * if arr[i,j,k] != 0: * ptlabel[idx] = arr[i,j,k] # <<<<<<<<<<<<<< @@ -133275,7 +136017,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_21 = __pyx_v_idx; *__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_ptlabel.diminfo[0].strides) = (*__Pyx_BufPtrStrided3d(int16_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[2].strides)); - /* "fastremap.pyx":1223 + /* "fastremap.pyx":1239 * if arr[i,j,k] != 0: * ptlabel[idx] = arr[i,j,k] * ptcloud[idx,0] = i # <<<<<<<<<<<<<< @@ -133286,7 +136028,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_22 = 0; *__Pyx_BufPtrStrided2d(uint16_t *, __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ptcloud.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ptcloud.diminfo[1].strides) = __pyx_v_i; - /* "fastremap.pyx":1224 + /* "fastremap.pyx":1240 * ptlabel[idx] = arr[i,j,k] * ptcloud[idx,0] = i * ptcloud[idx,1] = j # <<<<<<<<<<<<<< @@ -133297,7 +136039,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_22 = 1; *__Pyx_BufPtrStrided2d(uint16_t *, __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ptcloud.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ptcloud.diminfo[1].strides) = __pyx_v_j; - /* "fastremap.pyx":1225 + /* "fastremap.pyx":1241 * ptcloud[idx,0] = i * ptcloud[idx,1] = j * ptcloud[idx,2] = k # <<<<<<<<<<<<<< @@ -133308,7 +136050,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_22 = 2; *__Pyx_BufPtrStrided2d(uint16_t *, __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ptcloud.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ptcloud.diminfo[1].strides) = __pyx_v_k; - /* "fastremap.pyx":1226 + /* "fastremap.pyx":1242 * ptcloud[idx,1] = j * ptcloud[idx,2] = k * idx += 1 # <<<<<<<<<<<<<< @@ -133317,7 +136059,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_idx = (__pyx_v_idx + 1); - /* "fastremap.pyx":1221 + /* "fastremap.pyx":1237 * for j in range(sy): * for k in range(sz): * if arr[i,j,k] != 0: # <<<<<<<<<<<<<< @@ -133329,14 +136071,14 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py } } - /* "fastremap.pyx":1228 + /* "fastremap.pyx":1244 * idx += 1 * * sortidx = ptlabel.argsort() # <<<<<<<<<<<<<< * ptlabel = ptlabel[sortidx] * ptcloud = ptcloud[sortidx] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ptlabel), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1228, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ptlabel), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -133350,22 +136092,22 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py } __pyx_t_8 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1228, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sortidx = __pyx_t_8; __pyx_t_8 = 0; - /* "fastremap.pyx":1229 + /* "fastremap.pyx":1245 * * sortidx = ptlabel.argsort() * ptlabel = ptlabel[sortidx] # <<<<<<<<<<<<<< * ptcloud = ptcloud[sortidx] * del sortidx */ - __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptlabel), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1229, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptlabel), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1229, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1245, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -133382,22 +136124,22 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_24 = __pyx_t_25 = __pyx_t_26 = 0; } __pyx_pybuffernd_ptlabel.diminfo[0].strides = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptlabel.diminfo[0].shape = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1229, __pyx_L1_error) + if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1245, __pyx_L1_error) } __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_ptlabel, ((PyArrayObject *)__pyx_t_8)); __pyx_t_8 = 0; - /* "fastremap.pyx":1230 + /* "fastremap.pyx":1246 * sortidx = ptlabel.argsort() * ptlabel = ptlabel[sortidx] * ptcloud = ptcloud[sortidx] # <<<<<<<<<<<<<< * del sortidx * */ - __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1230, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1230, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1246, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -133414,13 +136156,13 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_26 = __pyx_t_25 = __pyx_t_24 = 0; } __pyx_pybuffernd_ptcloud.diminfo[0].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptcloud.diminfo[0].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ptcloud.diminfo[1].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ptcloud.diminfo[1].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1230, __pyx_L1_error) + if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1246, __pyx_L1_error) } __pyx_t_9 = 0; __Pyx_DECREF_SET(__pyx_v_ptcloud, ((PyArrayObject *)__pyx_t_8)); __pyx_t_8 = 0; - /* "fastremap.pyx":1231 + /* "fastremap.pyx":1247 * ptlabel = ptlabel[sortidx] * ptcloud = ptcloud[sortidx] * del sortidx # <<<<<<<<<<<<<< @@ -133430,19 +136172,19 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_DECREF(__pyx_v_sortidx); __pyx_v_sortidx = NULL; - /* "fastremap.pyx":1233 + /* "fastremap.pyx":1249 * del sortidx * * ptcloud_by_label = {} # <<<<<<<<<<<<<< * if n_foreground == 1: * ptcloud_by_label[ptlabel[0]] = ptcloud */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1233, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_ptcloud_by_label = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1234 + /* "fastremap.pyx":1250 * * ptcloud_by_label = {} * if n_foreground == 1: # <<<<<<<<<<<<<< @@ -133452,7 +136194,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = ((__pyx_v_n_foreground == 1) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1235 + /* "fastremap.pyx":1251 * ptcloud_by_label = {} * if n_foreground == 1: * ptcloud_by_label[ptlabel[0]] = ptcloud # <<<<<<<<<<<<<< @@ -133460,12 +136202,12 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py * */ __pyx_t_22 = 0; - __pyx_t_8 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1235, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_8, ((PyObject *)__pyx_v_ptcloud)) < 0)) __PYX_ERR(0, 1235, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_8, ((PyObject *)__pyx_v_ptcloud)) < 0)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1236 + /* "fastremap.pyx":1252 * if n_foreground == 1: * ptcloud_by_label[ptlabel[0]] = ptcloud * return ptcloud_by_label # <<<<<<<<<<<<<< @@ -133477,7 +136219,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py __pyx_r = __pyx_v_ptcloud_by_label; goto __pyx_L0; - /* "fastremap.pyx":1234 + /* "fastremap.pyx":1250 * * ptcloud_by_label = {} * if n_foreground == 1: # <<<<<<<<<<<<<< @@ -133486,7 +136228,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py */ } - /* "fastremap.pyx":1238 + /* "fastremap.pyx":1254 * return ptcloud_by_label * * cdef size_t start = 0 # <<<<<<<<<<<<<< @@ -133495,7 +136237,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_start = 0; - /* "fastremap.pyx":1239 + /* "fastremap.pyx":1255 * * cdef size_t start = 0 * cdef size_t end = 0 # <<<<<<<<<<<<<< @@ -133504,7 +136246,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_end = 0; - /* "fastremap.pyx":1240 + /* "fastremap.pyx":1256 * cdef size_t start = 0 * cdef size_t end = 0 * for end in range(1, n_foreground): # <<<<<<<<<<<<<< @@ -133516,7 +136258,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_11 = 1; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_end = __pyx_t_11; - /* "fastremap.pyx":1241 + /* "fastremap.pyx":1257 * cdef size_t end = 0 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: # <<<<<<<<<<<<<< @@ -133528,22 +136270,22 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_ptlabel.diminfo[0].strides)) != (*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ptlabel.diminfo[0].strides))) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1242 + /* "fastremap.pyx":1258 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: * ptcloud_by_label[ptlabel[end - 1]] = ptcloud[start:end,:] # <<<<<<<<<<<<<< * start = end * */ - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PySlice_New(__pyx_t_8, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_6 = PySlice_New(__pyx_t_8, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); @@ -133551,17 +136293,17 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_slice__30); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__30); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_13 = (__pyx_v_end - 1); - __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_1, __pyx_t_6) < 0)) __PYX_ERR(0, 1242, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_1, __pyx_t_6) < 0)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":1243 + /* "fastremap.pyx":1259 * if ptlabel[end] != ptlabel[end - 1]: * ptcloud_by_label[ptlabel[end - 1]] = ptcloud[start:end,:] * start = end # <<<<<<<<<<<<<< @@ -133570,7 +136312,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_start = __pyx_v_end; - /* "fastremap.pyx":1241 + /* "fastremap.pyx":1257 * cdef size_t end = 0 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: # <<<<<<<<<<<<<< @@ -133580,19 +136322,19 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py } } - /* "fastremap.pyx":1245 + /* "fastremap.pyx":1261 * start = end * * ptcloud_by_label[ptlabel[end]] = ptcloud[start:,:] # <<<<<<<<<<<<<< * * return ptcloud_by_label */ - __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PySlice_New(__pyx_t_6, Py_None, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_1 = PySlice_New(__pyx_t_6, Py_None, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); @@ -133600,17 +136342,17 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_slice__25); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__25); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = __pyx_v_end; - __pyx_t_6 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int16_t((*__Pyx_BufPtrStrided1d(int16_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_6, __pyx_t_1) < 0)) __PYX_ERR(0, 1245, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_6, __pyx_t_1) < 0)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":1247 + /* "fastremap.pyx":1263 * ptcloud_by_label[ptlabel[end]] = ptcloud[start:,:] * * return ptcloud_by_label # <<<<<<<<<<<<<< @@ -133622,7 +136364,7 @@ static PyObject *__pyx_pf_9fastremap_594point_cloud(CYTHON_UNUSED PyObject *__py __pyx_r = __pyx_v_ptcloud_by_label; goto __pyx_L0; - /* "fastremap.pyx":1190 + /* "fastremap.pyx":1206 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def point_cloud(cnp.ndarray[ALLINT, ndim=3] arr): # <<<<<<<<<<<<<< @@ -133672,7 +136414,7 @@ static PyObject *__pyx_fuse_6__pyx_pw_9fastremap_597point_cloud(PyObject *__pyx_ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("point_cloud (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1206, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_596point_cloud(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -133751,18 +136493,18 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1206, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; - /* "fastremap.pyx":1201 + /* "fastremap.pyx":1217 * Returns: ndarray(N, 3, dtype=uint16) * """ * cdef size_t n_foreground = foreground(arr) # <<<<<<<<<<<<<< * * cdef size_t sx = arr.shape[0] */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_foreground_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_foreground_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -133776,14 +136518,14 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_arr)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_arr)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1201, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_n_foreground = __pyx_t_4; - /* "fastremap.pyx":1203 + /* "fastremap.pyx":1219 * cdef size_t n_foreground = foreground(arr) * * cdef size_t sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -133792,7 +136534,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1204 + /* "fastremap.pyx":1220 * * cdef size_t sx = arr.shape[0] * cdef size_t sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -133801,7 +136543,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1205 + /* "fastremap.pyx":1221 * cdef size_t sx = arr.shape[0] * cdef size_t sy = arr.shape[1] * cdef size_t sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -133810,7 +136552,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1207 + /* "fastremap.pyx":1223 * cdef size_t sz = arr.shape[2] * * if n_foreground == 0: # <<<<<<<<<<<<<< @@ -133820,7 +136562,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = ((__pyx_v_n_foreground == 0) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1208 + /* "fastremap.pyx":1224 * * if n_foreground == 0: * return {} # <<<<<<<<<<<<<< @@ -133828,13 +136570,13 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py * cdef cnp.ndarray[ALLINT, ndim=1] ptlabel = np.zeros((n_foreground,), dtype=arr.dtype) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1208, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":1207 + /* "fastremap.pyx":1223 * cdef size_t sz = arr.shape[2] * * if n_foreground == 0: # <<<<<<<<<<<<<< @@ -133843,48 +136585,48 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py */ } - /* "fastremap.pyx":1210 + /* "fastremap.pyx":1226 * return {} * * cdef cnp.ndarray[ALLINT, ndim=1] ptlabel = np.zeros((n_foreground,), dtype=arr.dtype) # <<<<<<<<<<<<<< * cdef cnp.ndarray[uint16_t, ndim=2] ptcloud = np.zeros((n_foreground, 3), dtype=np.uint16) * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1210, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1210, __pyx_L1_error) + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1226, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ptlabel.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_ptlabel = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 1210, __pyx_L1_error) + __PYX_ERR(0, 1226, __pyx_L1_error) } else {__pyx_pybuffernd_ptlabel.diminfo[0].strides = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptlabel.diminfo[0].shape = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.shape[0]; } } @@ -133892,21 +136634,21 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py __pyx_v_ptlabel = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":1211 + /* "fastremap.pyx":1227 * * cdef cnp.ndarray[ALLINT, ndim=1] ptlabel = np.zeros((n_foreground,), dtype=arr.dtype) * cdef cnp.ndarray[uint16_t, ndim=2] ptcloud = np.zeros((n_foreground, 3), dtype=np.uint16) # <<<<<<<<<<<<<< * * cdef size_t i = 0 */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); @@ -133914,32 +136656,32 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1211, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 1211, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1211, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1227, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ptcloud.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_ptcloud = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 1211, __pyx_L1_error) + __PYX_ERR(0, 1227, __pyx_L1_error) } else {__pyx_pybuffernd_ptcloud.diminfo[0].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptcloud.diminfo[0].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ptcloud.diminfo[1].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ptcloud.diminfo[1].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[1]; } } @@ -133947,7 +136689,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py __pyx_v_ptcloud = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1213 + /* "fastremap.pyx":1229 * cdef cnp.ndarray[uint16_t, ndim=2] ptcloud = np.zeros((n_foreground, 3), dtype=np.uint16) * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -133956,7 +136698,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_i = 0; - /* "fastremap.pyx":1214 + /* "fastremap.pyx":1230 * * cdef size_t i = 0 * cdef size_t j = 0 # <<<<<<<<<<<<<< @@ -133965,7 +136707,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_j = 0; - /* "fastremap.pyx":1215 + /* "fastremap.pyx":1231 * cdef size_t i = 0 * cdef size_t j = 0 * cdef size_t k = 0 # <<<<<<<<<<<<<< @@ -133974,7 +136716,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_k = 0; - /* "fastremap.pyx":1217 + /* "fastremap.pyx":1233 * cdef size_t k = 0 * * cdef size_t idx = 0 # <<<<<<<<<<<<<< @@ -133983,7 +136725,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_idx = 0; - /* "fastremap.pyx":1218 + /* "fastremap.pyx":1234 * * cdef size_t idx = 0 * for i in range(sx): # <<<<<<<<<<<<<< @@ -133995,7 +136737,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "fastremap.pyx":1219 + /* "fastremap.pyx":1235 * cdef size_t idx = 0 * for i in range(sx): * for j in range(sy): # <<<<<<<<<<<<<< @@ -134007,7 +136749,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_j = __pyx_t_14; - /* "fastremap.pyx":1220 + /* "fastremap.pyx":1236 * for i in range(sx): * for j in range(sy): * for k in range(sz): # <<<<<<<<<<<<<< @@ -134019,7 +136761,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_k = __pyx_t_17; - /* "fastremap.pyx":1221 + /* "fastremap.pyx":1237 * for j in range(sy): * for k in range(sz): * if arr[i,j,k] != 0: # <<<<<<<<<<<<<< @@ -134032,7 +136774,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = (((*__Pyx_BufPtrStrided3d(int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[2].strides)) != 0) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1222 + /* "fastremap.pyx":1238 * for k in range(sz): * if arr[i,j,k] != 0: * ptlabel[idx] = arr[i,j,k] # <<<<<<<<<<<<<< @@ -134045,7 +136787,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_21 = __pyx_v_idx; *__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_ptlabel.diminfo[0].strides) = (*__Pyx_BufPtrStrided3d(int32_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[2].strides)); - /* "fastremap.pyx":1223 + /* "fastremap.pyx":1239 * if arr[i,j,k] != 0: * ptlabel[idx] = arr[i,j,k] * ptcloud[idx,0] = i # <<<<<<<<<<<<<< @@ -134056,7 +136798,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_22 = 0; *__Pyx_BufPtrStrided2d(uint16_t *, __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ptcloud.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ptcloud.diminfo[1].strides) = __pyx_v_i; - /* "fastremap.pyx":1224 + /* "fastremap.pyx":1240 * ptlabel[idx] = arr[i,j,k] * ptcloud[idx,0] = i * ptcloud[idx,1] = j # <<<<<<<<<<<<<< @@ -134067,7 +136809,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_22 = 1; *__Pyx_BufPtrStrided2d(uint16_t *, __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ptcloud.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ptcloud.diminfo[1].strides) = __pyx_v_j; - /* "fastremap.pyx":1225 + /* "fastremap.pyx":1241 * ptcloud[idx,0] = i * ptcloud[idx,1] = j * ptcloud[idx,2] = k # <<<<<<<<<<<<<< @@ -134078,7 +136820,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_22 = 2; *__Pyx_BufPtrStrided2d(uint16_t *, __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ptcloud.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ptcloud.diminfo[1].strides) = __pyx_v_k; - /* "fastremap.pyx":1226 + /* "fastremap.pyx":1242 * ptcloud[idx,1] = j * ptcloud[idx,2] = k * idx += 1 # <<<<<<<<<<<<<< @@ -134087,7 +136829,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_idx = (__pyx_v_idx + 1); - /* "fastremap.pyx":1221 + /* "fastremap.pyx":1237 * for j in range(sy): * for k in range(sz): * if arr[i,j,k] != 0: # <<<<<<<<<<<<<< @@ -134099,14 +136841,14 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py } } - /* "fastremap.pyx":1228 + /* "fastremap.pyx":1244 * idx += 1 * * sortidx = ptlabel.argsort() # <<<<<<<<<<<<<< * ptlabel = ptlabel[sortidx] * ptcloud = ptcloud[sortidx] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ptlabel), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1228, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ptlabel), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -134120,22 +136862,22 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py } __pyx_t_8 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1228, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sortidx = __pyx_t_8; __pyx_t_8 = 0; - /* "fastremap.pyx":1229 + /* "fastremap.pyx":1245 * * sortidx = ptlabel.argsort() * ptlabel = ptlabel[sortidx] # <<<<<<<<<<<<<< * ptcloud = ptcloud[sortidx] * del sortidx */ - __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptlabel), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1229, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptlabel), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1229, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1245, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -134152,22 +136894,22 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_24 = __pyx_t_25 = __pyx_t_26 = 0; } __pyx_pybuffernd_ptlabel.diminfo[0].strides = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptlabel.diminfo[0].shape = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1229, __pyx_L1_error) + if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1245, __pyx_L1_error) } __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_ptlabel, ((PyArrayObject *)__pyx_t_8)); __pyx_t_8 = 0; - /* "fastremap.pyx":1230 + /* "fastremap.pyx":1246 * sortidx = ptlabel.argsort() * ptlabel = ptlabel[sortidx] * ptcloud = ptcloud[sortidx] # <<<<<<<<<<<<<< * del sortidx * */ - __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1230, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1230, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1246, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -134184,13 +136926,13 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_26 = __pyx_t_25 = __pyx_t_24 = 0; } __pyx_pybuffernd_ptcloud.diminfo[0].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptcloud.diminfo[0].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ptcloud.diminfo[1].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ptcloud.diminfo[1].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1230, __pyx_L1_error) + if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1246, __pyx_L1_error) } __pyx_t_9 = 0; __Pyx_DECREF_SET(__pyx_v_ptcloud, ((PyArrayObject *)__pyx_t_8)); __pyx_t_8 = 0; - /* "fastremap.pyx":1231 + /* "fastremap.pyx":1247 * ptlabel = ptlabel[sortidx] * ptcloud = ptcloud[sortidx] * del sortidx # <<<<<<<<<<<<<< @@ -134200,19 +136942,19 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_DECREF(__pyx_v_sortidx); __pyx_v_sortidx = NULL; - /* "fastremap.pyx":1233 + /* "fastremap.pyx":1249 * del sortidx * * ptcloud_by_label = {} # <<<<<<<<<<<<<< * if n_foreground == 1: * ptcloud_by_label[ptlabel[0]] = ptcloud */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1233, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_ptcloud_by_label = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1234 + /* "fastremap.pyx":1250 * * ptcloud_by_label = {} * if n_foreground == 1: # <<<<<<<<<<<<<< @@ -134222,7 +136964,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = ((__pyx_v_n_foreground == 1) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1235 + /* "fastremap.pyx":1251 * ptcloud_by_label = {} * if n_foreground == 1: * ptcloud_by_label[ptlabel[0]] = ptcloud # <<<<<<<<<<<<<< @@ -134230,12 +136972,12 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py * */ __pyx_t_22 = 0; - __pyx_t_8 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1235, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_8, ((PyObject *)__pyx_v_ptcloud)) < 0)) __PYX_ERR(0, 1235, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_8, ((PyObject *)__pyx_v_ptcloud)) < 0)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1236 + /* "fastremap.pyx":1252 * if n_foreground == 1: * ptcloud_by_label[ptlabel[0]] = ptcloud * return ptcloud_by_label # <<<<<<<<<<<<<< @@ -134247,7 +136989,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py __pyx_r = __pyx_v_ptcloud_by_label; goto __pyx_L0; - /* "fastremap.pyx":1234 + /* "fastremap.pyx":1250 * * ptcloud_by_label = {} * if n_foreground == 1: # <<<<<<<<<<<<<< @@ -134256,7 +136998,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py */ } - /* "fastremap.pyx":1238 + /* "fastremap.pyx":1254 * return ptcloud_by_label * * cdef size_t start = 0 # <<<<<<<<<<<<<< @@ -134265,7 +137007,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_start = 0; - /* "fastremap.pyx":1239 + /* "fastremap.pyx":1255 * * cdef size_t start = 0 * cdef size_t end = 0 # <<<<<<<<<<<<<< @@ -134274,7 +137016,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_end = 0; - /* "fastremap.pyx":1240 + /* "fastremap.pyx":1256 * cdef size_t start = 0 * cdef size_t end = 0 * for end in range(1, n_foreground): # <<<<<<<<<<<<<< @@ -134286,7 +137028,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_11 = 1; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_end = __pyx_t_11; - /* "fastremap.pyx":1241 + /* "fastremap.pyx":1257 * cdef size_t end = 0 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: # <<<<<<<<<<<<<< @@ -134298,22 +137040,22 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_ptlabel.diminfo[0].strides)) != (*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ptlabel.diminfo[0].strides))) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1242 + /* "fastremap.pyx":1258 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: * ptcloud_by_label[ptlabel[end - 1]] = ptcloud[start:end,:] # <<<<<<<<<<<<<< * start = end * */ - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PySlice_New(__pyx_t_8, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_6 = PySlice_New(__pyx_t_8, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); @@ -134321,17 +137063,17 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_slice__31); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__31); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_13 = (__pyx_v_end - 1); - __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_1, __pyx_t_6) < 0)) __PYX_ERR(0, 1242, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_1, __pyx_t_6) < 0)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":1243 + /* "fastremap.pyx":1259 * if ptlabel[end] != ptlabel[end - 1]: * ptcloud_by_label[ptlabel[end - 1]] = ptcloud[start:end,:] * start = end # <<<<<<<<<<<<<< @@ -134340,7 +137082,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_start = __pyx_v_end; - /* "fastremap.pyx":1241 + /* "fastremap.pyx":1257 * cdef size_t end = 0 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: # <<<<<<<<<<<<<< @@ -134350,19 +137092,19 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py } } - /* "fastremap.pyx":1245 + /* "fastremap.pyx":1261 * start = end * * ptcloud_by_label[ptlabel[end]] = ptcloud[start:,:] # <<<<<<<<<<<<<< * * return ptcloud_by_label */ - __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PySlice_New(__pyx_t_6, Py_None, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_1 = PySlice_New(__pyx_t_6, Py_None, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); @@ -134370,17 +137112,17 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_slice__25); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__25); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = __pyx_v_end; - __pyx_t_6 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int32_t((*__Pyx_BufPtrStrided1d(int32_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_6, __pyx_t_1) < 0)) __PYX_ERR(0, 1245, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_6, __pyx_t_1) < 0)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":1247 + /* "fastremap.pyx":1263 * ptcloud_by_label[ptlabel[end]] = ptcloud[start:,:] * * return ptcloud_by_label # <<<<<<<<<<<<<< @@ -134392,7 +137134,7 @@ static PyObject *__pyx_pf_9fastremap_596point_cloud(CYTHON_UNUSED PyObject *__py __pyx_r = __pyx_v_ptcloud_by_label; goto __pyx_L0; - /* "fastremap.pyx":1190 + /* "fastremap.pyx":1206 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def point_cloud(cnp.ndarray[ALLINT, ndim=3] arr): # <<<<<<<<<<<<<< @@ -134442,7 +137184,7 @@ static PyObject *__pyx_fuse_7__pyx_pw_9fastremap_599point_cloud(PyObject *__pyx_ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("point_cloud (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) __PYX_ERR(0, 1206, __pyx_L1_error) __pyx_r = __pyx_pf_9fastremap_598point_cloud(__pyx_self, ((PyArrayObject *)__pyx_v_arr)); /* function exit code */ @@ -134521,18 +137263,18 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py __pyx_pybuffernd_arr.rcbuffer = &__pyx_pybuffer_arr; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1206, __pyx_L1_error) } __pyx_pybuffernd_arr.diminfo[0].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_arr.diminfo[0].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_arr.diminfo[1].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_arr.diminfo[1].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_arr.diminfo[2].strides = __pyx_pybuffernd_arr.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_arr.diminfo[2].shape = __pyx_pybuffernd_arr.rcbuffer->pybuffer.shape[2]; - /* "fastremap.pyx":1201 + /* "fastremap.pyx":1217 * Returns: ndarray(N, 3, dtype=uint16) * """ * cdef size_t n_foreground = foreground(arr) # <<<<<<<<<<<<<< * * cdef size_t sx = arr.shape[0] */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_foreground_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_foreground_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -134546,14 +137288,14 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_arr)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_arr)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1201, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_n_foreground = __pyx_t_4; - /* "fastremap.pyx":1203 + /* "fastremap.pyx":1219 * cdef size_t n_foreground = foreground(arr) * * cdef size_t sx = arr.shape[0] # <<<<<<<<<<<<<< @@ -134562,7 +137304,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_sx = (__pyx_v_arr->dimensions[0]); - /* "fastremap.pyx":1204 + /* "fastremap.pyx":1220 * * cdef size_t sx = arr.shape[0] * cdef size_t sy = arr.shape[1] # <<<<<<<<<<<<<< @@ -134571,7 +137313,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_sy = (__pyx_v_arr->dimensions[1]); - /* "fastremap.pyx":1205 + /* "fastremap.pyx":1221 * cdef size_t sx = arr.shape[0] * cdef size_t sy = arr.shape[1] * cdef size_t sz = arr.shape[2] # <<<<<<<<<<<<<< @@ -134580,7 +137322,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_sz = (__pyx_v_arr->dimensions[2]); - /* "fastremap.pyx":1207 + /* "fastremap.pyx":1223 * cdef size_t sz = arr.shape[2] * * if n_foreground == 0: # <<<<<<<<<<<<<< @@ -134590,7 +137332,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = ((__pyx_v_n_foreground == 0) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1208 + /* "fastremap.pyx":1224 * * if n_foreground == 0: * return {} # <<<<<<<<<<<<<< @@ -134598,13 +137340,13 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py * cdef cnp.ndarray[ALLINT, ndim=1] ptlabel = np.zeros((n_foreground,), dtype=arr.dtype) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1208, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "fastremap.pyx":1207 + /* "fastremap.pyx":1223 * cdef size_t sz = arr.shape[2] * * if n_foreground == 0: # <<<<<<<<<<<<<< @@ -134613,48 +137355,48 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py */ } - /* "fastremap.pyx":1210 + /* "fastremap.pyx":1226 * return {} * * cdef cnp.ndarray[ALLINT, ndim=1] ptlabel = np.zeros((n_foreground,), dtype=arr.dtype) # <<<<<<<<<<<<<< * cdef cnp.ndarray[uint16_t, ndim=2] ptcloud = np.zeros((n_foreground, 3), dtype=np.uint16) * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1210, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1210, __pyx_L1_error) + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1226, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ptlabel.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_ptlabel = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 1210, __pyx_L1_error) + __PYX_ERR(0, 1226, __pyx_L1_error) } else {__pyx_pybuffernd_ptlabel.diminfo[0].strides = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptlabel.diminfo[0].shape = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.shape[0]; } } @@ -134662,21 +137404,21 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py __pyx_v_ptlabel = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":1211 + /* "fastremap.pyx":1227 * * cdef cnp.ndarray[ALLINT, ndim=1] ptlabel = np.zeros((n_foreground,), dtype=arr.dtype) * cdef cnp.ndarray[uint16_t, ndim=2] ptcloud = np.zeros((n_foreground, 3), dtype=np.uint16) # <<<<<<<<<<<<<< * * cdef size_t i = 0 */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_n_foreground); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); @@ -134684,32 +137426,32 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1211, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 1211, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1211, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1227, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ptcloud.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_ptcloud = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 1211, __pyx_L1_error) + __PYX_ERR(0, 1227, __pyx_L1_error) } else {__pyx_pybuffernd_ptcloud.diminfo[0].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptcloud.diminfo[0].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ptcloud.diminfo[1].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ptcloud.diminfo[1].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[1]; } } @@ -134717,7 +137459,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py __pyx_v_ptcloud = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1213 + /* "fastremap.pyx":1229 * cdef cnp.ndarray[uint16_t, ndim=2] ptcloud = np.zeros((n_foreground, 3), dtype=np.uint16) * * cdef size_t i = 0 # <<<<<<<<<<<<<< @@ -134726,7 +137468,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_i = 0; - /* "fastremap.pyx":1214 + /* "fastremap.pyx":1230 * * cdef size_t i = 0 * cdef size_t j = 0 # <<<<<<<<<<<<<< @@ -134735,7 +137477,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_j = 0; - /* "fastremap.pyx":1215 + /* "fastremap.pyx":1231 * cdef size_t i = 0 * cdef size_t j = 0 * cdef size_t k = 0 # <<<<<<<<<<<<<< @@ -134744,7 +137486,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_k = 0; - /* "fastremap.pyx":1217 + /* "fastremap.pyx":1233 * cdef size_t k = 0 * * cdef size_t idx = 0 # <<<<<<<<<<<<<< @@ -134753,7 +137495,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_idx = 0; - /* "fastremap.pyx":1218 + /* "fastremap.pyx":1234 * * cdef size_t idx = 0 * for i in range(sx): # <<<<<<<<<<<<<< @@ -134765,7 +137507,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "fastremap.pyx":1219 + /* "fastremap.pyx":1235 * cdef size_t idx = 0 * for i in range(sx): * for j in range(sy): # <<<<<<<<<<<<<< @@ -134777,7 +137519,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_j = __pyx_t_14; - /* "fastremap.pyx":1220 + /* "fastremap.pyx":1236 * for i in range(sx): * for j in range(sy): * for k in range(sz): # <<<<<<<<<<<<<< @@ -134789,7 +137531,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_k = __pyx_t_17; - /* "fastremap.pyx":1221 + /* "fastremap.pyx":1237 * for j in range(sy): * for k in range(sz): * if arr[i,j,k] != 0: # <<<<<<<<<<<<<< @@ -134802,7 +137544,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = (((*__Pyx_BufPtrStrided3d(int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[2].strides)) != 0) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1222 + /* "fastremap.pyx":1238 * for k in range(sz): * if arr[i,j,k] != 0: * ptlabel[idx] = arr[i,j,k] # <<<<<<<<<<<<<< @@ -134815,7 +137557,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_21 = __pyx_v_idx; *__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_ptlabel.diminfo[0].strides) = (*__Pyx_BufPtrStrided3d(int64_t *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_arr.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_arr.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_arr.diminfo[2].strides)); - /* "fastremap.pyx":1223 + /* "fastremap.pyx":1239 * if arr[i,j,k] != 0: * ptlabel[idx] = arr[i,j,k] * ptcloud[idx,0] = i # <<<<<<<<<<<<<< @@ -134826,7 +137568,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_22 = 0; *__Pyx_BufPtrStrided2d(uint16_t *, __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ptcloud.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ptcloud.diminfo[1].strides) = __pyx_v_i; - /* "fastremap.pyx":1224 + /* "fastremap.pyx":1240 * ptlabel[idx] = arr[i,j,k] * ptcloud[idx,0] = i * ptcloud[idx,1] = j # <<<<<<<<<<<<<< @@ -134837,7 +137579,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_22 = 1; *__Pyx_BufPtrStrided2d(uint16_t *, __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ptcloud.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ptcloud.diminfo[1].strides) = __pyx_v_j; - /* "fastremap.pyx":1225 + /* "fastremap.pyx":1241 * ptcloud[idx,0] = i * ptcloud[idx,1] = j * ptcloud[idx,2] = k # <<<<<<<<<<<<<< @@ -134848,7 +137590,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_22 = 2; *__Pyx_BufPtrStrided2d(uint16_t *, __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ptcloud.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_ptcloud.diminfo[1].strides) = __pyx_v_k; - /* "fastremap.pyx":1226 + /* "fastremap.pyx":1242 * ptcloud[idx,1] = j * ptcloud[idx,2] = k * idx += 1 # <<<<<<<<<<<<<< @@ -134857,7 +137599,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_idx = (__pyx_v_idx + 1); - /* "fastremap.pyx":1221 + /* "fastremap.pyx":1237 * for j in range(sy): * for k in range(sz): * if arr[i,j,k] != 0: # <<<<<<<<<<<<<< @@ -134869,14 +137611,14 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py } } - /* "fastremap.pyx":1228 + /* "fastremap.pyx":1244 * idx += 1 * * sortidx = ptlabel.argsort() # <<<<<<<<<<<<<< * ptlabel = ptlabel[sortidx] * ptcloud = ptcloud[sortidx] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ptlabel), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1228, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ptlabel), __pyx_n_s_argsort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -134890,22 +137632,22 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py } __pyx_t_8 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1228, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sortidx = __pyx_t_8; __pyx_t_8 = 0; - /* "fastremap.pyx":1229 + /* "fastremap.pyx":1245 * * sortidx = ptlabel.argsort() * ptlabel = ptlabel[sortidx] # <<<<<<<<<<<<<< * ptcloud = ptcloud[sortidx] * del sortidx */ - __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptlabel), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1229, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptlabel), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1229, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1245, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -134922,22 +137664,22 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_24 = __pyx_t_25 = __pyx_t_26 = 0; } __pyx_pybuffernd_ptlabel.diminfo[0].strides = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptlabel.diminfo[0].shape = __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1229, __pyx_L1_error) + if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1245, __pyx_L1_error) } __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_ptlabel, ((PyArrayObject *)__pyx_t_8)); __pyx_t_8 = 0; - /* "fastremap.pyx":1230 + /* "fastremap.pyx":1246 * sortidx = ptlabel.argsort() * ptlabel = ptlabel[sortidx] * ptcloud = ptcloud[sortidx] # <<<<<<<<<<<<<< * del sortidx * */ - __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1230, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_v_sortidx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1230, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1246, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -134954,13 +137696,13 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_26 = __pyx_t_25 = __pyx_t_24 = 0; } __pyx_pybuffernd_ptcloud.diminfo[0].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ptcloud.diminfo[0].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ptcloud.diminfo[1].strides = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ptcloud.diminfo[1].shape = __pyx_pybuffernd_ptcloud.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1230, __pyx_L1_error) + if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 1246, __pyx_L1_error) } __pyx_t_9 = 0; __Pyx_DECREF_SET(__pyx_v_ptcloud, ((PyArrayObject *)__pyx_t_8)); __pyx_t_8 = 0; - /* "fastremap.pyx":1231 + /* "fastremap.pyx":1247 * ptlabel = ptlabel[sortidx] * ptcloud = ptcloud[sortidx] * del sortidx # <<<<<<<<<<<<<< @@ -134970,19 +137712,19 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_DECREF(__pyx_v_sortidx); __pyx_v_sortidx = NULL; - /* "fastremap.pyx":1233 + /* "fastremap.pyx":1249 * del sortidx * * ptcloud_by_label = {} # <<<<<<<<<<<<<< * if n_foreground == 1: * ptcloud_by_label[ptlabel[0]] = ptcloud */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1233, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_ptcloud_by_label = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1234 + /* "fastremap.pyx":1250 * * ptcloud_by_label = {} * if n_foreground == 1: # <<<<<<<<<<<<<< @@ -134992,7 +137734,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = ((__pyx_v_n_foreground == 1) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1235 + /* "fastremap.pyx":1251 * ptcloud_by_label = {} * if n_foreground == 1: * ptcloud_by_label[ptlabel[0]] = ptcloud # <<<<<<<<<<<<<< @@ -135000,12 +137742,12 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py * */ __pyx_t_22 = 0; - __pyx_t_8 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1235, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_8, ((PyObject *)__pyx_v_ptcloud)) < 0)) __PYX_ERR(0, 1235, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_8, ((PyObject *)__pyx_v_ptcloud)) < 0)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "fastremap.pyx":1236 + /* "fastremap.pyx":1252 * if n_foreground == 1: * ptcloud_by_label[ptlabel[0]] = ptcloud * return ptcloud_by_label # <<<<<<<<<<<<<< @@ -135017,7 +137759,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py __pyx_r = __pyx_v_ptcloud_by_label; goto __pyx_L0; - /* "fastremap.pyx":1234 + /* "fastremap.pyx":1250 * * ptcloud_by_label = {} * if n_foreground == 1: # <<<<<<<<<<<<<< @@ -135026,7 +137768,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py */ } - /* "fastremap.pyx":1238 + /* "fastremap.pyx":1254 * return ptcloud_by_label * * cdef size_t start = 0 # <<<<<<<<<<<<<< @@ -135035,7 +137777,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_start = 0; - /* "fastremap.pyx":1239 + /* "fastremap.pyx":1255 * * cdef size_t start = 0 * cdef size_t end = 0 # <<<<<<<<<<<<<< @@ -135044,7 +137786,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_end = 0; - /* "fastremap.pyx":1240 + /* "fastremap.pyx":1256 * cdef size_t start = 0 * cdef size_t end = 0 * for end in range(1, n_foreground): # <<<<<<<<<<<<<< @@ -135056,7 +137798,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py for (__pyx_t_11 = 1; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_end = __pyx_t_11; - /* "fastremap.pyx":1241 + /* "fastremap.pyx":1257 * cdef size_t end = 0 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: # <<<<<<<<<<<<<< @@ -135068,22 +137810,22 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_ptlabel.diminfo[0].strides)) != (*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ptlabel.diminfo[0].strides))) != 0); if (__pyx_t_5) { - /* "fastremap.pyx":1242 + /* "fastremap.pyx":1258 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: * ptcloud_by_label[ptlabel[end - 1]] = ptcloud[start:end,:] # <<<<<<<<<<<<<< * start = end * */ - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PySlice_New(__pyx_t_8, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_6 = PySlice_New(__pyx_t_8, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); @@ -135091,17 +137833,17 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_slice__32); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__32); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_13 = (__pyx_v_end - 1); - __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_1, __pyx_t_6) < 0)) __PYX_ERR(0, 1242, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_1, __pyx_t_6) < 0)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "fastremap.pyx":1243 + /* "fastremap.pyx":1259 * if ptlabel[end] != ptlabel[end - 1]: * ptcloud_by_label[ptlabel[end - 1]] = ptcloud[start:end,:] * start = end # <<<<<<<<<<<<<< @@ -135110,7 +137852,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py */ __pyx_v_start = __pyx_v_end; - /* "fastremap.pyx":1241 + /* "fastremap.pyx":1257 * cdef size_t end = 0 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: # <<<<<<<<<<<<<< @@ -135120,19 +137862,19 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py } } - /* "fastremap.pyx":1245 + /* "fastremap.pyx":1261 * start = end * * ptcloud_by_label[ptlabel[end]] = ptcloud[start:,:] # <<<<<<<<<<<<<< * * return ptcloud_by_label */ - __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PySlice_New(__pyx_t_6, Py_None, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_1 = PySlice_New(__pyx_t_6, Py_None, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); @@ -135140,17 +137882,17 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_slice__25); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__25); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_ptcloud), __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = __pyx_v_end; - __pyx_t_6 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int64_t((*__Pyx_BufPtrStrided1d(int64_t *, __pyx_pybuffernd_ptlabel.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ptlabel.diminfo[0].strides))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_6, __pyx_t_1) < 0)) __PYX_ERR(0, 1245, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ptcloud_by_label, __pyx_t_6, __pyx_t_1) < 0)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":1247 + /* "fastremap.pyx":1263 * ptcloud_by_label[ptlabel[end]] = ptcloud[start:,:] * * return ptcloud_by_label # <<<<<<<<<<<<<< @@ -135162,7 +137904,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py __pyx_r = __pyx_v_ptcloud_by_label; goto __pyx_L0; - /* "fastremap.pyx":1190 + /* "fastremap.pyx":1206 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def point_cloud(cnp.ndarray[ALLINT, ndim=3] arr): # <<<<<<<<<<<<<< @@ -135202,7 +137944,7 @@ static PyObject *__pyx_pf_9fastremap_598point_cloud(CYTHON_UNUSED PyObject *__py return __pyx_r; } -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":734 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":735 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -135219,7 +137961,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":735 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":736 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -135227,13 +137969,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ * cdef inline object PyArray_MultiIterNew2(a, b): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 735, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":734 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":735 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -135252,7 +137994,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":737 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":738 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -135269,7 +138011,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":738 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":739 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -135277,13 +138019,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ * cdef inline object PyArray_MultiIterNew3(a, b, c): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 738, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":737 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":738 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -135302,7 +138044,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":740 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":741 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -135319,7 +138061,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":741 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":742 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -135327,13 +138069,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 741, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":740 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":741 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -135352,7 +138094,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":743 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":744 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -135369,7 +138111,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":744 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":745 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -135377,13 +138119,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 744, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":743 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":744 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -135402,7 +138144,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":746 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":747 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -135419,7 +138161,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":747 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":748 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -135427,13 +138169,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ * cdef inline tuple PyDataType_SHAPE(dtype d): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 747, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":746 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":747 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -135452,7 +138194,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":749 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":750 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -135466,7 +138208,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ int __pyx_t_1; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":750 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":751 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -135476,7 +138218,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0); if (__pyx_t_1) { - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":751 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":752 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -135488,7 +138230,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":750 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":751 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -135497,7 +138239,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":753 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":754 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -135511,7 +138253,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":749 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":750 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -135526,7 +138268,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":868 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":931 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -135538,7 +138280,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":869 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":932 * * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< @@ -135547,7 +138289,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":870 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":933 * 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) # <<<<<<<<<<<<<< @@ -135556,7 +138298,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base)); - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":868 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":931 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -135568,7 +138310,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":872 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":935 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -135583,7 +138325,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":873 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":936 * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< @@ -135592,7 +138334,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ __pyx_v_base = PyArray_BASE(__pyx_v_arr); - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":874 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":937 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -135602,7 +138344,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_base == NULL) != 0); if (__pyx_t_1) { - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":875 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":938 * base = PyArray_BASE(arr) * if base is NULL: * return None # <<<<<<<<<<<<<< @@ -135613,7 +138355,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":874 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":937 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -135622,7 +138364,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":876 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":939 * if base is NULL: * return None * return base # <<<<<<<<<<<<<< @@ -135634,7 +138376,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = ((PyObject *)__pyx_v_base); goto __pyx_L0; - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":872 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":935 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -135649,7 +138391,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":880 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":943 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -135673,7 +138415,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_array", 0); - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":881 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":944 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -135689,16 +138431,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":882 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":945 * 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, 882, __pyx_L3_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 945, __pyx_L3_error) - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":881 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":944 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -135712,7 +138454,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":883 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":946 * try: * __pyx_import_array() * except Exception: # <<<<<<<<<<<<<< @@ -135722,28 +138464,28 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 883, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 946, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":884 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":947 * __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__33, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 884, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 947, __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, 884, __pyx_L5_except_error) + __PYX_ERR(1, 947, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":881 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":944 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -135758,7 +138500,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":880 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":943 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -135781,7 +138523,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":886 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":949 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -135805,7 +138547,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_umath", 0); - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":887 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":950 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -135821,16 +138563,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":888 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":951 * 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, 888, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 951, __pyx_L3_error) - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":887 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":950 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -135844,7 +138586,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":889 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":952 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -135854,28 +138596,28 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 889, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 952, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":890 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":953 * _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__34, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 890, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 953, __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, 890, __pyx_L5_except_error) + __PYX_ERR(1, 953, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":887 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":950 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -135890,7 +138632,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":886 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":949 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -135913,7 +138655,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":892 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":955 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -135937,7 +138679,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":893 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":956 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -135953,16 +138695,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":894 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":957 * 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, 894, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 957, __pyx_L3_error) - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":893 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":956 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -135976,7 +138718,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":895 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":958 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -135986,28 +138728,28 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 895, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 958, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":896 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":959 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * * cdef extern from *: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 896, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 959, __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, 896, __pyx_L5_except_error) + __PYX_ERR(1, 959, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":893 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":956 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -136022,7 +138764,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":892 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":955 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -136045,1139 +138787,743 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { return __pyx_r; } -/* "map.to_py":201 +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":969 * - * @cname("__pyx_convert_unordered_map_to_py_uint8_t____uint8_t") - * cdef object __pyx_convert_unordered_map_to_py_uint8_t____uint8_t(const map[X,Y]& s): # <<<<<<<<<<<<<< - * o = {} - * cdef const map[X,Y].value_type *key_value + * + * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.timedelta64)` */ -static PyObject *__pyx_convert_unordered_map_to_py_uint8_t____uint8_t(std::unordered_map const &__pyx_v_s) { - PyObject *__pyx_v_o = NULL; - std::unordered_map ::value_type const *__pyx_v_key_value; - std::unordered_map ::const_iterator __pyx_v_iter; - PyObject *__pyx_r = NULL; +static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) { + int __pyx_r; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_convert_unordered_map_to_py_uint8_t____uint8_t", 0); + __Pyx_RefNannySetupContext("is_timedelta64_object", 0); - /* "map.to_py":202 - * @cname("__pyx_convert_unordered_map_to_py_uint8_t____uint8_t") - * cdef object __pyx_convert_unordered_map_to_py_uint8_t____uint8_t(const map[X,Y]& s): - * o = {} # <<<<<<<<<<<<<< - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":981 + * bool + * """ + * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< + * + * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_o = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); + goto __pyx_L0; - /* "map.to_py":204 - * o = {} - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() # <<<<<<<<<<<<<< - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":969 + * + * + * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.timedelta64)` */ - __pyx_v_iter = __pyx_v_s.begin(); - /* "map.to_py":205 - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() - * while iter != s.end(): # <<<<<<<<<<<<<< - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":984 + * + * + * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.datetime64)` */ - while (1) { - __pyx_t_2 = ((__pyx_v_iter != __pyx_v_s.end()) != 0); - if (!__pyx_t_2) break; - /* "map.to_py":206 - * cdef map[X,Y].const_iterator iter = s.begin() - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) # <<<<<<<<<<<<<< - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) +static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_datetime64_object", 0); + + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":996 + * bool + * """ + * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< + * + * */ - __pyx_v_key_value = (&(*__pyx_v_iter)); + __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); + goto __pyx_L0; - /* "map.to_py":207 - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second # <<<<<<<<<<<<<< - * cython.operator.preincrement(iter) - * return o + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":984 + * + * + * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.datetime64)` */ - __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_key_value->second); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_key_value->first); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (unlikely(PyDict_SetItem(__pyx_v_o, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "map.to_py":208 - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) # <<<<<<<<<<<<<< - * return o + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":999 + * * + * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy datetime64 object */ - (void)((++__pyx_v_iter)); - } - /* "map.to_py":209 - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) - * return o # <<<<<<<<<<<<<< +static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { + npy_datetime __pyx_r; + + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":1006 + * also needed. That can be found using `get_datetime64_unit`. + * """ + * return (obj).obval # <<<<<<<<<<<<<< * * */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_o); - __pyx_r = __pyx_v_o; + __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "map.to_py":201 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":999 + * * - * @cname("__pyx_convert_unordered_map_to_py_uint8_t____uint8_t") - * cdef object __pyx_convert_unordered_map_to_py_uint8_t____uint8_t(const map[X,Y]& s): # <<<<<<<<<<<<<< - * o = {} - * cdef const map[X,Y].value_type *key_value + * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy datetime64 object */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("map.to_py.__pyx_convert_unordered_map_to_py_uint8_t____uint8_t", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_o); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_convert_unordered_map_to_py_uint16_t____uint16_t(std::unordered_map const &__pyx_v_s) { - PyObject *__pyx_v_o = NULL; - std::unordered_map ::value_type const *__pyx_v_key_value; - std::unordered_map ::const_iterator __pyx_v_iter; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_convert_unordered_map_to_py_uint16_t____uint16_t", 0); +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":1009 + * + * + * 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; - /* "map.to_py":202 - * @cname("__pyx_convert_unordered_map_to_py_uint16_t____uint16_t") - * cdef object __pyx_convert_unordered_map_to_py_uint16_t____uint16_t(const map[X,Y]& s): - * o = {} # <<<<<<<<<<<<<< - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":1013 + * returns the int64 value underlying scalar numpy timedelta64 object + * """ + * return (obj).obval # <<<<<<<<<<<<<< + * + * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_o = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; + goto __pyx_L0; - /* "map.to_py":204 - * o = {} - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() # <<<<<<<<<<<<<< - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":1009 + * + * + * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy timedelta64 object */ - __pyx_v_iter = __pyx_v_s.begin(); - /* "map.to_py":205 - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() - * while iter != s.end(): # <<<<<<<<<<<<<< - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":1016 + * + * + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the unit part of the dtype for a numpy datetime64 object. */ - while (1) { - __pyx_t_2 = ((__pyx_v_iter != __pyx_v_s.end()) != 0); - if (!__pyx_t_2) break; - /* "map.to_py":206 - * cdef map[X,Y].const_iterator iter = s.begin() - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) # <<<<<<<<<<<<<< - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) +static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { + NPY_DATETIMEUNIT __pyx_r; + + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":1020 + * returns the unit part of the dtype for a numpy datetime64 object. + * """ + * return (obj).obmeta.base # <<<<<<<<<<<<<< */ - __pyx_v_key_value = (&(*__pyx_v_iter)); + __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); + goto __pyx_L0; - /* "map.to_py":207 - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second # <<<<<<<<<<<<<< - * cython.operator.preincrement(iter) - * return o + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":1016 + * + * + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the unit part of the dtype for a numpy datetime64 object. */ - __pyx_t_1 = __Pyx_PyInt_From_uint16_t(__pyx_v_key_value->second); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_From_uint16_t(__pyx_v_key_value->first); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (unlikely(PyDict_SetItem(__pyx_v_o, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "map.to_py":208 - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) # <<<<<<<<<<<<<< - * return o + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "pair.to_py":158 + * + * @cname("__pyx_convert_pair_to_py_uint8_t____uint8_t") + * cdef object __pyx_convert_pair_to_py_uint8_t____uint8_t(const pair[X,Y]& p): # <<<<<<<<<<<<<< + * return p.first, p.second * */ - (void)((++__pyx_v_iter)); - } - /* "map.to_py":209 - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) - * return o # <<<<<<<<<<<<<< +static PyObject *__pyx_convert_pair_to_py_uint8_t____uint8_t(std::pair const &__pyx_v_p) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_pair_to_py_uint8_t____uint8_t", 0); + + /* "pair.to_py":159 + * @cname("__pyx_convert_pair_to_py_uint8_t____uint8_t") + * cdef object __pyx_convert_pair_to_py_uint8_t____uint8_t(const pair[X,Y]& p): + * return p.first, p.second # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_o); - __pyx_r = __pyx_v_o; + __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_p.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_p.second); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "map.to_py":201 + /* "pair.to_py":158 + * + * @cname("__pyx_convert_pair_to_py_uint8_t____uint8_t") + * cdef object __pyx_convert_pair_to_py_uint8_t____uint8_t(const pair[X,Y]& p): # <<<<<<<<<<<<<< + * return p.first, p.second * - * @cname("__pyx_convert_unordered_map_to_py_uint16_t____uint16_t") - * cdef object __pyx_convert_unordered_map_to_py_uint16_t____uint16_t(const map[X,Y]& s): # <<<<<<<<<<<<<< - * o = {} - * cdef const map[X,Y].value_type *key_value */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("map.to_py.__pyx_convert_unordered_map_to_py_uint16_t____uint16_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("pair.to_py.__pyx_convert_pair_to_py_uint8_t____uint8_t", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_o); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_convert_unordered_map_to_py_uint32_t____uint32_t(std::unordered_map const &__pyx_v_s) { - PyObject *__pyx_v_o = NULL; - std::unordered_map ::value_type const *__pyx_v_key_value; - std::unordered_map ::const_iterator __pyx_v_iter; +static PyObject *__pyx_convert_pair_to_py_uint16_t____uint16_t(std::pair const &__pyx_v_p) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; + PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_convert_unordered_map_to_py_uint32_t____uint32_t", 0); - - /* "map.to_py":202 - * @cname("__pyx_convert_unordered_map_to_py_uint32_t____uint32_t") - * cdef object __pyx_convert_unordered_map_to_py_uint32_t____uint32_t(const map[X,Y]& s): - * o = {} # <<<<<<<<<<<<<< - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() - */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_o = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "map.to_py":204 - * o = {} - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() # <<<<<<<<<<<<<< - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) - */ - __pyx_v_iter = __pyx_v_s.begin(); + __Pyx_RefNannySetupContext("__pyx_convert_pair_to_py_uint16_t____uint16_t", 0); - /* "map.to_py":205 - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() - * while iter != s.end(): # <<<<<<<<<<<<<< - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second - */ - while (1) { - __pyx_t_2 = ((__pyx_v_iter != __pyx_v_s.end()) != 0); - if (!__pyx_t_2) break; - - /* "map.to_py":206 - * cdef map[X,Y].const_iterator iter = s.begin() - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) # <<<<<<<<<<<<<< - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) - */ - __pyx_v_key_value = (&(*__pyx_v_iter)); - - /* "map.to_py":207 - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second # <<<<<<<<<<<<<< - * cython.operator.preincrement(iter) - * return o - */ - __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_key_value->second); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_key_value->first); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (unlikely(PyDict_SetItem(__pyx_v_o, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "map.to_py":208 - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) # <<<<<<<<<<<<<< - * return o - * - */ - (void)((++__pyx_v_iter)); - } - - /* "map.to_py":209 - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) - * return o # <<<<<<<<<<<<<< + /* "pair.to_py":159 + * @cname("__pyx_convert_pair_to_py_uint16_t____uint16_t") + * cdef object __pyx_convert_pair_to_py_uint16_t____uint16_t(const pair[X,Y]& p): + * return p.first, p.second # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_o); - __pyx_r = __pyx_v_o; + __pyx_t_1 = __Pyx_PyInt_From_uint16_t(__pyx_v_p.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_uint16_t(__pyx_v_p.second); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "map.to_py":201 + /* "pair.to_py":158 + * + * @cname("__pyx_convert_pair_to_py_uint16_t____uint16_t") + * cdef object __pyx_convert_pair_to_py_uint16_t____uint16_t(const pair[X,Y]& p): # <<<<<<<<<<<<<< + * return p.first, p.second * - * @cname("__pyx_convert_unordered_map_to_py_uint32_t____uint32_t") - * cdef object __pyx_convert_unordered_map_to_py_uint32_t____uint32_t(const map[X,Y]& s): # <<<<<<<<<<<<<< - * o = {} - * cdef const map[X,Y].value_type *key_value */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("map.to_py.__pyx_convert_unordered_map_to_py_uint32_t____uint32_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("pair.to_py.__pyx_convert_pair_to_py_uint16_t____uint16_t", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_o); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_convert_unordered_map_to_py_uint64_t____uint64_t(std::unordered_map const &__pyx_v_s) { - PyObject *__pyx_v_o = NULL; - std::unordered_map ::value_type const *__pyx_v_key_value; - std::unordered_map ::const_iterator __pyx_v_iter; +static PyObject *__pyx_convert_pair_to_py_uint32_t____uint32_t(std::pair const &__pyx_v_p) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; + PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_convert_unordered_map_to_py_uint64_t____uint64_t", 0); - - /* "map.to_py":202 - * @cname("__pyx_convert_unordered_map_to_py_uint64_t____uint64_t") - * cdef object __pyx_convert_unordered_map_to_py_uint64_t____uint64_t(const map[X,Y]& s): - * o = {} # <<<<<<<<<<<<<< - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() - */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_o = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "map.to_py":204 - * o = {} - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() # <<<<<<<<<<<<<< - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) - */ - __pyx_v_iter = __pyx_v_s.begin(); + __Pyx_RefNannySetupContext("__pyx_convert_pair_to_py_uint32_t____uint32_t", 0); - /* "map.to_py":205 - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() - * while iter != s.end(): # <<<<<<<<<<<<<< - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second - */ - while (1) { - __pyx_t_2 = ((__pyx_v_iter != __pyx_v_s.end()) != 0); - if (!__pyx_t_2) break; - - /* "map.to_py":206 - * cdef map[X,Y].const_iterator iter = s.begin() - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) # <<<<<<<<<<<<<< - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) - */ - __pyx_v_key_value = (&(*__pyx_v_iter)); - - /* "map.to_py":207 - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second # <<<<<<<<<<<<<< - * cython.operator.preincrement(iter) - * return o - */ - __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_key_value->second); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_key_value->first); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (unlikely(PyDict_SetItem(__pyx_v_o, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "map.to_py":208 - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) # <<<<<<<<<<<<<< - * return o - * - */ - (void)((++__pyx_v_iter)); - } - - /* "map.to_py":209 - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) - * return o # <<<<<<<<<<<<<< + /* "pair.to_py":159 + * @cname("__pyx_convert_pair_to_py_uint32_t____uint32_t") + * cdef object __pyx_convert_pair_to_py_uint32_t____uint32_t(const pair[X,Y]& p): + * return p.first, p.second # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_o); - __pyx_r = __pyx_v_o; + __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_p.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_p.second); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "map.to_py":201 + /* "pair.to_py":158 + * + * @cname("__pyx_convert_pair_to_py_uint32_t____uint32_t") + * cdef object __pyx_convert_pair_to_py_uint32_t____uint32_t(const pair[X,Y]& p): # <<<<<<<<<<<<<< + * return p.first, p.second * - * @cname("__pyx_convert_unordered_map_to_py_uint64_t____uint64_t") - * cdef object __pyx_convert_unordered_map_to_py_uint64_t____uint64_t(const map[X,Y]& s): # <<<<<<<<<<<<<< - * o = {} - * cdef const map[X,Y].value_type *key_value */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("map.to_py.__pyx_convert_unordered_map_to_py_uint64_t____uint64_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("pair.to_py.__pyx_convert_pair_to_py_uint32_t____uint32_t", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_o); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_convert_unordered_map_to_py_int8_t____int8_t(std::unordered_map const &__pyx_v_s) { - PyObject *__pyx_v_o = NULL; - std::unordered_map ::value_type const *__pyx_v_key_value; - std::unordered_map ::const_iterator __pyx_v_iter; +static PyObject *__pyx_convert_pair_to_py_uint64_t____uint64_t(std::pair const &__pyx_v_p) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; + PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_convert_unordered_map_to_py_int8_t____int8_t", 0); - - /* "map.to_py":202 - * @cname("__pyx_convert_unordered_map_to_py_int8_t____int8_t") - * cdef object __pyx_convert_unordered_map_to_py_int8_t____int8_t(const map[X,Y]& s): - * o = {} # <<<<<<<<<<<<<< - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() - */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_o = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "map.to_py":204 - * o = {} - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() # <<<<<<<<<<<<<< - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) - */ - __pyx_v_iter = __pyx_v_s.begin(); - - /* "map.to_py":205 - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() - * while iter != s.end(): # <<<<<<<<<<<<<< - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second - */ - while (1) { - __pyx_t_2 = ((__pyx_v_iter != __pyx_v_s.end()) != 0); - if (!__pyx_t_2) break; - - /* "map.to_py":206 - * cdef map[X,Y].const_iterator iter = s.begin() - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) # <<<<<<<<<<<<<< - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) - */ - __pyx_v_key_value = (&(*__pyx_v_iter)); - - /* "map.to_py":207 - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second # <<<<<<<<<<<<<< - * cython.operator.preincrement(iter) - * return o - */ - __pyx_t_1 = __Pyx_PyInt_From_int8_t(__pyx_v_key_value->second); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_From_int8_t(__pyx_v_key_value->first); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (unlikely(PyDict_SetItem(__pyx_v_o, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "map.to_py":208 - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) # <<<<<<<<<<<<<< - * return o - * - */ - (void)((++__pyx_v_iter)); - } + __Pyx_RefNannySetupContext("__pyx_convert_pair_to_py_uint64_t____uint64_t", 0); - /* "map.to_py":209 - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) - * return o # <<<<<<<<<<<<<< + /* "pair.to_py":159 + * @cname("__pyx_convert_pair_to_py_uint64_t____uint64_t") + * cdef object __pyx_convert_pair_to_py_uint64_t____uint64_t(const pair[X,Y]& p): + * return p.first, p.second # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_o); - __pyx_r = __pyx_v_o; + __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_p.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_uint64_t(__pyx_v_p.second); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "map.to_py":201 + /* "pair.to_py":158 + * + * @cname("__pyx_convert_pair_to_py_uint64_t____uint64_t") + * cdef object __pyx_convert_pair_to_py_uint64_t____uint64_t(const pair[X,Y]& p): # <<<<<<<<<<<<<< + * return p.first, p.second * - * @cname("__pyx_convert_unordered_map_to_py_int8_t____int8_t") - * cdef object __pyx_convert_unordered_map_to_py_int8_t____int8_t(const map[X,Y]& s): # <<<<<<<<<<<<<< - * o = {} - * cdef const map[X,Y].value_type *key_value */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("map.to_py.__pyx_convert_unordered_map_to_py_int8_t____int8_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("pair.to_py.__pyx_convert_pair_to_py_uint64_t____uint64_t", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_o); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_convert_unordered_map_to_py_int16_t____int16_t(std::unordered_map const &__pyx_v_s) { - PyObject *__pyx_v_o = NULL; - std::unordered_map ::value_type const *__pyx_v_key_value; - std::unordered_map ::const_iterator __pyx_v_iter; +static PyObject *__pyx_convert_pair_to_py_int8_t____int8_t(std::pair const &__pyx_v_p) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; + PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_convert_unordered_map_to_py_int16_t____int16_t", 0); - - /* "map.to_py":202 - * @cname("__pyx_convert_unordered_map_to_py_int16_t____int16_t") - * cdef object __pyx_convert_unordered_map_to_py_int16_t____int16_t(const map[X,Y]& s): - * o = {} # <<<<<<<<<<<<<< - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() - */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_o = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "map.to_py":204 - * o = {} - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() # <<<<<<<<<<<<<< - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) - */ - __pyx_v_iter = __pyx_v_s.begin(); - - /* "map.to_py":205 - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() - * while iter != s.end(): # <<<<<<<<<<<<<< - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second - */ - while (1) { - __pyx_t_2 = ((__pyx_v_iter != __pyx_v_s.end()) != 0); - if (!__pyx_t_2) break; - - /* "map.to_py":206 - * cdef map[X,Y].const_iterator iter = s.begin() - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) # <<<<<<<<<<<<<< - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) - */ - __pyx_v_key_value = (&(*__pyx_v_iter)); - - /* "map.to_py":207 - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second # <<<<<<<<<<<<<< - * cython.operator.preincrement(iter) - * return o - */ - __pyx_t_1 = __Pyx_PyInt_From_int16_t(__pyx_v_key_value->second); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_From_int16_t(__pyx_v_key_value->first); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (unlikely(PyDict_SetItem(__pyx_v_o, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "map.to_py":208 - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) # <<<<<<<<<<<<<< - * return o - * - */ - (void)((++__pyx_v_iter)); - } + __Pyx_RefNannySetupContext("__pyx_convert_pair_to_py_int8_t____int8_t", 0); - /* "map.to_py":209 - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) - * return o # <<<<<<<<<<<<<< + /* "pair.to_py":159 + * @cname("__pyx_convert_pair_to_py_int8_t____int8_t") + * cdef object __pyx_convert_pair_to_py_int8_t____int8_t(const pair[X,Y]& p): + * return p.first, p.second # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_o); - __pyx_r = __pyx_v_o; + __pyx_t_1 = __Pyx_PyInt_From_int8_t(__pyx_v_p.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int8_t(__pyx_v_p.second); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "map.to_py":201 + /* "pair.to_py":158 + * + * @cname("__pyx_convert_pair_to_py_int8_t____int8_t") + * cdef object __pyx_convert_pair_to_py_int8_t____int8_t(const pair[X,Y]& p): # <<<<<<<<<<<<<< + * return p.first, p.second * - * @cname("__pyx_convert_unordered_map_to_py_int16_t____int16_t") - * cdef object __pyx_convert_unordered_map_to_py_int16_t____int16_t(const map[X,Y]& s): # <<<<<<<<<<<<<< - * o = {} - * cdef const map[X,Y].value_type *key_value */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("map.to_py.__pyx_convert_unordered_map_to_py_int16_t____int16_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("pair.to_py.__pyx_convert_pair_to_py_int8_t____int8_t", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_o); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_convert_unordered_map_to_py_int32_t____int32_t(std::unordered_map const &__pyx_v_s) { - PyObject *__pyx_v_o = NULL; - std::unordered_map ::value_type const *__pyx_v_key_value; - std::unordered_map ::const_iterator __pyx_v_iter; +static PyObject *__pyx_convert_pair_to_py_int16_t____int16_t(std::pair const &__pyx_v_p) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; + PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_convert_unordered_map_to_py_int32_t____int32_t", 0); - - /* "map.to_py":202 - * @cname("__pyx_convert_unordered_map_to_py_int32_t____int32_t") - * cdef object __pyx_convert_unordered_map_to_py_int32_t____int32_t(const map[X,Y]& s): - * o = {} # <<<<<<<<<<<<<< - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() - */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_o = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "map.to_py":204 - * o = {} - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() # <<<<<<<<<<<<<< - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) - */ - __pyx_v_iter = __pyx_v_s.begin(); - - /* "map.to_py":205 - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() - * while iter != s.end(): # <<<<<<<<<<<<<< - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second - */ - while (1) { - __pyx_t_2 = ((__pyx_v_iter != __pyx_v_s.end()) != 0); - if (!__pyx_t_2) break; - - /* "map.to_py":206 - * cdef map[X,Y].const_iterator iter = s.begin() - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) # <<<<<<<<<<<<<< - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) - */ - __pyx_v_key_value = (&(*__pyx_v_iter)); - - /* "map.to_py":207 - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second # <<<<<<<<<<<<<< - * cython.operator.preincrement(iter) - * return o - */ - __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_key_value->second); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_key_value->first); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (unlikely(PyDict_SetItem(__pyx_v_o, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannySetupContext("__pyx_convert_pair_to_py_int16_t____int16_t", 0); - /* "map.to_py":208 - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) # <<<<<<<<<<<<<< - * return o - * - */ - (void)((++__pyx_v_iter)); - } - - /* "map.to_py":209 - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) - * return o # <<<<<<<<<<<<<< + /* "pair.to_py":159 + * @cname("__pyx_convert_pair_to_py_int16_t____int16_t") + * cdef object __pyx_convert_pair_to_py_int16_t____int16_t(const pair[X,Y]& p): + * return p.first, p.second # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_o); - __pyx_r = __pyx_v_o; + __pyx_t_1 = __Pyx_PyInt_From_int16_t(__pyx_v_p.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int16_t(__pyx_v_p.second); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "map.to_py":201 + /* "pair.to_py":158 + * + * @cname("__pyx_convert_pair_to_py_int16_t____int16_t") + * cdef object __pyx_convert_pair_to_py_int16_t____int16_t(const pair[X,Y]& p): # <<<<<<<<<<<<<< + * return p.first, p.second * - * @cname("__pyx_convert_unordered_map_to_py_int32_t____int32_t") - * cdef object __pyx_convert_unordered_map_to_py_int32_t____int32_t(const map[X,Y]& s): # <<<<<<<<<<<<<< - * o = {} - * cdef const map[X,Y].value_type *key_value */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("map.to_py.__pyx_convert_unordered_map_to_py_int32_t____int32_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("pair.to_py.__pyx_convert_pair_to_py_int16_t____int16_t", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_o); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_convert_unordered_map_to_py_int64_t____int64_t(std::unordered_map const &__pyx_v_s) { - PyObject *__pyx_v_o = NULL; - std::unordered_map ::value_type const *__pyx_v_key_value; - std::unordered_map ::const_iterator __pyx_v_iter; +static PyObject *__pyx_convert_pair_to_py_int32_t____int32_t(std::pair const &__pyx_v_p) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; + PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_convert_unordered_map_to_py_int64_t____int64_t", 0); - - /* "map.to_py":202 - * @cname("__pyx_convert_unordered_map_to_py_int64_t____int64_t") - * cdef object __pyx_convert_unordered_map_to_py_int64_t____int64_t(const map[X,Y]& s): - * o = {} # <<<<<<<<<<<<<< - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() - */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_o = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "map.to_py":204 - * o = {} - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() # <<<<<<<<<<<<<< - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) - */ - __pyx_v_iter = __pyx_v_s.begin(); - - /* "map.to_py":205 - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() - * while iter != s.end(): # <<<<<<<<<<<<<< - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second - */ - while (1) { - __pyx_t_2 = ((__pyx_v_iter != __pyx_v_s.end()) != 0); - if (!__pyx_t_2) break; - - /* "map.to_py":206 - * cdef map[X,Y].const_iterator iter = s.begin() - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) # <<<<<<<<<<<<<< - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) - */ - __pyx_v_key_value = (&(*__pyx_v_iter)); - - /* "map.to_py":207 - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second # <<<<<<<<<<<<<< - * cython.operator.preincrement(iter) - * return o - */ - __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_key_value->second); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_key_value->first); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (unlikely(PyDict_SetItem(__pyx_v_o, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "map.to_py":208 - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) # <<<<<<<<<<<<<< - * return o - * - */ - (void)((++__pyx_v_iter)); - } + __Pyx_RefNannySetupContext("__pyx_convert_pair_to_py_int32_t____int32_t", 0); - /* "map.to_py":209 - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) - * return o # <<<<<<<<<<<<<< + /* "pair.to_py":159 + * @cname("__pyx_convert_pair_to_py_int32_t____int32_t") + * cdef object __pyx_convert_pair_to_py_int32_t____int32_t(const pair[X,Y]& p): + * return p.first, p.second # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_o); - __pyx_r = __pyx_v_o; + __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_p.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_p.second); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "map.to_py":201 + /* "pair.to_py":158 + * + * @cname("__pyx_convert_pair_to_py_int32_t____int32_t") + * cdef object __pyx_convert_pair_to_py_int32_t____int32_t(const pair[X,Y]& p): # <<<<<<<<<<<<<< + * return p.first, p.second * - * @cname("__pyx_convert_unordered_map_to_py_int64_t____int64_t") - * cdef object __pyx_convert_unordered_map_to_py_int64_t____int64_t(const map[X,Y]& s): # <<<<<<<<<<<<<< - * o = {} - * cdef const map[X,Y].value_type *key_value */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("map.to_py.__pyx_convert_unordered_map_to_py_int64_t____int64_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("pair.to_py.__pyx_convert_pair_to_py_int32_t____int32_t", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_o); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_convert_unordered_map_to_py_float____float(std::unordered_map const &__pyx_v_s) { - PyObject *__pyx_v_o = NULL; - std::unordered_map ::value_type const *__pyx_v_key_value; - std::unordered_map ::const_iterator __pyx_v_iter; +static PyObject *__pyx_convert_pair_to_py_int64_t____int64_t(std::pair const &__pyx_v_p) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; + PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_convert_unordered_map_to_py_float____float", 0); - - /* "map.to_py":202 - * @cname("__pyx_convert_unordered_map_to_py_float____float") - * cdef object __pyx_convert_unordered_map_to_py_float____float(const map[X,Y]& s): - * o = {} # <<<<<<<<<<<<<< - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() - */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_o = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_RefNannySetupContext("__pyx_convert_pair_to_py_int64_t____int64_t", 0); - /* "map.to_py":204 - * o = {} - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() # <<<<<<<<<<<<<< - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) - */ - __pyx_v_iter = __pyx_v_s.begin(); - - /* "map.to_py":205 - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() - * while iter != s.end(): # <<<<<<<<<<<<<< - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second - */ - while (1) { - __pyx_t_2 = ((__pyx_v_iter != __pyx_v_s.end()) != 0); - if (!__pyx_t_2) break; - - /* "map.to_py":206 - * cdef map[X,Y].const_iterator iter = s.begin() - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) # <<<<<<<<<<<<<< - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) - */ - __pyx_v_key_value = (&(*__pyx_v_iter)); - - /* "map.to_py":207 - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second # <<<<<<<<<<<<<< - * cython.operator.preincrement(iter) - * return o - */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_key_value->second); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_key_value->first); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (unlikely(PyDict_SetItem(__pyx_v_o, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "map.to_py":208 - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) # <<<<<<<<<<<<<< - * return o - * - */ - (void)((++__pyx_v_iter)); - } - - /* "map.to_py":209 - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) - * return o # <<<<<<<<<<<<<< + /* "pair.to_py":159 + * @cname("__pyx_convert_pair_to_py_int64_t____int64_t") + * cdef object __pyx_convert_pair_to_py_int64_t____int64_t(const pair[X,Y]& p): + * return p.first, p.second # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_o); - __pyx_r = __pyx_v_o; + __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_p.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_p.second); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "map.to_py":201 + /* "pair.to_py":158 + * + * @cname("__pyx_convert_pair_to_py_int64_t____int64_t") + * cdef object __pyx_convert_pair_to_py_int64_t____int64_t(const pair[X,Y]& p): # <<<<<<<<<<<<<< + * return p.first, p.second * - * @cname("__pyx_convert_unordered_map_to_py_float____float") - * cdef object __pyx_convert_unordered_map_to_py_float____float(const map[X,Y]& s): # <<<<<<<<<<<<<< - * o = {} - * cdef const map[X,Y].value_type *key_value */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("map.to_py.__pyx_convert_unordered_map_to_py_float____float", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("pair.to_py.__pyx_convert_pair_to_py_int64_t____int64_t", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_o); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_convert_unordered_map_to_py_double____double(std::unordered_map const &__pyx_v_s) { - PyObject *__pyx_v_o = NULL; - std::unordered_map ::value_type const *__pyx_v_key_value; - std::unordered_map ::const_iterator __pyx_v_iter; +static PyObject *__pyx_convert_pair_to_py_float____float(std::pair const &__pyx_v_p) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; + PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_convert_unordered_map_to_py_double____double", 0); + __Pyx_RefNannySetupContext("__pyx_convert_pair_to_py_float____float", 0); - /* "map.to_py":202 - * @cname("__pyx_convert_unordered_map_to_py_double____double") - * cdef object __pyx_convert_unordered_map_to_py_double____double(const map[X,Y]& s): - * o = {} # <<<<<<<<<<<<<< - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() + /* "pair.to_py":159 + * @cname("__pyx_convert_pair_to_py_float____float") + * cdef object __pyx_convert_pair_to_py_float____float(const pair[X,Y]& p): + * return p.first, p.second # <<<<<<<<<<<<<< + * + * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 202, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_p.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_o = ((PyObject*)__pyx_t_1); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_p.second); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; - /* "map.to_py":204 - * o = {} - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() # <<<<<<<<<<<<<< - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) - */ - __pyx_v_iter = __pyx_v_s.begin(); - - /* "map.to_py":205 - * cdef const map[X,Y].value_type *key_value - * cdef map[X,Y].const_iterator iter = s.begin() - * while iter != s.end(): # <<<<<<<<<<<<<< - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second - */ - while (1) { - __pyx_t_2 = ((__pyx_v_iter != __pyx_v_s.end()) != 0); - if (!__pyx_t_2) break; - - /* "map.to_py":206 - * cdef map[X,Y].const_iterator iter = s.begin() - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) # <<<<<<<<<<<<<< - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) + /* "pair.to_py":158 + * + * @cname("__pyx_convert_pair_to_py_float____float") + * cdef object __pyx_convert_pair_to_py_float____float(const pair[X,Y]& p): # <<<<<<<<<<<<<< + * return p.first, p.second + * */ - __pyx_v_key_value = (&(*__pyx_v_iter)); - /* "map.to_py":207 - * while iter != s.end(): - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second # <<<<<<<<<<<<<< - * cython.operator.preincrement(iter) - * return o - */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_key_value->second); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_key_value->first); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (unlikely(PyDict_SetItem(__pyx_v_o, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(2, 207, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("pair.to_py.__pyx_convert_pair_to_py_float____float", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "map.to_py":208 - * key_value = &cython.operator.dereference(iter) - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) # <<<<<<<<<<<<<< - * return o - * - */ - (void)((++__pyx_v_iter)); - } +static PyObject *__pyx_convert_pair_to_py_double____double(std::pair const &__pyx_v_p) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_pair_to_py_double____double", 0); - /* "map.to_py":209 - * o[key_value.first] = key_value.second - * cython.operator.preincrement(iter) - * return o # <<<<<<<<<<<<<< + /* "pair.to_py":159 + * @cname("__pyx_convert_pair_to_py_double____double") + * cdef object __pyx_convert_pair_to_py_double____double(const pair[X,Y]& p): + * return p.first, p.second # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_o); - __pyx_r = __pyx_v_o; + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_p.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_p.second); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "map.to_py":201 + /* "pair.to_py":158 + * + * @cname("__pyx_convert_pair_to_py_double____double") + * cdef object __pyx_convert_pair_to_py_double____double(const pair[X,Y]& p): # <<<<<<<<<<<<<< + * return p.first, p.second * - * @cname("__pyx_convert_unordered_map_to_py_double____double") - * cdef object __pyx_convert_unordered_map_to_py_double____double(const map[X,Y]& s): # <<<<<<<<<<<<<< - * o = {} - * cdef const map[X,Y].value_type *key_value */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("map.to_py.__pyx_convert_unordered_map_to_py_double____double", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("pair.to_py.__pyx_convert_pair_to_py_double____double", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_o); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -151126,6 +153472,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0}, {&__pyx_n_s_accum, __pyx_k_accum, sizeof(__pyx_k_accum), 0, 0, 1, 1}, + {&__pyx_n_s_after, __pyx_k_after, sizeof(__pyx_k_after), 0, 0, 1, 1}, {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, @@ -151140,6 +153487,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1}, {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1}, {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_n_s_before, __pyx_k_before, sizeof(__pyx_k_before), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, {&__pyx_n_s_c_order_index, __pyx_k_c_order_index, sizeof(__pyx_k_c_order_index), 0, 0, 1, 1}, @@ -151449,12 +153797,12 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 76, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 76, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 301, __pyx_L1_error) - __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_n_s_min); if (!__pyx_builtin_min) __PYX_ERR(0, 565, __pyx_L1_error) - __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) __PYX_ERR(0, 565, __pyx_L1_error) - __pyx_builtin_all = __Pyx_GetBuiltinName(__pyx_n_s_all); if (!__pyx_builtin_all) __PYX_ERR(0, 572, __pyx_L1_error) - __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 602, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 884, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_n_s_min); if (!__pyx_builtin_min) __PYX_ERR(0, 567, __pyx_L1_error) + __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) __PYX_ERR(0, 567, __pyx_L1_error) + __pyx_builtin_all = __Pyx_GetBuiltinName(__pyx_n_s_all); if (!__pyx_builtin_all) __PYX_ERR(0, 574, __pyx_L1_error) + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 618, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 947, __pyx_L1_error) __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 148, __pyx_L1_error) __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 151, __pyx_L1_error) __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 404, __pyx_L1_error) @@ -151524,9 +153872,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { /* "fastremap.pyx":187 * * if arr.size == 0: - * return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict # <<<<<<<<<<<<<< + * return refit(np.zeros((0,), dtype=arr.dtype), 0), {} # <<<<<<<<<<<<<< * - * if preserve_zero: + * remap_dict.reserve(1024) */ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); @@ -151535,99 +153883,99 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); - /* "fastremap.pyx":727 + /* "fastremap.pyx":743 * """ * if not np.issubdtype(labels.dtype, np.integer): * raise TypeError("fastremap.unique only supports integer types.") # <<<<<<<<<<<<<< * * # These flags are currently unsupported so call uncle and */ - __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_u_fastremap_unique_only_supports_i); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 727, __pyx_L1_error) + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_u_fastremap_unique_only_supports_i); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); - /* "fastremap.pyx":754 + /* "fastremap.pyx":770 * min_label, max_label = (0, 0) * * def c_order_index(index): # <<<<<<<<<<<<<< * if len(shape) > 1 and fortran_order: * return np.ravel_multi_index( */ - __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_index); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 754, __pyx_L1_error) + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_index); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 770, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); - __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_c_order_index, 754, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 754, __pyx_L1_error) + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_c_order_index, 770, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 770, __pyx_L1_error) - /* "fastremap.pyx":1242 + /* "fastremap.pyx":1258 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: * ptcloud_by_label[ptlabel[end - 1]] = ptcloud[start:end,:] # <<<<<<<<<<<<<< * start = end * */ - __pyx_slice__24 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__24)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_slice__24 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__24)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__24); __Pyx_GIVEREF(__pyx_slice__24); - /* "fastremap.pyx":1245 + /* "fastremap.pyx":1261 * start = end * * ptcloud_by_label[ptlabel[end]] = ptcloud[start:,:] # <<<<<<<<<<<<<< * * return ptcloud_by_label */ - __pyx_slice__25 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__25)) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_slice__25 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__25)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__25); __Pyx_GIVEREF(__pyx_slice__25); - /* "fastremap.pyx":1242 + /* "fastremap.pyx":1258 * for end in range(1, n_foreground): * if ptlabel[end] != ptlabel[end - 1]: * ptcloud_by_label[ptlabel[end - 1]] = ptcloud[start:end,:] # <<<<<<<<<<<<<< * start = end * */ - __pyx_slice__26 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__26)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_slice__26 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__26)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__26); __Pyx_GIVEREF(__pyx_slice__26); - __pyx_slice__27 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__27)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_slice__27 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__27)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__27); __Pyx_GIVEREF(__pyx_slice__27); - __pyx_slice__28 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__28)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_slice__28 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__28)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__28); __Pyx_GIVEREF(__pyx_slice__28); - __pyx_slice__29 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__29)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_slice__29 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__29)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__29); __Pyx_GIVEREF(__pyx_slice__29); - __pyx_slice__30 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__30)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_slice__30 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__30)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__30); __Pyx_GIVEREF(__pyx_slice__30); - __pyx_slice__31 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__31)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_slice__31 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__31)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__31); __Pyx_GIVEREF(__pyx_slice__31); - __pyx_slice__32 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__32)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_slice__32 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__32)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__32); __Pyx_GIVEREF(__pyx_slice__32); - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":884 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":947 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_umath() except -1: */ - __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 884, __pyx_L1_error) + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 947, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); - /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":890 + /* "../../.virtualenvs/fr/lib/python3.9/site-packages/numpy/__init__.pxd":953 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 890, __pyx_L1_error) + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); @@ -151867,358 +154215,358 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """ * renumber(arr, int64_t start=1, preserve_zero=True) */ - __pyx_tuple__60 = PyTuple_Pack(12, __pyx_n_s_arr, __pyx_n_s_start, __pyx_n_s_preserve_zero, __pyx_n_s_remap_dict, __pyx_n_s_arrview, __pyx_n_s_remap_id, __pyx_n_s_elem, __pyx_n_s_last_elem, __pyx_n_s_last_remap_id, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_factor); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_tuple__60 = PyTuple_Pack(14, __pyx_n_s_arr, __pyx_n_s_start, __pyx_n_s_preserve_zero, __pyx_n_s_remap_dict, __pyx_n_s_arrview, __pyx_n_s_remap_id, __pyx_n_s_elem, __pyx_n_s_last_elem, __pyx_n_s_last_remap_id, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_factor, __pyx_n_s_k, __pyx_n_s_v); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__60); __Pyx_GIVEREF(__pyx_tuple__60); - __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_renumber, 170, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(3, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_renumber, 170, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 170, __pyx_L1_error) - /* "fastremap.pyx":228 - * return refit(arr, factor), remap_dict + /* "fastremap.pyx":230 + * return refit(arr, factor), { k:v for k,v in remap_dict } * * def refit(arr, value=None, increase_only=False, exotics=False): # <<<<<<<<<<<<<< * """ * Resize the array to the smallest dtype of the */ - __pyx_tuple__62 = PyTuple_Pack(7, __pyx_n_s_arr, __pyx_n_s_value, __pyx_n_s_increase_only, __pyx_n_s_exotics, __pyx_n_s_min_value, __pyx_n_s_max_value, __pyx_n_s_dtype); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_tuple__62 = PyTuple_Pack(7, __pyx_n_s_arr, __pyx_n_s_value, __pyx_n_s_increase_only, __pyx_n_s_exotics, __pyx_n_s_min_value, __pyx_n_s_max_value, __pyx_n_s_dtype); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__62); __Pyx_GIVEREF(__pyx_tuple__62); - __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_refit, 228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_refit, 230, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 230, __pyx_L1_error) - /* "fastremap.pyx":272 + /* "fastremap.pyx":274 * return arr.astype(dtype) * * def fit_dtype(dtype, value, exotics=False): # <<<<<<<<<<<<<< * """ * Find the smallest dtype of the */ - __pyx_tuple__64 = PyTuple_Pack(7, __pyx_n_s_dtype, __pyx_n_s_value, __pyx_n_s_exotics, __pyx_n_s_sequence, __pyx_n_s_infofn, __pyx_n_s_test_value, __pyx_n_s_seq_dtype); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_tuple__64 = PyTuple_Pack(7, __pyx_n_s_dtype, __pyx_n_s_value, __pyx_n_s_exotics, __pyx_n_s_sequence, __pyx_n_s_infofn, __pyx_n_s_test_value, __pyx_n_s_seq_dtype); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__64); __Pyx_GIVEREF(__pyx_tuple__64); - __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_fit_dtype, 272, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_fit_dtype, 274, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 274, __pyx_L1_error) - /* "fastremap.pyx":330 + /* "fastremap.pyx":332 * )) * * def mask(arr, labels, in_place=False, value=0): # <<<<<<<<<<<<<< * """ * mask(arr, labels, in_place=False, value=0) */ - __pyx_tuple__66 = PyTuple_Pack(5, __pyx_n_s_arr, __pyx_n_s_labels, __pyx_n_s_in_place, __pyx_n_s_value, __pyx_n_s_lbl); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_tuple__66 = PyTuple_Pack(5, __pyx_n_s_arr, __pyx_n_s_labels, __pyx_n_s_in_place, __pyx_n_s_value, __pyx_n_s_lbl); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__66); __Pyx_GIVEREF(__pyx_tuple__66); - __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_mask, 330, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_mask, 332, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 332, __pyx_L1_error) - /* "fastremap.pyx":352 + /* "fastremap.pyx":354 * return remap(arr, labels, preserve_missing_labels=True, in_place=in_place) * * def mask_except(arr, labels, in_place=False, value=0): # <<<<<<<<<<<<<< * """ * mask_except(arr, labels, in_place=False, value=0) */ - __pyx_tuple__68 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_labels, __pyx_n_s_in_place, __pyx_n_s_value, __pyx_n_s_shape, __pyx_n_s_order); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_tuple__68 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_labels, __pyx_n_s_in_place, __pyx_n_s_value, __pyx_n_s_shape, __pyx_n_s_order); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__68); __Pyx_GIVEREF(__pyx_tuple__68); - __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_mask_except_2, 352, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_mask_except_2, 354, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 354, __pyx_L1_error) - /* "fastremap.pyx":387 + /* "fastremap.pyx":389 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): # <<<<<<<<<<<<<< * cdef ALLINT[:] arrview = arr * cdef size_t i = 0 */ - __pyx_tuple__70 = PyTuple_Pack(10, __pyx_n_s_arr, __pyx_n_s_labels, __pyx_n_s_value, __pyx_n_s_arrview, __pyx_n_s_i, __pyx_n_s_size, __pyx_n_s_tbl, __pyx_n_s_label, __pyx_n_s_last_elem, __pyx_n_s_last_elem_value); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_tuple__70 = PyTuple_Pack(10, __pyx_n_s_arr, __pyx_n_s_labels, __pyx_n_s_value, __pyx_n_s_arrview, __pyx_n_s_i, __pyx_n_s_size, __pyx_n_s_tbl, __pyx_n_s_label, __pyx_n_s_last_elem, __pyx_n_s_last_elem_value); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__70); __Pyx_GIVEREF(__pyx_tuple__70); - __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_mask_except, 387, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_mask_except, 389, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 389, __pyx_L1_error) - /* "fastremap.pyx":421 + /* "fastremap.pyx":423 * return arr * * def component_map(component_labels, parent_labels): # <<<<<<<<<<<<<< * """ * Given two sets of images that have a surjective mapping between their labels, */ - __pyx_tuple__72 = PyTuple_Pack(3, __pyx_n_s_component_labels, __pyx_n_s_parent_labels, __pyx_n_s_shape); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 421, __pyx_L1_error) + __pyx_tuple__72 = PyTuple_Pack(3, __pyx_n_s_component_labels, __pyx_n_s_parent_labels, __pyx_n_s_shape); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__72); __Pyx_GIVEREF(__pyx_tuple__72); - __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_component_map_2, 421, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 421, __pyx_L1_error) + __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_component_map_2, 423, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 423, __pyx_L1_error) - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< * cnp.ndarray[ALLINT, ndim=1, cast=True] component_labels, * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels */ - __pyx_tuple__74 = PyTuple_Pack(6, __pyx_n_s_component_labels, __pyx_n_s_parent_labels, __pyx_n_s_size, __pyx_n_s_remap, __pyx_n_s_i, __pyx_n_s_last_label); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_tuple__74 = PyTuple_Pack(6, __pyx_n_s_component_labels, __pyx_n_s_parent_labels, __pyx_n_s_size, __pyx_n_s_remap, __pyx_n_s_i, __pyx_n_s_last_label); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__74); __Pyx_GIVEREF(__pyx_tuple__74); - __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_component_map, 456, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_component_map, 458, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 458, __pyx_L1_error) - /* "fastremap.pyx":477 + /* "fastremap.pyx":479 * return remap * * def inverse_component_map(parent_labels, component_labels): # <<<<<<<<<<<<<< * """ * Given two sets of images that have a mapping between their labels, */ - __pyx_tuple__76 = PyTuple_Pack(3, __pyx_n_s_parent_labels, __pyx_n_s_component_labels, __pyx_n_s_shape); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 477, __pyx_L1_error) + __pyx_tuple__76 = PyTuple_Pack(3, __pyx_n_s_parent_labels, __pyx_n_s_component_labels, __pyx_n_s_shape); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__76); __Pyx_GIVEREF(__pyx_tuple__76); - __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_inverse_component_map_2, 477, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 477, __pyx_L1_error) + __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_inverse_component_map_2, 479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 479, __pyx_L1_error) - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< * cnp.ndarray[ALLINT, ndim=1, cast=True] parent_labels, * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels */ - __pyx_tuple__78 = PyTuple_Pack(7, __pyx_n_s_parent_labels, __pyx_n_s_component_labels, __pyx_n_s_size, __pyx_n_s_remap, __pyx_n_s_i, __pyx_n_s_last_label, __pyx_n_s_last_component); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_tuple__78 = PyTuple_Pack(7, __pyx_n_s_parent_labels, __pyx_n_s_component_labels, __pyx_n_s_size, __pyx_n_s_remap, __pyx_n_s_i, __pyx_n_s_last_label, __pyx_n_s_last_component); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__78); __Pyx_GIVEREF(__pyx_tuple__78); - __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_inverse_component_map, 512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_inverse_component_map, 514, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 514, __pyx_L1_error) - /* "fastremap.pyx":535 + /* "fastremap.pyx":537 * return remap * * def remap(arr, table, preserve_missing_labels=False, in_place=False): # <<<<<<<<<<<<<< * """ * remap(cnp.ndarray[COMPLEX_NUMBER] arr, dict table, */ - __pyx_tuple__80 = PyTuple_Pack(12, __pyx_n_s_arr, __pyx_n_s_table, __pyx_n_s_preserve_missing_labels, __pyx_n_s_in_place, __pyx_n_s_shape, __pyx_n_s_order, __pyx_n_s_original_dtype, __pyx_n_s_min_label, __pyx_n_s_max_label, __pyx_n_s_fit_value, __pyx_n_s_k, __pyx_n_s_v); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 535, __pyx_L1_error) + __pyx_tuple__80 = PyTuple_Pack(12, __pyx_n_s_arr, __pyx_n_s_table, __pyx_n_s_preserve_missing_labels, __pyx_n_s_in_place, __pyx_n_s_shape, __pyx_n_s_order, __pyx_n_s_original_dtype, __pyx_n_s_min_label, __pyx_n_s_max_label, __pyx_n_s_fit_value, __pyx_n_s_k, __pyx_n_s_v); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__80); __Pyx_GIVEREF(__pyx_tuple__80); - __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_remap, 535, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 535, __pyx_L1_error) + __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_remap, 537, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 537, __pyx_L1_error) - /* "fastremap.pyx":582 + /* "fastremap.pyx":584 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): # <<<<<<<<<<<<<< * cdef NUMBER[:] arrview = arr * cdef size_t i = 0 */ - __pyx_tuple__82 = PyTuple_Pack(12, __pyx_n_s_arr, __pyx_n_s_table, __pyx_n_s_preserve_missing_labels, __pyx_n_s_arrview, __pyx_n_s_i, __pyx_n_s_size, __pyx_n_s_elem, __pyx_n_s_tbl, __pyx_n_s_k, __pyx_n_s_v, __pyx_n_s_last_elem, __pyx_n_s_last_remap_id); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_tuple__82 = PyTuple_Pack(14, __pyx_n_s_arr, __pyx_n_s_table, __pyx_n_s_preserve_missing_labels, __pyx_n_s_arrview, __pyx_n_s_i, __pyx_n_s_size, __pyx_n_s_elem, __pyx_n_s_before, __pyx_n_s_after, __pyx_n_s_tbl, __pyx_n_s_k, __pyx_n_s_v, __pyx_n_s_last_elem, __pyx_n_s_last_remap_id); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__82); __Pyx_GIVEREF(__pyx_tuple__82); - __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_remap_2, 582, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(3, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_remap_2, 584, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 584, __pyx_L1_error) - /* "fastremap.pyx":632 + /* "fastremap.pyx":648 * * @cython.boundscheck(False) * def remap_from_array(cnp.ndarray[UINT] arr, cnp.ndarray[UINT] vals): # <<<<<<<<<<<<<< * """ * remap_from_array(cnp.ndarray[UINT] arr, cnp.ndarray[UINT] vals) */ - __pyx_tuple__84 = PyTuple_Pack(8, __pyx_n_s_arr, __pyx_n_s_vals, __pyx_n_s_valview, __pyx_n_s_arrview, __pyx_n_s_i, __pyx_n_s_size, __pyx_n_s_maxkey, __pyx_n_s_elem); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_tuple__84 = PyTuple_Pack(8, __pyx_n_s_arr, __pyx_n_s_vals, __pyx_n_s_valview, __pyx_n_s_arrview, __pyx_n_s_i, __pyx_n_s_size, __pyx_n_s_maxkey, __pyx_n_s_elem); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__84); __Pyx_GIVEREF(__pyx_tuple__84); - __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_remap_from_array, 632, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_remap_from_array, 648, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 648, __pyx_L1_error) - /* "fastremap.pyx":654 + /* "fastremap.pyx":670 * * @cython.boundscheck(False) * def remap_from_array_kv(cnp.ndarray[ALLINT] arr, cnp.ndarray[ALLINT] keys, cnp.ndarray[ALLINT] vals): # <<<<<<<<<<<<<< * """ * remap_from_array_kv(cnp.ndarray[ALLINT] arr, cnp.ndarray[ALLINT] keys, cnp.ndarray[ALLINT] vals) */ - __pyx_tuple__86 = PyTuple_Pack(10, __pyx_n_s_arr, __pyx_n_s_keys, __pyx_n_s_vals, __pyx_n_s_keyview, __pyx_n_s_valview, __pyx_n_s_arrview, __pyx_n_s_remap_dict, __pyx_n_s_i, __pyx_n_s_size, __pyx_n_s_elem); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_tuple__86 = PyTuple_Pack(10, __pyx_n_s_arr, __pyx_n_s_keys, __pyx_n_s_vals, __pyx_n_s_keyview, __pyx_n_s_valview, __pyx_n_s_arrview, __pyx_n_s_remap_dict, __pyx_n_s_i, __pyx_n_s_size, __pyx_n_s_elem); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__86); __Pyx_GIVEREF(__pyx_tuple__86); - __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_remap_from_array_kv, 654, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_remap_from_array_kv, 670, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(0, 670, __pyx_L1_error) - /* "fastremap.pyx":686 + /* "fastremap.pyx":702 * return arr * * def pixel_pairs(labels): # <<<<<<<<<<<<<< * """ * Computes the number of matching adjacent memory locations. */ - __pyx_tuple__88 = PyTuple_Pack(1, __pyx_n_s_labels); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 686, __pyx_L1_error) + __pyx_tuple__88 = PyTuple_Pack(1, __pyx_n_s_labels); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__88); __Pyx_GIVEREF(__pyx_tuple__88); - __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_pixel_pairs_2, 686, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(0, 686, __pyx_L1_error) + __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_pixel_pairs_2, 702, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(0, 702, __pyx_L1_error) - /* "fastremap.pyx":697 + /* "fastremap.pyx":713 * return _pixel_pairs(reshape(labels, (labels.size,))) * * def _pixel_pairs(cnp.ndarray[ALLINT, ndim=1] labels): # <<<<<<<<<<<<<< * cdef size_t voxels = labels.size * */ - __pyx_tuple__90 = PyTuple_Pack(5, __pyx_n_s_labels, __pyx_n_s_voxels, __pyx_n_s_pairs, __pyx_n_s_label, __pyx_n_s_i); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_tuple__90 = PyTuple_Pack(5, __pyx_n_s_labels, __pyx_n_s_voxels, __pyx_n_s_pairs, __pyx_n_s_label, __pyx_n_s_i); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__90); __Pyx_GIVEREF(__pyx_tuple__90); - __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_pixel_pairs, 697, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_pixel_pairs, 713, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 713, __pyx_L1_error) - /* "fastremap.pyx":712 + /* "fastremap.pyx":728 * return pairs * * def unique(labels, return_index=False, return_inverse=False, return_counts=False, axis=None): # <<<<<<<<<<<<<< * """ * Compute the sorted set of unique labels in the input array. */ - __pyx_tuple__92 = PyTuple_Pack(17, __pyx_n_s_labels, __pyx_n_s_return_index, __pyx_n_s_return_inverse, __pyx_n_s_return_counts, __pyx_n_s_axis, __pyx_n_s_voxels, __pyx_n_s_shape, __pyx_n_s_fortran_order, __pyx_n_s_labels_orig, __pyx_n_s_max_label, __pyx_n_s_min_label, __pyx_n_s_c_order_index, __pyx_n_s_c_order_index, __pyx_n_s_uniq, __pyx_n_s_counts, __pyx_n_s_index, __pyx_n_s_results); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 712, __pyx_L1_error) + __pyx_tuple__92 = PyTuple_Pack(17, __pyx_n_s_labels, __pyx_n_s_return_index, __pyx_n_s_return_inverse, __pyx_n_s_return_counts, __pyx_n_s_axis, __pyx_n_s_voxels, __pyx_n_s_shape, __pyx_n_s_fortran_order, __pyx_n_s_labels_orig, __pyx_n_s_max_label, __pyx_n_s_min_label, __pyx_n_s_c_order_index, __pyx_n_s_c_order_index, __pyx_n_s_uniq, __pyx_n_s_counts, __pyx_n_s_index, __pyx_n_s_results); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__92); __Pyx_GIVEREF(__pyx_tuple__92); - __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(5, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_unique, 712, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 712, __pyx_L1_error) + __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(5, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_unique, 728, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 728, __pyx_L1_error) - /* "fastremap.pyx":788 + /* "fastremap.pyx":804 * return uniq * * def unique_via_shifted_array(labels, min_label=None, max_label=None, return_index=False): # <<<<<<<<<<<<<< * if min_label is None or max_label is None: * min_label, max_label = minmax(labels) */ - __pyx_tuple__94 = PyTuple_Pack(7, __pyx_n_s_labels, __pyx_n_s_min_label, __pyx_n_s_max_label, __pyx_n_s_return_index, __pyx_n_s_uniq, __pyx_n_s_idx, __pyx_n_s_counts); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 788, __pyx_L1_error) + __pyx_tuple__94 = PyTuple_Pack(7, __pyx_n_s_labels, __pyx_n_s_min_label, __pyx_n_s_max_label, __pyx_n_s_return_index, __pyx_n_s_uniq, __pyx_n_s_idx, __pyx_n_s_counts); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__94); __Pyx_GIVEREF(__pyx_tuple__94); - __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_unique_via_shifted_array, 788, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 788, __pyx_L1_error) + __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_unique_via_shifted_array, 804, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 804, __pyx_L1_error) - /* "fastremap.pyx":798 + /* "fastremap.pyx":814 * return uniq, idx, counts * * def unique_via_renumber(labels, return_index=False): # <<<<<<<<<<<<<< * dtype = labels.dtype * labels, remap = renumber(labels) */ - __pyx_tuple__96 = PyTuple_Pack(10, __pyx_n_s_labels, __pyx_n_s_return_index, __pyx_n_s_dtype, __pyx_n_s_remap, __pyx_n_s_uniq, __pyx_n_s_idx, __pyx_n_s_counts, __pyx_n_s_k, __pyx_n_s_v, __pyx_n_s_segid); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 798, __pyx_L1_error) + __pyx_tuple__96 = PyTuple_Pack(10, __pyx_n_s_labels, __pyx_n_s_return_index, __pyx_n_s_dtype, __pyx_n_s_remap, __pyx_n_s_uniq, __pyx_n_s_idx, __pyx_n_s_counts, __pyx_n_s_k, __pyx_n_s_v, __pyx_n_s_segid); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__96); __Pyx_GIVEREF(__pyx_tuple__96); - __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_unique_via_renumber, 798, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(0, 798, __pyx_L1_error) + __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_unique_via_renumber, 814, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(0, 814, __pyx_L1_error) - /* "fastremap.pyx":809 + /* "fastremap.pyx":825 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def unique_via_sort(cnp.ndarray[ALLINT, ndim=1] labels): # <<<<<<<<<<<<<< * """Slower than unique_via_array but can handle any label.""" * labels = np.copy(labels) */ - __pyx_tuple__98 = PyTuple_Pack(8, __pyx_n_s_labels, __pyx_n_s_voxels, __pyx_n_s_uniq, __pyx_n_s_counts, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_cur, __pyx_n_s_accum); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_tuple__98 = PyTuple_Pack(8, __pyx_n_s_labels, __pyx_n_s_voxels, __pyx_n_s_uniq, __pyx_n_s_counts, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_cur, __pyx_n_s_accum); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__98); __Pyx_GIVEREF(__pyx_tuple__98); - __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_unique_via_sort, 809, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_unique_via_sort, 825, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 825, __pyx_L1_error) - /* "fastremap.pyx":842 + /* "fastremap.pyx":858 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def unique_via_array(cnp.ndarray[ALLINT, ndim=1] labels, size_t max_label, return_index=False): # <<<<<<<<<<<<<< * """ * unique(cnp.ndarray[ALLINT, ndim=1] labels, return_counts=False) */ - __pyx_tuple__100 = PyTuple_Pack(13, __pyx_n_s_labels, __pyx_n_s_max_label, __pyx_n_s_return_index, __pyx_n_s_counts, __pyx_n_s_index, __pyx_n_s_sentinel, __pyx_n_s_voxels, __pyx_n_s_i, __pyx_n_s_real_size, __pyx_n_s_segids, __pyx_n_s_cts, __pyx_n_s_idx, __pyx_n_s_j); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_tuple__100 = PyTuple_Pack(13, __pyx_n_s_labels, __pyx_n_s_max_label, __pyx_n_s_return_index, __pyx_n_s_counts, __pyx_n_s_index, __pyx_n_s_sentinel, __pyx_n_s_voxels, __pyx_n_s_i, __pyx_n_s_real_size, __pyx_n_s_segids, __pyx_n_s_cts, __pyx_n_s_idx, __pyx_n_s_j); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__100); __Pyx_GIVEREF(__pyx_tuple__100); - __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(3, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_unique_via_array, 842, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(3, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_unique_via_array, 858, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 858, __pyx_L1_error) - /* "fastremap.pyx":904 + /* "fastremap.pyx":920 * return segids, None, cts * * def transpose(arr): # <<<<<<<<<<<<<< * """ * transpose(arr) */ - __pyx_tuple__102 = PyTuple_Pack(5, __pyx_n_s_arr, __pyx_n_s_shape, __pyx_n_s_strides, __pyx_n_s_nbytes, __pyx_n_s_dtype); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 904, __pyx_L1_error) + __pyx_tuple__102 = PyTuple_Pack(5, __pyx_n_s_arr, __pyx_n_s_shape, __pyx_n_s_strides, __pyx_n_s_nbytes, __pyx_n_s_dtype); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 920, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__102); __Pyx_GIVEREF(__pyx_tuple__102); - __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_transpose, 904, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(0, 904, __pyx_L1_error) + __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_transpose, 920, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(0, 920, __pyx_L1_error) - /* "fastremap.pyx":939 + /* "fastremap.pyx":955 * return arr.T * * def asfortranarray(arr): # <<<<<<<<<<<<<< * """ * asfortranarray(arr) */ - __pyx_tuple__104 = PyTuple_Pack(5, __pyx_n_s_arr, __pyx_n_s_shape, __pyx_n_s_strides, __pyx_n_s_nbytes, __pyx_n_s_dtype); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 939, __pyx_L1_error) + __pyx_tuple__104 = PyTuple_Pack(5, __pyx_n_s_arr, __pyx_n_s_shape, __pyx_n_s_strides, __pyx_n_s_nbytes, __pyx_n_s_dtype); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__104); __Pyx_GIVEREF(__pyx_tuple__104); - __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_asfortranarray, 939, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(0, 939, __pyx_L1_error) + __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_asfortranarray, 955, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(0, 955, __pyx_L1_error) - /* "fastremap.pyx":987 + /* "fastremap.pyx":1003 * return np.asfortranarray(arr) * * def ascontiguousarray(arr): # <<<<<<<<<<<<<< * """ * ascontiguousarray(arr) */ - __pyx_tuple__106 = PyTuple_Pack(5, __pyx_n_s_arr, __pyx_n_s_shape, __pyx_n_s_strides, __pyx_n_s_nbytes, __pyx_n_s_dtype); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 987, __pyx_L1_error) + __pyx_tuple__106 = PyTuple_Pack(5, __pyx_n_s_arr, __pyx_n_s_shape, __pyx_n_s_strides, __pyx_n_s_nbytes, __pyx_n_s_dtype); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 1003, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__106); __Pyx_GIVEREF(__pyx_tuple__106); - __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_ascontiguousarray, 987, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(0, 987, __pyx_L1_error) + __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_ascontiguousarray, 1003, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(0, 1003, __pyx_L1_error) - /* "fastremap.pyx":1039 + /* "fastremap.pyx":1055 * return np.ascontiguousarray(arr) * * def ipt2d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=2] arr): # <<<<<<<<<<<<<< * cdef COMPLEX_NUMBER[:,:] arrview = arr * */ - __pyx_tuple__108 = PyTuple_Pack(5, __pyx_n_s_arr, __pyx_n_s_arrview, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_nbytes); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_tuple__108 = PyTuple_Pack(5, __pyx_n_s_arr, __pyx_n_s_arrview, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_nbytes); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__108); __Pyx_GIVEREF(__pyx_tuple__108); - __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_ipt2d, 1039, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_ipt2d, 1055, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 1055, __pyx_L1_error) - /* "fastremap.pyx":1080 + /* "fastremap.pyx":1096 * return arr * * def ipt3d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=3] arr): # <<<<<<<<<<<<<< * cdef COMPLEX_NUMBER[:,:,:] arrview = arr * */ - __pyx_tuple__110 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_arrview, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_nbytes); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_tuple__110 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_arrview, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_nbytes); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__110); __Pyx_GIVEREF(__pyx_tuple__110); - __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_ipt3d, 1080, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_ipt3d, 1096, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(0, 1096, __pyx_L1_error) - /* "fastremap.pyx":1124 + /* "fastremap.pyx":1140 * return arr * * def ipt4d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=4] arr): # <<<<<<<<<<<<<< * cdef COMPLEX_NUMBER[:,:,:,:] arrview = arr * */ - __pyx_tuple__112 = PyTuple_Pack(7, __pyx_n_s_arr, __pyx_n_s_arrview, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_sw, __pyx_n_s_nbytes); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_tuple__112 = PyTuple_Pack(7, __pyx_n_s_arr, __pyx_n_s_arrview, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_sw, __pyx_n_s_nbytes); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__112); __Pyx_GIVEREF(__pyx_tuple__112); - __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__112, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_ipt4d, 1124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__112, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_ipt4d, 1140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) __PYX_ERR(0, 1140, __pyx_L1_error) - /* "fastremap.pyx":1171 + /* "fastremap.pyx":1187 * return arr * * def foreground(arr): # <<<<<<<<<<<<<< * """Returns the number of non-zero voxels in an array.""" * arr = reshape(arr, (arr.size,)) */ - __pyx_tuple__114 = PyTuple_Pack(1, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(0, 1171, __pyx_L1_error) + __pyx_tuple__114 = PyTuple_Pack(1, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(0, 1187, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__114); __Pyx_GIVEREF(__pyx_tuple__114); - __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_foreground_2, 1171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(0, 1171, __pyx_L1_error) + __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_foreground_2, 1187, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(0, 1187, __pyx_L1_error) - /* "fastremap.pyx":1179 + /* "fastremap.pyx":1195 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): # <<<<<<<<<<<<<< * cdef size_t i = 0 * cdef size_t sz = arr.size */ - __pyx_tuple__116 = PyTuple_Pack(4, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_sz, __pyx_n_s_n_foreground); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_tuple__116 = PyTuple_Pack(4, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_sz, __pyx_n_s_n_foreground); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__116); __Pyx_GIVEREF(__pyx_tuple__116); - __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_foreground, 1179, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_foreground, 1195, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(0, 1195, __pyx_L1_error) - /* "fastremap.pyx":1190 + /* "fastremap.pyx":1206 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def point_cloud(cnp.ndarray[ALLINT, ndim=3] arr): # <<<<<<<<<<<<<< * """ * point_cloud(arr) */ - __pyx_tuple__118 = PyTuple_Pack(15, __pyx_n_s_arr, __pyx_n_s_n_foreground, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_ptlabel, __pyx_n_s_ptcloud, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_idx, __pyx_n_s_sortidx, __pyx_n_s_ptcloud_by_label, __pyx_n_s_start, __pyx_n_s_end); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_tuple__118 = PyTuple_Pack(15, __pyx_n_s_arr, __pyx_n_s_n_foreground, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_sz, __pyx_n_s_ptlabel, __pyx_n_s_ptcloud, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_idx, __pyx_n_s_sortidx, __pyx_n_s_ptcloud_by_label, __pyx_n_s_start, __pyx_n_s_end); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__118); __Pyx_GIVEREF(__pyx_tuple__118); - __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(1, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__118, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_point_cloud, 1190, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(1, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__118, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastremap_pyx, __pyx_n_s_point_cloud, 1206, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(0, 1206, __pyx_L1_error) /* "View.MemoryView":286 * return self.name @@ -152292,6 +154640,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { } static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + __pyx_umethod_PyDict_Type_keys.type = (PyObject*)&PyDict_Type; if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -152349,7 +154698,7 @@ static int __Pyx_modinit_type_init_code(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ - if (PyType_Ready(&__pyx_type_9fastremap___pyx_scope_struct__unique) < 0) __PYX_ERR(0, 712, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_9fastremap___pyx_scope_struct__unique) < 0) __PYX_ERR(0, 728, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_9fastremap___pyx_scope_struct__unique.tp_print = 0; #endif @@ -152434,18 +154783,38 @@ static int __Pyx_modinit_type_import_code(void) { __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 199, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore); - if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 199, __pyx_L1_error) + if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 200, __pyx_L1_error) __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore); - if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 222, __pyx_L1_error) + if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 223, __pyx_L1_error) __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore); - if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 226, __pyx_L1_error) + if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 227, __pyx_L1_error) __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore); - if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 238, __pyx_L1_error) + if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 239, __pyx_L1_error) + __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 771, __pyx_L1_error) + __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 773, __pyx_L1_error) + __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 775, __pyx_L1_error) + __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 777, __pyx_L1_error) + __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 779, __pyx_L1_error) + __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 781, __pyx_L1_error) + __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 783, __pyx_L1_error) + __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 785, __pyx_L1_error) + __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 787, __pyx_L1_error) + __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 789, __pyx_L1_error) __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore); - if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 764, __pyx_L1_error) + if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -152678,7 +155047,7 @@ if (!__Pyx_RefNanny) { #endif /* "fastremap.pyx":25 - * from libcpp.unordered_map cimport unordered_map + * cimport fastremap * * from collections import defaultdict # <<<<<<<<<<<<<< * from functools import reduce @@ -153039,1660 +155408,1660 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":228 - * return refit(arr, factor), remap_dict + /* "fastremap.pyx":230 + * return refit(arr, factor), { k:v for k,v in remap_dict } * * def refit(arr, value=None, increase_only=False, exotics=False): # <<<<<<<<<<<<<< * """ * Resize the array to the smallest dtype of the */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_11refit, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_11refit, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_refit, __pyx_t_3) < 0) __PYX_ERR(0, 228, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_refit, __pyx_t_3) < 0) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":272 + /* "fastremap.pyx":274 * return arr.astype(dtype) * * def fit_dtype(dtype, value, exotics=False): # <<<<<<<<<<<<<< * """ * Find the smallest dtype of the */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_13fit_dtype, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_13fit_dtype, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_fit_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 272, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fit_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":330 + /* "fastremap.pyx":332 * )) * * def mask(arr, labels, in_place=False, value=0): # <<<<<<<<<<<<<< * """ * mask(arr, labels, in_place=False, value=0) */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_15mask, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_15mask, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_mask, __pyx_t_3) < 0) __PYX_ERR(0, 330, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mask, __pyx_t_3) < 0) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":352 + /* "fastremap.pyx":354 * return remap(arr, labels, preserve_missing_labels=True, in_place=in_place) * * def mask_except(arr, labels, in_place=False, value=0): # <<<<<<<<<<<<<< * """ * mask_except(arr, labels, in_place=False, value=0) */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_17mask_except, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_17mask_except, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_mask_except_2, __pyx_t_3) < 0) __PYX_ERR(0, 352, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mask_except_2, __pyx_t_3) < 0) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":387 + /* "fastremap.pyx":389 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): # <<<<<<<<<<<<<< * cdef ALLINT[:] arrview = arr * cdef size_t i = 0 */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_9fastremap_113_mask_except, 0, __pyx_n_s_mask_except, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_9fastremap_113_mask_except, 0, __pyx_n_s_mask_except, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 387, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_9fastremap_115_mask_except, 0, __pyx_n_s_mask_except, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_9fastremap_115_mask_except, 0, __pyx_n_s_mask_except, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 387, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_9fastremap_117_mask_except, 0, __pyx_n_s_mask_except, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_9fastremap_117_mask_except, 0, __pyx_n_s_mask_except, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 387, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_9fastremap_119_mask_except, 0, __pyx_n_s_mask_except, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_9fastremap_119_mask_except, 0, __pyx_n_s_mask_except, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 387, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_9fastremap_121_mask_except, 0, __pyx_n_s_mask_except, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_9fastremap_121_mask_except, 0, __pyx_n_s_mask_except, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int8_t, __pyx_t_2) < 0) __PYX_ERR(0, 387, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int8_t, __pyx_t_2) < 0) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_5__pyx_mdef_9fastremap_123_mask_except, 0, __pyx_n_s_mask_except, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_5__pyx_mdef_9fastremap_123_mask_except, 0, __pyx_n_s_mask_except, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int16_t, __pyx_t_2) < 0) __PYX_ERR(0, 387, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int16_t, __pyx_t_2) < 0) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_6__pyx_mdef_9fastremap_125_mask_except, 0, __pyx_n_s_mask_except, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_6__pyx_mdef_9fastremap_125_mask_except, 0, __pyx_n_s_mask_except, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 387, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_7__pyx_mdef_9fastremap_127_mask_except, 0, __pyx_n_s_mask_except, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_7__pyx_mdef_9fastremap_127_mask_except, 0, __pyx_n_s_mask_except, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 387, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_19_mask_except, 0, __pyx_n_s_mask_except, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_19_mask_except, 0, __pyx_n_s_mask_except, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); ((__pyx_FusedFunctionObject *) __pyx_t_2)->__signatures__ = __pyx_t_3; __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_mask_except, __pyx_t_2) < 0) __PYX_ERR(0, 387, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mask_except, __pyx_t_2) < 0) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":421 + /* "fastremap.pyx":423 * return arr * * def component_map(component_labels, parent_labels): # <<<<<<<<<<<<<< * """ * Given two sets of images that have a surjective mapping between their labels, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_21component_map, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 421, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_21component_map, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_component_map_2, __pyx_t_2) < 0) __PYX_ERR(0, 421, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_component_map_2, __pyx_t_2) < 0) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":456 + /* "fastremap.pyx":458 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _component_map( # <<<<<<<<<<<<<< * cnp.ndarray[ALLINT, ndim=1, cast=True] component_labels, * cnp.ndarray[ALLINT_2, ndim=1, cast=True] parent_labels */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0_0__pyx_mdef_9fastremap_131_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0_0__pyx_mdef_9fastremap_131_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint8_t_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint8_t_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0_1__pyx_mdef_9fastremap_133_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0_1__pyx_mdef_9fastremap_133_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint8_t_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint8_t_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0_2__pyx_mdef_9fastremap_135_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0_2__pyx_mdef_9fastremap_135_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint8_t_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint8_t_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0_3__pyx_mdef_9fastremap_137_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0_3__pyx_mdef_9fastremap_137_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint8_t_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint8_t_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0_4__pyx_mdef_9fastremap_139_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0_4__pyx_mdef_9fastremap_139_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint8_t_int8_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint8_t_int8_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0_5__pyx_mdef_9fastremap_141_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0_5__pyx_mdef_9fastremap_141_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint8_t_int16_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint8_t_int16_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0_6__pyx_mdef_9fastremap_143_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0_6__pyx_mdef_9fastremap_143_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint8_t_int32_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint8_t_int32_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0_7__pyx_mdef_9fastremap_145_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0_7__pyx_mdef_9fastremap_145_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint8_t_int64_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint8_t_int64_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1_0__pyx_mdef_9fastremap_147_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1_0__pyx_mdef_9fastremap_147_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint16_t_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint16_t_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1_1__pyx_mdef_9fastremap_149_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1_1__pyx_mdef_9fastremap_149_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint16_t_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint16_t_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1_2__pyx_mdef_9fastremap_151_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1_2__pyx_mdef_9fastremap_151_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint16_t_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint16_t_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1_3__pyx_mdef_9fastremap_153_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1_3__pyx_mdef_9fastremap_153_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint16_t_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint16_t_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1_4__pyx_mdef_9fastremap_155_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1_4__pyx_mdef_9fastremap_155_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint16_t_int8_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint16_t_int8_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1_5__pyx_mdef_9fastremap_157_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1_5__pyx_mdef_9fastremap_157_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint16_t_int16_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint16_t_int16_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1_6__pyx_mdef_9fastremap_159_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1_6__pyx_mdef_9fastremap_159_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint16_t_int32_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint16_t_int32_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1_7__pyx_mdef_9fastremap_161_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1_7__pyx_mdef_9fastremap_161_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint16_t_int64_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint16_t_int64_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2_0__pyx_mdef_9fastremap_163_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2_0__pyx_mdef_9fastremap_163_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint32_t_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint32_t_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2_1__pyx_mdef_9fastremap_165_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2_1__pyx_mdef_9fastremap_165_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint32_t_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint32_t_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2_2__pyx_mdef_9fastremap_167_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2_2__pyx_mdef_9fastremap_167_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint32_t_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint32_t_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2_3__pyx_mdef_9fastremap_169_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2_3__pyx_mdef_9fastremap_169_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint32_t_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint32_t_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2_4__pyx_mdef_9fastremap_171_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2_4__pyx_mdef_9fastremap_171_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint32_t_int8_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint32_t_int8_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2_5__pyx_mdef_9fastremap_173_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2_5__pyx_mdef_9fastremap_173_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint32_t_int16_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint32_t_int16_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2_6__pyx_mdef_9fastremap_175_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2_6__pyx_mdef_9fastremap_175_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint32_t_int32_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint32_t_int32_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2_7__pyx_mdef_9fastremap_177_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2_7__pyx_mdef_9fastremap_177_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint32_t_int64_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint32_t_int64_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3_0__pyx_mdef_9fastremap_179_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3_0__pyx_mdef_9fastremap_179_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint64_t_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint64_t_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3_1__pyx_mdef_9fastremap_181_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3_1__pyx_mdef_9fastremap_181_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint64_t_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint64_t_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3_2__pyx_mdef_9fastremap_183_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3_2__pyx_mdef_9fastremap_183_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint64_t_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint64_t_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3_3__pyx_mdef_9fastremap_185_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3_3__pyx_mdef_9fastremap_185_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint64_t_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint64_t_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3_4__pyx_mdef_9fastremap_187_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3_4__pyx_mdef_9fastremap_187_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint64_t_int8_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint64_t_int8_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3_5__pyx_mdef_9fastremap_189_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3_5__pyx_mdef_9fastremap_189_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint64_t_int16_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint64_t_int16_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3_6__pyx_mdef_9fastremap_191_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3_6__pyx_mdef_9fastremap_191_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint64_t_int32_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint64_t_int32_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3_7__pyx_mdef_9fastremap_193_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3_7__pyx_mdef_9fastremap_193_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint64_t_int64_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_uint64_t_int64_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4_0__pyx_mdef_9fastremap_195_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4_0__pyx_mdef_9fastremap_195_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int8_t_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int8_t_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4_1__pyx_mdef_9fastremap_197_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4_1__pyx_mdef_9fastremap_197_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int8_t_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int8_t_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4_2__pyx_mdef_9fastremap_199_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4_2__pyx_mdef_9fastremap_199_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int8_t_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int8_t_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4_3__pyx_mdef_9fastremap_201_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4_3__pyx_mdef_9fastremap_201_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int8_t_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int8_t_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4_4__pyx_mdef_9fastremap_203_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4_4__pyx_mdef_9fastremap_203_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int8_t_int8_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int8_t_int8_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4_5__pyx_mdef_9fastremap_205_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4_5__pyx_mdef_9fastremap_205_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int8_t_int16_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int8_t_int16_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4_6__pyx_mdef_9fastremap_207_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4_6__pyx_mdef_9fastremap_207_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int8_t_int32_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int8_t_int32_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4_7__pyx_mdef_9fastremap_209_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4_7__pyx_mdef_9fastremap_209_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int8_t_int64_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int8_t_int64_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_5_0__pyx_mdef_9fastremap_211_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_5_0__pyx_mdef_9fastremap_211_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int16_t_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int16_t_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_5_1__pyx_mdef_9fastremap_213_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_5_1__pyx_mdef_9fastremap_213_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int16_t_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int16_t_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_5_2__pyx_mdef_9fastremap_215_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_5_2__pyx_mdef_9fastremap_215_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int16_t_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int16_t_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_5_3__pyx_mdef_9fastremap_217_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_5_3__pyx_mdef_9fastremap_217_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int16_t_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int16_t_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_5_4__pyx_mdef_9fastremap_219_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_5_4__pyx_mdef_9fastremap_219_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int16_t_int8_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int16_t_int8_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_5_5__pyx_mdef_9fastremap_221_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_5_5__pyx_mdef_9fastremap_221_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int16_t_int16_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int16_t_int16_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_5_6__pyx_mdef_9fastremap_223_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_5_6__pyx_mdef_9fastremap_223_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int16_t_int32_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int16_t_int32_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_5_7__pyx_mdef_9fastremap_225_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_5_7__pyx_mdef_9fastremap_225_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int16_t_int64_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int16_t_int64_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_6_0__pyx_mdef_9fastremap_227_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_6_0__pyx_mdef_9fastremap_227_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int32_t_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int32_t_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_6_1__pyx_mdef_9fastremap_229_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_6_1__pyx_mdef_9fastremap_229_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int32_t_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int32_t_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_6_2__pyx_mdef_9fastremap_231_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_6_2__pyx_mdef_9fastremap_231_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int32_t_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int32_t_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_6_3__pyx_mdef_9fastremap_233_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_6_3__pyx_mdef_9fastremap_233_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int32_t_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int32_t_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_6_4__pyx_mdef_9fastremap_235_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_6_4__pyx_mdef_9fastremap_235_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int32_t_int8_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int32_t_int8_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_6_5__pyx_mdef_9fastremap_237_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_6_5__pyx_mdef_9fastremap_237_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int32_t_int16_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int32_t_int16_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_6_6__pyx_mdef_9fastremap_239_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_6_6__pyx_mdef_9fastremap_239_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int32_t_int32_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int32_t_int32_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_6_7__pyx_mdef_9fastremap_241_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_6_7__pyx_mdef_9fastremap_241_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int32_t_int64_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int32_t_int64_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_7_0__pyx_mdef_9fastremap_243_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_7_0__pyx_mdef_9fastremap_243_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int64_t_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int64_t_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_7_1__pyx_mdef_9fastremap_245_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_7_1__pyx_mdef_9fastremap_245_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int64_t_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int64_t_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_7_2__pyx_mdef_9fastremap_247_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_7_2__pyx_mdef_9fastremap_247_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int64_t_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int64_t_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_7_3__pyx_mdef_9fastremap_249_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_7_3__pyx_mdef_9fastremap_249_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int64_t_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int64_t_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_7_4__pyx_mdef_9fastremap_251_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_7_4__pyx_mdef_9fastremap_251_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int64_t_int8_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int64_t_int8_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_7_5__pyx_mdef_9fastremap_253_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_7_5__pyx_mdef_9fastremap_253_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int64_t_int16_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int64_t_int16_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_7_6__pyx_mdef_9fastremap_255_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_7_6__pyx_mdef_9fastremap_255_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int64_t_int32_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int64_t_int32_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_7_7__pyx_mdef_9fastremap_257_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_7_7__pyx_mdef_9fastremap_257_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int64_t_int64_t, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int64_t_int64_t, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_23_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_23_component_map, 0, __pyx_n_s_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); ((__pyx_FusedFunctionObject *) __pyx_t_3)->__signatures__ = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_component_map, __pyx_t_3) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_component_map, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":477 + /* "fastremap.pyx":479 * return remap * * def inverse_component_map(parent_labels, component_labels): # <<<<<<<<<<<<<< * """ * Given two sets of images that have a mapping between their labels, */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_25inverse_component_map, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 477, __pyx_L1_error) + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_25inverse_component_map, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_inverse_component_map_2, __pyx_t_3) < 0) __PYX_ERR(0, 477, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_inverse_component_map_2, __pyx_t_3) < 0) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":512 + /* "fastremap.pyx":514 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _inverse_component_map( # <<<<<<<<<<<<<< * cnp.ndarray[ALLINT, ndim=1, cast=True] parent_labels, * cnp.ndarray[ALLINT_2, ndim=1, cast=True] component_labels */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0_0__pyx_mdef_9fastremap_261_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0_0__pyx_mdef_9fastremap_261_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint8_t_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint8_t_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0_1__pyx_mdef_9fastremap_263_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0_1__pyx_mdef_9fastremap_263_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint8_t_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint8_t_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0_2__pyx_mdef_9fastremap_265_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0_2__pyx_mdef_9fastremap_265_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint8_t_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint8_t_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0_3__pyx_mdef_9fastremap_267_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0_3__pyx_mdef_9fastremap_267_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint8_t_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint8_t_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0_4__pyx_mdef_9fastremap_269_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0_4__pyx_mdef_9fastremap_269_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint8_t_int8_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint8_t_int8_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0_5__pyx_mdef_9fastremap_271_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0_5__pyx_mdef_9fastremap_271_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint8_t_int16_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint8_t_int16_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0_6__pyx_mdef_9fastremap_273_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0_6__pyx_mdef_9fastremap_273_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint8_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint8_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0_7__pyx_mdef_9fastremap_275_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0_7__pyx_mdef_9fastremap_275_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint8_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint8_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1_0__pyx_mdef_9fastremap_277_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1_0__pyx_mdef_9fastremap_277_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint16_t_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint16_t_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1_1__pyx_mdef_9fastremap_279_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1_1__pyx_mdef_9fastremap_279_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint16_t_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint16_t_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1_2__pyx_mdef_9fastremap_281_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1_2__pyx_mdef_9fastremap_281_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint16_t_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint16_t_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1_3__pyx_mdef_9fastremap_283_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1_3__pyx_mdef_9fastremap_283_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint16_t_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint16_t_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1_4__pyx_mdef_9fastremap_285_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1_4__pyx_mdef_9fastremap_285_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint16_t_int8_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint16_t_int8_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1_5__pyx_mdef_9fastremap_287_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1_5__pyx_mdef_9fastremap_287_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint16_t_int16_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint16_t_int16_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1_6__pyx_mdef_9fastremap_289_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1_6__pyx_mdef_9fastremap_289_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint16_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint16_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1_7__pyx_mdef_9fastremap_291_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1_7__pyx_mdef_9fastremap_291_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint16_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint16_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2_0__pyx_mdef_9fastremap_293_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2_0__pyx_mdef_9fastremap_293_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint32_t_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint32_t_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2_1__pyx_mdef_9fastremap_295_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2_1__pyx_mdef_9fastremap_295_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint32_t_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint32_t_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2_2__pyx_mdef_9fastremap_297_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2_2__pyx_mdef_9fastremap_297_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint32_t_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint32_t_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2_3__pyx_mdef_9fastremap_299_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2_3__pyx_mdef_9fastremap_299_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint32_t_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint32_t_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2_4__pyx_mdef_9fastremap_301_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2_4__pyx_mdef_9fastremap_301_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint32_t_int8_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint32_t_int8_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2_5__pyx_mdef_9fastremap_303_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2_5__pyx_mdef_9fastremap_303_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint32_t_int16_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint32_t_int16_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2_6__pyx_mdef_9fastremap_305_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2_6__pyx_mdef_9fastremap_305_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint32_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint32_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2_7__pyx_mdef_9fastremap_307_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2_7__pyx_mdef_9fastremap_307_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint32_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint32_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3_0__pyx_mdef_9fastremap_309_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3_0__pyx_mdef_9fastremap_309_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint64_t_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint64_t_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3_1__pyx_mdef_9fastremap_311_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3_1__pyx_mdef_9fastremap_311_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint64_t_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint64_t_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3_2__pyx_mdef_9fastremap_313_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3_2__pyx_mdef_9fastremap_313_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint64_t_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint64_t_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3_3__pyx_mdef_9fastremap_315_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3_3__pyx_mdef_9fastremap_315_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint64_t_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint64_t_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3_4__pyx_mdef_9fastremap_317_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3_4__pyx_mdef_9fastremap_317_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint64_t_int8_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint64_t_int8_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3_5__pyx_mdef_9fastremap_319_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3_5__pyx_mdef_9fastremap_319_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint64_t_int16_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint64_t_int16_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3_6__pyx_mdef_9fastremap_321_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3_6__pyx_mdef_9fastremap_321_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint64_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint64_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3_7__pyx_mdef_9fastremap_323_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3_7__pyx_mdef_9fastremap_323_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint64_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_uint64_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_4_0__pyx_mdef_9fastremap_325_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_4_0__pyx_mdef_9fastremap_325_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int8_t_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int8_t_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_4_1__pyx_mdef_9fastremap_327_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_4_1__pyx_mdef_9fastremap_327_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int8_t_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int8_t_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_4_2__pyx_mdef_9fastremap_329_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_4_2__pyx_mdef_9fastremap_329_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int8_t_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int8_t_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_4_3__pyx_mdef_9fastremap_331_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_4_3__pyx_mdef_9fastremap_331_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int8_t_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int8_t_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_4_4__pyx_mdef_9fastremap_333_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_4_4__pyx_mdef_9fastremap_333_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int8_t_int8_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int8_t_int8_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_4_5__pyx_mdef_9fastremap_335_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_4_5__pyx_mdef_9fastremap_335_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int8_t_int16_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int8_t_int16_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_4_6__pyx_mdef_9fastremap_337_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_4_6__pyx_mdef_9fastremap_337_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int8_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int8_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_4_7__pyx_mdef_9fastremap_339_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_4_7__pyx_mdef_9fastremap_339_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int8_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int8_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_5_0__pyx_mdef_9fastremap_341_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_5_0__pyx_mdef_9fastremap_341_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int16_t_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int16_t_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_5_1__pyx_mdef_9fastremap_343_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_5_1__pyx_mdef_9fastremap_343_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int16_t_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int16_t_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_5_2__pyx_mdef_9fastremap_345_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_5_2__pyx_mdef_9fastremap_345_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int16_t_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int16_t_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_5_3__pyx_mdef_9fastremap_347_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_5_3__pyx_mdef_9fastremap_347_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int16_t_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int16_t_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_5_4__pyx_mdef_9fastremap_349_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_5_4__pyx_mdef_9fastremap_349_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int16_t_int8_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int16_t_int8_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_5_5__pyx_mdef_9fastremap_351_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_5_5__pyx_mdef_9fastremap_351_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int16_t_int16_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int16_t_int16_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_5_6__pyx_mdef_9fastremap_353_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_5_6__pyx_mdef_9fastremap_353_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int16_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int16_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_5_7__pyx_mdef_9fastremap_355_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_5_7__pyx_mdef_9fastremap_355_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int16_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int16_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_6_0__pyx_mdef_9fastremap_357_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_6_0__pyx_mdef_9fastremap_357_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int32_t_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int32_t_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_6_1__pyx_mdef_9fastremap_359_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_6_1__pyx_mdef_9fastremap_359_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int32_t_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int32_t_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_6_2__pyx_mdef_9fastremap_361_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_6_2__pyx_mdef_9fastremap_361_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int32_t_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int32_t_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_6_3__pyx_mdef_9fastremap_363_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_6_3__pyx_mdef_9fastremap_363_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int32_t_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int32_t_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_6_4__pyx_mdef_9fastremap_365_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_6_4__pyx_mdef_9fastremap_365_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int32_t_int8_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int32_t_int8_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_6_5__pyx_mdef_9fastremap_367_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_6_5__pyx_mdef_9fastremap_367_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int32_t_int16_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int32_t_int16_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_6_6__pyx_mdef_9fastremap_369_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_6_6__pyx_mdef_9fastremap_369_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int32_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int32_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_6_7__pyx_mdef_9fastremap_371_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_6_7__pyx_mdef_9fastremap_371_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int32_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int32_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_7_0__pyx_mdef_9fastremap_373_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_7_0__pyx_mdef_9fastremap_373_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int64_t_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int64_t_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_7_1__pyx_mdef_9fastremap_375_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_7_1__pyx_mdef_9fastremap_375_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int64_t_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int64_t_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_7_2__pyx_mdef_9fastremap_377_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_7_2__pyx_mdef_9fastremap_377_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int64_t_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int64_t_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_7_3__pyx_mdef_9fastremap_379_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_7_3__pyx_mdef_9fastremap_379_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int64_t_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int64_t_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_7_4__pyx_mdef_9fastremap_381_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_7_4__pyx_mdef_9fastremap_381_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int64_t_int8_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int64_t_int8_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_7_5__pyx_mdef_9fastremap_383_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_7_5__pyx_mdef_9fastremap_383_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int64_t_int16_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int64_t_int16_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_7_6__pyx_mdef_9fastremap_385_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_7_6__pyx_mdef_9fastremap_385_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int64_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int64_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_7_7__pyx_mdef_9fastremap_387_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_7_7__pyx_mdef_9fastremap_387_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int64_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int64_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_27_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_27_inverse_component_map, 0, __pyx_n_s_inverse_component_map, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); ((__pyx_FusedFunctionObject *) __pyx_t_2)->__signatures__ = __pyx_t_3; __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_inverse_component_map, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_inverse_component_map, __pyx_t_2) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":535 + /* "fastremap.pyx":537 * return remap * * def remap(arr, table, preserve_missing_labels=False, in_place=False): # <<<<<<<<<<<<<< * """ * remap(cnp.ndarray[COMPLEX_NUMBER] arr, dict table, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_29remap, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_29remap, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_remap, __pyx_t_2) < 0) __PYX_ERR(0, 535, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_remap, __pyx_t_2) < 0) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":582 + /* "fastremap.pyx":584 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels): # <<<<<<<<<<<<<< * cdef NUMBER[:] arrview = arr * cdef size_t i = 0 */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_9fastremap_391_remap, 0, __pyx_n_s_remap_2, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_9fastremap_391_remap, 0, __pyx_n_s_remap_2, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 582, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_9fastremap_393_remap, 0, __pyx_n_s_remap_2, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_9fastremap_393_remap, 0, __pyx_n_s_remap_2, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 582, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_9fastremap_395_remap, 0, __pyx_n_s_remap_2, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_9fastremap_395_remap, 0, __pyx_n_s_remap_2, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 582, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_9fastremap_397_remap, 0, __pyx_n_s_remap_2, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_9fastremap_397_remap, 0, __pyx_n_s_remap_2, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 582, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_9fastremap_399_remap, 0, __pyx_n_s_remap_2, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_9fastremap_399_remap, 0, __pyx_n_s_remap_2, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int8_t, __pyx_t_3) < 0) __PYX_ERR(0, 582, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int8_t, __pyx_t_3) < 0) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_5__pyx_mdef_9fastremap_401_remap, 0, __pyx_n_s_remap_2, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_5__pyx_mdef_9fastremap_401_remap, 0, __pyx_n_s_remap_2, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int16_t, __pyx_t_3) < 0) __PYX_ERR(0, 582, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int16_t, __pyx_t_3) < 0) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_6__pyx_mdef_9fastremap_403_remap, 0, __pyx_n_s_remap_2, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_6__pyx_mdef_9fastremap_403_remap, 0, __pyx_n_s_remap_2, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int32_t, __pyx_t_3) < 0) __PYX_ERR(0, 582, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int32_t, __pyx_t_3) < 0) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_7__pyx_mdef_9fastremap_405_remap, 0, __pyx_n_s_remap_2, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_7__pyx_mdef_9fastremap_405_remap, 0, __pyx_n_s_remap_2, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int64_t, __pyx_t_3) < 0) __PYX_ERR(0, 582, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int64_t, __pyx_t_3) < 0) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_8__pyx_mdef_9fastremap_407_remap, 0, __pyx_n_s_remap_2, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_8__pyx_mdef_9fastremap_407_remap, 0, __pyx_n_s_remap_2, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_float, __pyx_t_3) < 0) __PYX_ERR(0, 582, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_float, __pyx_t_3) < 0) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_9__pyx_mdef_9fastremap_409_remap, 0, __pyx_n_s_remap_2, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_9__pyx_mdef_9fastremap_409_remap, 0, __pyx_n_s_remap_2, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_double, __pyx_t_3) < 0) __PYX_ERR(0, 582, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_double, __pyx_t_3) < 0) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_31_remap, 0, __pyx_n_s_remap_2, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_31_remap, 0, __pyx_n_s_remap_2, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); ((__pyx_FusedFunctionObject *) __pyx_t_3)->__signatures__ = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_remap_2, __pyx_t_3) < 0) __PYX_ERR(0, 582, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_remap_2, __pyx_t_3) < 0) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":632 + /* "fastremap.pyx":648 * * @cython.boundscheck(False) * def remap_from_array(cnp.ndarray[UINT] arr, cnp.ndarray[UINT] vals): # <<<<<<<<<<<<<< * """ * remap_from_array(cnp.ndarray[UINT] arr, cnp.ndarray[UINT] vals) */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_9fastremap_413remap_from_array, 0, __pyx_n_s_remap_from_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_9fastremap_413remap_from_array, 0, __pyx_n_s_remap_from_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 632, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_9fastremap_415remap_from_array, 0, __pyx_n_s_remap_from_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_9fastremap_415remap_from_array, 0, __pyx_n_s_remap_from_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 632, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_9fastremap_417remap_from_array, 0, __pyx_n_s_remap_from_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_9fastremap_417remap_from_array, 0, __pyx_n_s_remap_from_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 632, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_9fastremap_419remap_from_array, 0, __pyx_n_s_remap_from_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_9fastremap_419remap_from_array, 0, __pyx_n_s_remap_from_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 632, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_33remap_from_array, 0, __pyx_n_s_remap_from_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_33remap_from_array, 0, __pyx_n_s_remap_from_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); ((__pyx_FusedFunctionObject *) __pyx_t_2)->__signatures__ = __pyx_t_3; __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_remap_from_array, __pyx_t_2) < 0) __PYX_ERR(0, 632, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_remap_from_array, __pyx_t_2) < 0) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":654 + /* "fastremap.pyx":670 * * @cython.boundscheck(False) * def remap_from_array_kv(cnp.ndarray[ALLINT] arr, cnp.ndarray[ALLINT] keys, cnp.ndarray[ALLINT] vals): # <<<<<<<<<<<<<< * """ * remap_from_array_kv(cnp.ndarray[ALLINT] arr, cnp.ndarray[ALLINT] keys, cnp.ndarray[ALLINT] vals) */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_9fastremap_423remap_from_array_kv, 0, __pyx_n_s_remap_from_array_kv, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_9fastremap_423remap_from_array_kv, 0, __pyx_n_s_remap_from_array_kv, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 654, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_9fastremap_425remap_from_array_kv, 0, __pyx_n_s_remap_from_array_kv, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_9fastremap_425remap_from_array_kv, 0, __pyx_n_s_remap_from_array_kv, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 654, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_9fastremap_427remap_from_array_kv, 0, __pyx_n_s_remap_from_array_kv, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_9fastremap_427remap_from_array_kv, 0, __pyx_n_s_remap_from_array_kv, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 654, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_9fastremap_429remap_from_array_kv, 0, __pyx_n_s_remap_from_array_kv, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_9fastremap_429remap_from_array_kv, 0, __pyx_n_s_remap_from_array_kv, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 654, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_9fastremap_431remap_from_array_kv, 0, __pyx_n_s_remap_from_array_kv, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_9fastremap_431remap_from_array_kv, 0, __pyx_n_s_remap_from_array_kv, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int8_t, __pyx_t_3) < 0) __PYX_ERR(0, 654, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int8_t, __pyx_t_3) < 0) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_5__pyx_mdef_9fastremap_433remap_from_array_kv, 0, __pyx_n_s_remap_from_array_kv, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_5__pyx_mdef_9fastremap_433remap_from_array_kv, 0, __pyx_n_s_remap_from_array_kv, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int16_t, __pyx_t_3) < 0) __PYX_ERR(0, 654, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int16_t, __pyx_t_3) < 0) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_6__pyx_mdef_9fastremap_435remap_from_array_kv, 0, __pyx_n_s_remap_from_array_kv, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_6__pyx_mdef_9fastremap_435remap_from_array_kv, 0, __pyx_n_s_remap_from_array_kv, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int32_t, __pyx_t_3) < 0) __PYX_ERR(0, 654, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int32_t, __pyx_t_3) < 0) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_7__pyx_mdef_9fastremap_437remap_from_array_kv, 0, __pyx_n_s_remap_from_array_kv, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_7__pyx_mdef_9fastremap_437remap_from_array_kv, 0, __pyx_n_s_remap_from_array_kv, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int64_t, __pyx_t_3) < 0) __PYX_ERR(0, 654, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int64_t, __pyx_t_3) < 0) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_35remap_from_array_kv, 0, __pyx_n_s_remap_from_array_kv, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_35remap_from_array_kv, 0, __pyx_n_s_remap_from_array_kv, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); ((__pyx_FusedFunctionObject *) __pyx_t_3)->__signatures__ = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_remap_from_array_kv, __pyx_t_3) < 0) __PYX_ERR(0, 654, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_remap_from_array_kv, __pyx_t_3) < 0) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":686 + /* "fastremap.pyx":702 * return arr * * def pixel_pairs(labels): # <<<<<<<<<<<<<< * """ * Computes the number of matching adjacent memory locations. */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_37pixel_pairs, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 686, __pyx_L1_error) + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_37pixel_pairs, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_pixel_pairs_2, __pyx_t_3) < 0) __PYX_ERR(0, 686, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pixel_pairs_2, __pyx_t_3) < 0) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":697 + /* "fastremap.pyx":713 * return _pixel_pairs(reshape(labels, (labels.size,))) * * def _pixel_pairs(cnp.ndarray[ALLINT, ndim=1] labels): # <<<<<<<<<<<<<< * cdef size_t voxels = labels.size * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_9fastremap_441_pixel_pairs, 0, __pyx_n_s_pixel_pairs, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_9fastremap_441_pixel_pairs, 0, __pyx_n_s_pixel_pairs, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 697, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_9fastremap_443_pixel_pairs, 0, __pyx_n_s_pixel_pairs, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_9fastremap_443_pixel_pairs, 0, __pyx_n_s_pixel_pairs, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 697, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_9fastremap_445_pixel_pairs, 0, __pyx_n_s_pixel_pairs, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_9fastremap_445_pixel_pairs, 0, __pyx_n_s_pixel_pairs, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 697, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_9fastremap_447_pixel_pairs, 0, __pyx_n_s_pixel_pairs, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_9fastremap_447_pixel_pairs, 0, __pyx_n_s_pixel_pairs, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 697, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_9fastremap_449_pixel_pairs, 0, __pyx_n_s_pixel_pairs, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_9fastremap_449_pixel_pairs, 0, __pyx_n_s_pixel_pairs, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int8_t, __pyx_t_2) < 0) __PYX_ERR(0, 697, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int8_t, __pyx_t_2) < 0) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_5__pyx_mdef_9fastremap_451_pixel_pairs, 0, __pyx_n_s_pixel_pairs, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_5__pyx_mdef_9fastremap_451_pixel_pairs, 0, __pyx_n_s_pixel_pairs, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int16_t, __pyx_t_2) < 0) __PYX_ERR(0, 697, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int16_t, __pyx_t_2) < 0) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_6__pyx_mdef_9fastremap_453_pixel_pairs, 0, __pyx_n_s_pixel_pairs, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_6__pyx_mdef_9fastremap_453_pixel_pairs, 0, __pyx_n_s_pixel_pairs, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 697, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_7__pyx_mdef_9fastremap_455_pixel_pairs, 0, __pyx_n_s_pixel_pairs, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_7__pyx_mdef_9fastremap_455_pixel_pairs, 0, __pyx_n_s_pixel_pairs, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 697, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_39_pixel_pairs, 0, __pyx_n_s_pixel_pairs, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_39_pixel_pairs, 0, __pyx_n_s_pixel_pairs, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); ((__pyx_FusedFunctionObject *) __pyx_t_2)->__signatures__ = __pyx_t_3; __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_pixel_pairs, __pyx_t_2) < 0) __PYX_ERR(0, 697, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pixel_pairs, __pyx_t_2) < 0) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":712 + /* "fastremap.pyx":728 * return pairs * * def unique(labels, return_index=False, return_inverse=False, return_counts=False, axis=None): # <<<<<<<<<<<<<< * """ * Compute the sorted set of unique labels in the input array. */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_41unique, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_41unique, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_unique, __pyx_t_2) < 0) __PYX_ERR(0, 712, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_unique, __pyx_t_2) < 0) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":788 + /* "fastremap.pyx":804 * return uniq * * def unique_via_shifted_array(labels, min_label=None, max_label=None, return_index=False): # <<<<<<<<<<<<<< * if min_label is None or max_label is None: * min_label, max_label = minmax(labels) */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_43unique_via_shifted_array, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 788, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_43unique_via_shifted_array, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_unique_via_shifted_array, __pyx_t_2) < 0) __PYX_ERR(0, 788, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_unique_via_shifted_array, __pyx_t_2) < 0) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":798 + /* "fastremap.pyx":814 * return uniq, idx, counts * * def unique_via_renumber(labels, return_index=False): # <<<<<<<<<<<<<< * dtype = labels.dtype * labels, remap = renumber(labels) */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_45unique_via_renumber, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 798, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_45unique_via_renumber, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_unique_via_renumber, __pyx_t_2) < 0) __PYX_ERR(0, 798, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_unique_via_renumber, __pyx_t_2) < 0) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":809 + /* "fastremap.pyx":825 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def unique_via_sort(cnp.ndarray[ALLINT, ndim=1] labels): # <<<<<<<<<<<<<< * """Slower than unique_via_array but can handle any label.""" * labels = np.copy(labels) */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_9fastremap_459unique_via_sort, 0, __pyx_n_s_unique_via_sort, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_9fastremap_459unique_via_sort, 0, __pyx_n_s_unique_via_sort, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint8_t, __pyx_t_3) < 0) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_9fastremap_461unique_via_sort, 0, __pyx_n_s_unique_via_sort, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_9fastremap_461unique_via_sort, 0, __pyx_n_s_unique_via_sort, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint16_t, __pyx_t_3) < 0) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_9fastremap_463unique_via_sort, 0, __pyx_n_s_unique_via_sort, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_9fastremap_463unique_via_sort, 0, __pyx_n_s_unique_via_sort, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint32_t, __pyx_t_3) < 0) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_9fastremap_465unique_via_sort, 0, __pyx_n_s_unique_via_sort, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_9fastremap_465unique_via_sort, 0, __pyx_n_s_unique_via_sort, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint64_t, __pyx_t_3) < 0) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_9fastremap_467unique_via_sort, 0, __pyx_n_s_unique_via_sort, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_9fastremap_467unique_via_sort, 0, __pyx_n_s_unique_via_sort, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int8_t, __pyx_t_3) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int8_t, __pyx_t_3) < 0) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_5__pyx_mdef_9fastremap_469unique_via_sort, 0, __pyx_n_s_unique_via_sort, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_5__pyx_mdef_9fastremap_469unique_via_sort, 0, __pyx_n_s_unique_via_sort, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int16_t, __pyx_t_3) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int16_t, __pyx_t_3) < 0) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_6__pyx_mdef_9fastremap_471unique_via_sort, 0, __pyx_n_s_unique_via_sort, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_6__pyx_mdef_9fastremap_471unique_via_sort, 0, __pyx_n_s_unique_via_sort, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int32_t, __pyx_t_3) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int32_t, __pyx_t_3) < 0) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_7__pyx_mdef_9fastremap_473unique_via_sort, 0, __pyx_n_s_unique_via_sort, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_fuse_7__pyx_mdef_9fastremap_473unique_via_sort, 0, __pyx_n_s_unique_via_sort, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int64_t, __pyx_t_3) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int64_t, __pyx_t_3) < 0) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_47unique_via_sort, 0, __pyx_n_s_unique_via_sort, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 809, __pyx_L1_error) + __pyx_t_3 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_47unique_via_sort, 0, __pyx_n_s_unique_via_sort, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple); ((__pyx_FusedFunctionObject *) __pyx_t_3)->__signatures__ = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_unique_via_sort, __pyx_t_3) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_unique_via_sort, __pyx_t_3) < 0) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "fastremap.pyx":842 + /* "fastremap.pyx":858 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def unique_via_array(cnp.ndarray[ALLINT, ndim=1] labels, size_t max_label, return_index=False): # <<<<<<<<<<<<<< * """ * unique(cnp.ndarray[ALLINT, ndim=1] labels, return_counts=False) */ - __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_k__23 = __pyx_t_3; __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_9fastremap_477unique_via_array, 0, __pyx_n_s_unique_via_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_9fastremap_477unique_via_array, 0, __pyx_n_s_unique_via_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults28), 1)) __PYX_ERR(0, 842, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 842, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults28), 1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_Defaults(__pyx_defaults28, __pyx_t_1)->__pyx_arg_return_index = __pyx_t_4; __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_t_2); __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_9fastremap_658__defaults__); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint8_t, __pyx_t_1) < 0) __PYX_ERR(0, 842, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint8_t, __pyx_t_1) < 0) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_9fastremap_479unique_via_array, 0, __pyx_n_s_unique_via_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_9fastremap_479unique_via_array, 0, __pyx_n_s_unique_via_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults29), 1)) __PYX_ERR(0, 842, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 842, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults29), 1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_Defaults(__pyx_defaults29, __pyx_t_1)->__pyx_arg_return_index = __pyx_t_4; __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_t_2); __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_9fastremap_660__defaults__); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint16_t, __pyx_t_1) < 0) __PYX_ERR(0, 842, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint16_t, __pyx_t_1) < 0) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_9fastremap_481unique_via_array, 0, __pyx_n_s_unique_via_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_9fastremap_481unique_via_array, 0, __pyx_n_s_unique_via_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults30), 1)) __PYX_ERR(0, 842, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 842, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults30), 1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_Defaults(__pyx_defaults30, __pyx_t_1)->__pyx_arg_return_index = __pyx_t_4; __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_t_2); __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_9fastremap_662__defaults__); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint32_t, __pyx_t_1) < 0) __PYX_ERR(0, 842, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint32_t, __pyx_t_1) < 0) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_9fastremap_483unique_via_array, 0, __pyx_n_s_unique_via_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_9fastremap_483unique_via_array, 0, __pyx_n_s_unique_via_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults31), 1)) __PYX_ERR(0, 842, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 842, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults31), 1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_Defaults(__pyx_defaults31, __pyx_t_1)->__pyx_arg_return_index = __pyx_t_4; __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_t_2); __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_9fastremap_664__defaults__); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint64_t, __pyx_t_1) < 0) __PYX_ERR(0, 842, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_uint64_t, __pyx_t_1) < 0) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_9fastremap_485unique_via_array, 0, __pyx_n_s_unique_via_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_9fastremap_485unique_via_array, 0, __pyx_n_s_unique_via_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults32), 1)) __PYX_ERR(0, 842, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 842, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults32), 1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_Defaults(__pyx_defaults32, __pyx_t_1)->__pyx_arg_return_index = __pyx_t_4; __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_t_2); __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_9fastremap_666__defaults__); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int8_t, __pyx_t_1) < 0) __PYX_ERR(0, 842, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int8_t, __pyx_t_1) < 0) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_5__pyx_mdef_9fastremap_487unique_via_array, 0, __pyx_n_s_unique_via_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_5__pyx_mdef_9fastremap_487unique_via_array, 0, __pyx_n_s_unique_via_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults33), 1)) __PYX_ERR(0, 842, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 842, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults33), 1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_Defaults(__pyx_defaults33, __pyx_t_1)->__pyx_arg_return_index = __pyx_t_4; __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_t_2); __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_9fastremap_668__defaults__); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int16_t, __pyx_t_1) < 0) __PYX_ERR(0, 842, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int16_t, __pyx_t_1) < 0) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_6__pyx_mdef_9fastremap_489unique_via_array, 0, __pyx_n_s_unique_via_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_6__pyx_mdef_9fastremap_489unique_via_array, 0, __pyx_n_s_unique_via_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults34), 1)) __PYX_ERR(0, 842, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 842, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults34), 1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_Defaults(__pyx_defaults34, __pyx_t_1)->__pyx_arg_return_index = __pyx_t_4; __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_t_2); __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_9fastremap_670__defaults__); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int32_t, __pyx_t_1) < 0) __PYX_ERR(0, 842, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int32_t, __pyx_t_1) < 0) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_7__pyx_mdef_9fastremap_491unique_via_array, 0, __pyx_n_s_unique_via_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_7__pyx_mdef_9fastremap_491unique_via_array, 0, __pyx_n_s_unique_via_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults35), 1)) __PYX_ERR(0, 842, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 842, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults35), 1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_Defaults(__pyx_defaults35, __pyx_t_1)->__pyx_arg_return_index = __pyx_t_4; __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_t_2); __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_9fastremap_672__defaults__); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int64_t, __pyx_t_1) < 0) __PYX_ERR(0, 842, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_int64_t, __pyx_t_1) < 0) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_49unique_via_array, 0, __pyx_n_s_unique_via_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_49unique_via_array, 0, __pyx_n_s_unique_via_array, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_t_2); ((__pyx_FusedFunctionObject *) __pyx_t_1)->__signatures__ = __pyx_t_3; __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_unique_via_array, __pyx_t_1) < 0) __PYX_ERR(0, 842, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_unique_via_array, __pyx_t_1) < 0) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":904 + /* "fastremap.pyx":920 * return segids, None, cts * * def transpose(arr): # <<<<<<<<<<<<<< * """ * transpose(arr) */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_51transpose, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 904, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_51transpose, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_transpose, __pyx_t_2) < 0) __PYX_ERR(0, 904, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_transpose, __pyx_t_2) < 0) __PYX_ERR(0, 920, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":939 + /* "fastremap.pyx":955 * return arr.T * * def asfortranarray(arr): # <<<<<<<<<<<<<< * """ * asfortranarray(arr) */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_53asfortranarray, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 939, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_53asfortranarray, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_asfortranarray, __pyx_t_2) < 0) __PYX_ERR(0, 939, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_asfortranarray, __pyx_t_2) < 0) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":987 + /* "fastremap.pyx":1003 * return np.asfortranarray(arr) * * def ascontiguousarray(arr): # <<<<<<<<<<<<<< * """ * ascontiguousarray(arr) */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_55ascontiguousarray, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_55ascontiguousarray, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ascontiguousarray, __pyx_t_2) < 0) __PYX_ERR(0, 987, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ascontiguousarray, __pyx_t_2) < 0) __PYX_ERR(0, 1003, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":1039 + /* "fastremap.pyx":1055 * return np.ascontiguousarray(arr) * * def ipt2d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=2] arr): # <<<<<<<<<<<<<< * cdef COMPLEX_NUMBER[:,:] arrview = arr * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_9fastremap_495ipt2d, 0, __pyx_n_s_ipt2d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_9fastremap_495ipt2d, 0, __pyx_n_s_ipt2d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint8_t, __pyx_t_1) < 0) __PYX_ERR(0, 1039, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint8_t, __pyx_t_1) < 0) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_9fastremap_497ipt2d, 0, __pyx_n_s_ipt2d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_9fastremap_497ipt2d, 0, __pyx_n_s_ipt2d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint16_t, __pyx_t_1) < 0) __PYX_ERR(0, 1039, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint16_t, __pyx_t_1) < 0) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_9fastremap_499ipt2d, 0, __pyx_n_s_ipt2d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_9fastremap_499ipt2d, 0, __pyx_n_s_ipt2d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint32_t, __pyx_t_1) < 0) __PYX_ERR(0, 1039, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint32_t, __pyx_t_1) < 0) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_9fastremap_501ipt2d, 0, __pyx_n_s_ipt2d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_9fastremap_501ipt2d, 0, __pyx_n_s_ipt2d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint64_t, __pyx_t_1) < 0) __PYX_ERR(0, 1039, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint64_t, __pyx_t_1) < 0) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_9fastremap_503ipt2d, 0, __pyx_n_s_ipt2d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_9fastremap_503ipt2d, 0, __pyx_n_s_ipt2d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int8_t, __pyx_t_1) < 0) __PYX_ERR(0, 1039, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int8_t, __pyx_t_1) < 0) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_5__pyx_mdef_9fastremap_505ipt2d, 0, __pyx_n_s_ipt2d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_5__pyx_mdef_9fastremap_505ipt2d, 0, __pyx_n_s_ipt2d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int16_t, __pyx_t_1) < 0) __PYX_ERR(0, 1039, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int16_t, __pyx_t_1) < 0) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_6__pyx_mdef_9fastremap_507ipt2d, 0, __pyx_n_s_ipt2d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_6__pyx_mdef_9fastremap_507ipt2d, 0, __pyx_n_s_ipt2d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int32_t, __pyx_t_1) < 0) __PYX_ERR(0, 1039, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int32_t, __pyx_t_1) < 0) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_7__pyx_mdef_9fastremap_509ipt2d, 0, __pyx_n_s_ipt2d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_7__pyx_mdef_9fastremap_509ipt2d, 0, __pyx_n_s_ipt2d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int64_t, __pyx_t_1) < 0) __PYX_ERR(0, 1039, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int64_t, __pyx_t_1) < 0) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_8__pyx_mdef_9fastremap_511ipt2d, 0, __pyx_n_s_ipt2d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_8__pyx_mdef_9fastremap_511ipt2d, 0, __pyx_n_s_ipt2d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_float, __pyx_t_1) < 0) __PYX_ERR(0, 1039, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_float, __pyx_t_1) < 0) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_9__pyx_mdef_9fastremap_513ipt2d, 0, __pyx_n_s_ipt2d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_9__pyx_mdef_9fastremap_513ipt2d, 0, __pyx_n_s_ipt2d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_double, __pyx_t_1) < 0) __PYX_ERR(0, 1039, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_double, __pyx_t_1) < 0) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_10__pyx_mdef_9fastremap_515ipt2d, 0, __pyx_n_s_ipt2d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_10__pyx_mdef_9fastremap_515ipt2d, 0, __pyx_n_s_ipt2d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_float_complex, __pyx_t_1) < 0) __PYX_ERR(0, 1039, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_float_complex, __pyx_t_1) < 0) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_57ipt2d, 0, __pyx_n_s_ipt2d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_57ipt2d, 0, __pyx_n_s_ipt2d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); ((__pyx_FusedFunctionObject *) __pyx_t_1)->__signatures__ = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ipt2d, __pyx_t_1) < 0) __PYX_ERR(0, 1039, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ipt2d, __pyx_t_1) < 0) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":1080 + /* "fastremap.pyx":1096 * return arr * * def ipt3d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=3] arr): # <<<<<<<<<<<<<< * cdef COMPLEX_NUMBER[:,:,:] arrview = arr * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_9fastremap_519ipt3d, 0, __pyx_n_s_ipt3d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_9fastremap_519ipt3d, 0, __pyx_n_s_ipt3d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 1080, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_9fastremap_521ipt3d, 0, __pyx_n_s_ipt3d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_9fastremap_521ipt3d, 0, __pyx_n_s_ipt3d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 1080, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_9fastremap_523ipt3d, 0, __pyx_n_s_ipt3d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_9fastremap_523ipt3d, 0, __pyx_n_s_ipt3d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 1080, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_9fastremap_525ipt3d, 0, __pyx_n_s_ipt3d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_9fastremap_525ipt3d, 0, __pyx_n_s_ipt3d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 1080, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_9fastremap_527ipt3d, 0, __pyx_n_s_ipt3d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_9fastremap_527ipt3d, 0, __pyx_n_s_ipt3d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int8_t, __pyx_t_2) < 0) __PYX_ERR(0, 1080, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int8_t, __pyx_t_2) < 0) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_5__pyx_mdef_9fastremap_529ipt3d, 0, __pyx_n_s_ipt3d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_5__pyx_mdef_9fastremap_529ipt3d, 0, __pyx_n_s_ipt3d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int16_t, __pyx_t_2) < 0) __PYX_ERR(0, 1080, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int16_t, __pyx_t_2) < 0) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_6__pyx_mdef_9fastremap_531ipt3d, 0, __pyx_n_s_ipt3d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_6__pyx_mdef_9fastremap_531ipt3d, 0, __pyx_n_s_ipt3d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 1080, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_7__pyx_mdef_9fastremap_533ipt3d, 0, __pyx_n_s_ipt3d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_7__pyx_mdef_9fastremap_533ipt3d, 0, __pyx_n_s_ipt3d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 1080, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_8__pyx_mdef_9fastremap_535ipt3d, 0, __pyx_n_s_ipt3d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_8__pyx_mdef_9fastremap_535ipt3d, 0, __pyx_n_s_ipt3d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_float, __pyx_t_2) < 0) __PYX_ERR(0, 1080, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_float, __pyx_t_2) < 0) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_9__pyx_mdef_9fastremap_537ipt3d, 0, __pyx_n_s_ipt3d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_9__pyx_mdef_9fastremap_537ipt3d, 0, __pyx_n_s_ipt3d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_double, __pyx_t_2) < 0) __PYX_ERR(0, 1080, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_double, __pyx_t_2) < 0) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_10__pyx_mdef_9fastremap_539ipt3d, 0, __pyx_n_s_ipt3d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_10__pyx_mdef_9fastremap_539ipt3d, 0, __pyx_n_s_ipt3d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float_complex, __pyx_t_2) < 0) __PYX_ERR(0, 1080, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float_complex, __pyx_t_2) < 0) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_59ipt3d, 0, __pyx_n_s_ipt3d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_59ipt3d, 0, __pyx_n_s_ipt3d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); ((__pyx_FusedFunctionObject *) __pyx_t_2)->__signatures__ = __pyx_t_1; __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ipt3d, __pyx_t_2) < 0) __PYX_ERR(0, 1080, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ipt3d, __pyx_t_2) < 0) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":1124 + /* "fastremap.pyx":1140 * return arr * * def ipt4d(cnp.ndarray[COMPLEX_NUMBER, cast=True, ndim=4] arr): # <<<<<<<<<<<<<< * cdef COMPLEX_NUMBER[:,:,:,:] arrview = arr * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_9fastremap_543ipt4d, 0, __pyx_n_s_ipt4d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_9fastremap_543ipt4d, 0, __pyx_n_s_ipt4d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint8_t, __pyx_t_1) < 0) __PYX_ERR(0, 1124, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint8_t, __pyx_t_1) < 0) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_9fastremap_545ipt4d, 0, __pyx_n_s_ipt4d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_9fastremap_545ipt4d, 0, __pyx_n_s_ipt4d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint16_t, __pyx_t_1) < 0) __PYX_ERR(0, 1124, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint16_t, __pyx_t_1) < 0) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_9fastremap_547ipt4d, 0, __pyx_n_s_ipt4d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_9fastremap_547ipt4d, 0, __pyx_n_s_ipt4d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint32_t, __pyx_t_1) < 0) __PYX_ERR(0, 1124, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint32_t, __pyx_t_1) < 0) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_9fastremap_549ipt4d, 0, __pyx_n_s_ipt4d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_9fastremap_549ipt4d, 0, __pyx_n_s_ipt4d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint64_t, __pyx_t_1) < 0) __PYX_ERR(0, 1124, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint64_t, __pyx_t_1) < 0) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_9fastremap_551ipt4d, 0, __pyx_n_s_ipt4d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_9fastremap_551ipt4d, 0, __pyx_n_s_ipt4d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int8_t, __pyx_t_1) < 0) __PYX_ERR(0, 1124, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int8_t, __pyx_t_1) < 0) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_5__pyx_mdef_9fastremap_553ipt4d, 0, __pyx_n_s_ipt4d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_5__pyx_mdef_9fastremap_553ipt4d, 0, __pyx_n_s_ipt4d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int16_t, __pyx_t_1) < 0) __PYX_ERR(0, 1124, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int16_t, __pyx_t_1) < 0) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_6__pyx_mdef_9fastremap_555ipt4d, 0, __pyx_n_s_ipt4d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_6__pyx_mdef_9fastremap_555ipt4d, 0, __pyx_n_s_ipt4d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int32_t, __pyx_t_1) < 0) __PYX_ERR(0, 1124, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int32_t, __pyx_t_1) < 0) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_7__pyx_mdef_9fastremap_557ipt4d, 0, __pyx_n_s_ipt4d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_7__pyx_mdef_9fastremap_557ipt4d, 0, __pyx_n_s_ipt4d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int64_t, __pyx_t_1) < 0) __PYX_ERR(0, 1124, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int64_t, __pyx_t_1) < 0) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_8__pyx_mdef_9fastremap_559ipt4d, 0, __pyx_n_s_ipt4d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_8__pyx_mdef_9fastremap_559ipt4d, 0, __pyx_n_s_ipt4d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_float, __pyx_t_1) < 0) __PYX_ERR(0, 1124, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_float, __pyx_t_1) < 0) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_9__pyx_mdef_9fastremap_561ipt4d, 0, __pyx_n_s_ipt4d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_9__pyx_mdef_9fastremap_561ipt4d, 0, __pyx_n_s_ipt4d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_double, __pyx_t_1) < 0) __PYX_ERR(0, 1124, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_double, __pyx_t_1) < 0) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_10__pyx_mdef_9fastremap_563ipt4d, 0, __pyx_n_s_ipt4d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_10__pyx_mdef_9fastremap_563ipt4d, 0, __pyx_n_s_ipt4d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_float_complex, __pyx_t_1) < 0) __PYX_ERR(0, 1124, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_float_complex, __pyx_t_1) < 0) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_61ipt4d, 0, __pyx_n_s_ipt4d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_61ipt4d, 0, __pyx_n_s_ipt4d, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); ((__pyx_FusedFunctionObject *) __pyx_t_1)->__signatures__ = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ipt4d, __pyx_t_1) < 0) __PYX_ERR(0, 1124, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ipt4d, __pyx_t_1) < 0) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":1171 + /* "fastremap.pyx":1187 * return arr * * def foreground(arr): # <<<<<<<<<<<<<< * """Returns the number of non-zero voxels in an array.""" * arr = reshape(arr, (arr.size,)) */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_63foreground, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1171, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9fastremap_63foreground, NULL, __pyx_n_s_fastremap); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_foreground_2, __pyx_t_1) < 0) __PYX_ERR(0, 1171, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_foreground_2, __pyx_t_1) < 0) __PYX_ERR(0, 1187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fastremap.pyx":1179 + /* "fastremap.pyx":1195 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def _foreground(cnp.ndarray[ALLINT, ndim=1] arr): # <<<<<<<<<<<<<< * cdef size_t i = 0 * cdef size_t sz = arr.size */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_9fastremap_567_foreground, 0, __pyx_n_s_foreground, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_9fastremap_567_foreground, 0, __pyx_n_s_foreground, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 1179, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_9fastremap_569_foreground, 0, __pyx_n_s_foreground, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_9fastremap_569_foreground, 0, __pyx_n_s_foreground, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 1179, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_9fastremap_571_foreground, 0, __pyx_n_s_foreground, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_9fastremap_571_foreground, 0, __pyx_n_s_foreground, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 1179, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_9fastremap_573_foreground, 0, __pyx_n_s_foreground, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_9fastremap_573_foreground, 0, __pyx_n_s_foreground, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 1179, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_9fastremap_575_foreground, 0, __pyx_n_s_foreground, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_9fastremap_575_foreground, 0, __pyx_n_s_foreground, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int8_t, __pyx_t_2) < 0) __PYX_ERR(0, 1179, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int8_t, __pyx_t_2) < 0) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_5__pyx_mdef_9fastremap_577_foreground, 0, __pyx_n_s_foreground, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_5__pyx_mdef_9fastremap_577_foreground, 0, __pyx_n_s_foreground, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int16_t, __pyx_t_2) < 0) __PYX_ERR(0, 1179, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int16_t, __pyx_t_2) < 0) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_6__pyx_mdef_9fastremap_579_foreground, 0, __pyx_n_s_foreground, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_6__pyx_mdef_9fastremap_579_foreground, 0, __pyx_n_s_foreground, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 1179, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_7__pyx_mdef_9fastremap_581_foreground, 0, __pyx_n_s_foreground, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_fuse_7__pyx_mdef_9fastremap_581_foreground, 0, __pyx_n_s_foreground, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 1179, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_65_foreground, 0, __pyx_n_s_foreground, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_2 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_65_foreground, 0, __pyx_n_s_foreground, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple); ((__pyx_FusedFunctionObject *) __pyx_t_2)->__signatures__ = __pyx_t_1; __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_foreground, __pyx_t_2) < 0) __PYX_ERR(0, 1179, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_foreground, __pyx_t_2) < 0) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fastremap.pyx":1190 + /* "fastremap.pyx":1206 * @cython.wraparound(False) # turn off negative index wrapping for entire function * @cython.nonecheck(False) * def point_cloud(cnp.ndarray[ALLINT, ndim=3] arr): # <<<<<<<<<<<<<< * """ * point_cloud(arr) */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_9fastremap_585point_cloud, 0, __pyx_n_s_point_cloud, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_9fastremap_585point_cloud, 0, __pyx_n_s_point_cloud, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint8_t, __pyx_t_1) < 0) __PYX_ERR(0, 1190, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint8_t, __pyx_t_1) < 0) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_9fastremap_587point_cloud, 0, __pyx_n_s_point_cloud, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_9fastremap_587point_cloud, 0, __pyx_n_s_point_cloud, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint16_t, __pyx_t_1) < 0) __PYX_ERR(0, 1190, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint16_t, __pyx_t_1) < 0) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_9fastremap_589point_cloud, 0, __pyx_n_s_point_cloud, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_2__pyx_mdef_9fastremap_589point_cloud, 0, __pyx_n_s_point_cloud, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint32_t, __pyx_t_1) < 0) __PYX_ERR(0, 1190, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint32_t, __pyx_t_1) < 0) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_9fastremap_591point_cloud, 0, __pyx_n_s_point_cloud, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_3__pyx_mdef_9fastremap_591point_cloud, 0, __pyx_n_s_point_cloud, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint64_t, __pyx_t_1) < 0) __PYX_ERR(0, 1190, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_uint64_t, __pyx_t_1) < 0) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_9fastremap_593point_cloud, 0, __pyx_n_s_point_cloud, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_4__pyx_mdef_9fastremap_593point_cloud, 0, __pyx_n_s_point_cloud, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int8_t, __pyx_t_1) < 0) __PYX_ERR(0, 1190, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int8_t, __pyx_t_1) < 0) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_5__pyx_mdef_9fastremap_595point_cloud, 0, __pyx_n_s_point_cloud, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_5__pyx_mdef_9fastremap_595point_cloud, 0, __pyx_n_s_point_cloud, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int16_t, __pyx_t_1) < 0) __PYX_ERR(0, 1190, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int16_t, __pyx_t_1) < 0) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_6__pyx_mdef_9fastremap_597point_cloud, 0, __pyx_n_s_point_cloud, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_6__pyx_mdef_9fastremap_597point_cloud, 0, __pyx_n_s_point_cloud, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int32_t, __pyx_t_1) < 0) __PYX_ERR(0, 1190, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int32_t, __pyx_t_1) < 0) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_7__pyx_mdef_9fastremap_599point_cloud, 0, __pyx_n_s_point_cloud, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_fuse_7__pyx_mdef_9fastremap_599point_cloud, 0, __pyx_n_s_point_cloud, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int64_t, __pyx_t_1) < 0) __PYX_ERR(0, 1190, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_int64_t, __pyx_t_1) < 0) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_67point_cloud, 0, __pyx_n_s_point_cloud, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error) + __pyx_t_1 = __pyx_FusedFunction_New(&__pyx_mdef_9fastremap_67point_cloud, 0, __pyx_n_s_point_cloud, NULL, __pyx_n_s_fastremap, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_empty_tuple); ((__pyx_FusedFunctionObject *) __pyx_t_1)->__signatures__ = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_point_cloud, __pyx_t_1) < 0) __PYX_ERR(0, 1190, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_point_cloud, __pyx_t_1) < 0) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "fastremap.pyx":1 @@ -157246,6 +159615,108 @@ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name return 0; } +/* IterNext */ + static PyObject *__Pyx_PyIter_Next2Default(PyObject* defval) { + PyObject* exc_type; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + exc_type = __Pyx_PyErr_Occurred(); + if (unlikely(exc_type)) { + if (!defval || unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(defval); + return defval; + } + if (defval) { + Py_INCREF(defval); + return defval; + } + __Pyx_PyErr_SetNone(PyExc_StopIteration); + return NULL; +} +static void __Pyx_PyIter_Next_ErrorNoIterator(PyObject *iterator) { + PyErr_Format(PyExc_TypeError, + "%.200s object is not an iterator", Py_TYPE(iterator)->tp_name); +} +static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) { + PyObject* next; + iternextfunc iternext = Py_TYPE(iterator)->tp_iternext; + if (likely(iternext)) { +#if CYTHON_USE_TYPE_SLOTS + next = iternext(iterator); + if (likely(next)) + return next; + #if PY_VERSION_HEX >= 0x02070000 + if (unlikely(iternext == &_PyObject_NextNotImplemented)) + return NULL; + #endif +#else + next = PyIter_Next(iterator); + if (likely(next)) + return next; +#endif + } else if (CYTHON_USE_TYPE_SLOTS || unlikely(!PyIter_Check(iterator))) { + __Pyx_PyIter_Next_ErrorNoIterator(iterator); + return NULL; + } +#if !CYTHON_USE_TYPE_SLOTS + else { + next = PyIter_Next(iterator); + if (likely(next)) + return next; + } +#endif + return __Pyx_PyIter_Next2Default(defval); +} + +/* UnpackUnboundCMethod */ + static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + target->method = method; +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION >= 3 + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + #endif + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } +#endif + return 0; +} + +/* CallUnboundCMethod0 */ + static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { + PyObject *args, *result = NULL; + if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_ASSUME_SAFE_MACROS + args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); +#else + args = PyTuple_Pack(1, self); + if (unlikely(!args)) goto bad; +#endif + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + Py_DECREF(args); +bad: + return result; +} + +/* py_dict_keys */ + static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) { + if (PY_MAJOR_VERSION >= 3) + return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_keys, d); + else + return PyDict_Keys(d); +} + /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) { diff --git a/fastremap.pxd b/fastremap.pxd new file mode 100644 index 0000000..7da4b20 --- /dev/null +++ b/fastremap.pxd @@ -0,0 +1,99 @@ +from libcpp.utility cimport pair + +cdef extern from "ska_flat_hash_map.hpp" namespace "ska" nogil: + cdef cppclass flat_hash_map[T, U, HASH=*, PRED=*, ALLOCATOR=*]: + ctypedef T key_type + ctypedef U mapped_type + ctypedef pair[const T, U] value_type + ctypedef ALLOCATOR allocator_type + + # these should really be allocator_type.size_type and + # allocator_type.difference_type to be true to the C++ definition + # but cython doesn't support deferred access on template arguments + ctypedef size_t size_type + ctypedef ptrdiff_t difference_type + + cppclass iterator + cppclass iterator: + iterator() except + + iterator(iterator&) except + + # correct would be value_type& but this does not work + # well with cython's code gen + pair[T, U]& operator*() + iterator operator++() + iterator operator--() + iterator operator++(int) + iterator operator--(int) + bint operator==(iterator) + bint operator==(const_iterator) + bint operator!=(iterator) + bint operator!=(const_iterator) + cppclass const_iterator: + const_iterator() except + + const_iterator(iterator&) except + + operator=(iterator&) except + + # correct would be const value_type& but this does not work + # well with cython's code gen + const pair[T, U]& operator*() + const_iterator operator++() + const_iterator operator--() + const_iterator operator++(int) + const_iterator operator--(int) + bint operator==(iterator) + bint operator==(const_iterator) + bint operator!=(iterator) + bint operator!=(const_iterator) + + flat_hash_map() except + + flat_hash_map(flat_hash_map&) except + + #flat_hash_map(key_compare&) + U& operator[](const T&) + #flat_hash_map& operator=(flat_hash_map&) + bint operator==(flat_hash_map&, flat_hash_map&) + bint operator!=(flat_hash_map&, flat_hash_map&) + bint operator<(flat_hash_map&, flat_hash_map&) + bint operator>(flat_hash_map&, flat_hash_map&) + bint operator<=(flat_hash_map&, flat_hash_map&) + bint operator>=(flat_hash_map&, flat_hash_map&) + U& at(const T&) except + + const U& const_at "at"(const T&) except + + iterator begin() + const_iterator const_begin "begin"() + const_iterator cbegin() + void clear() + size_t count(const T&) + bint empty() + iterator end() + const_iterator const_end "end"() + const_iterator cend() + pair[iterator, iterator] equal_range(const T&) + pair[const_iterator, const_iterator] const_equal_range "equal_range"(const T&) + iterator erase(iterator) + iterator const_erase "erase"(const_iterator) + iterator erase(const_iterator, const_iterator) + size_t erase(const T&) + iterator find(const T&) + const_iterator const_find "find"(const T&) + pair[iterator, bint] insert(const pair[T, U]&) except + + iterator insert(const_iterator, const pair[T, U]&) except + + void insert[InputIt](InputIt, InputIt) except + + #key_compare key_comp() + iterator lower_bound(const T&) + const_iterator const_lower_bound "lower_bound"(const T&) + size_t max_size() + size_t size() + void swap(flat_hash_map&) + iterator upper_bound(const T&) + const_iterator const_upper_bound "upper_bound"(const T&) + #value_compare value_comp() + void max_load_factor(float) + float max_load_factor() + float load_factor() + void rehash(size_t) + void reserve(size_t) + size_t bucket_count() + size_t max_bucket_count() + size_t bucket_size(size_t) + size_t bucket(const T&) + + diff --git a/fastremap.pyx b/fastremap.pyx index 900e126..667c066 100644 --- a/fastremap.pyx +++ b/fastremap.pyx @@ -11,7 +11,7 @@ constrained environments when format shifting. Author: William Silversmith Affiliation: Seung Lab, Princeton Neuroscience Institute -Date: August 2018 - January 2020 +Date: August 2018 - May 2022 """ cimport cython @@ -20,7 +20,7 @@ from libc.stdint cimport ( int8_t, int16_t, int32_t, int64_t, uintptr_t ) -from libcpp.unordered_map cimport unordered_map +cimport fastremap from collections import defaultdict from functools import reduce @@ -181,10 +181,12 @@ def _renumber(cnp.ndarray[NUMBER, cast=True, ndim=1] arr, int64_t start=1, prese Return: a renumbered array, dict with remapping of oldval => newval """ - cdef unordered_map[NUMBER, NUMBER] remap_dict + cdef flat_hash_map[NUMBER, NUMBER] remap_dict if arr.size == 0: - return refit(np.zeros((0,), dtype=arr.dtype), 0), remap_dict + return refit(np.zeros((0,), dtype=arr.dtype), 0), {} + + remap_dict.reserve(1024) if preserve_zero: remap_dict[0] = 0 @@ -223,7 +225,7 @@ def _renumber(cnp.ndarray[NUMBER, cast=True, ndim=1] arr, int64_t start=1, prese if abs(start) > abs(factor): factor = start - return refit(arr, factor), remap_dict + return refit(arr, factor), { k:v for k,v in remap_dict } def refit(arr, value=None, increase_only=False, exotics=False): """ @@ -392,7 +394,7 @@ def _mask_except(cnp.ndarray[ALLINT] arr, list labels, ALLINT value): if size == 0: return arr - cdef unordered_map[ALLINT, ALLINT] tbl + cdef flat_hash_map[ALLINT, ALLINT] tbl for label in labels: tbl[label] = label @@ -588,7 +590,21 @@ def _remap(cnp.ndarray[NUMBER] arr, dict table, uint8_t preserve_missing_labels) if size == 0: return arr - cdef unordered_map[NUMBER, NUMBER] tbl + # fast path for remapping only a single label + # e.g. for masking something out + cdef NUMBER before = 0 + cdef NUMBER after = 0 + if preserve_missing_labels and len(table) == 1: + before = next(iter(table.keys())) + after = table[before] + if before == after: + return arr + for i in range(size): + if arr[i] == before: + arr[i] = after + return arr + + cdef flat_hash_map[NUMBER, NUMBER] tbl for k, v in table.items(): tbl[k] = v @@ -658,7 +674,7 @@ def remap_from_array_kv(cnp.ndarray[ALLINT] arr, cnp.ndarray[ALLINT] keys, cnp.n cdef ALLINT[:] keyview = keys cdef ALLINT[:] valview = vals cdef ALLINT[:] arrview = arr - cdef unordered_map[ALLINT, ALLINT] remap_dict + cdef flat_hash_map[ALLINT, ALLINT] remap_dict assert keys.size == vals.size diff --git a/ska_flat_hash_map.hpp b/ska_flat_hash_map.hpp new file mode 100644 index 0000000..97997a1 --- /dev/null +++ b/ska_flat_hash_map.hpp @@ -0,0 +1,1572 @@ +// Copyright Malte Skarupke 2017. +// Distributed under the Boost Software License, Version 1.0. +// (See http://www.boost.org/LICENSE_1_0.txt) + +// Boost Software License - Version 1.0 - August 17th, 2003 + +// Permission is hereby granted, free of charge, to any person or organization +// obtaining a copy of the software and accompanying documentation covered by +// this license (the "Software") to use, reproduce, display, distribute, +// execute, and transmit the Software, and to prepare derivative works of the +// Software, and to permit third-parties to whom the Software is furnished to +// do so, all subject to the following: + +// The copyright notices in the Software and this entire statement, including +// the above license grant, this restriction and the following disclaimer, +// must be included in all copies of the Software, in whole or in part, and +// all derivative works of the Software, unless such copies or derivative +// works are solely in the form of machine-executable object code generated by +// a source language processor. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +#pragma once + +// Check windows +#if _WIN32 || _WIN64 + #if _WIN64 + #define ENV64BIT + #else + #define ENV32BIT + #endif +#endif + +// Check GCC +#if __GNUC__ + #if __x86_64__ || __ppc64__ || __aarch64__ + #define ENV64BIT + #else + #define ENV32BIT + #endif +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef _MSC_VER +#define SKA_NOINLINE(...) __declspec(noinline) __VA_ARGS__ +#else +#define SKA_NOINLINE(...) __VA_ARGS__ __attribute__((noinline)) +#endif + +namespace ska +{ +struct prime_number_hash_policy; +struct power_of_two_hash_policy; +struct fibonacci_hash_policy; + +namespace detailv3 +{ +template +struct functor_storage : Functor +{ + functor_storage() = default; + functor_storage(const Functor & functor) + : Functor(functor) + { + } + template + Result operator()(Args &&... args) + { + return static_cast(*this)(std::forward(args)...); + } + template + Result operator()(Args &&... args) const + { + return static_cast(*this)(std::forward(args)...); + } +}; +template +struct functor_storage +{ + typedef Result (*function_ptr)(Args...); + function_ptr function; + functor_storage(function_ptr function) + : function(function) + { + } + Result operator()(Args... args) const + { + return function(std::forward(args)...); + } + operator function_ptr &() + { + return function; + } + operator const function_ptr &() + { + return function; + } +}; +template +struct KeyOrValueHasher : functor_storage +{ + typedef functor_storage hasher_storage; + KeyOrValueHasher() = default; + KeyOrValueHasher(const hasher & hash) + : hasher_storage(hash) + { + } + size_t operator()(const key_type & key) + { + return static_cast(*this)(key); + } + size_t operator()(const key_type & key) const + { + return static_cast(*this)(key); + } + size_t operator()(const value_type & value) + { + return static_cast(*this)(value.first); + } + size_t operator()(const value_type & value) const + { + return static_cast(*this)(value.first); + } + template + size_t operator()(const std::pair & value) + { + return static_cast(*this)(value.first); + } + template + size_t operator()(const std::pair & value) const + { + return static_cast(*this)(value.first); + } +}; +template +struct KeyOrValueEquality : functor_storage +{ + typedef functor_storage equality_storage; + KeyOrValueEquality() = default; + KeyOrValueEquality(const key_equal & equality) + : equality_storage(equality) + { + } + bool operator()(const key_type & lhs, const key_type & rhs) + { + return static_cast(*this)(lhs, rhs); + } + bool operator()(const key_type & lhs, const value_type & rhs) + { + return static_cast(*this)(lhs, rhs.first); + } + bool operator()(const value_type & lhs, const key_type & rhs) + { + return static_cast(*this)(lhs.first, rhs); + } + bool operator()(const value_type & lhs, const value_type & rhs) + { + return static_cast(*this)(lhs.first, rhs.first); + } + template + bool operator()(const key_type & lhs, const std::pair & rhs) + { + return static_cast(*this)(lhs, rhs.first); + } + template + bool operator()(const std::pair & lhs, const key_type & rhs) + { + return static_cast(*this)(lhs.first, rhs); + } + template + bool operator()(const value_type & lhs, const std::pair & rhs) + { + return static_cast(*this)(lhs.first, rhs.first); + } + template + bool operator()(const std::pair & lhs, const value_type & rhs) + { + return static_cast(*this)(lhs.first, rhs.first); + } + template + bool operator()(const std::pair & lhs, const std::pair & rhs) + { + return static_cast(*this)(lhs.first, rhs.first); + } +}; +static constexpr int8_t min_lookups = 4; +template +struct sherwood_v3_entry +{ + sherwood_v3_entry() + { + } + sherwood_v3_entry(int8_t distance_from_desired) + : distance_from_desired(distance_from_desired) + { + } + ~sherwood_v3_entry() + { + } + + bool has_value() const + { + return distance_from_desired >= 0; + } + bool is_empty() const + { + return distance_from_desired < 0; + } + bool is_at_desired_position() const + { + return distance_from_desired <= 0; + } + template + void emplace(int8_t distance, Args &&... args) + { + new (std::addressof(value)) T(std::forward(args)...); + distance_from_desired = distance; + } + + void destroy_value() + { + value.~T(); + distance_from_desired = -1; + } + + int8_t distance_from_desired = -1; + static constexpr int8_t special_end_value = 0; + union { T value; }; +}; + +inline int8_t log2(size_t value) +{ +#ifdef ENV64BIT + static constexpr int8_t table[64] = + { + 63, 0, 58, 1, 59, 47, 53, 2, + 60, 39, 48, 27, 54, 33, 42, 3, + 61, 51, 37, 40, 49, 18, 28, 20, + 55, 30, 34, 11, 43, 14, 22, 4, + 62, 57, 46, 52, 38, 26, 32, 41, + 50, 36, 17, 19, 29, 10, 13, 21, + 56, 45, 25, 31, 35, 16, 9, 12, + 44, 24, 15, 8, 23, 7, 6, 5 + }; + value |= value >> 1; + value |= value >> 2; + value |= value >> 4; + value |= value >> 8; + value |= value >> 16; + value |= value >> 32; + return table[((value - (value >> 1)) * 0x07EDD5E59A4E28C2) >> 58]; +#endif +#ifdef ENV32BIT + static constexpr int8_t table[32] = + { + 0, 9, 1, 10, 13, 21, 2, 29, + 11, 14, 16, 18, 22, 25, 3, 30, + 8, 12, 20, 28, 15, 17, 24, 7, + 19, 27, 23, 6, 26, 5, 4, 31 + }; + + value |= value >> 1; + value |= value >> 2; + value |= value >> 4; + value |= value >> 8; + value |= value >> 16; + return table[(value*0x07C4ACDD) >> 27]; +#endif +} + +template +struct AssignIfTrue +{ + void operator()(T & lhs, const T & rhs) + { + lhs = rhs; + } + void operator()(T & lhs, T && rhs) + { + lhs = std::move(rhs); + } +}; +template +struct AssignIfTrue +{ + void operator()(T &, const T &) + { + } + void operator()(T &, T &&) + { + } +}; + +inline size_t next_power_of_two(size_t i) +{ + --i; + i |= i >> 1; + i |= i >> 2; + i |= i >> 4; + i |= i >> 8; + i |= i >> 16; +#ifdef ENV64BIT + i |= i >> 32; +#endif + ++i; + return i; +} + +// Implementation taken from http://en.cppreference.com/w/cpp/types/void_t +// (it takes CWG1558 into account and also works for older compilers) +template struct make_void { typedef void type;}; +template using void_t = typename make_void::type; + +template +struct HashPolicySelector +{ + typedef fibonacci_hash_policy type; +}; +template +struct HashPolicySelector> +{ + typedef typename T::hash_policy type; +}; + +template +class sherwood_v3_table : private EntryAlloc, private Hasher, private Equal +{ + using Entry = detailv3::sherwood_v3_entry; + using AllocatorTraits = std::allocator_traits; + using EntryPointer = typename AllocatorTraits::pointer; + struct convertible_to_iterator; + +public: + + using value_type = T; + using size_type = size_t; + using difference_type = std::ptrdiff_t; + using hasher = ArgumentHash; + using key_equal = ArgumentEqual; + using allocator_type = EntryAlloc; + using reference = value_type &; + using const_reference = const value_type &; + using pointer = value_type *; + using const_pointer = const value_type *; + + sherwood_v3_table() + { + } + explicit sherwood_v3_table(size_type bucket_count, const ArgumentHash & hash = ArgumentHash(), const ArgumentEqual & equal = ArgumentEqual(), const ArgumentAlloc & alloc = ArgumentAlloc()) + : EntryAlloc(alloc), Hasher(hash), Equal(equal) + { + rehash(bucket_count); + } + sherwood_v3_table(size_type bucket_count, const ArgumentAlloc & alloc) + : sherwood_v3_table(bucket_count, ArgumentHash(), ArgumentEqual(), alloc) + { + } + sherwood_v3_table(size_type bucket_count, const ArgumentHash & hash, const ArgumentAlloc & alloc) + : sherwood_v3_table(bucket_count, hash, ArgumentEqual(), alloc) + { + } + explicit sherwood_v3_table(const ArgumentAlloc & alloc) + : EntryAlloc(alloc) + { + } + template + sherwood_v3_table(It first, It last, size_type bucket_count = 0, const ArgumentHash & hash = ArgumentHash(), const ArgumentEqual & equal = ArgumentEqual(), const ArgumentAlloc & alloc = ArgumentAlloc()) + : sherwood_v3_table(bucket_count, hash, equal, alloc) + { + insert(first, last); + } + template + sherwood_v3_table(It first, It last, size_type bucket_count, const ArgumentAlloc & alloc) + : sherwood_v3_table(first, last, bucket_count, ArgumentHash(), ArgumentEqual(), alloc) + { + } + template + sherwood_v3_table(It first, It last, size_type bucket_count, const ArgumentHash & hash, const ArgumentAlloc & alloc) + : sherwood_v3_table(first, last, bucket_count, hash, ArgumentEqual(), alloc) + { + } + sherwood_v3_table(std::initializer_list il, size_type bucket_count = 0, const ArgumentHash & hash = ArgumentHash(), const ArgumentEqual & equal = ArgumentEqual(), const ArgumentAlloc & alloc = ArgumentAlloc()) + : sherwood_v3_table(bucket_count, hash, equal, alloc) + { + if (bucket_count == 0) + rehash(il.size()); + insert(il.begin(), il.end()); + } + sherwood_v3_table(std::initializer_list il, size_type bucket_count, const ArgumentAlloc & alloc) + : sherwood_v3_table(il, bucket_count, ArgumentHash(), ArgumentEqual(), alloc) + { + } + sherwood_v3_table(std::initializer_list il, size_type bucket_count, const ArgumentHash & hash, const ArgumentAlloc & alloc) + : sherwood_v3_table(il, bucket_count, hash, ArgumentEqual(), alloc) + { + } + sherwood_v3_table(const sherwood_v3_table & other) + : sherwood_v3_table(other, AllocatorTraits::select_on_container_copy_construction(other.get_allocator())) + { + } + sherwood_v3_table(const sherwood_v3_table & other, const ArgumentAlloc & alloc) + : EntryAlloc(alloc), Hasher(other), Equal(other), _max_load_factor(other._max_load_factor) + { + rehash_for_other_container(other); + try + { + insert(other.begin(), other.end()); + } + catch(...) + { + clear(); + deallocate_data(entries, num_slots_minus_one, max_lookups); + throw; + } + } + sherwood_v3_table(sherwood_v3_table && other) noexcept + : EntryAlloc(std::move(other)), Hasher(std::move(other)), Equal(std::move(other)) + { + swap_pointers(other); + } + sherwood_v3_table(sherwood_v3_table && other, const ArgumentAlloc & alloc) noexcept + : EntryAlloc(alloc), Hasher(std::move(other)), Equal(std::move(other)) + { + swap_pointers(other); + } + sherwood_v3_table & operator=(const sherwood_v3_table & other) + { + if (this == std::addressof(other)) + return *this; + + clear(); + if (AllocatorTraits::propagate_on_container_copy_assignment::value) + { + if (static_cast(*this) != static_cast(other)) + { + reset_to_empty_state(); + } + AssignIfTrue()(*this, other); + } + _max_load_factor = other._max_load_factor; + static_cast(*this) = other; + static_cast(*this) = other; + rehash_for_other_container(other); + insert(other.begin(), other.end()); + return *this; + } + sherwood_v3_table & operator=(sherwood_v3_table && other) noexcept + { + if (this == std::addressof(other)) + return *this; + else if (AllocatorTraits::propagate_on_container_move_assignment::value) + { + clear(); + reset_to_empty_state(); + AssignIfTrue()(*this, std::move(other)); + swap_pointers(other); + } + else if (static_cast(*this) == static_cast(other)) + { + swap_pointers(other); + } + else + { + clear(); + _max_load_factor = other._max_load_factor; + rehash_for_other_container(other); + for (T & elem : other) + emplace(std::move(elem)); + other.clear(); + } + static_cast(*this) = std::move(other); + static_cast(*this) = std::move(other); + return *this; + } + ~sherwood_v3_table() + { + clear(); + deallocate_data(entries, num_slots_minus_one, max_lookups); + } + + const allocator_type & get_allocator() const + { + return static_cast(*this); + } + const ArgumentEqual & key_eq() const + { + return static_cast(*this); + } + const ArgumentHash & hash_function() const + { + return static_cast(*this); + } + + template + struct templated_iterator + { + templated_iterator() = default; + templated_iterator(EntryPointer current) + : current(current) + { + } + EntryPointer current = EntryPointer(); + + using iterator_category = std::forward_iterator_tag; + using value_type = ValueType; + using difference_type = ptrdiff_t; + using pointer = ValueType *; + using reference = ValueType &; + + friend bool operator==(const templated_iterator & lhs, const templated_iterator & rhs) + { + return lhs.current == rhs.current; + } + friend bool operator!=(const templated_iterator & lhs, const templated_iterator & rhs) + { + return !(lhs == rhs); + } + + templated_iterator & operator++() + { + do + { + ++current; + } + while(current->is_empty()); + return *this; + } + templated_iterator operator++(int) + { + templated_iterator copy(*this); + ++*this; + return copy; + } + + ValueType & operator*() const + { + return current->value; + } + ValueType * operator->() const + { + return std::addressof(current->value); + } + + operator templated_iterator() const + { + return { current }; + } + }; + using iterator = templated_iterator; + using const_iterator = templated_iterator; + + iterator begin() + { + for (EntryPointer it = entries;; ++it) + { + if (it->has_value()) + return { it }; + } + } + const_iterator begin() const + { + for (EntryPointer it = entries;; ++it) + { + if (it->has_value()) + return { it }; + } + } + const_iterator cbegin() const + { + return begin(); + } + iterator end() + { + return { entries + static_cast(num_slots_minus_one + max_lookups) }; + } + const_iterator end() const + { + return { entries + static_cast(num_slots_minus_one + max_lookups) }; + } + const_iterator cend() const + { + return end(); + } + + iterator find(const FindKey & key) + { + size_t index = hash_policy.index_for_hash(hash_object(key), num_slots_minus_one); + EntryPointer it = entries + ptrdiff_t(index); + for (int8_t distance = 0; it->distance_from_desired >= distance; ++distance, ++it) + { + if (compares_equal(key, it->value)) + return { it }; + } + return end(); + } + const_iterator find(const FindKey & key) const + { + return const_cast(this)->find(key); + } + size_t count(const FindKey & key) const + { + return find(key) == end() ? 0 : 1; + } + std::pair equal_range(const FindKey & key) + { + iterator found = find(key); + if (found == end()) + return { found, found }; + else + return { found, std::next(found) }; + } + std::pair equal_range(const FindKey & key) const + { + const_iterator found = find(key); + if (found == end()) + return { found, found }; + else + return { found, std::next(found) }; + } + + template + std::pair emplace(Key && key, Args &&... args) + { + size_t index = hash_policy.index_for_hash(hash_object(key), num_slots_minus_one); + EntryPointer current_entry = entries + ptrdiff_t(index); + int8_t distance_from_desired = 0; + for (; current_entry->distance_from_desired >= distance_from_desired; ++current_entry, ++distance_from_desired) + { + if (compares_equal(key, current_entry->value)) + return { { current_entry }, false }; + } + return emplace_new_key(distance_from_desired, current_entry, std::forward(key), std::forward(args)...); + } + + std::pair insert(const value_type & value) + { + return emplace(value); + } + std::pair insert(value_type && value) + { + return emplace(std::move(value)); + } + template + iterator emplace_hint(const_iterator, Args &&... args) + { + return emplace(std::forward(args)...).first; + } + iterator insert(const_iterator, const value_type & value) + { + return emplace(value).first; + } + iterator insert(const_iterator, value_type && value) + { + return emplace(std::move(value)).first; + } + + template + void insert(It begin, It end) + { + for (; begin != end; ++begin) + { + emplace(*begin); + } + } + void insert(std::initializer_list il) + { + insert(il.begin(), il.end()); + } + + void rehash(size_t num_buckets) + { + num_buckets = std::max(num_buckets, static_cast(std::ceil(num_elements / static_cast(_max_load_factor)))); + if (num_buckets == 0) + { + reset_to_empty_state(); + return; + } + auto new_prime_index = hash_policy.next_size_over(num_buckets); + if (num_buckets == bucket_count()) + return; + int8_t new_max_lookups = compute_max_lookups(num_buckets); + EntryPointer new_buckets(AllocatorTraits::allocate(*this, num_buckets + new_max_lookups)); + EntryPointer special_end_item = new_buckets + static_cast(num_buckets + new_max_lookups - 1); + for (EntryPointer it = new_buckets; it != special_end_item; ++it) + it->distance_from_desired = -1; + special_end_item->distance_from_desired = Entry::special_end_value; + std::swap(entries, new_buckets); + std::swap(num_slots_minus_one, num_buckets); + --num_slots_minus_one; + hash_policy.commit(new_prime_index); + int8_t old_max_lookups = max_lookups; + max_lookups = new_max_lookups; + num_elements = 0; + for (EntryPointer it = new_buckets, end = it + static_cast(num_buckets + old_max_lookups); it != end; ++it) + { + if (it->has_value()) + { + emplace(std::move(it->value)); + it->destroy_value(); + } + } + deallocate_data(new_buckets, num_buckets, old_max_lookups); + } + + void reserve(size_t num_elements) + { + size_t required_buckets = num_buckets_for_reserve(num_elements); + if (required_buckets > bucket_count()) + rehash(required_buckets); + } + + // the return value is a type that can be converted to an iterator + // the reason for doing this is that it's not free to find the + // iterator pointing at the next element. if you care about the + // next iterator, turn the return value into an iterator + convertible_to_iterator erase(const_iterator to_erase) + { + EntryPointer current = to_erase.current; + current->destroy_value(); + --num_elements; + for (EntryPointer next = current + ptrdiff_t(1); !next->is_at_desired_position(); ++current, ++next) + { + current->emplace(next->distance_from_desired - 1, std::move(next->value)); + next->destroy_value(); + } + return { to_erase.current }; + } + + iterator erase(const_iterator begin_it, const_iterator end_it) + { + if (begin_it == end_it) + return { begin_it.current }; + for (EntryPointer it = begin_it.current, end = end_it.current; it != end; ++it) + { + if (it->has_value()) + { + it->destroy_value(); + --num_elements; + } + } + if (end_it == this->end()) + return this->end(); + ptrdiff_t num_to_move = std::min(static_cast(end_it.current->distance_from_desired), end_it.current - begin_it.current); + EntryPointer to_return = end_it.current - num_to_move; + for (EntryPointer it = end_it.current; !it->is_at_desired_position();) + { + EntryPointer target = it - num_to_move; + target->emplace(it->distance_from_desired - num_to_move, std::move(it->value)); + it->destroy_value(); + ++it; + num_to_move = std::min(static_cast(it->distance_from_desired), num_to_move); + } + return { to_return }; + } + + size_t erase(const FindKey & key) + { + auto found = find(key); + if (found == end()) + return 0; + else + { + erase(found); + return 1; + } + } + + void clear() + { + for (EntryPointer it = entries, end = it + static_cast(num_slots_minus_one + max_lookups); it != end; ++it) + { + if (it->has_value()) + it->destroy_value(); + } + num_elements = 0; + } + + void shrink_to_fit() + { + rehash_for_other_container(*this); + } + + void swap(sherwood_v3_table & other) + { + using std::swap; + swap_pointers(other); + swap(static_cast(*this), static_cast(other)); + swap(static_cast(*this), static_cast(other)); + if (AllocatorTraits::propagate_on_container_swap::value) + swap(static_cast(*this), static_cast(other)); + } + + size_t size() const + { + return num_elements; + } + size_t max_size() const + { + return (AllocatorTraits::max_size(*this)) / sizeof(Entry); + } + size_t bucket_count() const + { + return num_slots_minus_one ? num_slots_minus_one + 1 : 0; + } + size_type max_bucket_count() const + { + return (AllocatorTraits::max_size(*this) - min_lookups) / sizeof(Entry); + } + size_t bucket(const FindKey & key) const + { + return hash_policy.index_for_hash(hash_object(key), num_slots_minus_one); + } + float load_factor() const + { + size_t buckets = bucket_count(); + if (buckets) + return static_cast(num_elements) / bucket_count(); + else + return 0; + } + void max_load_factor(float value) + { + _max_load_factor = value; + } + float max_load_factor() const + { + return _max_load_factor; + } + + bool empty() const + { + return num_elements == 0; + } + +private: + EntryPointer entries = empty_default_table(); + size_t num_slots_minus_one = 0; + typename HashPolicySelector::type hash_policy; + int8_t max_lookups = detailv3::min_lookups - 1; + float _max_load_factor = 0.5f; + size_t num_elements = 0; + + EntryPointer empty_default_table() + { + EntryPointer result = AllocatorTraits::allocate(*this, detailv3::min_lookups); + EntryPointer special_end_item = result + static_cast(detailv3::min_lookups - 1); + for (EntryPointer it = result; it != special_end_item; ++it) + it->distance_from_desired = -1; + special_end_item->distance_from_desired = Entry::special_end_value; + return result; + } + + static int8_t compute_max_lookups(size_t num_buckets) + { + int8_t desired = detailv3::log2(num_buckets); + return std::max(detailv3::min_lookups, desired); + } + + size_t num_buckets_for_reserve(size_t num_elements) const + { + return static_cast(std::ceil(num_elements / std::min(0.5, static_cast(_max_load_factor)))); + } + void rehash_for_other_container(const sherwood_v3_table & other) + { + rehash(std::min(num_buckets_for_reserve(other.size()), other.bucket_count())); + } + + void swap_pointers(sherwood_v3_table & other) + { + using std::swap; + swap(hash_policy, other.hash_policy); + swap(entries, other.entries); + swap(num_slots_minus_one, other.num_slots_minus_one); + swap(num_elements, other.num_elements); + swap(max_lookups, other.max_lookups); + swap(_max_load_factor, other._max_load_factor); + } + + template + SKA_NOINLINE(std::pair) emplace_new_key(int8_t distance_from_desired, EntryPointer current_entry, Key && key, Args &&... args) + { + using std::swap; + if (num_slots_minus_one == 0 || distance_from_desired == max_lookups || num_elements + 1 > (num_slots_minus_one + 1) * static_cast(_max_load_factor)) + { + grow(); + return emplace(std::forward(key), std::forward(args)...); + } + else if (current_entry->is_empty()) + { + current_entry->emplace(distance_from_desired, std::forward(key), std::forward(args)...); + ++num_elements; + return { { current_entry }, true }; + } + value_type to_insert(std::forward(key), std::forward(args)...); + swap(distance_from_desired, current_entry->distance_from_desired); + swap(to_insert, current_entry->value); + iterator result = { current_entry }; + for (++distance_from_desired, ++current_entry;; ++current_entry) + { + if (current_entry->is_empty()) + { + current_entry->emplace(distance_from_desired, std::move(to_insert)); + ++num_elements; + return { result, true }; + } + else if (current_entry->distance_from_desired < distance_from_desired) + { + swap(distance_from_desired, current_entry->distance_from_desired); + swap(to_insert, current_entry->value); + ++distance_from_desired; + } + else + { + ++distance_from_desired; + if (distance_from_desired == max_lookups) + { + swap(to_insert, result.current->value); + grow(); + return emplace(std::move(to_insert)); + } + } + } + } + + void grow() + { + rehash(std::max(size_t(4), 2 * bucket_count())); + } + + void deallocate_data(EntryPointer begin, size_t num_slots_minus_one, int8_t max_lookups) + { + AllocatorTraits::deallocate(*this, begin, num_slots_minus_one + max_lookups + 1); + } + + void reset_to_empty_state() + { + deallocate_data(entries, num_slots_minus_one, max_lookups); + entries = empty_default_table(); + num_slots_minus_one = 0; + hash_policy.reset(); + max_lookups = detailv3::min_lookups - 1; + } + + template + size_t hash_object(const U & key) + { + return static_cast(*this)(key); + } + template + size_t hash_object(const U & key) const + { + return static_cast(*this)(key); + } + template + bool compares_equal(const L & lhs, const R & rhs) + { + return static_cast(*this)(lhs, rhs); + } + + struct convertible_to_iterator + { + EntryPointer it; + + operator iterator() + { + if (it->has_value()) + return { it }; + else + return ++iterator{it}; + } + operator const_iterator() + { + if (it->has_value()) + return { it }; + else + return ++const_iterator{it}; + } + }; + +}; +} + +struct prime_number_hash_policy +{ + static size_t mod0(size_t) { return 0u; } + static size_t mod2(size_t hash) { return hash % 2u; } + static size_t mod3(size_t hash) { return hash % 3u; } + static size_t mod5(size_t hash) { return hash % 5u; } + static size_t mod7(size_t hash) { return hash % 7u; } + static size_t mod11(size_t hash) { return hash % 11u; } + static size_t mod13(size_t hash) { return hash % 13u; } + static size_t mod17(size_t hash) { return hash % 17u; } + static size_t mod23(size_t hash) { return hash % 23u; } + static size_t mod29(size_t hash) { return hash % 29u; } + static size_t mod37(size_t hash) { return hash % 37u; } + static size_t mod47(size_t hash) { return hash % 47u; } + static size_t mod59(size_t hash) { return hash % 59u; } + static size_t mod73(size_t hash) { return hash % 73u; } + static size_t mod97(size_t hash) { return hash % 97u; } + static size_t mod127(size_t hash) { return hash % 127u; } + static size_t mod151(size_t hash) { return hash % 151u; } + static size_t mod197(size_t hash) { return hash % 197u; } + static size_t mod251(size_t hash) { return hash % 251u; } + static size_t mod313(size_t hash) { return hash % 313u; } + static size_t mod397(size_t hash) { return hash % 397u; } + static size_t mod499(size_t hash) { return hash % 499u; } + static size_t mod631(size_t hash) { return hash % 631u; } + static size_t mod797(size_t hash) { return hash % 797u; } + static size_t mod1009(size_t hash) { return hash % 1009u; } + static size_t mod1259(size_t hash) { return hash % 1259u; } + static size_t mod1597(size_t hash) { return hash % 1597u; } + static size_t mod2011(size_t hash) { return hash % 2011u; } + static size_t mod2539(size_t hash) { return hash % 2539u; } + static size_t mod3203(size_t hash) { return hash % 3203u; } + static size_t mod4027(size_t hash) { return hash % 4027u; } + static size_t mod5087(size_t hash) { return hash % 5087u; } + static size_t mod6421(size_t hash) { return hash % 6421u; } + static size_t mod8089(size_t hash) { return hash % 8089u; } + static size_t mod10193(size_t hash) { return hash % 10193u; } + static size_t mod12853(size_t hash) { return hash % 12853u; } + static size_t mod16193(size_t hash) { return hash % 16193u; } + static size_t mod20399(size_t hash) { return hash % 20399u; } + static size_t mod25717(size_t hash) { return hash % 25717u; } + static size_t mod32401(size_t hash) { return hash % 32401u; } + static size_t mod40823(size_t hash) { return hash % 40823u; } + static size_t mod51437(size_t hash) { return hash % 51437u; } + static size_t mod64811(size_t hash) { return hash % 64811u; } + static size_t mod81649(size_t hash) { return hash % 81649u; } + static size_t mod102877(size_t hash) { return hash % 102877u; } + static size_t mod129607(size_t hash) { return hash % 129607u; } + static size_t mod163307(size_t hash) { return hash % 163307u; } + static size_t mod205759(size_t hash) { return hash % 205759u; } + static size_t mod259229(size_t hash) { return hash % 259229u; } + static size_t mod326617(size_t hash) { return hash % 326617u; } + static size_t mod411527(size_t hash) { return hash % 411527u; } + static size_t mod518509(size_t hash) { return hash % 518509u; } + static size_t mod653267(size_t hash) { return hash % 653267u; } + static size_t mod823117(size_t hash) { return hash % 823117u; } + static size_t mod1037059(size_t hash) { return hash % 1037059u; } + static size_t mod1306601(size_t hash) { return hash % 1306601u; } + static size_t mod1646237(size_t hash) { return hash % 1646237u; } + static size_t mod2074129(size_t hash) { return hash % 2074129u; } + static size_t mod2613229(size_t hash) { return hash % 2613229u; } + static size_t mod3292489(size_t hash) { return hash % 3292489u; } + static size_t mod4148279(size_t hash) { return hash % 4148279u; } + static size_t mod5226491(size_t hash) { return hash % 5226491u; } + static size_t mod6584983(size_t hash) { return hash % 6584983u; } + static size_t mod8296553(size_t hash) { return hash % 8296553u; } + static size_t mod10453007(size_t hash) { return hash % 10453007u; } + static size_t mod13169977(size_t hash) { return hash % 13169977u; } + static size_t mod16593127(size_t hash) { return hash % 16593127u; } + static size_t mod20906033(size_t hash) { return hash % 20906033u; } + static size_t mod26339969(size_t hash) { return hash % 26339969u; } + static size_t mod33186281(size_t hash) { return hash % 33186281u; } + static size_t mod41812097(size_t hash) { return hash % 41812097u; } + static size_t mod52679969(size_t hash) { return hash % 52679969u; } + static size_t mod66372617(size_t hash) { return hash % 66372617u; } + static size_t mod83624237(size_t hash) { return hash % 83624237u; } + static size_t mod105359939(size_t hash) { return hash % 105359939u; } + static size_t mod132745199(size_t hash) { return hash % 132745199u; } + static size_t mod167248483(size_t hash) { return hash % 167248483u; } + static size_t mod210719881(size_t hash) { return hash % 210719881u; } + static size_t mod265490441(size_t hash) { return hash % 265490441u; } + static size_t mod334496971(size_t hash) { return hash % 334496971u; } + static size_t mod421439783(size_t hash) { return hash % 421439783u; } + static size_t mod530980861(size_t hash) { return hash % 530980861u; } + static size_t mod668993977(size_t hash) { return hash % 668993977u; } + static size_t mod842879579(size_t hash) { return hash % 842879579u; } + static size_t mod1061961721(size_t hash) { return hash % 1061961721u; } + static size_t mod1337987929(size_t hash) { return hash % 1337987929u; } + static size_t mod1685759167(size_t hash) { return hash % 1685759167u; } + static size_t mod2123923447(size_t hash) { return hash % 2123923447u; } + static size_t mod2675975881(size_t hash) { return hash % 2675975881u; } + static size_t mod3371518343(size_t hash) { return hash % 3371518343u; } + static size_t mod4247846927(size_t hash) { return hash % 4247846927u; } + +#ifdef ENV64BIT + static size_t mod5351951779(size_t hash) { return hash % 5351951779llu; } + static size_t mod6743036717(size_t hash) { return hash % 6743036717llu; } + static size_t mod8495693897(size_t hash) { return hash % 8495693897llu; } + static size_t mod10703903591(size_t hash) { return hash % 10703903591llu; } + static size_t mod13486073473(size_t hash) { return hash % 13486073473llu; } + static size_t mod16991387857(size_t hash) { return hash % 16991387857llu; } + static size_t mod21407807219(size_t hash) { return hash % 21407807219llu; } + static size_t mod26972146961(size_t hash) { return hash % 26972146961llu; } + static size_t mod33982775741(size_t hash) { return hash % 33982775741llu; } + static size_t mod42815614441(size_t hash) { return hash % 42815614441llu; } + static size_t mod53944293929(size_t hash) { return hash % 53944293929llu; } + static size_t mod67965551447(size_t hash) { return hash % 67965551447llu; } + static size_t mod85631228929(size_t hash) { return hash % 85631228929llu; } + static size_t mod107888587883(size_t hash) { return hash % 107888587883llu; } + static size_t mod135931102921(size_t hash) { return hash % 135931102921llu; } + static size_t mod171262457903(size_t hash) { return hash % 171262457903llu; } + static size_t mod215777175787(size_t hash) { return hash % 215777175787llu; } + static size_t mod271862205833(size_t hash) { return hash % 271862205833llu; } + static size_t mod342524915839(size_t hash) { return hash % 342524915839llu; } + static size_t mod431554351609(size_t hash) { return hash % 431554351609llu; } + static size_t mod543724411781(size_t hash) { return hash % 543724411781llu; } + static size_t mod685049831731(size_t hash) { return hash % 685049831731llu; } + static size_t mod863108703229(size_t hash) { return hash % 863108703229llu; } + static size_t mod1087448823553(size_t hash) { return hash % 1087448823553llu; } + static size_t mod1370099663459(size_t hash) { return hash % 1370099663459llu; } + static size_t mod1726217406467(size_t hash) { return hash % 1726217406467llu; } + static size_t mod2174897647073(size_t hash) { return hash % 2174897647073llu; } + static size_t mod2740199326961(size_t hash) { return hash % 2740199326961llu; } + static size_t mod3452434812973(size_t hash) { return hash % 3452434812973llu; } + static size_t mod4349795294267(size_t hash) { return hash % 4349795294267llu; } + static size_t mod5480398654009(size_t hash) { return hash % 5480398654009llu; } + static size_t mod6904869625999(size_t hash) { return hash % 6904869625999llu; } + static size_t mod8699590588571(size_t hash) { return hash % 8699590588571llu; } + static size_t mod10960797308051(size_t hash) { return hash % 10960797308051llu; } + static size_t mod13809739252051(size_t hash) { return hash % 13809739252051llu; } + static size_t mod17399181177241(size_t hash) { return hash % 17399181177241llu; } + static size_t mod21921594616111(size_t hash) { return hash % 21921594616111llu; } + static size_t mod27619478504183(size_t hash) { return hash % 27619478504183llu; } + static size_t mod34798362354533(size_t hash) { return hash % 34798362354533llu; } + static size_t mod43843189232363(size_t hash) { return hash % 43843189232363llu; } + static size_t mod55238957008387(size_t hash) { return hash % 55238957008387llu; } + static size_t mod69596724709081(size_t hash) { return hash % 69596724709081llu; } + static size_t mod87686378464759(size_t hash) { return hash % 87686378464759llu; } + static size_t mod110477914016779(size_t hash) { return hash % 110477914016779llu; } + static size_t mod139193449418173(size_t hash) { return hash % 139193449418173llu; } + static size_t mod175372756929481(size_t hash) { return hash % 175372756929481llu; } + static size_t mod220955828033581(size_t hash) { return hash % 220955828033581llu; } + static size_t mod278386898836457(size_t hash) { return hash % 278386898836457llu; } + static size_t mod350745513859007(size_t hash) { return hash % 350745513859007llu; } + static size_t mod441911656067171(size_t hash) { return hash % 441911656067171llu; } + static size_t mod556773797672909(size_t hash) { return hash % 556773797672909llu; } + static size_t mod701491027718027(size_t hash) { return hash % 701491027718027llu; } + static size_t mod883823312134381(size_t hash) { return hash % 883823312134381llu; } + static size_t mod1113547595345903(size_t hash) { return hash % 1113547595345903llu; } + static size_t mod1402982055436147(size_t hash) { return hash % 1402982055436147llu; } + static size_t mod1767646624268779(size_t hash) { return hash % 1767646624268779llu; } + static size_t mod2227095190691797(size_t hash) { return hash % 2227095190691797llu; } + static size_t mod2805964110872297(size_t hash) { return hash % 2805964110872297llu; } + static size_t mod3535293248537579(size_t hash) { return hash % 3535293248537579llu; } + static size_t mod4454190381383713(size_t hash) { return hash % 4454190381383713llu; } + static size_t mod5611928221744609(size_t hash) { return hash % 5611928221744609llu; } + static size_t mod7070586497075177(size_t hash) { return hash % 7070586497075177llu; } + static size_t mod8908380762767489(size_t hash) { return hash % 8908380762767489llu; } + static size_t mod11223856443489329(size_t hash) { return hash % 11223856443489329llu; } + static size_t mod14141172994150357(size_t hash) { return hash % 14141172994150357llu; } + static size_t mod17816761525534927(size_t hash) { return hash % 17816761525534927llu; } + static size_t mod22447712886978529(size_t hash) { return hash % 22447712886978529llu; } + static size_t mod28282345988300791(size_t hash) { return hash % 28282345988300791llu; } + static size_t mod35633523051069991(size_t hash) { return hash % 35633523051069991llu; } + static size_t mod44895425773957261(size_t hash) { return hash % 44895425773957261llu; } + static size_t mod56564691976601587(size_t hash) { return hash % 56564691976601587llu; } + static size_t mod71267046102139967(size_t hash) { return hash % 71267046102139967llu; } + static size_t mod89790851547914507(size_t hash) { return hash % 89790851547914507llu; } + static size_t mod113129383953203213(size_t hash) { return hash % 113129383953203213llu; } + static size_t mod142534092204280003(size_t hash) { return hash % 142534092204280003llu; } + static size_t mod179581703095829107(size_t hash) { return hash % 179581703095829107llu; } + static size_t mod226258767906406483(size_t hash) { return hash % 226258767906406483llu; } + static size_t mod285068184408560057(size_t hash) { return hash % 285068184408560057llu; } + static size_t mod359163406191658253(size_t hash) { return hash % 359163406191658253llu; } + static size_t mod452517535812813007(size_t hash) { return hash % 452517535812813007llu; } + static size_t mod570136368817120201(size_t hash) { return hash % 570136368817120201llu; } + static size_t mod718326812383316683(size_t hash) { return hash % 718326812383316683llu; } + static size_t mod905035071625626043(size_t hash) { return hash % 905035071625626043llu; } + static size_t mod1140272737634240411(size_t hash) { return hash % 1140272737634240411llu; } + static size_t mod1436653624766633509(size_t hash) { return hash % 1436653624766633509llu; } + static size_t mod1810070143251252131(size_t hash) { return hash % 1810070143251252131llu; } + static size_t mod2280545475268481167(size_t hash) { return hash % 2280545475268481167llu; } + static size_t mod2873307249533267101(size_t hash) { return hash % 2873307249533267101llu; } + static size_t mod3620140286502504283(size_t hash) { return hash % 3620140286502504283llu; } + static size_t mod4561090950536962147(size_t hash) { return hash % 4561090950536962147llu; } + static size_t mod5746614499066534157(size_t hash) { return hash % 5746614499066534157llu; } + static size_t mod7240280573005008577(size_t hash) { return hash % 7240280573005008577llu; } + static size_t mod9122181901073924329(size_t hash) { return hash % 9122181901073924329llu; } + static size_t mod11493228998133068689(size_t hash) { return hash % 11493228998133068689llu; } + static size_t mod14480561146010017169(size_t hash) { return hash % 14480561146010017169llu; } + static size_t mod18446744073709551557(size_t hash) { return hash % 18446744073709551557llu; } +#endif + + using mod_function = size_t (*)(size_t); + + mod_function next_size_over(size_t & size) const + { + // prime numbers generated by the following method: + // 1. start with a prime p = 2 + // 2. go to wolfram alpha and get p = NextPrime(2 * p) + // 3. repeat 2. until you overflow 64 bits + // you now have large gaps which you would hit if somebody called reserve() with an unlucky number. + // 4. to fill the gaps for every prime p go to wolfram alpha and get ClosestPrime(p * 2^(1/3)) and ClosestPrime(p * 2^(2/3)) and put those in the gaps + // 5. get PrevPrime(2^64) and put it at the end + static constexpr const size_t prime_list[] = + { + 2u, 3u, 5u, 7u, 11u, 13u, 17u, 23u, 29u, 37u, 47u, + 59u, 73u, 97u, 127u, 151u, 197u, 251u, 313u, 397u, + 499u, 631u, 797u, 1009u, 1259u, 1597u, 2011u, 2539u, + 3203u, 4027u, 5087u, 6421u, 8089u, 10193u, 12853u, 16193u, + 20399u, 25717u, 32401u, 40823u, 51437u, 64811u, 81649u, + 102877u, 129607u, 163307u, 205759u, 259229u, 326617u, + 411527u, 518509u, 653267u, 823117u, 1037059u, 1306601u, + 1646237u, 2074129u, 2613229u, 3292489u, 4148279u, 5226491u, + 6584983u, 8296553u, 10453007u, 13169977u, 16593127u, 20906033u, + 26339969u, 33186281u, 41812097u, 52679969u, 66372617u, + 83624237u, 105359939u, 132745199u, 167248483u, 210719881u, + 265490441u, 334496971u, 421439783u, 530980861u, 668993977u, + 842879579u, 1061961721u, 1337987929u, 1685759167u, 2123923447u, + 2675975881u, 3371518343u, 4247846927u +#ifdef ENV64BIT + , 5351951779llu, 6743036717llu, + 8495693897llu, 10703903591llu, 13486073473llu, 16991387857llu, + 21407807219llu, 26972146961llu, 33982775741llu, 42815614441llu, + 53944293929llu, 67965551447llu, 85631228929llu, 107888587883llu, + 135931102921llu, 171262457903llu, 215777175787llu, 271862205833llu, + 342524915839llu, 431554351609llu, 543724411781llu, 685049831731llu, + 863108703229llu, 1087448823553llu, 1370099663459llu, 1726217406467llu, + 2174897647073llu, 2740199326961llu, 3452434812973llu, 4349795294267llu, + 5480398654009llu, 6904869625999llu, 8699590588571llu, 10960797308051llu, + 13809739252051llu, 17399181177241llu, 21921594616111llu, 27619478504183llu, + 34798362354533llu, 43843189232363llu, 55238957008387llu, 69596724709081llu, + 87686378464759llu, 110477914016779llu, 139193449418173llu, + 175372756929481llu, 220955828033581llu, 278386898836457llu, + 350745513859007llu, 441911656067171llu, 556773797672909llu, + 701491027718027llu, 883823312134381llu, 1113547595345903llu, + 1402982055436147llu, 1767646624268779llu, 2227095190691797llu, + 2805964110872297llu, 3535293248537579llu, 4454190381383713llu, + 5611928221744609llu, 7070586497075177llu, 8908380762767489llu, + 11223856443489329llu, 14141172994150357llu, 17816761525534927llu, + 22447712886978529llu, 28282345988300791llu, 35633523051069991llu, + 44895425773957261llu, 56564691976601587llu, 71267046102139967llu, + 89790851547914507llu, 113129383953203213llu, 142534092204280003llu, + 179581703095829107llu, 226258767906406483llu, 285068184408560057llu, + 359163406191658253llu, 452517535812813007llu, 570136368817120201llu, + 718326812383316683llu, 905035071625626043llu, 1140272737634240411llu, + 1436653624766633509llu, 1810070143251252131llu, 2280545475268481167llu, + 2873307249533267101llu, 3620140286502504283llu, 4561090950536962147llu, + 5746614499066534157llu, 7240280573005008577llu, 9122181901073924329llu, + 11493228998133068689llu, 14480561146010017169llu, 18446744073709551557llu +#endif + }; + static constexpr size_t (* const mod_functions[])(size_t) = + { + &mod0, &mod2, &mod3, &mod5, &mod7, &mod11, &mod13, &mod17, &mod23, &mod29, &mod37, + &mod47, &mod59, &mod73, &mod97, &mod127, &mod151, &mod197, &mod251, &mod313, &mod397, + &mod499, &mod631, &mod797, &mod1009, &mod1259, &mod1597, &mod2011, &mod2539, &mod3203, + &mod4027, &mod5087, &mod6421, &mod8089, &mod10193, &mod12853, &mod16193, &mod20399, + &mod25717, &mod32401, &mod40823, &mod51437, &mod64811, &mod81649, &mod102877, + &mod129607, &mod163307, &mod205759, &mod259229, &mod326617, &mod411527, &mod518509, + &mod653267, &mod823117, &mod1037059, &mod1306601, &mod1646237, &mod2074129, + &mod2613229, &mod3292489, &mod4148279, &mod5226491, &mod6584983, &mod8296553, + &mod10453007, &mod13169977, &mod16593127, &mod20906033, &mod26339969, &mod33186281, + &mod41812097, &mod52679969, &mod66372617, &mod83624237, &mod105359939, &mod132745199, + &mod167248483, &mod210719881, &mod265490441, &mod334496971, &mod421439783, + &mod530980861, &mod668993977, &mod842879579, &mod1061961721, &mod1337987929, + &mod1685759167, &mod2123923447, &mod2675975881, &mod3371518343, &mod4247846927 + +#ifdef ENV64BIT + , &mod5351951779, &mod6743036717, &mod8495693897, &mod10703903591, &mod13486073473, + &mod16991387857, &mod21407807219, &mod26972146961, &mod33982775741, &mod42815614441, + &mod53944293929, &mod67965551447, &mod85631228929, &mod107888587883, &mod135931102921, + &mod171262457903, &mod215777175787, &mod271862205833, &mod342524915839, + &mod431554351609, &mod543724411781, &mod685049831731, &mod863108703229, + &mod1087448823553, &mod1370099663459, &mod1726217406467, &mod2174897647073, + &mod2740199326961, &mod3452434812973, &mod4349795294267, &mod5480398654009, + &mod6904869625999, &mod8699590588571, &mod10960797308051, &mod13809739252051, + &mod17399181177241, &mod21921594616111, &mod27619478504183, &mod34798362354533, + &mod43843189232363, &mod55238957008387, &mod69596724709081, &mod87686378464759, + &mod110477914016779, &mod139193449418173, &mod175372756929481, &mod220955828033581, + &mod278386898836457, &mod350745513859007, &mod441911656067171, &mod556773797672909, + &mod701491027718027, &mod883823312134381, &mod1113547595345903, &mod1402982055436147, + &mod1767646624268779, &mod2227095190691797, &mod2805964110872297, &mod3535293248537579, + &mod4454190381383713, &mod5611928221744609, &mod7070586497075177, &mod8908380762767489, + &mod11223856443489329, &mod14141172994150357, &mod17816761525534927, + &mod22447712886978529, &mod28282345988300791, &mod35633523051069991, + &mod44895425773957261, &mod56564691976601587, &mod71267046102139967, + &mod89790851547914507, &mod113129383953203213, &mod142534092204280003, + &mod179581703095829107, &mod226258767906406483, &mod285068184408560057, + &mod359163406191658253, &mod452517535812813007, &mod570136368817120201, + &mod718326812383316683, &mod905035071625626043, &mod1140272737634240411, + &mod1436653624766633509, &mod1810070143251252131, &mod2280545475268481167, + &mod2873307249533267101, &mod3620140286502504283, &mod4561090950536962147, + &mod5746614499066534157, &mod7240280573005008577, &mod9122181901073924329, + &mod11493228998133068689, &mod14480561146010017169, &mod18446744073709551557 +#endif + }; + const size_t * found = std::lower_bound(std::begin(prime_list), std::end(prime_list) - 1, size); + size = *found; + return mod_functions[1 + found - prime_list]; + } + void commit(mod_function new_mod_function) + { + current_mod_function = new_mod_function; + } + void reset() + { + current_mod_function = &mod0; + } + + size_t index_for_hash(size_t hash, size_t /*num_slots_minus_one*/) const + { + return current_mod_function(hash); + } + size_t keep_in_range(size_t index, size_t num_slots_minus_one) const + { + return index > num_slots_minus_one ? current_mod_function(index) : index; + } + +private: + mod_function current_mod_function = &mod0; +}; + +struct power_of_two_hash_policy +{ + size_t index_for_hash(size_t hash, size_t num_slots_minus_one) const + { + return hash & num_slots_minus_one; + } + size_t keep_in_range(size_t index, size_t num_slots_minus_one) const + { + return index_for_hash(index, num_slots_minus_one); + } + int8_t next_size_over(size_t & size) const + { + size = detailv3::next_power_of_two(size); + return 0; + } + void commit(int8_t) + { + } + void reset() + { + } + +}; + +struct fibonacci_hash_policy +{ + size_t index_for_hash(size_t hash, size_t /*num_slots_minus_one*/) const + { + return (11400714819323198485ull * hash) >> shift; + } + size_t keep_in_range(size_t index, size_t num_slots_minus_one) const + { + return index & num_slots_minus_one; + } + + int8_t next_size_over(size_t & size) const + { + size = std::max(size_t(2), detailv3::next_power_of_two(size)); + return 64 - detailv3::log2(size); + } + void commit(int8_t shift) + { + this->shift = shift; + } + void reset() + { + shift = 63; + } + +private: + int8_t shift = 63; +}; + +template, typename E = std::equal_to, typename A = std::allocator > > +class flat_hash_map + : public detailv3::sherwood_v3_table + < + std::pair, + K, + H, + detailv3::KeyOrValueHasher, H>, + E, + detailv3::KeyOrValueEquality, E>, + A, + typename std::allocator_traits::template rebind_alloc>> + > +{ + using Table = detailv3::sherwood_v3_table + < + std::pair, + K, + H, + detailv3::KeyOrValueHasher, H>, + E, + detailv3::KeyOrValueEquality, E>, + A, + typename std::allocator_traits::template rebind_alloc>> + >; +public: + + using key_type = K; + using mapped_type = V; + + using Table::Table; + flat_hash_map() + { + } + + inline V & operator[](const K & key) + { + return emplace(key, convertible_to_value()).first->second; + } + inline V & operator[](K && key) + { + return emplace(std::move(key), convertible_to_value()).first->second; + } + V & at(const K & key) + { + auto found = this->find(key); + if (found == this->end()) + throw std::out_of_range("Argument passed to at() was not in the map."); + return found->second; + } + const V & at(const K & key) const + { + auto found = this->find(key); + if (found == this->end()) + throw std::out_of_range("Argument passed to at() was not in the map."); + return found->second; + } + + using Table::emplace; + std::pair emplace() + { + return emplace(key_type(), convertible_to_value()); + } + template + std::pair insert_or_assign(const key_type & key, M && m) + { + auto emplace_result = emplace(key, std::forward(m)); + if (!emplace_result.second) + emplace_result.first->second = std::forward(m); + return emplace_result; + } + template + std::pair insert_or_assign(key_type && key, M && m) + { + auto emplace_result = emplace(std::move(key), std::forward(m)); + if (!emplace_result.second) + emplace_result.first->second = std::forward(m); + return emplace_result; + } + template + typename Table::iterator insert_or_assign(typename Table::const_iterator, const key_type & key, M && m) + { + return insert_or_assign(key, std::forward(m)).first; + } + template + typename Table::iterator insert_or_assign(typename Table::const_iterator, key_type && key, M && m) + { + return insert_or_assign(std::move(key), std::forward(m)).first; + } + + friend bool operator==(const flat_hash_map & lhs, const flat_hash_map & rhs) + { + if (lhs.size() != rhs.size()) + return false; + for (const typename Table::value_type & value : lhs) + { + auto found = rhs.find(value.first); + if (found == rhs.end()) + return false; + else if (value.second != found->second) + return false; + } + return true; + } + friend bool operator!=(const flat_hash_map & lhs, const flat_hash_map & rhs) + { + return !(lhs == rhs); + } + +private: + struct convertible_to_value + { + operator V() const + { + return V(); + } + }; +}; + +template, typename E = std::equal_to, typename A = std::allocator > +class flat_hash_set + : public detailv3::sherwood_v3_table + < + T, + T, + H, + detailv3::functor_storage, + E, + detailv3::functor_storage, + A, + typename std::allocator_traits::template rebind_alloc> + > +{ + using Table = detailv3::sherwood_v3_table + < + T, + T, + H, + detailv3::functor_storage, + E, + detailv3::functor_storage, + A, + typename std::allocator_traits::template rebind_alloc> + >; +public: + + using key_type = T; + + using Table::Table; + flat_hash_set() + { + } + + template + std::pair emplace(Args &&... args) + { + return Table::emplace(T(std::forward(args)...)); + } + std::pair emplace(const key_type & arg) + { + return Table::emplace(arg); + } + std::pair emplace(key_type & arg) + { + return Table::emplace(arg); + } + std::pair emplace(const key_type && arg) + { + return Table::emplace(std::move(arg)); + } + std::pair emplace(key_type && arg) + { + return Table::emplace(std::move(arg)); + } + + friend bool operator==(const flat_hash_set & lhs, const flat_hash_set & rhs) + { + if (lhs.size() != rhs.size()) + return false; + for (const T & value : lhs) + { + if (rhs.find(value) == rhs.end()) + return false; + } + return true; + } + friend bool operator!=(const flat_hash_set & lhs, const flat_hash_set & rhs) + { + return !(lhs == rhs); + } +}; + + +template +struct power_of_two_std_hash : std::hash +{ + typedef ska::power_of_two_hash_policy hash_policy; +}; + +} // end namespace ska