From 4a94815bfe65c9c114bcaabaa057e68b64d24c87 Mon Sep 17 00:00:00 2001 From: foefl Date: Mon, 10 Nov 2025 15:27:30 +0100 Subject: [PATCH] add graceful error handling with return of status codes, closes #12 --- cli.py | 4 +- src/dopt_sensor_anomalies/_interface.py | 30 +- src/dopt_sensor_anomalies/detection.c | 5372 +++++++++++------------ tests/test_interface.py | 57 +- 4 files changed, 2610 insertions(+), 2853 deletions(-) diff --git a/cli.py b/cli.py index a39f1e4..52f4dcc 100644 --- a/cli.py +++ b/cli.py @@ -12,7 +12,7 @@ class CliArgs: calib_value_y: float -def main() -> None: +def main() -> int: parser = argparse.ArgumentParser( description=("simple CLI tool to analyse single sensor images for anomalies") ) @@ -33,7 +33,7 @@ def main() -> None: ) args = cast(CliArgs, parser.parse_args()) - _interface.sensor_anomalies_detection( + return _interface.sensor_anomalies_detection( args.img_path, args.calib_value_x, args.calib_value_y, diff --git a/src/dopt_sensor_anomalies/_interface.py b/src/dopt_sensor_anomalies/_interface.py index 590cf6d..748e6b7 100644 --- a/src/dopt_sensor_anomalies/_interface.py +++ b/src/dopt_sensor_anomalies/_interface.py @@ -1,16 +1,44 @@ """main pipeline interface for external calls""" +from __future__ import annotations + +import sys +from typing import TYPE_CHECKING, TextIO + from dopt_sensor_anomalies import detection +if TYPE_CHECKING: + from dopt_basics.result_pattern import Status + + +def _print_error_state( + state: Status, + out_stream: TextIO, +) -> None: + if state.ExceptionType is None: + raise RuntimeError("Tried to treat state as error, but no exception is registered") + + msg = ( + f"During the procedure the following exception occurred:" + f"\nType: {state.ExceptionType.__name__}\nDescription: {state.description}\n" + f"Message: {state.message}" + ) + print(msg, flush=True, file=out_stream) + def sensor_anomalies_detection( user_img_path: str, pixels_per_metric_X: float, pixels_per_metric_Y: float, -) -> None: +) -> int: res = detection.pipeline( user_img_path=user_img_path, pixels_per_metric_X=pixels_per_metric_X, pixels_per_metric_Y=pixels_per_metric_Y, ) + if res.status.code != 0: + _print_error_state(res.status, out_stream=sys.stderr) + return 1 + res.unwrap() + return 0 diff --git a/src/dopt_sensor_anomalies/detection.c b/src/dopt_sensor_anomalies/detection.c index 1bbeded..f74d3bd 100644 --- a/src/dopt_sensor_anomalies/detection.c +++ b/src/dopt_sensor_anomalies/detection.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.1.6 */ +/* Generated by Cython 3.2.0 */ /* BEGIN: Cython Metadata { @@ -34,8 +34,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x03080000 #error Cython requires Python 3.8+. #else -#define __PYX_ABI_VERSION "3_1_6" -#define CYTHON_HEX_VERSION 0x030106F0 +#define __PYX_ABI_VERSION "3_2_0" +#define CYTHON_HEX_VERSION 0x030200F0 #define CYTHON_FUTURE_DIVISION 1 /* CModulePreamble */ #include @@ -60,9 +60,6 @@ END: Cython Metadata */ #define DL_EXPORT(t) t #endif #define __PYX_COMMA , -#ifndef HAVE_LONG_LONG - #define HAVE_LONG_LONG -#endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif @@ -95,7 +92,7 @@ END: Cython Metadata */ #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_ASSUME_SAFE_SIZE @@ -132,6 +129,8 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 + #undef CYTHON_IMMORTAL_CONSTANTS + #define CYTHON_IMMORTAL_CONSTANTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 @@ -199,6 +198,8 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 + #undef CYTHON_IMMORTAL_CONSTANTS + #define CYTHON_IMMORTAL_CONSTANTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX @@ -209,8 +210,6 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 - #undef CYTHON_CLINE_IN_TRACEBACK - #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS @@ -270,8 +269,11 @@ END: Cython Metadata */ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif - #undef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 + #ifndef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 1 + #endif + #undef CYTHON_IMMORTAL_CONSTANTS + #define CYTHON_IMMORTAL_CONSTANTS 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 @@ -378,6 +380,15 @@ END: Cython Metadata */ #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) #endif + #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000 + #undef CYTHON_IMMORTAL_CONSTANTS + #define CYTHON_IMMORTAL_CONSTANTS 0 // definitely won't work + #elif !defined(CYTHON_IMMORTAL_CONSTANTS) + #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) + #endif +#endif +#ifndef CYTHON_COMPRESS_STRINGS + #define CYTHON_COMPRESS_STRINGS 1 #endif #ifndef CYTHON_FAST_PYCCALL #define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL @@ -386,10 +397,9 @@ END: Cython Metadata */ #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) #else -#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) +#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL) #endif #endif -#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #undef SHIFT #undef BASE @@ -398,9 +408,6 @@ END: Cython Metadata */ enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif -#ifndef CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME - #define CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME 100 -#endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif @@ -468,35 +475,8 @@ END: Cython Metadata */ #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) -#ifdef _MSC_VER - #ifndef _MSC_STDINT_H_ - #if _MSC_VER < 1300 - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; - #else - typedef unsigned __int8 uint8_t; - typedef unsigned __int16 uint16_t; - typedef unsigned __int32 uint32_t; - #endif - #endif - #if _MSC_VER < 1300 - #ifdef _WIN64 - typedef unsigned long long __pyx_uintptr_t; - #else - typedef unsigned int __pyx_uintptr_t; - #endif - #else - #ifdef _WIN64 - typedef unsigned __int64 __pyx_uintptr_t; - #else - typedef unsigned __int32 __pyx_uintptr_t; - #endif - #endif -#else - #include - typedef uintptr_t __pyx_uintptr_t; -#endif +#include +typedef uintptr_t __pyx_uintptr_t; #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 @@ -539,9 +519,9 @@ END: Cython Metadata */ #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000) #else - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) @@ -645,6 +625,12 @@ static int __Pyx_init_co_variables(void); #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif +#ifndef Py_TPFLAGS_IMMUTABLETYPE + #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8) +#endif +#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION + #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7) +#endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif @@ -677,11 +663,6 @@ static int __Pyx_init_co_variables(void); #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) -#elif CYTHON_BACKPORT_VECTORCALL - typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, - size_t nargsf, PyObject *kwnames); - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) - #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) @@ -711,7 +692,7 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(vo #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) -#if __PYX_LIMITED_VERSION_HEX < 0x03090000 +#if PY_VERSION_HEX < 0x03090000 || (CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000) #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else @@ -728,6 +709,9 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(vo #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000 + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno)) #elif CYTHON_COMPILING_IN_GRAAL #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno)) @@ -818,7 +802,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #endif #define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc) -#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 +#if CYTHON_USE_TYPE_SPECS #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ @@ -882,7 +866,10 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #endif #endif #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + #define __Pyx_PySequence_ListKeepNew(obj)\ + (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj)) +#elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else @@ -898,6 +885,22 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif +enum __Pyx_ReferenceSharing { + __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check + __Pyx_ReferenceSharing_OwnStrongReference, + __Pyx_ReferenceSharing_FunctionArgument, + __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar +}; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000 +#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\ + (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\ + (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\ + (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0))) +#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1) +#else +#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0) +#endif #if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) @@ -915,6 +918,12 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #else #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) #endif +#if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !CYTHON_COMPILING_IN_LIMITED_API && CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) (__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\ + __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i)) +#else + #define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) __Pyx_PyList_GetItemRef(o, i) +#endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) #elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS @@ -974,15 +983,6 @@ static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o) #endif -#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 - #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) -#else - static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { - PyObject *module = PyImport_AddModule(name); - Py_XINCREF(module); - return module; - } -#endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString) #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif @@ -1089,15 +1089,6 @@ static int __Pyx_init_co_variables(void) { #endif #endif #include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else @@ -1293,7 +1284,6 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif - static CYTHON_INLINE int __Pyx_PyLong_CompactAsLong(PyObject *x, long *return_value); #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else @@ -1385,6 +1375,7 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed) #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire) #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value) + #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired) #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) #pragma message ("Using standard C atomics") #elif defined(__PYX_DEBUG_ATOMICS) @@ -1409,6 +1400,7 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed) #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire) #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value) + #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired) #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) #pragma message ("Using standard C++ atomics") #elif defined(__PYX_DEBUG_ATOMICS) @@ -1418,6 +1410,7 @@ static const char* const __pyx_f[] = { (__GNUC_MINOR__ > 1 ||\ (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2)))) #define __pyx_atomic_ptr_type void* + #define __pyx_nonatomic_ptr_type void* #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1) #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1) #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1) @@ -1433,6 +1426,12 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0) #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0) #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value) + static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) { + __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired); + int result = old == *expected; + *expected = old; + return result; + } #ifdef __PYX_DEBUG_ATOMICS #warning "Using GNU atomics" #endif @@ -1443,6 +1442,7 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_ptr_type void* #undef __pyx_nonatomic_int_type #define __pyx_nonatomic_int_type long + #define __pyx_nonatomic_ptr_type void* #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer) #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1) #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1) @@ -1459,6 +1459,12 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0) #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value) + static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) { + __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected); + int result = old == *expected; + *expected = old; + return result; + } #ifdef __PYX_DEBUG_ATOMICS #pragma message ("Using MSVC atomics") #endif @@ -1469,33 +1475,27 @@ static const char* const __pyx_f[] = { #warning "Not using atomics" #endif #endif -#if CYTHON_ATOMICS - #define __pyx_add_acquisition_count(memview)\ - __pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview)) - #define __pyx_sub_acquisition_count(memview)\ - __pyx_atomic_decr_acq_rel(__pyx_get_slice_count_pointer(memview)) + +/* CriticalSectionsDefinition.proto */ +#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +#define __Pyx_PyCriticalSection void* +#define __Pyx_PyCriticalSection2 void* +#define __Pyx_PyCriticalSection_End(cs) +#define __Pyx_PyCriticalSection2_End(cs) #else - #define __pyx_add_acquisition_count(memview)\ - __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) - #define __pyx_sub_acquisition_count(memview)\ - __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) +#define __Pyx_PyCriticalSection PyCriticalSection +#define __Pyx_PyCriticalSection2 PyCriticalSection2 +#define __Pyx_PyCriticalSection_End PyCriticalSection_End +#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End #endif /* CriticalSections.proto */ #if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING -#define __Pyx_PyCriticalSection void* -#define __Pyx_PyCriticalSection2 void* -#define __Pyx_PyCriticalSection_Begin1(cs, arg) (void)cs -#define __Pyx_PyCriticalSection_Begin2(cs, arg1, arg2) (void)cs -#define __Pyx_PyCriticalSection_End1(cs) -#define __Pyx_PyCriticalSection_End2(cs) +#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs) +#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs) #else -#define __Pyx_PyCriticalSection PyCriticalSection -#define __Pyx_PyCriticalSection2 PyCriticalSection2 -#define __Pyx_PyCriticalSection_Begin1 PyCriticalSection_Begin -#define __Pyx_PyCriticalSection_Begin2 PyCriticalSection2_Begin -#define __Pyx_PyCriticalSection_End1 PyCriticalSection_End -#define __Pyx_PyCriticalSection_End2 PyCriticalSection2_End +#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin +#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin #endif #if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_BEGIN_CRITICAL_SECTION(o) { @@ -1584,9 +1584,9 @@ struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr /* "dopt_sensor_anomalies/detection.py":143 * ) * - * x_min = min(np.min(c[:, 0, 0]) for c in filtered_cnts) - 20 # <<<<<<<<<<<<<< - * x_max = max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20 - * y_min = min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20 + * x_min = max(min(np.min(c[:, 0, 0]) for c in filtered_cnts) - 20, 0) # <<<<<<<<<<<<<< + * x_max = min(max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20, orig.shape[1]) + * y_min = max(min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20, 0) */ struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr { PyObject_HEAD @@ -1599,10 +1599,10 @@ struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr /* "dopt_sensor_anomalies/detection.py":144 * - * x_min = min(np.min(c[:, 0, 0]) for c in filtered_cnts) - 20 - * x_max = max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20 # <<<<<<<<<<<<<< - * y_min = min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20 - * y_max = max(np.max(c[:, 0, 1]) for c in filtered_cnts) + 20 + * x_min = max(min(np.min(c[:, 0, 0]) for c in filtered_cnts) - 20, 0) + * x_max = min(max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20, orig.shape[1]) # <<<<<<<<<<<<<< + * y_min = max(min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20, 0) + * y_max = min(max(np.max(c[:, 0, 1]) for c in filtered_cnts) + 20, orig.shape[0]) */ struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr { PyObject_HEAD @@ -1614,10 +1614,10 @@ struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr /* "dopt_sensor_anomalies/detection.py":145 - * x_min = min(np.min(c[:, 0, 0]) for c in filtered_cnts) - 20 - * x_max = max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20 - * y_min = min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20 # <<<<<<<<<<<<<< - * y_max = max(np.max(c[:, 0, 1]) for c in filtered_cnts) + 20 + * x_min = max(min(np.min(c[:, 0, 0]) for c in filtered_cnts) - 20, 0) + * x_max = min(max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20, orig.shape[1]) + * y_min = max(min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20, 0) # <<<<<<<<<<<<<< + * y_max = min(max(np.max(c[:, 0, 1]) for c in filtered_cnts) + 20, orig.shape[0]) * */ struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr { @@ -1630,9 +1630,9 @@ struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr /* "dopt_sensor_anomalies/detection.py":146 - * x_max = max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20 - * y_min = min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20 - * y_max = max(np.max(c[:, 0, 1]) for c in filtered_cnts) + 20 # <<<<<<<<<<<<<< + * x_max = min(max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20, orig.shape[1]) + * y_min = max(min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20, 0) + * y_max = min(max(np.max(c[:, 0, 1]) for c in filtered_cnts) + 20, orig.shape[0]) # <<<<<<<<<<<<<< * * rightmost_x_third = max(filtered_cnts[2][:, 0, 0]) */ @@ -1837,17 +1837,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif -/* RaiseDoubleKeywords.proto */ -static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); - -/* ParseKeywords.proto */ -static CYTHON_INLINE int __Pyx_ParseKeywords( - PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[], - PyObject *kwds2, PyObject *values[], - Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, - const char* function_name, - int ignore_unknown_kwargs -); +/* py_dict_items.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d); /* CallCFunction.proto */ #define __Pyx_CallCFunction(cfunc, self, args)\ @@ -1859,35 +1850,6 @@ static CYTHON_INLINE int __Pyx_ParseKeywords( #define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\ ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames) -/* PyFunctionFastCall.proto */ -#if CYTHON_FAST_PYCALL -#if !CYTHON_VECTORCALL -#define __Pyx_PyFunction_FastCall(func, args, nargs)\ - __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs); -#endif -#define __Pyx_BUILD_ASSERT_EXPR(cond)\ - (sizeof(char [1 - 2*!(cond)]) - 1) -#ifndef Py_MEMBER_SIZE -#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) -#endif -#if !CYTHON_VECTORCALL -#if PY_VERSION_HEX >= 0x03080000 - #include "frameobject.h" - #define __Pxy_PyFrame_Initialize_Offsets() - #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) -#else - static size_t __pyx_pyframe_localsplus_offset = 0; - #include "frameobject.h" - #define __Pxy_PyFrame_Initialize_Offsets()\ - ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ - (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) - #define __Pyx_PyFrame_GetLocalsplus(frame)\ - (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) -#endif -#endif -#endif - /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); @@ -1904,6 +1866,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs); +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + /* UnpackUnboundCMethod.proto */ typedef struct { PyObject *type; @@ -1937,6 +1902,59 @@ static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_Ca #define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc) #endif +/* CallUnboundCMethod0.proto */ +CYTHON_UNUSED +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); +#else +#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) +#endif + +/* py_dict_values.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d); + +/* OwnedDictNext.proto */ +#if CYTHON_AVOID_BORROWED_REFS +static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue); +#else +CYTHON_INLINE +static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue); +#endif + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywordsImpl.export */ +static int __Pyx_ParseKeywordsTuple( + PyObject *kwds, + PyObject * const *kwvalues, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs +); +static int __Pyx_ParseKeywordDictToDict( + PyObject *kwds, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name +); +static int __Pyx_ParseKeywordDict( + PyObject *kwds, + PyObject ** const argnames[], + PyObject *values[], + Py_ssize_t num_pos_args, + Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs +); + /* CallUnboundCMethod2.proto */ CYTHON_UNUSED static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); @@ -1946,31 +1964,40 @@ static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction * #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) #endif +/* ParseKeywords.proto */ +static CYTHON_INLINE int __Pyx_ParseKeywords( + PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[], + PyObject *kwds2, PyObject *values[], + Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs +); + /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* GetItemInt.proto */ -#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck, unsafe_shared) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) -#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\ +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\ + int wraparound, int boundscheck, int unsafe_shared); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); + int wraparound, int boundscheck, int unsafe_shared); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck); + int is_list, int wraparound, int boundscheck, int unsafe_shared); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); @@ -1995,7 +2022,7 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ - (VAR) = __pyx_dict_cached_value;\ + (VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ @@ -2055,9 +2082,6 @@ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen); /* RaiseClosureNameError.proto */ static void __Pyx_RaiseClosureNameError(const char *varname); -/* PyObjectCallOneArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); - /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); @@ -2086,11 +2110,11 @@ static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *k PyObject_Format(s, f)) #endif -/* JoinPyUnicode.proto */ +/* JoinPyUnicode.export */ static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char); -/* RaiseException.proto */ +/* RaiseException.export */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* PyLongBinop.proto */ @@ -2242,7 +2266,9 @@ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectGetMethod.proto */ +#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))) static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); +#endif /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); @@ -2288,26 +2314,65 @@ static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, P /* UnicodeConcatInPlace.proto */ # if CYTHON_COMPILING_IN_CPYTHON #if CYTHON_REFNANNY - #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, __pyx_refnanny) + #define __Pyx_PyUnicode_ConcatInPlace(left, right, unsafe_shared) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, unsafe_shared, __pyx_refnanny) #else - #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right) + #define __Pyx_PyUnicode_ConcatInPlace(left, right, unsafe_shared) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, unsafe_shared) #endif - static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right + #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_DefinitelyUniqueInPlace(left, right) __Pyx_PyUnicode_ConcatInPlace(left, right, __Pyx_ReferenceSharing_DefinitelyUnique) + #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(left, right) __Pyx_PyUnicode_ConcatInPlace(left, right, __Pyx_ReferenceSharing_OwnStrongReference) + #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_FunctionArgumentInPlace(left, right) __Pyx_PyUnicode_ConcatInPlace(left, right, __Pyx_ReferenceSharing_DefinitelyUnique) + #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_SharedReferenceInPlace(left, right) __Pyx_PyUnicode_ConcatInPlace(left, right, __Pyx_ReferenceSharing_SharedReference) + static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right, int unsafe_shared #if CYTHON_REFNANNY , void* __pyx_refnanny #endif ); #else -#define __Pyx_PyUnicode_ConcatInPlace __Pyx_PyUnicode_Concat +#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_DefinitelyUniqueInPlace __Pyx_PyUnicode_Concat +#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace __Pyx_PyUnicode_Concat +#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_FunctionArgumentInPlace __Pyx_PyUnicode_Concat +#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_SharedReferenceInPlace __Pyx_PyUnicode_Concat #endif -#define __Pyx_PyUnicode_ConcatInPlaceSafe(left, right) ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ - PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_ConcatInPlace(left, right)) +#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_DefinitelyUniqueInPlaceSafe(left, right)\ + ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ + PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_DefinitelyUniqueInPlace(left, right)) +#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlaceSafe(left, right)\ + ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ + PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(left, right)) +#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_FunctionArgumentInPlaceSafe(left, right)\ + ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ + PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_FunctionArgumentInPlace(left, right)) +#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_SharedReferenceInPlaceSafe(left, right)\ + ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ + PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_SharedReferenceInPlace(left, right)) + +/* ArgTypeTestFunc.export */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) -static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* PyFileNotFoundError_Check.proto */ +#define __Pyx_PyExc_FileNotFoundError_Check(obj) __Pyx_TypeCheck(obj, PyExc_FileNotFoundError) + +/* CheckTypeForFreelists.proto */ +#if CYTHON_USE_FREELISTS +#if CYTHON_USE_TYPE_SPECS +#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t) == (expected_tp))) +#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS Py_TPFLAGS_IS_ABSTRACT +#else +#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t)->tp_basicsize == (expected_size))) +#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE) +#endif +#define __PYX_CHECK_TYPE_FOR_FREELISTS(t, expected_tp, expected_size)\ + (__PYX_CHECK_FINAL_TYPE_FOR_FREELISTS((t), (expected_tp), (expected_size)) &\ + (int) (!__Pyx_PyType_HasFeature((t), __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS))) +#endif + +/* AllocateExtensionType.proto */ +static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final); /* CallTypeTraverse.proto */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) @@ -2336,24 +2401,35 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); +/* HasAttr.proto */ +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 +#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n) +#else +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); +#endif -/* ImportDottedModule.proto */ -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); -static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); - -/* ListPack.proto */ -static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...); +/* Import.export */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); -/* FetchSharedCythonModule.proto */ -static PyObject *__Pyx_FetchSharedCythonABIModule(void); +/* PyUserWarning_Check.proto */ +#define __Pyx_PyExc_UserWarning_Check(obj) __Pyx_TypeCheck(obj, PyExc_UserWarning) /* dict_setdefault.proto */ -static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type); +static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value); + +/* AddModuleRef.proto */ +#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING ) ||\ + __PYX_LIMITED_VERSION_HEX < 0x030d0000) + static PyObject *__Pyx_PyImport_AddModuleRef(const char *name); +#else + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) +#endif + +/* FetchSharedCythonModule.proto */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases); @@ -2366,7 +2442,7 @@ static int __pyx_CommonTypesMetaclass_init(PyObject *module); static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ); /* PyVectorcallFastCallDict.proto */ -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif @@ -2400,14 +2476,15 @@ typedef struct { #else PyCMethodObject func; #endif -#if CYTHON_BACKPORT_VECTORCALL ||\ - (CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL) +#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL __pyx_vectorcallfunc func_vectorcall; #endif #if CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_dict; +#endif PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; @@ -2452,7 +2529,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) @@ -2549,6 +2626,15 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException) #endif +/* GetRuntimeVersion.proto */ +#if __PYX_LIMITED_VERSION_HEX < 0x030b0000 +static unsigned long __Pyx_cached_runtime_version = 0; +static void __Pyx_init_runtime_version(void); +#else +#define __Pyx_init_runtime_version() +#endif +static unsigned long __Pyx_get_runtime_version(void); + /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) @@ -2589,7 +2675,9 @@ typedef struct __pyx_CoroutineObject { __pyx_coroutine_body_t body; PyObject *closure; __Pyx_ExcInfoStruct gi_exc_state; +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API PyObject *gi_weakreflist; +#endif PyObject *classobj; PyObject *yieldfrom; __Pyx_pyiter_sendfunc yieldfrom_am_send; @@ -2657,12 +2745,12 @@ static PyObject *__Pyx_Generator_Next(PyObject *self); static int __pyx_Generator_init(PyObject *module); static CYTHON_INLINE PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self); -/* GetRuntimeVersion.proto */ -static unsigned long __Pyx_get_runtime_version(void); - /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); +/* DecompressString.proto */ +static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo); + /* MultiPhaseInitModuleState.proto */ #if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE static PyObject *__Pyx_State_FindModule(void*); @@ -2720,332 +2808,11 @@ int __pyx_module_is_main_dopt_sensor_anomalies__detection = 0; /* Implementation of "dopt_sensor_anomalies.detection" */ /* #### Code section: global_var ### */ -static PyObject *__pyx_builtin_UserWarning; static PyObject *__pyx_builtin_min; static PyObject *__pyx_builtin_max; static PyObject *__pyx_builtin_zip; static PyObject *__pyx_builtin_enumerate; -static PyObject *__pyx_builtin_FileNotFoundError; /* #### Code section: string_decls ### */ -static const char __pyx_k_[] = "<"; -static const char __pyx_k_a[] = "\220a"; -static const char __pyx_k_c[] = "c"; -static const char __pyx_k_i[] = "i"; -static const char __pyx_k_t[] = "t"; -static const char __pyx_k_w[] = "w"; -static const char __pyx_k_1f[] = ".1f"; -static const char __pyx_k_3f[] = ".3f"; -static const char __pyx_k__2[] = "."; -static const char __pyx_k__3[] = ","; -static const char __pyx_k__4[] = ";"; -static const char __pyx_k__5[] = "?"; -static const char __pyx_k__6[] = "\230!"; -static const char __pyx_k__7[] = "\240\001"; -static const char __pyx_k__8[] = "_"; -static const char __pyx_k_ax[] = "ax"; -static const char __pyx_k_bl[] = "bl"; -static const char __pyx_k_br[] = "br"; -static const char __pyx_k_c1[] = "c1"; -static const char __pyx_k_c2[] = "c2"; -static const char __pyx_k_dA[] = "dA"; -static const char __pyx_k_dB[] = "dB"; -static const char __pyx_k_df[] = "df"; -static const char __pyx_k_gc[] = "gc"; -static const char __pyx_k_np[] = "np"; -static const char __pyx_k_s1[] = "s1"; -static const char __pyx_k_s2[] = "s2"; -static const char __pyx_k_tl[] = "tl"; -static const char __pyx_k_to[] = "to"; -static const char __pyx_k_tr[] = "tr"; -static const char __pyx_k_x1[] = "x1"; -static const char __pyx_k_x2[] = "x2"; -static const char __pyx_k_Any[] = "Any"; -static const char __pyx_k_Box[] = "Box"; -static const char __pyx_k_PIL[] = "PIL"; -static const char __pyx_k_RGB[] = "RGB"; -static const char __pyx_k_all[] = "all"; -static const char __pyx_k_box[] = "box"; -static const char __pyx_k_cpu[] = "cpu"; -static const char __pyx_k_csv[] = ".csv"; -static const char __pyx_k_cv2[] = "cv2"; -static const char __pyx_k_img[] = "img"; -static const char __pyx_k_jet[] = "jet"; -static const char __pyx_k_max[] = "max"; -static const char __pyx_k_min[] = "min"; -static const char __pyx_k_npt[] = "npt"; -static const char __pyx_k_off[] = "off"; -static const char __pyx_k_plt[] = "plt"; -static const char __pyx_k_png[] = ".png"; -static const char __pyx_k_pop[] = "pop"; -static const char __pyx_k_sep[] = "sep"; -static const char __pyx_k_str[] = "str"; -static const char __pyx_k_zip[] = "zip"; -static const char __pyx_k_None[] = "None"; -static const char __pyx_k_Path[] = "Path"; -static const char __pyx_k_axes[] = "axes"; -static const char __pyx_k_axis[] = "axis"; -static const char __pyx_k_bool[] = "bool"; -static const char __pyx_k_cast[] = "cast"; -static const char __pyx_k_cmap[] = "cmap"; -static const char __pyx_k_cnts[] = "cnts"; -static const char __pyx_k_copy[] = "copy"; -static const char __pyx_k_cuda[] = "cuda"; -static const char __pyx_k_dimA[] = "dimA"; -static const char __pyx_k_dimB[] = "dimB"; -static const char __pyx_k_dist[] = "dist"; -static const char __pyx_k_eval[] = "eval"; -static const char __pyx_k_exit[] = "__exit__"; -static const char __pyx_k_func[] = "__func__"; -static const char __pyx_k_gray[] = "gray"; -static const char __pyx_k_item[] = "item"; -static const char __pyx_k_left[] = "left"; -static const char __pyx_k_load[] = "load"; -static const char __pyx_k_main[] = "__main__"; -static const char __pyx_k_mode[] = "mode"; -static const char __pyx_k_name[] = "__name__"; -static const char __pyx_k_next[] = "next"; -static const char __pyx_k_norm[] = "norm"; -static const char __pyx_k_orig[] = "orig"; -static const char __pyx_k_pt_A[] = "pt_A"; -static const char __pyx_k_pt_B[] = "pt_B"; -static const char __pyx_k_rbox[] = "rbox"; -static const char __pyx_k_send[] = "send"; -static const char __pyx_k_side[] = "side"; -static const char __pyx_k_spec[] = "__spec__"; -static const char __pyx_k_stem[] = "stem"; -static const char __pyx_k_test[] = "__test__"; -static const char __pyx_k_Canny[] = "Canny"; -static const char __pyx_k_Final[] = "Final"; -static const char __pyx_k_Image[] = "Image"; -static const char __pyx_k_RATIO[] = "RATIO"; -static const char __pyx_k_alpha[] = "alpha"; -static const char __pyx_k_array[] = "array"; -static const char __pyx_k_blbrX[] = "blbrX"; -static const char __pyx_k_blbrY[] = "blbrY"; -static const char __pyx_k_box_1[] = "box_1"; -static const char __pyx_k_box_2[] = "box_2"; -static const char __pyx_k_close[] = "close"; -static const char __pyx_k_const[] = "const"; -static const char __pyx_k_csv_2[] = "csv"; -static const char __pyx_k_dtype[] = "dtype"; -static const char __pyx_k_edged[] = "edged"; -static const char __pyx_k_enter[] = "__enter__"; -static const char __pyx_k_float[] = "float"; -static const char __pyx_k_image[] = "image"; -static const char __pyx_k_index[] = "index"; -static const char __pyx_k_int32[] = "int32"; -static const char __pyx_k_items[] = "items"; -static const char __pyx_k_model[] = "model"; -static const char __pyx_k_numpy[] = "numpy"; -static const char __pyx_k_right[] = "right"; -static const char __pyx_k_shape[] = "shape"; -static const char __pyx_k_t_Box[] = "t.Box"; -static const char __pyx_k_throw[] = "throw"; -static const char __pyx_k_tight[] = "tight"; -static const char __pyx_k_tlblX[] = "tlblX"; -static const char __pyx_k_tlblY[] = "tlblY"; -static const char __pyx_k_tltrX[] = "tltrX"; -static const char __pyx_k_tltrY[] = "tltrY"; -static const char __pyx_k_torch[] = "torch"; -static const char __pyx_k_trbrX[] = "trbrX"; -static const char __pyx_k_trbrY[] = "trbrY"; -static const char __pyx_k_types[] = "types"; -static const char __pyx_k_uint8[] = "uint8"; -static const char __pyx_k_value[] = "value"; -static const char __pyx_k_x_max[] = "x_max"; -static const char __pyx_k_x_min[] = "x_min"; -static const char __pyx_k_y_max[] = "y_max"; -static const char __pyx_k_y_min[] = "y_min"; -static const char __pyx_k_LAYERS[] = "LAYERS"; -static const char __pyx_k_astype[] = "astype"; -static const char __pyx_k_binary[] = "binary"; -static const char __pyx_k_closed[] = "closed"; -static const char __pyx_k_device[] = "device"; -static const char __pyx_k_enable[] = "enable"; -static const char __pyx_k_errors[] = "errors"; -static const char __pyx_k_exists[] = "exists"; -static const char __pyx_k_extend[] = "extend"; -static const char __pyx_k_header[] = "header"; -static const char __pyx_k_hspace[] = "hspace"; -static const char __pyx_k_ignore[] = "ignore"; -static const char __pyx_k_img_np[] = "img_np"; -static const char __pyx_k_imread[] = "imread"; -static const char __pyx_k_imshow[] = "imshow"; -static const char __pyx_k_kernel[] = "kernel"; -static const char __pyx_k_layers[] = "layers"; -static const char __pyx_k_linalg[] = "linalg"; -static const char __pyx_k_module[] = "__module__"; -static const char __pyx_k_output[] = "output"; -static const char __pyx_k_pandas[] = "pandas"; -static const char __pyx_k_parent[] = "parent"; -static const char __pyx_k_pyplot[] = "pyplot"; -static const char __pyx_k_resize[] = "resize"; -static const char __pyx_k_result[] = "result"; -static const char __pyx_k_return[] = "return"; -static const char __pyx_k_to_csv[] = "to_csv"; -static const char __pyx_k_typing[] = "typing"; -static const char __pyx_k_wspace[] = "wspace"; -static const char __pyx_k_NDArray[] = "NDArray"; -static const char __pyx_k_convert[] = "convert"; -static const char __pyx_k_cropped[] = "cropped"; -static const char __pyx_k_disable[] = "disable"; -static const char __pyx_k_figsize[] = "figsize"; -static const char __pyx_k_float32[] = "float32"; -static const char __pyx_k_genexpr[] = "genexpr"; -static const char __pyx_k_imutils[] = "imutils"; -static const char __pyx_k_message[] = "message"; -static const char __pyx_k_no_grad[] = "no_grad"; -static const char __pyx_k_pathlib[] = "pathlib"; -static const char __pyx_k_permute[] = "permute"; -static const char __pyx_k_quoting[] = "quoting"; -static const char __pyx_k_savefig[] = "savefig"; -static const char __pyx_k_squeeze[] = "squeeze"; -static const char __pyx_k_BACKBONE[] = "BACKBONE"; -static const char __pyx_k_add_note[] = "add_note"; -static const char __pyx_k_backbone[] = "backbone"; -static const char __pyx_k_category[] = "category"; -static const char __pyx_k_contours[] = "contours"; -static const char __pyx_k_cvtColor[] = "cvtColor"; -static const char __pyx_k_data_csv[] = "data_csv"; -static const char __pyx_k_distance[] = "distance"; -static const char __pyx_k_existing[] = "existing"; -static const char __pyx_k_expected[] = ", expected = "; -static const char __pyx_k_image_np[] = "image_np"; -static const char __pyx_k_img_path[] = "img_path"; -static const char __pyx_k_midpoint[] = "midpoint"; -static const char __pyx_k_pipeline[] = "pipeline"; -static const char __pyx_k_qualname[] = "__qualname__"; -static const char __pyx_k_set_name[] = "__set_name__"; -static const char __pyx_k_subplots[] = "subplots"; -static const char __pyx_k_warnings[] = "warnings"; -static const char __pyx_k_x_coords[] = "x_coords"; -static const char __pyx_k_x_middle[] = "x_middle"; -static const char __pyx_k_DataFrame[] = "DataFrame"; -static const char __pyx_k_Patchcore[] = "Patchcore"; -static const char __pyx_k_RETR_TREE[] = "RETR_TREE"; -static const char __pyx_k_boxPoints[] = "boxPoints"; -static const char __pyx_k_constants[] = "constants"; -static const char __pyx_k_enumerate[] = "enumerate"; -static const char __pyx_k_euclidean[] = "euclidean"; -static const char __pyx_k_file_path[] = "file_path"; -static const char __pyx_k_file_stem[] = "file_stem"; -static const char __pyx_k_fromarray[] = "fromarray"; -static const char __pyx_k_image_rgb[] = "image_rgb"; -static const char __pyx_k_is_sorted[] = "is_sorted"; -static const char __pyx_k_isenabled[] = "isenabled"; -static const char __pyx_k_pil_image[] = "pil_image"; -static const char __pyx_k_size_diff[] = "size_diff"; -static const char __pyx_k_t_CsvData[] = "t.CsvData"; -static const char __pyx_k_threshold[] = "threshold"; -static const char __pyx_k_tolerance[] = "tolerance"; -static const char __pyx_k_unsqueeze[] = "unsqueeze"; -static const char __pyx_k_MORPH_RECT[] = "MORPH_RECT"; -static const char __pyx_k_QUOTE_NONE[] = "QUOTE_NONE"; -static const char __pyx_k_checkpoint[] = "checkpoint"; -static const char __pyx_k_find_paths[] = "_find_paths"; -static const char __pyx_k_from_numpy[] = "from_numpy"; -static const char __pyx_k_matplotlib[] = "matplotlib"; -static const char __pyx_k_pad_inches[] = "pad_inches"; -static const char __pyx_k_pred_label[] = "pred_label"; -static const char __pyx_k_pred_score[] = "pred_score"; -static const char __pyx_k_MORPH_CLOSE[] = "MORPH_CLOSE"; -static const char __pyx_k_UserWarning[] = "UserWarning"; -static const char __pyx_k_anomaly_map[] = "anomaly_map"; -static const char __pyx_k_bbox_inches[] = "bbox_inches"; -static const char __pyx_k_center_dist[] = "center_dist"; -static const char __pyx_k_dopt_basics[] = "dopt_basics"; -static const char __pyx_k_folder_path[] = "folder_path"; -static const char __pyx_k_infer_image[] = "infer_image"; -static const char __pyx_k_minAreaRect[] = "minAreaRect"; -static const char __pyx_k_perspective[] = "perspective"; -static const char __pyx_k_wrap_result[] = "wrap_result"; -static const char __pyx_k_MODEL_FOLDER[] = "MODEL_FOLDER"; -static const char __pyx_k_SensorImages[] = "SensorImages"; -static const char __pyx_k_THRESHOLD_BW[] = "THRESHOLD_BW"; -static const char __pyx_k_boundingRect[] = "boundingRect"; -static const char __pyx_k_findContours[] = "findContours"; -static const char __pyx_k_initializing[] = "_initializing"; -static const char __pyx_k_input_tensor[] = "input_tensor"; -static const char __pyx_k_is_available[] = "is_available"; -static const char __pyx_k_is_coroutine[] = "_is_coroutine"; -static const char __pyx_k_is_duplicate[] = "is_duplicate"; -static const char __pyx_k_morphologyEx[] = "morphologyEx"; -static const char __pyx_k_num_contours[] = "num_contours"; -static const char __pyx_k_numpy_typing[] = "numpy.typing"; -static const char __pyx_k_order_points[] = "order_points"; -static const char __pyx_k_torch_device[] = "torch_device"; -static const char __pyx_k_COLOR_BGR2RGB[] = "COLOR_BGR2RGB"; -static const char __pyx_k_THRESH_BINARY[] = "THRESH_BINARY"; -static const char __pyx_k_anomaly_label[] = "anomaly_label"; -static const char __pyx_k_anomaly_score[] = "anomaly_score"; -static const char __pyx_k_class_getitem[] = "__class_getitem__"; -static const char __pyx_k_filtered_cnts[] = "filtered_cnts"; -static const char __pyx_k_grab_contours[] = "grab_contours"; -static const char __pyx_k_scipy_spatial[] = "scipy.spatial"; -static const char __pyx_k_sensor_images[] = "sensor_images"; -static const char __pyx_k_sort_contours[] = "sort_contours"; -static const char __pyx_k_user_img_path[] = "user_img_path"; -static const char __pyx_k_COLOR_BGR2GRAY[] = "COLOR_BGR2GRAY"; -static const char __pyx_k_accepted_boxes[] = "accepted_boxes"; -static const char __pyx_k_filterwarnings[] = "filterwarnings"; -static const char __pyx_k_measure_length[] = "measure_length"; -static const char __pyx_k_result_pattern[] = "result_pattern"; -static const char __pyx_k_t_SensorImages[] = "t.SensorImages"; -static const char __pyx_k_AT_Rt1D_AS_at2Q[] = "\200\001\330\n\013\330\n\013\330\005\006\330\004\014\210A\210T\220\021\220#\220R\220t\2301\230D\240\002\240&\250\004\250A\250S\260\002\260$\260a\260t\2702\270Q"; -static const char __pyx_k_InferenceResult[] = "InferenceResult"; -static const char __pyx_k_anomalib_models[] = "anomalib.models"; -static const char __pyx_k_load_state_dict[] = "load_state_dict"; -static const char __pyx_k_subplots_adjust[] = "subplots_adjust"; -static const char __pyx_k_DETECTION_MODELS[] = "DETECTION_MODELS"; -static const char __pyx_k_detection_models[] = "detection_models"; -static const char __pyx_k_get_model_folder[] = "get_model_folder"; -static const char __pyx_k_model_state_dict[] = "model_state_dict"; -static const char __pyx_k_FileNotFoundError[] = "FileNotFoundError"; -static const char __pyx_k_ImageNotReadError[] = "ImageNotReadError"; -static const char __pyx_k_anomaly_detection[] = "anomaly_detection"; -static const char __pyx_k_leftmost_x_fourth[] = "leftmost_x_fourth"; -static const char __pyx_k_matplotlib_pyplot[] = "matplotlib.pyplot"; -static const char __pyx_k_rightmost_x_third[] = "rightmost_x_third"; -static const char __pyx_k_t_DetectionModels[] = "t.DetectionModels"; -static const char __pyx_k_t_InferenceResult[] = "t.InferenceResult"; -static const char __pyx_k_tuple_float_float[] = "tuple[float, float]"; -static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; -static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; -static const char __pyx_k_CHAIN_APPROX_SIMPLE[] = "CHAIN_APPROX_SIMPLE"; -static const char __pyx_k_anomaly_map_resized[] = "anomaly_map_resized"; -static const char __pyx_k_cropped_sensor_left[] = "cropped_sensor_left"; -static const char __pyx_k_pixels_per_metric_X[] = "pixels_per_metric_X"; -static const char __pyx_k_pixels_per_metric_Y[] = "pixels_per_metric_Y"; -static const char __pyx_k_NUM_VALID_ELECTRODES[] = "NUM_VALID_ELECTRODES"; -static const char __pyx_k_check_box_redundancy[] = "check_box_redundancy"; -static const char __pyx_k_cropped_sensor_right[] = "cropped_sensor_right"; -static const char __pyx_k_get_detection_models[] = "get_detection_models"; -static const char __pyx_k_npt_NDArray_np_uint8[] = "npt.NDArray[np.uint8]"; -static const char __pyx_k_InvalidElectrodeCount[] = "InvalidElectrodeCount"; -static const char __pyx_k_dopt_sensor_anomalies[] = "dopt_sensor_anomalies"; -static const char __pyx_k_getStructuringElement[] = "getStructuringElement"; -static const char __pyx_k_coreset_sampling_ratio[] = "coreset_sampling_ratio"; -static const char __pyx_k_ContourCalculationError[] = "ContourCalculationError"; -static const char __pyx_k_HEATMAP_FILENAME_SUFFIX[] = "HEATMAP_FILENAME_SUFFIX"; -static const char __pyx_k_npt_NDArray_np_floating[] = "npt.NDArray[np.floating]"; -static const char __pyx_k_AQ_t9G1_q_5_ARRS_aq_nA_Q_a[] = "\200\001\340\023\024\330\031\032\330\031\032\330\005\006\330\004\020\220\004\220A\220Q\330\004\007\200t\2109\220G\2301\330\010\016\320\016\037\230q\240\001\340\004 \320 5\260\\\320AR\320RS\330\004\005\330\010\035\230\\\320)>\270a\270q\360\006\000\005\017\320\016\036\230n\250A\330\010\023\320\023(\250\001\340\004\025\220Q\330\010\021\220\021\330\010\031\230\021\330\010\021\220\021\330\010\026\220a"; -static const char __pyx_k_Image_could_not_be_read_from[] = "Image could not be read from: >"; -static const char __pyx_k_measure_length_locals_genexpr[] = "measure_length..genexpr"; -static const char __pyx_k_tuple_t_CsvData_t_SensorImages[] = "tuple[t.CsvData, t.SensorImages]"; -static const char __pyx_k_5_q_uM_AQ_9AWCq_Zq_r_q_Jb_5_1IX[] = "\200\001\330\013\014\330\013\014\330\005\006\330\004\023\2205\230\007\230q\240\n\250%\250u\260M\300\030\310\021\330\004\t\210\023\210A\210Q\340\004\020\220\003\2209\230A\230W\240C\240q\330\004\020\220\005\220Z\230q\240\001\330\004\020\220\t\230\030\240\021\240!\330\004\017\210r\220\026\220q\230\n\240'\250\021\250\"\250J\260b\270\001\330\004\023\2205\230\013\2401\240I\250X\260Q\260c\270\023\270A\340\004\023\220<\230z\250\021\250!\330\004\023\220<\230s\240!\2401\340\004\t\210\025\210a\330\t\016\210h\220a\330\010\021\220\025\220a\220q\340\004\024\220F\230+\240U\250!\330\004\024\220F\230+\240U\250!\330\004\022\220&\230\014\240H\250B\250d\260\"\260F\270!\340\004\r\210R\210v\220Q\220a\330\004\032\230#\230W\240A\240^\2606\270\026\270q\300\004\300F\310&\320PQ\320QR\340\004\013\2101\320\014\034\230A\330\010\014\210A\330\010\034\230A\330\010\026\220a\330\010\026\220a"; -static const char __pyx_k_Cwas_1_vS_f_ar_LA_e1D_fE_q_2Q_7[] = "\200\001\330\016\017\330\031\032\330\031\032\330\005\006\330\004 \240\001\330\004\014\210C\210w\220a\220s\230!\2301\330\004\007\200v\210S\220\001\330\010\016\210f\320\024&\240a\240r\320)L\310A\340\004\016\210e\2201\220D\230\006\230f\240E\250\026\250q\260\003\2602\260Q\330\004\013\2107\220%\220q\340\004\013\2103\210i\220q\230\t\240\023\240A\330\004\007\200y\220\003\220:\230Q\230f\240E\250\037\270\005\270S\300\001\340\004\r\210S\320\020&\240a\240s\250.\270\003\2701\330\004\r\210S\220\r\230Q\230h\240c\250\036\260q\330\004\014\210C\210v\220Q\220h\230d\240!\340\004\013\2103\210m\2301\230E\240\025\240d\250#\250\\\270\023\270A\330\004\013\2107\220.\240\001\240\021\330\004\007\200u\210C\210q\330\010\016\210f\320\024,\250A\330\014\r\360\006\000\005\013\210$\210h\220n\240A\240Q\330\004\017\210q\220\003\220=\240\001\240\022\2401\240C\240t\2505\260\001\330\004\020\220\002\220$\220d\230!\330\004\007\200t\2101\330\010\016\210f\320\024,\250A\330\014\r\360\006\000\005#\240!\330\004\037\230q\340\004\010\210\005\210Q\330\010\017\210t\2201\220A\220V\2303\230l\250!\2501\330\010\016\210c\220\032\2301\230A\330\010\016\210b\220\006\220a\220u\230F\240\"\240A\330\010\016\210d\220!\2203\220h\230a\230r\240\033\250K\260}\300A\300Q\340\t\r\210T\220\024\220V\2301\330\t\020\220\t\230\030\240\021\240$\240a\330\t\020\220\t\230\030\240\021\240$\240a\330\t\020\220\t\230\030\240\021\240$\240a\330\t\020\220\t\230\030\240\021\240$\240a\340\010\r\210T\220\032\2302\230W\240I\250W\260A\330\010\r\210T\220\032\2302\230W\240I\250W\260A\340\010\013\2103\210b\220\004\220C\220s\230\"\230A\330\014\r\340\010\032\230!\330 !\340\010\013\2101\330\014\r\340\010\026\220g\230Q\230a\330\010\025\220W\230A\230Q\340\010\017\210s\220\"\220A\330\010\017\210s\220\"\220A\340\010\020\220\007\220q\330\014\r\330\022\026\220g\230X\240Q\240e\2501\330\022\026\220g\230X\240Q\240e\2501\330\022\026\220e\2302\230W\240H\250A\250U\260!\360\010\000\005\010\200t\2101\330\010\016\210f\320\024,\250A\330\014\r\360\006\000\005\024\2203\220a\220q""\330\004\007\200}\220C\220u\230A\330\010\016\210f\320\024*\250!\330\014\016\210a\330\016*\320*E\300U\310!\360\006\000\005\r\210C\210w\320\026;\2702\270Q\330\004\014\210C\210w\320\026;\2702\270Q\330\004\014\210C\210w\320\026;\2702\270Q\330\004\014\210C\210w\320\026;\2702\270Q\340\004\030\230\003\2301\230M\250\021\250\"\250D\260\003\2601\330\004\030\230\003\2301\230M\250\021\250\"\250D\260\003\2601\330\004\017\320\017!\240\022\2403\240b\320(:\270\"\320\270f\300A"; -static const char __pyx_k_IQ_k_Y6MURS_wc_3c_a_F_IQm6_AS_9[] = "\200\001\330\016\017\330\026\027\330\016\017\330\023\024\330\005\006\330\004\020\220\010\230\001\330\004\022\220(\230!\340\004\014\210I\220Q\330\010\021\220\025\220k\240\027\250\005\250Y\3206M\310U\320RS\340\004\007\200w\210c\220\031\230!\2303\230c\240\031\250$\250a\340\004\010\210\004\210F\220*\230I\240Q\240m\2606\270\021\330\010\020\220\004\220A\220S\230\010\240\001\240\022\2409\250A\330\010\025\220U\230%\230q\320 0\260\001\260\021\330\010\r\320\r\035\230Q\230j\250\001\250\021\340\010\021\220\033\230A\230W\240A\330\010\020\220\007\220q\230\001\230\023\230A\230V\2401\340\010\r\210T\220\021\220!\330\010\n\210%\210q\220\001\330\010\n\210'\220\021\220'\230\026\230q\330\010\n\210'\220\021\220&\320\030.\250e\2607\270&\300\001\340\004\007\320\007\027\220q\230\007\230s\240'\250\021\330\004\007\200x\210q\330\t\025\220R\220r\230\024\230[\250\005\250Q\330\010\024\220A\330\010\023\2201\340\004\007\200v\210Q\340\004\t\210\031\220!\2201\220A\330\004\006\200g\210Q\330\t\025\220R\220r\230\024\230Q\330\010\r\210Q\330\010\016\210a\330\010\017\210q\330\010\020\220\003\2201\330\010\014\210A"; -static const char __pyx_k_dopt_sensor_anomalies_detection[] = "dopt_sensor_anomalies.detection"; -static const char __pyx_k_huggingface_hub_cache_system_us[] = ".*huggingface_hub.*cache-system uses symlinks.*"; -static const char __pyx_k_q_D_D_q_q_awb_uARvQd_BfAQ_AWBgU[] = "\200\001\330\013\014\330\013\014\330\004\017\210q\330\005\006\330\004\010\210\004\210D\220\001\330\004\010\210\004\210D\220\001\330\004\017\210q\220\001\330\004\017\210q\220\001\340\004\022\220$\220a\220w\230b\240\007\240u\250A\250R\250v\260Q\260d\270\"\270B\270f\300A\300Q\330\004\020\220\004\220A\220W\230B\230g\240U\250!\2502\250V\2601\260D\270\002\270\"\270F\300!\3001\340\004\013\2104\210q\220\014\230B\230j\250\004\250J\260b\270\001"; -static const char __pyx_k_Contour_detection_not_valid_cont[] = "Contour detection not valid: contours are not properly sorted from left to right."; -static const char __pyx_k_Contour_detection_not_valid_no_c[] = "Contour detection not valid: no contours recognized"; -static const char __pyx_k_No_contours_were_found_in_the_pr[] = "No contours were found in the provided image. Can not continue analysis."; -static const char __pyx_k_Note_that_Cython_is_deliberately[] = "Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False."; -static const char __pyx_k_Number_of_counted_electrodes_doe[] = "Number of counted electrodes does not match the expected value: count = "; -static const char __pyx_k_The_provided_path_seems_not_to_e[] = "The provided path seems not to exist"; -static const char __pyx_k_dopt_sensor_anomalies__find_path[] = "dopt_sensor_anomalies._find_paths"; -static const char __pyx_k_src_dopt_sensor_anomalies_detect[] = "src/dopt_sensor_anomalies/detection.py"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_midpoint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pt_A, PyObject *__pyx_v_pt_B); /* proto */ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_2check_box_redundancy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_box_1, PyObject *__pyx_v_box_2, double __pyx_v_tolerance); /* proto */ @@ -3086,24 +2853,6 @@ typedef struct { PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; - #ifdef __Pyx_CyFunction_USED - PyTypeObject *__pyx_CyFunctionType; - #endif - #ifdef __Pyx_FusedFunction_USED - PyTypeObject *__pyx_FusedFunctionType; - #endif - #ifdef __Pyx_Generator_USED - PyTypeObject *__pyx_GeneratorType; - #endif - #ifdef __Pyx_IterableCoroutine_USED - PyTypeObject *__pyx_IterableCoroutineType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineAwaitType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineType; - #endif PyObject *__pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length; PyObject *__pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr; PyObject *__pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr; @@ -3118,27 +2867,14 @@ typedef struct { PyTypeObject *__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr; PyTypeObject *__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr; PyTypeObject *__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values; PyObject *__pyx_slice[2]; - PyObject *__pyx_tuple[10]; + PyObject *__pyx_tuple[7]; PyObject *__pyx_codeobj_tab[12]; - PyObject *__pyx_string_tab[310]; - PyObject *__pyx_float_0_5; - PyObject *__pyx_float_0_8; - PyObject *__pyx_float_2_0; - PyObject *__pyx_float_255_0; - PyObject *__pyx_int_0; - PyObject *__pyx_int_1; - PyObject *__pyx_int_2; - PyObject *__pyx_int_5; - PyObject *__pyx_int_6; - PyObject *__pyx_int_12; - PyObject *__pyx_int_20; - PyObject *__pyx_int_50; - PyObject *__pyx_int_100; - PyObject *__pyx_int_255; - PyObject *__pyx_int_500; - PyObject *__pyx_int_1500; + PyObject *__pyx_string_tab[315]; + PyObject *__pyx_number_tab[17]; /* #### Code section: module_state_contents ### */ #if CYTHON_USE_FREELISTS @@ -3183,6 +2919,9 @@ PyTypeObject *__pyx_CommonTypesMetaclassType; PyObject *__Pyx_CachedMethodType; #endif +/* CythonFunctionShared.module_state_decls */ +PyTypeObject *__pyx_CyFunctionType; + /* CodeObjectCache.module_state_decls */ struct __Pyx_CodeObjectCache __pyx_code_cache; @@ -3191,6 +2930,9 @@ struct __Pyx_CodeObjectCache __pyx_code_cache; PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache; #endif +/* Generator.module_state_decls */ +PyTypeObject *__pyx_GeneratorType; + /* #### Code section: module_state_end ### */ } __pyx_mstatetype; @@ -3219,313 +2961,335 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_kp_u_ __pyx_string_tab[0] #define __pyx_kp_u_1f __pyx_string_tab[1] #define __pyx_kp_u_3f __pyx_string_tab[2] -#define __pyx_n_u_Any __pyx_string_tab[3] -#define __pyx_n_u_BACKBONE __pyx_string_tab[4] -#define __pyx_n_u_Box __pyx_string_tab[5] -#define __pyx_n_u_CHAIN_APPROX_SIMPLE __pyx_string_tab[6] -#define __pyx_n_u_COLOR_BGR2GRAY __pyx_string_tab[7] -#define __pyx_n_u_COLOR_BGR2RGB __pyx_string_tab[8] -#define __pyx_n_u_Canny __pyx_string_tab[9] -#define __pyx_n_u_ContourCalculationError __pyx_string_tab[10] -#define __pyx_kp_u_Contour_detection_not_valid_cont __pyx_string_tab[11] -#define __pyx_kp_u_Contour_detection_not_valid_no_c __pyx_string_tab[12] -#define __pyx_n_u_DETECTION_MODELS __pyx_string_tab[13] -#define __pyx_n_u_DataFrame __pyx_string_tab[14] -#define __pyx_n_u_FileNotFoundError __pyx_string_tab[15] -#define __pyx_n_u_Final __pyx_string_tab[16] -#define __pyx_n_u_HEATMAP_FILENAME_SUFFIX __pyx_string_tab[17] -#define __pyx_n_u_Image __pyx_string_tab[18] -#define __pyx_n_u_ImageNotReadError __pyx_string_tab[19] -#define __pyx_kp_u_Image_could_not_be_read_from __pyx_string_tab[20] -#define __pyx_n_u_InferenceResult __pyx_string_tab[21] -#define __pyx_n_u_InvalidElectrodeCount __pyx_string_tab[22] -#define __pyx_n_u_LAYERS __pyx_string_tab[23] -#define __pyx_n_u_MODEL_FOLDER __pyx_string_tab[24] -#define __pyx_n_u_MORPH_CLOSE __pyx_string_tab[25] -#define __pyx_n_u_MORPH_RECT __pyx_string_tab[26] -#define __pyx_n_u_NDArray __pyx_string_tab[27] -#define __pyx_n_u_NUM_VALID_ELECTRODES __pyx_string_tab[28] -#define __pyx_kp_u_No_contours_were_found_in_the_pr __pyx_string_tab[29] -#define __pyx_n_u_None __pyx_string_tab[30] -#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[31] -#define __pyx_kp_u_Number_of_counted_electrodes_doe __pyx_string_tab[32] -#define __pyx_n_u_PIL __pyx_string_tab[33] -#define __pyx_n_u_Patchcore __pyx_string_tab[34] -#define __pyx_n_u_Path __pyx_string_tab[35] -#define __pyx_n_u_QUOTE_NONE __pyx_string_tab[36] -#define __pyx_n_u_RATIO __pyx_string_tab[37] -#define __pyx_n_u_RETR_TREE __pyx_string_tab[38] -#define __pyx_n_u_RGB __pyx_string_tab[39] -#define __pyx_n_u_SensorImages __pyx_string_tab[40] -#define __pyx_n_u_THRESHOLD_BW __pyx_string_tab[41] -#define __pyx_n_u_THRESH_BINARY __pyx_string_tab[42] -#define __pyx_kp_u_The_provided_path_seems_not_to_e __pyx_string_tab[43] -#define __pyx_n_u_UserWarning __pyx_string_tab[44] -#define __pyx_kp_u__2 __pyx_string_tab[45] -#define __pyx_kp_u__3 __pyx_string_tab[46] -#define __pyx_kp_u__4 __pyx_string_tab[47] -#define __pyx_kp_u__5 __pyx_string_tab[48] -#define __pyx_n_u__8 __pyx_string_tab[49] -#define __pyx_n_u_accepted_boxes __pyx_string_tab[50] -#define __pyx_kp_u_add_note __pyx_string_tab[51] -#define __pyx_n_u_all __pyx_string_tab[52] -#define __pyx_n_u_alpha __pyx_string_tab[53] -#define __pyx_n_u_anomalib_models __pyx_string_tab[54] -#define __pyx_n_u_anomaly_detection __pyx_string_tab[55] -#define __pyx_n_u_anomaly_label __pyx_string_tab[56] -#define __pyx_n_u_anomaly_map __pyx_string_tab[57] -#define __pyx_n_u_anomaly_map_resized __pyx_string_tab[58] -#define __pyx_n_u_anomaly_score __pyx_string_tab[59] -#define __pyx_n_u_array __pyx_string_tab[60] -#define __pyx_n_u_astype __pyx_string_tab[61] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[62] -#define __pyx_n_u_ax __pyx_string_tab[63] -#define __pyx_n_u_axes __pyx_string_tab[64] -#define __pyx_n_u_axis __pyx_string_tab[65] -#define __pyx_n_u_backbone __pyx_string_tab[66] -#define __pyx_n_u_bbox_inches __pyx_string_tab[67] -#define __pyx_n_u_binary __pyx_string_tab[68] -#define __pyx_n_u_bl __pyx_string_tab[69] -#define __pyx_n_u_blbrX __pyx_string_tab[70] -#define __pyx_n_u_blbrY __pyx_string_tab[71] -#define __pyx_n_u_bool __pyx_string_tab[72] -#define __pyx_n_u_boundingRect __pyx_string_tab[73] -#define __pyx_n_u_box __pyx_string_tab[74] -#define __pyx_n_u_boxPoints __pyx_string_tab[75] -#define __pyx_n_u_box_1 __pyx_string_tab[76] -#define __pyx_n_u_box_2 __pyx_string_tab[77] -#define __pyx_n_u_br __pyx_string_tab[78] -#define __pyx_n_u_c __pyx_string_tab[79] -#define __pyx_n_u_c1 __pyx_string_tab[80] -#define __pyx_n_u_c2 __pyx_string_tab[81] -#define __pyx_n_u_cast __pyx_string_tab[82] -#define __pyx_n_u_category __pyx_string_tab[83] -#define __pyx_n_u_center_dist __pyx_string_tab[84] -#define __pyx_n_u_check_box_redundancy __pyx_string_tab[85] -#define __pyx_n_u_checkpoint __pyx_string_tab[86] -#define __pyx_n_u_class_getitem __pyx_string_tab[87] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[88] -#define __pyx_n_u_close __pyx_string_tab[89] -#define __pyx_n_u_closed __pyx_string_tab[90] -#define __pyx_n_u_cmap __pyx_string_tab[91] -#define __pyx_n_u_cnts __pyx_string_tab[92] -#define __pyx_n_u_const __pyx_string_tab[93] -#define __pyx_n_u_constants __pyx_string_tab[94] -#define __pyx_n_u_contours __pyx_string_tab[95] -#define __pyx_n_u_convert __pyx_string_tab[96] -#define __pyx_n_u_copy __pyx_string_tab[97] -#define __pyx_n_u_coreset_sampling_ratio __pyx_string_tab[98] -#define __pyx_n_u_cpu __pyx_string_tab[99] -#define __pyx_n_u_cropped __pyx_string_tab[100] -#define __pyx_n_u_cropped_sensor_left __pyx_string_tab[101] -#define __pyx_n_u_cropped_sensor_right __pyx_string_tab[102] -#define __pyx_kp_u_csv __pyx_string_tab[103] -#define __pyx_n_u_csv_2 __pyx_string_tab[104] -#define __pyx_n_u_cuda __pyx_string_tab[105] -#define __pyx_n_u_cv2 __pyx_string_tab[106] -#define __pyx_n_u_cvtColor __pyx_string_tab[107] -#define __pyx_n_u_dA __pyx_string_tab[108] -#define __pyx_n_u_dB __pyx_string_tab[109] -#define __pyx_n_u_data_csv __pyx_string_tab[110] -#define __pyx_n_u_detection_models __pyx_string_tab[111] -#define __pyx_n_u_device __pyx_string_tab[112] -#define __pyx_n_u_df __pyx_string_tab[113] -#define __pyx_n_u_dimA __pyx_string_tab[114] -#define __pyx_n_u_dimB __pyx_string_tab[115] -#define __pyx_kp_u_disable __pyx_string_tab[116] -#define __pyx_n_u_dist __pyx_string_tab[117] -#define __pyx_n_u_distance __pyx_string_tab[118] -#define __pyx_n_u_dopt_basics __pyx_string_tab[119] -#define __pyx_n_u_dopt_sensor_anomalies __pyx_string_tab[120] -#define __pyx_n_u_dopt_sensor_anomalies__find_path __pyx_string_tab[121] -#define __pyx_n_u_dopt_sensor_anomalies_detection __pyx_string_tab[122] -#define __pyx_n_u_dtype __pyx_string_tab[123] -#define __pyx_n_u_edged __pyx_string_tab[124] -#define __pyx_kp_u_enable __pyx_string_tab[125] -#define __pyx_n_u_enter __pyx_string_tab[126] -#define __pyx_n_u_enumerate __pyx_string_tab[127] -#define __pyx_n_u_errors __pyx_string_tab[128] -#define __pyx_n_u_euclidean __pyx_string_tab[129] -#define __pyx_n_u_eval __pyx_string_tab[130] -#define __pyx_n_u_existing __pyx_string_tab[131] -#define __pyx_n_u_exists __pyx_string_tab[132] -#define __pyx_n_u_exit __pyx_string_tab[133] -#define __pyx_kp_u_expected __pyx_string_tab[134] -#define __pyx_n_u_extend __pyx_string_tab[135] -#define __pyx_n_u_figsize __pyx_string_tab[136] -#define __pyx_n_u_file_path __pyx_string_tab[137] -#define __pyx_n_u_file_stem __pyx_string_tab[138] -#define __pyx_n_u_filtered_cnts __pyx_string_tab[139] -#define __pyx_n_u_filterwarnings __pyx_string_tab[140] -#define __pyx_n_u_findContours __pyx_string_tab[141] -#define __pyx_n_u_find_paths __pyx_string_tab[142] -#define __pyx_n_u_float __pyx_string_tab[143] -#define __pyx_n_u_float32 __pyx_string_tab[144] -#define __pyx_n_u_folder_path __pyx_string_tab[145] -#define __pyx_n_u_from_numpy __pyx_string_tab[146] -#define __pyx_n_u_fromarray __pyx_string_tab[147] -#define __pyx_n_u_func __pyx_string_tab[148] -#define __pyx_kp_u_gc __pyx_string_tab[149] -#define __pyx_n_u_genexpr __pyx_string_tab[150] -#define __pyx_n_u_getStructuringElement __pyx_string_tab[151] -#define __pyx_n_u_get_detection_models __pyx_string_tab[152] -#define __pyx_n_u_get_model_folder __pyx_string_tab[153] -#define __pyx_n_u_grab_contours __pyx_string_tab[154] -#define __pyx_n_u_gray __pyx_string_tab[155] -#define __pyx_n_u_header __pyx_string_tab[156] -#define __pyx_n_u_hspace __pyx_string_tab[157] -#define __pyx_kp_u_huggingface_hub_cache_system_us __pyx_string_tab[158] -#define __pyx_n_u_i __pyx_string_tab[159] -#define __pyx_n_u_ignore __pyx_string_tab[160] -#define __pyx_n_u_image __pyx_string_tab[161] -#define __pyx_n_u_image_np __pyx_string_tab[162] -#define __pyx_n_u_image_rgb __pyx_string_tab[163] -#define __pyx_n_u_img __pyx_string_tab[164] -#define __pyx_n_u_img_np __pyx_string_tab[165] -#define __pyx_n_u_img_path __pyx_string_tab[166] -#define __pyx_n_u_imread __pyx_string_tab[167] -#define __pyx_n_u_imshow __pyx_string_tab[168] -#define __pyx_n_u_imutils __pyx_string_tab[169] -#define __pyx_n_u_index __pyx_string_tab[170] -#define __pyx_n_u_infer_image __pyx_string_tab[171] -#define __pyx_n_u_initializing __pyx_string_tab[172] -#define __pyx_n_u_input_tensor __pyx_string_tab[173] -#define __pyx_n_u_int32 __pyx_string_tab[174] -#define __pyx_n_u_is_available __pyx_string_tab[175] -#define __pyx_n_u_is_coroutine __pyx_string_tab[176] -#define __pyx_n_u_is_duplicate __pyx_string_tab[177] -#define __pyx_n_u_is_sorted __pyx_string_tab[178] -#define __pyx_kp_u_isenabled __pyx_string_tab[179] -#define __pyx_n_u_item __pyx_string_tab[180] -#define __pyx_n_u_items __pyx_string_tab[181] -#define __pyx_n_u_jet __pyx_string_tab[182] -#define __pyx_n_u_kernel __pyx_string_tab[183] -#define __pyx_n_u_layers __pyx_string_tab[184] -#define __pyx_n_u_left __pyx_string_tab[185] -#define __pyx_n_u_leftmost_x_fourth __pyx_string_tab[186] -#define __pyx_n_u_linalg __pyx_string_tab[187] -#define __pyx_n_u_load __pyx_string_tab[188] -#define __pyx_n_u_load_state_dict __pyx_string_tab[189] -#define __pyx_n_u_main __pyx_string_tab[190] -#define __pyx_n_u_matplotlib __pyx_string_tab[191] -#define __pyx_n_u_matplotlib_pyplot __pyx_string_tab[192] -#define __pyx_n_u_max __pyx_string_tab[193] -#define __pyx_n_u_measure_length __pyx_string_tab[194] -#define __pyx_n_u_measure_length_locals_genexpr __pyx_string_tab[195] -#define __pyx_n_u_message __pyx_string_tab[196] -#define __pyx_n_u_midpoint __pyx_string_tab[197] -#define __pyx_n_u_min __pyx_string_tab[198] -#define __pyx_n_u_minAreaRect __pyx_string_tab[199] -#define __pyx_n_u_mode __pyx_string_tab[200] -#define __pyx_n_u_model __pyx_string_tab[201] -#define __pyx_n_u_model_state_dict __pyx_string_tab[202] -#define __pyx_n_u_module __pyx_string_tab[203] -#define __pyx_n_u_morphologyEx __pyx_string_tab[204] -#define __pyx_n_u_name __pyx_string_tab[205] -#define __pyx_n_u_next __pyx_string_tab[206] -#define __pyx_n_u_no_grad __pyx_string_tab[207] -#define __pyx_n_u_norm __pyx_string_tab[208] -#define __pyx_n_u_np __pyx_string_tab[209] -#define __pyx_n_u_npt __pyx_string_tab[210] -#define __pyx_kp_u_npt_NDArray_np_floating __pyx_string_tab[211] -#define __pyx_kp_u_npt_NDArray_np_uint8 __pyx_string_tab[212] -#define __pyx_n_u_num_contours __pyx_string_tab[213] -#define __pyx_n_u_numpy __pyx_string_tab[214] -#define __pyx_n_u_numpy_typing __pyx_string_tab[215] -#define __pyx_n_u_off __pyx_string_tab[216] -#define __pyx_n_u_order_points __pyx_string_tab[217] -#define __pyx_n_u_orig __pyx_string_tab[218] -#define __pyx_n_u_output __pyx_string_tab[219] -#define __pyx_n_u_pad_inches __pyx_string_tab[220] -#define __pyx_n_u_pandas __pyx_string_tab[221] -#define __pyx_n_u_parent __pyx_string_tab[222] -#define __pyx_n_u_pathlib __pyx_string_tab[223] -#define __pyx_n_u_permute __pyx_string_tab[224] -#define __pyx_n_u_perspective __pyx_string_tab[225] -#define __pyx_n_u_pil_image __pyx_string_tab[226] -#define __pyx_n_u_pipeline __pyx_string_tab[227] -#define __pyx_n_u_pixels_per_metric_X __pyx_string_tab[228] -#define __pyx_n_u_pixels_per_metric_Y __pyx_string_tab[229] -#define __pyx_n_u_plt __pyx_string_tab[230] -#define __pyx_kp_u_png __pyx_string_tab[231] -#define __pyx_n_u_pop __pyx_string_tab[232] -#define __pyx_n_u_pred_label __pyx_string_tab[233] -#define __pyx_n_u_pred_score __pyx_string_tab[234] -#define __pyx_n_u_pt_A __pyx_string_tab[235] -#define __pyx_n_u_pt_B __pyx_string_tab[236] -#define __pyx_n_u_pyplot __pyx_string_tab[237] -#define __pyx_n_u_qualname __pyx_string_tab[238] -#define __pyx_n_u_quoting __pyx_string_tab[239] -#define __pyx_n_u_rbox __pyx_string_tab[240] -#define __pyx_n_u_resize __pyx_string_tab[241] -#define __pyx_n_u_result __pyx_string_tab[242] -#define __pyx_n_u_result_pattern __pyx_string_tab[243] -#define __pyx_n_u_return __pyx_string_tab[244] -#define __pyx_n_u_right __pyx_string_tab[245] -#define __pyx_n_u_rightmost_x_third __pyx_string_tab[246] -#define __pyx_n_u_s1 __pyx_string_tab[247] -#define __pyx_n_u_s2 __pyx_string_tab[248] -#define __pyx_n_u_savefig __pyx_string_tab[249] -#define __pyx_n_u_scipy_spatial __pyx_string_tab[250] -#define __pyx_n_u_send __pyx_string_tab[251] -#define __pyx_n_u_sensor_images __pyx_string_tab[252] -#define __pyx_n_u_sep __pyx_string_tab[253] -#define __pyx_n_u_set_name __pyx_string_tab[254] -#define __pyx_n_u_shape __pyx_string_tab[255] -#define __pyx_n_u_side __pyx_string_tab[256] -#define __pyx_n_u_size_diff __pyx_string_tab[257] -#define __pyx_n_u_sort_contours __pyx_string_tab[258] -#define __pyx_n_u_spec __pyx_string_tab[259] -#define __pyx_n_u_squeeze __pyx_string_tab[260] -#define __pyx_kp_u_src_dopt_sensor_anomalies_detect __pyx_string_tab[261] -#define __pyx_n_u_stem __pyx_string_tab[262] -#define __pyx_n_u_str __pyx_string_tab[263] -#define __pyx_n_u_subplots __pyx_string_tab[264] -#define __pyx_n_u_subplots_adjust __pyx_string_tab[265] -#define __pyx_n_u_t __pyx_string_tab[266] -#define __pyx_kp_u_t_Box __pyx_string_tab[267] -#define __pyx_kp_u_t_CsvData __pyx_string_tab[268] -#define __pyx_kp_u_t_DetectionModels __pyx_string_tab[269] -#define __pyx_kp_u_t_InferenceResult __pyx_string_tab[270] -#define __pyx_kp_u_t_SensorImages __pyx_string_tab[271] -#define __pyx_n_u_test __pyx_string_tab[272] -#define __pyx_n_u_threshold __pyx_string_tab[273] -#define __pyx_n_u_throw __pyx_string_tab[274] -#define __pyx_n_u_tight __pyx_string_tab[275] -#define __pyx_n_u_tl __pyx_string_tab[276] -#define __pyx_n_u_tlblX __pyx_string_tab[277] -#define __pyx_n_u_tlblY __pyx_string_tab[278] -#define __pyx_n_u_tltrX __pyx_string_tab[279] -#define __pyx_n_u_tltrY __pyx_string_tab[280] -#define __pyx_n_u_to __pyx_string_tab[281] -#define __pyx_n_u_to_csv __pyx_string_tab[282] -#define __pyx_n_u_tolerance __pyx_string_tab[283] -#define __pyx_n_u_torch __pyx_string_tab[284] -#define __pyx_n_u_torch_device __pyx_string_tab[285] -#define __pyx_n_u_tr __pyx_string_tab[286] -#define __pyx_n_u_trbrX __pyx_string_tab[287] -#define __pyx_n_u_trbrY __pyx_string_tab[288] -#define __pyx_kp_u_tuple_float_float __pyx_string_tab[289] -#define __pyx_kp_u_tuple_t_CsvData_t_SensorImages __pyx_string_tab[290] -#define __pyx_n_u_types __pyx_string_tab[291] -#define __pyx_n_u_typing __pyx_string_tab[292] -#define __pyx_n_u_uint8 __pyx_string_tab[293] -#define __pyx_n_u_unsqueeze __pyx_string_tab[294] -#define __pyx_n_u_user_img_path __pyx_string_tab[295] -#define __pyx_n_u_value __pyx_string_tab[296] -#define __pyx_n_u_w __pyx_string_tab[297] -#define __pyx_n_u_warnings __pyx_string_tab[298] -#define __pyx_n_u_wrap_result __pyx_string_tab[299] -#define __pyx_n_u_wspace __pyx_string_tab[300] -#define __pyx_n_u_x1 __pyx_string_tab[301] -#define __pyx_n_u_x2 __pyx_string_tab[302] -#define __pyx_n_u_x_coords __pyx_string_tab[303] -#define __pyx_n_u_x_max __pyx_string_tab[304] -#define __pyx_n_u_x_middle __pyx_string_tab[305] -#define __pyx_n_u_x_min __pyx_string_tab[306] -#define __pyx_n_u_y_max __pyx_string_tab[307] -#define __pyx_n_u_y_min __pyx_string_tab[308] -#define __pyx_n_u_zip __pyx_string_tab[309] +#define __pyx_kp_u_Contour_detection_not_valid_cont __pyx_string_tab[3] +#define __pyx_kp_u_Contour_detection_not_valid_no_c __pyx_string_tab[4] +#define __pyx_kp_u_Image_could_not_be_read_from __pyx_string_tab[5] +#define __pyx_kp_u_No_contours_were_found_in_the_pr __pyx_string_tab[6] +#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[7] +#define __pyx_kp_u_Number_of_counted_electrodes_doe __pyx_string_tab[8] +#define __pyx_kp_u_The_provided_path_seems_not_to_e __pyx_string_tab[9] +#define __pyx_kp_u__2 __pyx_string_tab[10] +#define __pyx_kp_u__3 __pyx_string_tab[11] +#define __pyx_kp_u__4 __pyx_string_tab[12] +#define __pyx_kp_u__5 __pyx_string_tab[13] +#define __pyx_kp_u_add_note __pyx_string_tab[14] +#define __pyx_kp_u_csv __pyx_string_tab[15] +#define __pyx_kp_u_disable __pyx_string_tab[16] +#define __pyx_kp_u_enable __pyx_string_tab[17] +#define __pyx_kp_u_expected __pyx_string_tab[18] +#define __pyx_kp_u_gc __pyx_string_tab[19] +#define __pyx_kp_u_huggingface_hub_cache_system_us __pyx_string_tab[20] +#define __pyx_kp_u_isenabled __pyx_string_tab[21] +#define __pyx_kp_u_npt_NDArray_np_floating __pyx_string_tab[22] +#define __pyx_kp_u_npt_NDArray_np_uint8 __pyx_string_tab[23] +#define __pyx_kp_u_png __pyx_string_tab[24] +#define __pyx_kp_u_src_dopt_sensor_anomalies_detect __pyx_string_tab[25] +#define __pyx_kp_u_t_Box __pyx_string_tab[26] +#define __pyx_kp_u_t_CsvData __pyx_string_tab[27] +#define __pyx_kp_u_t_DetectionModels __pyx_string_tab[28] +#define __pyx_kp_u_t_InferenceResult __pyx_string_tab[29] +#define __pyx_kp_u_t_SensorImages __pyx_string_tab[30] +#define __pyx_kp_u_tuple_float_float __pyx_string_tab[31] +#define __pyx_kp_u_tuple_t_CsvData_t_SensorImages __pyx_string_tab[32] +#define __pyx_n_u_Any __pyx_string_tab[33] +#define __pyx_n_u_BACKBONE __pyx_string_tab[34] +#define __pyx_n_u_Box __pyx_string_tab[35] +#define __pyx_n_u_CHAIN_APPROX_SIMPLE __pyx_string_tab[36] +#define __pyx_n_u_COLOR_BGR2GRAY __pyx_string_tab[37] +#define __pyx_n_u_COLOR_BGR2RGB __pyx_string_tab[38] +#define __pyx_n_u_Canny __pyx_string_tab[39] +#define __pyx_n_u_ContourCalculationError __pyx_string_tab[40] +#define __pyx_n_u_DETECTION_MODELS __pyx_string_tab[41] +#define __pyx_n_u_DataFrame __pyx_string_tab[42] +#define __pyx_n_u_Final __pyx_string_tab[43] +#define __pyx_n_u_HEATMAP_FILENAME_SUFFIX __pyx_string_tab[44] +#define __pyx_n_u_Image __pyx_string_tab[45] +#define __pyx_n_u_ImageNotReadError __pyx_string_tab[46] +#define __pyx_n_u_InferenceResult __pyx_string_tab[47] +#define __pyx_n_u_InvalidElectrodeCount __pyx_string_tab[48] +#define __pyx_n_u_LAYERS __pyx_string_tab[49] +#define __pyx_n_u_MODEL_FOLDER __pyx_string_tab[50] +#define __pyx_n_u_MORPH_CLOSE __pyx_string_tab[51] +#define __pyx_n_u_MORPH_RECT __pyx_string_tab[52] +#define __pyx_n_u_NDArray __pyx_string_tab[53] +#define __pyx_n_u_NUM_VALID_ELECTRODES __pyx_string_tab[54] +#define __pyx_n_u_None __pyx_string_tab[55] +#define __pyx_n_u_PIL __pyx_string_tab[56] +#define __pyx_n_u_Patchcore __pyx_string_tab[57] +#define __pyx_n_u_Path __pyx_string_tab[58] +#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[59] +#define __pyx_n_u_QUOTE_NONE __pyx_string_tab[60] +#define __pyx_n_u_RATIO __pyx_string_tab[61] +#define __pyx_n_u_RETR_TREE __pyx_string_tab[62] +#define __pyx_n_u_RGB __pyx_string_tab[63] +#define __pyx_n_u_SensorImages __pyx_string_tab[64] +#define __pyx_n_u_THRESHOLD_BW __pyx_string_tab[65] +#define __pyx_n_u_THRESH_BINARY __pyx_string_tab[66] +#define __pyx_n_u__8 __pyx_string_tab[67] +#define __pyx_n_u_accepted_boxes __pyx_string_tab[68] +#define __pyx_n_u_all __pyx_string_tab[69] +#define __pyx_n_u_alpha __pyx_string_tab[70] +#define __pyx_n_u_anomalib_models __pyx_string_tab[71] +#define __pyx_n_u_anomaly_detection __pyx_string_tab[72] +#define __pyx_n_u_anomaly_label __pyx_string_tab[73] +#define __pyx_n_u_anomaly_map __pyx_string_tab[74] +#define __pyx_n_u_anomaly_map_resized __pyx_string_tab[75] +#define __pyx_n_u_anomaly_score __pyx_string_tab[76] +#define __pyx_n_u_array __pyx_string_tab[77] +#define __pyx_n_u_astype __pyx_string_tab[78] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[79] +#define __pyx_n_u_ax __pyx_string_tab[80] +#define __pyx_n_u_axes __pyx_string_tab[81] +#define __pyx_n_u_axis __pyx_string_tab[82] +#define __pyx_n_u_backbone __pyx_string_tab[83] +#define __pyx_n_u_bbox_inches __pyx_string_tab[84] +#define __pyx_n_u_binary __pyx_string_tab[85] +#define __pyx_n_u_bl __pyx_string_tab[86] +#define __pyx_n_u_blbrX __pyx_string_tab[87] +#define __pyx_n_u_blbrY __pyx_string_tab[88] +#define __pyx_n_u_bool __pyx_string_tab[89] +#define __pyx_n_u_boundingRect __pyx_string_tab[90] +#define __pyx_n_u_box __pyx_string_tab[91] +#define __pyx_n_u_boxPoints __pyx_string_tab[92] +#define __pyx_n_u_box_1 __pyx_string_tab[93] +#define __pyx_n_u_box_2 __pyx_string_tab[94] +#define __pyx_n_u_br __pyx_string_tab[95] +#define __pyx_n_u_c __pyx_string_tab[96] +#define __pyx_n_u_c1 __pyx_string_tab[97] +#define __pyx_n_u_c2 __pyx_string_tab[98] +#define __pyx_n_u_cast __pyx_string_tab[99] +#define __pyx_n_u_category __pyx_string_tab[100] +#define __pyx_n_u_center_dist __pyx_string_tab[101] +#define __pyx_n_u_check_box_redundancy __pyx_string_tab[102] +#define __pyx_n_u_checkpoint __pyx_string_tab[103] +#define __pyx_n_u_class_getitem __pyx_string_tab[104] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[105] +#define __pyx_n_u_close __pyx_string_tab[106] +#define __pyx_n_u_closed __pyx_string_tab[107] +#define __pyx_n_u_cmap __pyx_string_tab[108] +#define __pyx_n_u_cnts __pyx_string_tab[109] +#define __pyx_n_u_const __pyx_string_tab[110] +#define __pyx_n_u_constants __pyx_string_tab[111] +#define __pyx_n_u_contours __pyx_string_tab[112] +#define __pyx_n_u_convert __pyx_string_tab[113] +#define __pyx_n_u_copy __pyx_string_tab[114] +#define __pyx_n_u_coreset_sampling_ratio __pyx_string_tab[115] +#define __pyx_n_u_cpu __pyx_string_tab[116] +#define __pyx_n_u_cropped __pyx_string_tab[117] +#define __pyx_n_u_cropped_sensor_left __pyx_string_tab[118] +#define __pyx_n_u_cropped_sensor_right __pyx_string_tab[119] +#define __pyx_n_u_csv_2 __pyx_string_tab[120] +#define __pyx_n_u_cuda __pyx_string_tab[121] +#define __pyx_n_u_cv2 __pyx_string_tab[122] +#define __pyx_n_u_cvtColor __pyx_string_tab[123] +#define __pyx_n_u_dA __pyx_string_tab[124] +#define __pyx_n_u_dB __pyx_string_tab[125] +#define __pyx_n_u_data_csv __pyx_string_tab[126] +#define __pyx_n_u_detection_models __pyx_string_tab[127] +#define __pyx_n_u_device __pyx_string_tab[128] +#define __pyx_n_u_df __pyx_string_tab[129] +#define __pyx_n_u_dimA __pyx_string_tab[130] +#define __pyx_n_u_dimB __pyx_string_tab[131] +#define __pyx_n_u_dist __pyx_string_tab[132] +#define __pyx_n_u_distance __pyx_string_tab[133] +#define __pyx_n_u_dopt_basics __pyx_string_tab[134] +#define __pyx_n_u_dopt_sensor_anomalies __pyx_string_tab[135] +#define __pyx_n_u_dopt_sensor_anomalies__find_path __pyx_string_tab[136] +#define __pyx_n_u_dopt_sensor_anomalies_detection __pyx_string_tab[137] +#define __pyx_n_u_dtype __pyx_string_tab[138] +#define __pyx_n_u_edged __pyx_string_tab[139] +#define __pyx_n_u_enter __pyx_string_tab[140] +#define __pyx_n_u_enumerate __pyx_string_tab[141] +#define __pyx_n_u_errors __pyx_string_tab[142] +#define __pyx_n_u_euclidean __pyx_string_tab[143] +#define __pyx_n_u_eval __pyx_string_tab[144] +#define __pyx_n_u_existing __pyx_string_tab[145] +#define __pyx_n_u_exists __pyx_string_tab[146] +#define __pyx_n_u_exit __pyx_string_tab[147] +#define __pyx_n_u_extend __pyx_string_tab[148] +#define __pyx_n_u_figsize __pyx_string_tab[149] +#define __pyx_n_u_file_path __pyx_string_tab[150] +#define __pyx_n_u_file_stem __pyx_string_tab[151] +#define __pyx_n_u_filtered_cnts __pyx_string_tab[152] +#define __pyx_n_u_filterwarnings __pyx_string_tab[153] +#define __pyx_n_u_findContours __pyx_string_tab[154] +#define __pyx_n_u_find_paths __pyx_string_tab[155] +#define __pyx_n_u_float __pyx_string_tab[156] +#define __pyx_n_u_float32 __pyx_string_tab[157] +#define __pyx_n_u_folder_path __pyx_string_tab[158] +#define __pyx_n_u_from_numpy __pyx_string_tab[159] +#define __pyx_n_u_fromarray __pyx_string_tab[160] +#define __pyx_n_u_func __pyx_string_tab[161] +#define __pyx_n_u_genexpr __pyx_string_tab[162] +#define __pyx_n_u_getStructuringElement __pyx_string_tab[163] +#define __pyx_n_u_get_detection_models __pyx_string_tab[164] +#define __pyx_n_u_get_model_folder __pyx_string_tab[165] +#define __pyx_n_u_grab_contours __pyx_string_tab[166] +#define __pyx_n_u_gray __pyx_string_tab[167] +#define __pyx_n_u_header __pyx_string_tab[168] +#define __pyx_n_u_hspace __pyx_string_tab[169] +#define __pyx_n_u_i __pyx_string_tab[170] +#define __pyx_n_u_ignore __pyx_string_tab[171] +#define __pyx_n_u_image __pyx_string_tab[172] +#define __pyx_n_u_image_np __pyx_string_tab[173] +#define __pyx_n_u_image_rgb __pyx_string_tab[174] +#define __pyx_n_u_img __pyx_string_tab[175] +#define __pyx_n_u_img_np __pyx_string_tab[176] +#define __pyx_n_u_img_path __pyx_string_tab[177] +#define __pyx_n_u_imread __pyx_string_tab[178] +#define __pyx_n_u_imshow __pyx_string_tab[179] +#define __pyx_n_u_imutils __pyx_string_tab[180] +#define __pyx_n_u_index __pyx_string_tab[181] +#define __pyx_n_u_infer_image __pyx_string_tab[182] +#define __pyx_n_u_input_tensor __pyx_string_tab[183] +#define __pyx_n_u_int32 __pyx_string_tab[184] +#define __pyx_n_u_is_available __pyx_string_tab[185] +#define __pyx_n_u_is_coroutine __pyx_string_tab[186] +#define __pyx_n_u_is_duplicate __pyx_string_tab[187] +#define __pyx_n_u_is_sorted __pyx_string_tab[188] +#define __pyx_n_u_item __pyx_string_tab[189] +#define __pyx_n_u_items __pyx_string_tab[190] +#define __pyx_n_u_jet __pyx_string_tab[191] +#define __pyx_n_u_kernel __pyx_string_tab[192] +#define __pyx_n_u_layers __pyx_string_tab[193] +#define __pyx_n_u_left __pyx_string_tab[194] +#define __pyx_n_u_leftmost_x_fourth __pyx_string_tab[195] +#define __pyx_n_u_linalg __pyx_string_tab[196] +#define __pyx_n_u_load __pyx_string_tab[197] +#define __pyx_n_u_load_state_dict __pyx_string_tab[198] +#define __pyx_n_u_main __pyx_string_tab[199] +#define __pyx_n_u_matplotlib_pyplot __pyx_string_tab[200] +#define __pyx_n_u_max __pyx_string_tab[201] +#define __pyx_n_u_measure_length __pyx_string_tab[202] +#define __pyx_n_u_measure_length_locals_genexpr __pyx_string_tab[203] +#define __pyx_n_u_message __pyx_string_tab[204] +#define __pyx_n_u_midpoint __pyx_string_tab[205] +#define __pyx_n_u_min __pyx_string_tab[206] +#define __pyx_n_u_minAreaRect __pyx_string_tab[207] +#define __pyx_n_u_mode __pyx_string_tab[208] +#define __pyx_n_u_model __pyx_string_tab[209] +#define __pyx_n_u_model_state_dict __pyx_string_tab[210] +#define __pyx_n_u_module __pyx_string_tab[211] +#define __pyx_n_u_morphologyEx __pyx_string_tab[212] +#define __pyx_n_u_name __pyx_string_tab[213] +#define __pyx_n_u_next __pyx_string_tab[214] +#define __pyx_n_u_no_grad __pyx_string_tab[215] +#define __pyx_n_u_norm __pyx_string_tab[216] +#define __pyx_n_u_np __pyx_string_tab[217] +#define __pyx_n_u_npt __pyx_string_tab[218] +#define __pyx_n_u_num_contours __pyx_string_tab[219] +#define __pyx_n_u_numpy __pyx_string_tab[220] +#define __pyx_n_u_numpy_typing __pyx_string_tab[221] +#define __pyx_n_u_off __pyx_string_tab[222] +#define __pyx_n_u_order_points __pyx_string_tab[223] +#define __pyx_n_u_orig __pyx_string_tab[224] +#define __pyx_n_u_output __pyx_string_tab[225] +#define __pyx_n_u_pad_inches __pyx_string_tab[226] +#define __pyx_n_u_pandas __pyx_string_tab[227] +#define __pyx_n_u_parent __pyx_string_tab[228] +#define __pyx_n_u_pathlib __pyx_string_tab[229] +#define __pyx_n_u_permute __pyx_string_tab[230] +#define __pyx_n_u_perspective __pyx_string_tab[231] +#define __pyx_n_u_pil_image __pyx_string_tab[232] +#define __pyx_n_u_pipeline __pyx_string_tab[233] +#define __pyx_n_u_pixels_per_metric_X __pyx_string_tab[234] +#define __pyx_n_u_pixels_per_metric_Y __pyx_string_tab[235] +#define __pyx_n_u_plt __pyx_string_tab[236] +#define __pyx_n_u_pop __pyx_string_tab[237] +#define __pyx_n_u_pred_score __pyx_string_tab[238] +#define __pyx_n_u_pt_A __pyx_string_tab[239] +#define __pyx_n_u_pt_B __pyx_string_tab[240] +#define __pyx_n_u_pyplot __pyx_string_tab[241] +#define __pyx_n_u_qualname __pyx_string_tab[242] +#define __pyx_n_u_quoting __pyx_string_tab[243] +#define __pyx_n_u_rbox __pyx_string_tab[244] +#define __pyx_n_u_resize __pyx_string_tab[245] +#define __pyx_n_u_result __pyx_string_tab[246] +#define __pyx_n_u_result_pattern __pyx_string_tab[247] +#define __pyx_n_u_return __pyx_string_tab[248] +#define __pyx_n_u_right __pyx_string_tab[249] +#define __pyx_n_u_rightmost_x_third __pyx_string_tab[250] +#define __pyx_n_u_s1 __pyx_string_tab[251] +#define __pyx_n_u_s2 __pyx_string_tab[252] +#define __pyx_n_u_savefig __pyx_string_tab[253] +#define __pyx_n_u_scipy_spatial __pyx_string_tab[254] +#define __pyx_n_u_send __pyx_string_tab[255] +#define __pyx_n_u_sensor_images __pyx_string_tab[256] +#define __pyx_n_u_sep __pyx_string_tab[257] +#define __pyx_n_u_set_name __pyx_string_tab[258] +#define __pyx_n_u_setdefault __pyx_string_tab[259] +#define __pyx_n_u_shape __pyx_string_tab[260] +#define __pyx_n_u_side __pyx_string_tab[261] +#define __pyx_n_u_size_diff __pyx_string_tab[262] +#define __pyx_n_u_sort_contours __pyx_string_tab[263] +#define __pyx_n_u_squeeze __pyx_string_tab[264] +#define __pyx_n_u_stem __pyx_string_tab[265] +#define __pyx_n_u_str __pyx_string_tab[266] +#define __pyx_n_u_subplots __pyx_string_tab[267] +#define __pyx_n_u_subplots_adjust __pyx_string_tab[268] +#define __pyx_n_u_t __pyx_string_tab[269] +#define __pyx_n_u_test __pyx_string_tab[270] +#define __pyx_n_u_threshold __pyx_string_tab[271] +#define __pyx_n_u_throw __pyx_string_tab[272] +#define __pyx_n_u_tight __pyx_string_tab[273] +#define __pyx_n_u_tl __pyx_string_tab[274] +#define __pyx_n_u_tlblX __pyx_string_tab[275] +#define __pyx_n_u_tlblY __pyx_string_tab[276] +#define __pyx_n_u_tltrX __pyx_string_tab[277] +#define __pyx_n_u_tltrY __pyx_string_tab[278] +#define __pyx_n_u_to __pyx_string_tab[279] +#define __pyx_n_u_to_csv __pyx_string_tab[280] +#define __pyx_n_u_tolerance __pyx_string_tab[281] +#define __pyx_n_u_torch __pyx_string_tab[282] +#define __pyx_n_u_torch_device __pyx_string_tab[283] +#define __pyx_n_u_tr __pyx_string_tab[284] +#define __pyx_n_u_trbrX __pyx_string_tab[285] +#define __pyx_n_u_trbrY __pyx_string_tab[286] +#define __pyx_n_u_types __pyx_string_tab[287] +#define __pyx_n_u_typing __pyx_string_tab[288] +#define __pyx_n_u_uint8 __pyx_string_tab[289] +#define __pyx_n_u_unsqueeze __pyx_string_tab[290] +#define __pyx_n_u_user_img_path __pyx_string_tab[291] +#define __pyx_n_u_value __pyx_string_tab[292] +#define __pyx_n_u_values __pyx_string_tab[293] +#define __pyx_n_u_w __pyx_string_tab[294] +#define __pyx_n_u_warnings __pyx_string_tab[295] +#define __pyx_n_u_wrap_result __pyx_string_tab[296] +#define __pyx_n_u_wspace __pyx_string_tab[297] +#define __pyx_n_u_x1 __pyx_string_tab[298] +#define __pyx_n_u_x2 __pyx_string_tab[299] +#define __pyx_n_u_x_coords __pyx_string_tab[300] +#define __pyx_n_u_x_max __pyx_string_tab[301] +#define __pyx_n_u_x_middle __pyx_string_tab[302] +#define __pyx_n_u_x_min __pyx_string_tab[303] +#define __pyx_n_u_y_max __pyx_string_tab[304] +#define __pyx_n_u_y_min __pyx_string_tab[305] +#define __pyx_n_u_zip __pyx_string_tab[306] +#define __pyx_kp_b_iso88591_5_q_uM_AQ_9AWCq_Zq_r_q_Jb_5_1IX __pyx_string_tab[307] +#define __pyx_kp_b_iso88591_AQ_t9G1_q_5_ARRS_aq_nA_Q_a __pyx_string_tab[308] +#define __pyx_kp_b_iso88591_AT_Rt1D_AS_at2Q __pyx_string_tab[309] +#define __pyx_kp_b_iso88591_Cwas_1_vS_f_a_H_e1D_fE_q_2Q_7_q __pyx_string_tab[310] +#define __pyx_kp_b_iso88591_IQ_k_Y6MURS_wc_3c_a_F_IQm6_AS_9 __pyx_string_tab[311] +#define __pyx_kp_b_iso88591__6 __pyx_string_tab[312] +#define __pyx_kp_b_iso88591__7 __pyx_string_tab[313] +#define __pyx_kp_b_iso88591_q_D_D_q_q_awb_uARvQd_BfAQ_AWBgU __pyx_string_tab[314] +#define __pyx_float_0_2 __pyx_number_tab[0] +#define __pyx_float_0_5 __pyx_number_tab[1] +#define __pyx_float_0_8 __pyx_number_tab[2] +#define __pyx_float_2_0 __pyx_number_tab[3] +#define __pyx_float_255_0 __pyx_number_tab[4] +#define __pyx_int_0 __pyx_number_tab[5] +#define __pyx_int_1 __pyx_number_tab[6] +#define __pyx_int_2 __pyx_number_tab[7] +#define __pyx_int_5 __pyx_number_tab[8] +#define __pyx_int_6 __pyx_number_tab[9] +#define __pyx_int_12 __pyx_number_tab[10] +#define __pyx_int_20 __pyx_number_tab[11] +#define __pyx_int_50 __pyx_number_tab[12] +#define __pyx_int_100 __pyx_number_tab[13] +#define __pyx_int_255 __pyx_number_tab[14] +#define __pyx_int_500 __pyx_number_tab[15] +#define __pyx_int_1500 __pyx_number_tab[16] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -3537,12 +3301,6 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_CLEAR(clear_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); - #endif #if CYTHON_PEP489_MULTI_PHASE_INIT __Pyx_State_RemoveModule(NULL); #endif @@ -3561,26 +3319,22 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr); Py_CLEAR(clear_module_state->__pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr); for (int i=0; i<2; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); } - for (int i=0; i<10; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } + for (int i=0; i<7; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } for (int i=0; i<12; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<310; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } - Py_CLEAR(clear_module_state->__pyx_float_0_5); - Py_CLEAR(clear_module_state->__pyx_float_0_8); - Py_CLEAR(clear_module_state->__pyx_float_2_0); - Py_CLEAR(clear_module_state->__pyx_float_255_0); - Py_CLEAR(clear_module_state->__pyx_int_0); - Py_CLEAR(clear_module_state->__pyx_int_1); - Py_CLEAR(clear_module_state->__pyx_int_2); - Py_CLEAR(clear_module_state->__pyx_int_5); - Py_CLEAR(clear_module_state->__pyx_int_6); - Py_CLEAR(clear_module_state->__pyx_int_12); - Py_CLEAR(clear_module_state->__pyx_int_20); - Py_CLEAR(clear_module_state->__pyx_int_50); - Py_CLEAR(clear_module_state->__pyx_int_100); - Py_CLEAR(clear_module_state->__pyx_int_255); - Py_CLEAR(clear_module_state->__pyx_int_500); - Py_CLEAR(clear_module_state->__pyx_int_1500); - return 0; + for (int i=0; i<315; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<17; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); } +/* #### Code section: module_state_clear_contents ### */ +/* CommonTypesMetaclass.module_state_clear */ +Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType); + +/* CythonFunctionShared.module_state_clear */ +Py_CLEAR(clear_module_state->__pyx_CyFunctionType); + +/* Generator.module_state_clear */ +Py_CLEAR(clear_module_state->__pyx_GeneratorType); + +/* #### Code section: module_state_clear_end ### */ +return 0; } #endif /* #### Code section: module_state_traverse ### */ @@ -3594,12 +3348,6 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple); __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes); __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_VISIT(traverse_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); - #endif Py_VISIT(traverse_module_state->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length); Py_VISIT(traverse_module_state->__pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length); Py_VISIT(traverse_module_state->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr); @@ -3615,26 +3363,22 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void Py_VISIT(traverse_module_state->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr); Py_VISIT(traverse_module_state->__pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr); for (int i=0; i<2; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); } - for (int i=0; i<10; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } + for (int i=0; i<7; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } for (int i=0; i<12; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<310; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } - __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_0_5); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_0_8); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_2_0); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_255_0); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_2); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_5); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_6); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_12); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_20); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_50); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_100); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_255); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_500); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1500); - return 0; + for (int i=0; i<315; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<17; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); } +/* #### Code section: module_state_traverse_contents ### */ +/* CommonTypesMetaclass.module_state_traverse */ +Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType); + +/* CythonFunctionShared.module_state_traverse */ +Py_VISIT(traverse_module_state->__pyx_CyFunctionType); + +/* Generator.module_state_traverse */ +Py_VISIT(traverse_module_state->__pyx_GeneratorType); + +/* #### Code section: module_state_traverse_end ### */ +return 0; } #endif /* #### Code section: module_code ### */ @@ -3760,9 +3504,9 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_midpoint(CYTHON_UNU * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_pt_A, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_pt_A, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pt_B, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pt_B, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -3771,9 +3515,9 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_midpoint(CYTHON_UNU __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_mstate_global->__pyx_float_0_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pt_A, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pt_A, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_pt_B, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_pt_B, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -3988,13 +3732,13 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_2check_box_redundan __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_3); } else { - __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 2); + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); } @@ -4059,13 +3803,13 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_2check_box_redundan __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_1); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 2); + __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); } @@ -4169,7 +3913,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_2check_box_redundan #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_c1}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 49, __pyx_L1_error) @@ -4195,7 +3939,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_2check_box_redundan #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_c2}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 49, __pyx_L1_error) @@ -4208,7 +3952,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_2check_box_redundan __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_13}; - __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_norm, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_norm, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -4229,7 +3973,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_2check_box_redundan #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, ((PyObject *)(&PyFloat_Type)), __pyx_t_4}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -4276,7 +4020,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_2check_box_redundan #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_s1}; - __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_13 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 50, __pyx_L1_error) @@ -4302,7 +4046,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_2check_box_redundan #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_s2}; - __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 50, __pyx_L1_error) @@ -4315,7 +4059,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_2check_box_redundan __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_10}; - __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_norm, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_norm, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -4336,7 +4080,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_2check_box_redundan #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, ((PyObject *)(&PyFloat_Type)), __pyx_t_2}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -4618,7 +4362,7 @@ static PyObject *__pyx_gb_21dopt_sensor_anomalies_9detection_14measure_length_2g #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -4663,10 +4407,10 @@ static PyObject *__pyx_gb_21dopt_sensor_anomalies_9detection_14measure_length_2g __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_6); } else { - __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_6); } @@ -4837,7 +4581,7 @@ static PyObject *__pyx_gb_21dopt_sensor_anomalies_9detection_14measure_length_5g #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -4863,7 +4607,7 @@ static PyObject *__pyx_gb_21dopt_sensor_anomalies_9detection_14measure_length_5g #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_rbox, __pyx_cur_scope->__pyx_v_existing}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error) @@ -4946,9 +4690,9 @@ static PyObject *__pyx_gb_21dopt_sensor_anomalies_9detection_14measure_length_8g /* "dopt_sensor_anomalies/detection.py":143 * ) * - * x_min = min(np.min(c[:, 0, 0]) for c in filtered_cnts) - 20 # <<<<<<<<<<<<<< - * x_max = max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20 - * y_min = min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20 + * x_min = max(min(np.min(c[:, 0, 0]) for c in filtered_cnts) - 20, 0) # <<<<<<<<<<<<<< + * x_max = min(max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20, orig.shape[1]) + * y_min = max(min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20, 0) */ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_14measure_length_6genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { @@ -5026,7 +4770,7 @@ static PyObject *__pyx_gb_21dopt_sensor_anomalies_9detection_14measure_length_8g #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -5056,7 +4800,7 @@ static PyObject *__pyx_gb_21dopt_sensor_anomalies_9detection_14measure_length_8g #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -5111,10 +4855,10 @@ static PyObject *__pyx_gb_21dopt_sensor_anomalies_9detection_14measure_length_11 /* "dopt_sensor_anomalies/detection.py":144 * - * x_min = min(np.min(c[:, 0, 0]) for c in filtered_cnts) - 20 - * x_max = max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20 # <<<<<<<<<<<<<< - * y_min = min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20 - * y_max = max(np.max(c[:, 0, 1]) for c in filtered_cnts) + 20 + * x_min = max(min(np.min(c[:, 0, 0]) for c in filtered_cnts) - 20, 0) + * x_max = min(max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20, orig.shape[1]) # <<<<<<<<<<<<<< + * y_min = max(min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20, 0) + * y_max = min(max(np.max(c[:, 0, 1]) for c in filtered_cnts) + 20, orig.shape[0]) */ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_14measure_length_9genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { @@ -5192,7 +4936,7 @@ static PyObject *__pyx_gb_21dopt_sensor_anomalies_9detection_14measure_length_11 #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -5222,7 +4966,7 @@ static PyObject *__pyx_gb_21dopt_sensor_anomalies_9detection_14measure_length_11 #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -5276,10 +5020,10 @@ static PyObject *__pyx_gb_21dopt_sensor_anomalies_9detection_14measure_length_11 static PyObject *__pyx_gb_21dopt_sensor_anomalies_9detection_14measure_length_14generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "dopt_sensor_anomalies/detection.py":145 - * x_min = min(np.min(c[:, 0, 0]) for c in filtered_cnts) - 20 - * x_max = max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20 - * y_min = min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20 # <<<<<<<<<<<<<< - * y_max = max(np.max(c[:, 0, 1]) for c in filtered_cnts) + 20 + * x_min = max(min(np.min(c[:, 0, 0]) for c in filtered_cnts) - 20, 0) + * x_max = min(max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20, orig.shape[1]) + * y_min = max(min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20, 0) # <<<<<<<<<<<<<< + * y_max = min(max(np.max(c[:, 0, 1]) for c in filtered_cnts) + 20, orig.shape[0]) * */ @@ -5358,7 +5102,7 @@ static PyObject *__pyx_gb_21dopt_sensor_anomalies_9detection_14measure_length_14 #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -5388,7 +5132,7 @@ static PyObject *__pyx_gb_21dopt_sensor_anomalies_9detection_14measure_length_14 #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -5442,9 +5186,9 @@ static PyObject *__pyx_gb_21dopt_sensor_anomalies_9detection_14measure_length_14 static PyObject *__pyx_gb_21dopt_sensor_anomalies_9detection_14measure_length_17generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "dopt_sensor_anomalies/detection.py":146 - * x_max = max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20 - * y_min = min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20 - * y_max = max(np.max(c[:, 0, 1]) for c in filtered_cnts) + 20 # <<<<<<<<<<<<<< + * x_max = min(max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20, orig.shape[1]) + * y_min = max(min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20, 0) + * y_max = min(max(np.max(c[:, 0, 1]) for c in filtered_cnts) + 20, orig.shape[0]) # <<<<<<<<<<<<<< * * rightmost_x_third = max(filtered_cnts[2][:, 0, 0]) */ @@ -5524,7 +5268,7 @@ static PyObject *__pyx_gb_21dopt_sensor_anomalies_9detection_14measure_length_17 #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -5554,7 +5298,7 @@ static PyObject *__pyx_gb_21dopt_sensor_anomalies_9detection_14measure_length_17 #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -5689,6 +5433,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT int __pyx_t_18; int __pyx_t_19; PyObject *__pyx_t_20[4]; + long __pyx_t_21; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -5743,7 +5488,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -5799,7 +5544,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -5828,7 +5573,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_image, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyLong_SubtractObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_100, 0x64, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) @@ -5863,7 +5608,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; - __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -5903,7 +5648,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT #endif { PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_cropped, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -5950,7 +5695,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT #endif { PyObject *__pyx_callargs[5] = {__pyx_t_4, __pyx_v_gray, __pyx_t_8, __pyx_mstate_global->__pyx_int_255, __pyx_t_9}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_5, (5-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_5, (5-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -5973,10 +5718,10 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_9); } else { - __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_9); } @@ -6045,7 +5790,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT #endif { PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_4, __pyx_mstate_global->__pyx_tuple[2]}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -6087,7 +5832,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT #endif { PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_v_binary, __pyx_t_1, __pyx_v_kernel}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -6124,7 +5869,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT #endif { PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_v_closed, __pyx_mstate_global->__pyx_int_50, __pyx_mstate_global->__pyx_int_100}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) @@ -6151,7 +5896,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; - __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); @@ -6180,7 +5925,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT #endif { PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_t_9, __pyx_t_3, __pyx_t_11}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -6219,7 +5964,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_cnts}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) @@ -6265,7 +6010,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_No_contours_were_found_in_the_pr}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) @@ -6311,7 +6056,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_cnts}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) @@ -6332,10 +6077,10 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_11); } else { - __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_11 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_11); } @@ -6401,7 +6146,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT #endif if (__pyx_t_12 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_11, __pyx_t_12); + __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_11, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_12; } else { { @@ -6453,13 +6198,13 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_7genexpr__pyx_v_c}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 83, __pyx_L11_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 83, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 83, __pyx_L11_error) @@ -6490,16 +6235,13 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_3 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_9 = __pyx_builtin_zip; - __pyx_t_4 = __Pyx_PyList_GetSlice(__pyx_v_x_coords, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_PyList_GetSlice(__pyx_v_x_coords, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __pyx_t_5 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_x_coords, __pyx_t_4}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_x_coords, __pyx_t_9}; + __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); @@ -6521,7 +6263,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_9}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -6569,7 +6311,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_Contour_detection_not_valid_cont}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) @@ -6638,7 +6380,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT #endif if (__pyx_t_12 >= __pyx_temp) break; } - __pyx_t_11 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_12); + __pyx_t_11 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_12; } else { { @@ -6683,10 +6425,10 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT __Pyx_GOTREF(__pyx_t_9); __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_t); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Box); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Box); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_3 = NULL; + __pyx_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_cv2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_minAreaRect); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 94, __pyx_L1_error) @@ -6695,19 +6437,19 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_16))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_16); - assert(__pyx_t_3); + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_16); + assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16); - __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_16, __pyx__function); __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_c}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_c}; + __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_16, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); @@ -6725,10 +6467,10 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_4, __pyx_t_8}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_3, __pyx_t_8}; + __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 94, __pyx_L1_error) @@ -6749,26 +6491,26 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT __pyx_t_9 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_cv2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_boxPoints); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_boxPoints); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4); + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_9); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_cur_scope->__pyx_v_rbox}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } @@ -6782,7 +6524,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT * box = cast(npt.NDArray[np.float32], perspective.order_points(box)) * */ - __pyx_t_4 = NULL; + __pyx_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __pyx_L1_error) @@ -6796,22 +6538,22 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8); - assert(__pyx_t_4); + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); + assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_v_box}; + PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_v_box}; __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_1, __pyx_t_9, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 96, __pyx_L1_error) - __pyx_t_11 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_8, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -6833,40 +6575,40 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT __Pyx_GOTREF(__pyx_t_9); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_npt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_NDArray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_NDArray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_float32); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_perspective); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_order_points); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_3 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_perspective); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_order_points); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_15))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_15); - assert(__pyx_t_4); + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_15); + assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_15); - __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_15, __pyx__function); __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_box}; - __pyx_t_16 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_box}; + __pyx_t_16 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_15, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); @@ -6885,7 +6627,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_1, __pyx_t_16}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; @@ -6922,16 +6664,16 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT __pyx_t_1 = PyTuple_GET_ITEM(sequence, 3); __Pyx_INCREF(__pyx_t_1); } else { - __pyx_t_11 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_11 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_11); - __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_9); - __pyx_t_16 = __Pyx_PyList_GetItemRef(sequence, 2); + __pyx_t_16 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_16); - __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 3); + __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 3, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); } @@ -7001,7 +6743,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT #endif { PyObject *__pyx_callargs[3] = {__pyx_t_16, __pyx_v_tl, __pyx_v_tr}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) @@ -7022,10 +6764,10 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_16); } else { - __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_9); - __pyx_t_16 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_16 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_16); } @@ -7086,7 +6828,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT #endif { PyObject *__pyx_callargs[3] = {__pyx_t_16, __pyx_v_bl, __pyx_v_br}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error) @@ -7107,10 +6849,10 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_16); } else { - __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_9); - __pyx_t_16 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_16 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_16); } @@ -7171,7 +6913,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT #endif { PyObject *__pyx_callargs[3] = {__pyx_t_16, __pyx_v_tl, __pyx_v_bl}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) @@ -7192,10 +6934,10 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_16); } else { - __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_9); - __pyx_t_16 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_16 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_16); } @@ -7256,7 +6998,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT #endif { PyObject *__pyx_callargs[3] = {__pyx_t_16, __pyx_v_tr, __pyx_v_br}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) @@ -7277,10 +7019,10 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_16); } else { - __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_9); - __pyx_t_16 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_16 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_16); } @@ -7360,7 +7102,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT #endif { PyObject *__pyx_callargs[3] = {__pyx_t_16, __pyx_t_9, __pyx_t_8}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -7414,7 +7156,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT #endif { PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_8, __pyx_t_16}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; @@ -7568,7 +7310,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT */ __pyx_t_9 = __Pyx_PyObject_Format(__pyx_v_dimB, __pyx_mstate_global->__pyx_kp_u_3f); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = PyUnicode_Replace(((PyObject*)__pyx_t_9), __pyx_mstate_global->__pyx_kp_u__2, __pyx_mstate_global->__pyx_kp_u__3, -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_1 = PyUnicode_Replace(((PyObject*)__pyx_t_9), __pyx_mstate_global->__pyx_kp_u__2, __pyx_mstate_global->__pyx_kp_u__3, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -7581,7 +7323,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT */ __pyx_t_9 = __Pyx_PyObject_Format(__pyx_v_dimA, __pyx_mstate_global->__pyx_kp_u_3f); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_16 = PyUnicode_Replace(((PyObject*)__pyx_t_9), __pyx_mstate_global->__pyx_kp_u__2, __pyx_mstate_global->__pyx_kp_u__3, -1L); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_16 = PyUnicode_Replace(((PyObject*)__pyx_t_9), __pyx_mstate_global->__pyx_kp_u__2, __pyx_mstate_global->__pyx_kp_u__3, -1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -7597,7 +7339,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT __pyx_t_8 = __Pyx_PyObject_Format(__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_1f); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyUnicode_Replace(((PyObject*)__pyx_t_8), __pyx_mstate_global->__pyx_kp_u__2, __pyx_mstate_global->__pyx_kp_u__3, -1L); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_9 = PyUnicode_Replace(((PyObject*)__pyx_t_8), __pyx_mstate_global->__pyx_kp_u__2, __pyx_mstate_global->__pyx_kp_u__3, -1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -7670,7 +7412,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_Contour_detection_not_valid_no_c}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) @@ -7782,7 +7524,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_11}; - __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_16, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; @@ -7805,21 +7547,19 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT /* "dopt_sensor_anomalies/detection.py":143 * ) * - * x_min = min(np.min(c[:, 0, 0]) for c in filtered_cnts) - 20 # <<<<<<<<<<<<<< - * x_max = max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20 - * y_min = min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20 + * x_min = max(min(np.min(c[:, 0, 0]) for c in filtered_cnts) - 20, 0) # <<<<<<<<<<<<<< + * x_max = min(max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20, orig.shape[1]) + * y_min = max(min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20, 0) */ + __pyx_t_21 = 0; __pyx_t_16 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_11 = __pyx_builtin_min; - __pyx_t_1 = __pyx_pf_21dopt_sensor_anomalies_9detection_14measure_length_6genexpr(NULL, __pyx_v_filtered_cnts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = __pyx_pf_21dopt_sensor_anomalies_9detection_14measure_length_6genexpr(NULL, __pyx_v_filtered_cnts); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __pyx_t_5 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_t_1}; - __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_t_11}; + __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); @@ -7827,111 +7567,178 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT __pyx_t_11 = __Pyx_PyLong_SubtractObjC(__pyx_t_9, __pyx_mstate_global->__pyx_int_20, 20, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_16 = __Pyx_PyLong_From_long(__pyx_t_21); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_16, __pyx_t_11, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + __pyx_t_1 = __Pyx_PyLong_From_long(__pyx_t_21); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __pyx_t_1; + __pyx_t_1 = 0; + } else { + __Pyx_INCREF(__pyx_t_11); + __pyx_t_9 = __pyx_t_11; + } + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __pyx_t_9; + __Pyx_INCREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_x_min = __pyx_t_11; __pyx_t_11 = 0; /* "dopt_sensor_anomalies/detection.py":144 * - * x_min = min(np.min(c[:, 0, 0]) for c in filtered_cnts) - 20 - * x_max = max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20 # <<<<<<<<<<<<<< - * y_min = min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20 - * y_max = max(np.max(c[:, 0, 1]) for c in filtered_cnts) + 20 + * x_min = max(min(np.min(c[:, 0, 0]) for c in filtered_cnts) - 20, 0) + * x_max = min(max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20, orig.shape[1]) # <<<<<<<<<<<<<< + * y_min = max(min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20, 0) + * y_max = min(max(np.max(c[:, 0, 1]) for c in filtered_cnts) + 20, orig.shape[0]) */ - __pyx_t_9 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_1 = __pyx_builtin_max; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_orig, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_11, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_1 = NULL; __pyx_t_16 = __pyx_pf_21dopt_sensor_anomalies_9detection_14measure_length_9genexpr(NULL, __pyx_v_filtered_cnts); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_5 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_16}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_16}; + __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_1 = __Pyx_PyLong_AddObjC(__pyx_t_11, __pyx_mstate_global->__pyx_int_20, 20, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_16 = __Pyx_PyLong_AddObjC(__pyx_t_11, __pyx_mstate_global->__pyx_int_20, 20, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_v_x_max = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_9, __pyx_t_16, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + __Pyx_INCREF(__pyx_t_9); + __pyx_t_11 = __pyx_t_9; + } else { + __Pyx_INCREF(__pyx_t_16); + __pyx_t_11 = __pyx_t_16; + } + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __pyx_t_11; + __Pyx_INCREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_v_x_max = __pyx_t_9; + __pyx_t_9 = 0; /* "dopt_sensor_anomalies/detection.py":145 - * x_min = min(np.min(c[:, 0, 0]) for c in filtered_cnts) - 20 - * x_max = max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20 - * y_min = min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20 # <<<<<<<<<<<<<< - * y_max = max(np.max(c[:, 0, 1]) for c in filtered_cnts) + 20 + * x_min = max(min(np.min(c[:, 0, 0]) for c in filtered_cnts) - 20, 0) + * x_max = min(max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20, orig.shape[1]) + * y_min = max(min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20, 0) # <<<<<<<<<<<<<< + * y_max = min(max(np.max(c[:, 0, 1]) for c in filtered_cnts) + 20, orig.shape[0]) * */ + __pyx_t_21 = 0; __pyx_t_11 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_16 = __pyx_builtin_min; - __pyx_t_9 = __pyx_pf_21dopt_sensor_anomalies_9detection_14measure_length_12genexpr(NULL, __pyx_v_filtered_cnts); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 145, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_16 = __pyx_pf_21dopt_sensor_anomalies_9detection_14measure_length_12genexpr(NULL, __pyx_v_filtered_cnts); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); __pyx_t_5 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_9}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_16}; + __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); } - __pyx_t_16 = __Pyx_PyLong_SubtractObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_20, 20, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyLong_SubtractObjC(__pyx_t_9, __pyx_mstate_global->__pyx_int_20, 20, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_11 = __Pyx_PyLong_From_long(__pyx_t_21); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_11, __pyx_t_16, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + __pyx_t_1 = __Pyx_PyLong_From_long(__pyx_t_21); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __pyx_t_1; + __pyx_t_1 = 0; + } else { + __Pyx_INCREF(__pyx_t_16); + __pyx_t_9 = __pyx_t_16; + } + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __pyx_t_9; + __Pyx_INCREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_y_min = __pyx_t_16; __pyx_t_16 = 0; /* "dopt_sensor_anomalies/detection.py":146 - * x_max = max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20 - * y_min = min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20 - * y_max = max(np.max(c[:, 0, 1]) for c in filtered_cnts) + 20 # <<<<<<<<<<<<<< + * x_max = min(max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20, orig.shape[1]) + * y_min = max(min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20, 0) + * y_max = min(max(np.max(c[:, 0, 1]) for c in filtered_cnts) + 20, orig.shape[0]) # <<<<<<<<<<<<<< * * rightmost_x_third = max(filtered_cnts[2][:, 0, 0]) */ + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_orig, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_16, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_9 = __pyx_builtin_max; __pyx_t_11 = __pyx_pf_21dopt_sensor_anomalies_9detection_14measure_length_15genexpr(NULL, __pyx_v_filtered_cnts); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_11}; - __pyx_t_16 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_16 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); } - __pyx_t_9 = __Pyx_PyLong_AddObjC(__pyx_t_16, __pyx_mstate_global->__pyx_int_20, 20, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = __Pyx_PyLong_AddObjC(__pyx_t_16, __pyx_mstate_global->__pyx_int_20, 20, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_9, __pyx_t_11, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + __Pyx_INCREF(__pyx_t_9); + __pyx_t_16 = __pyx_t_9; + } else { + __Pyx_INCREF(__pyx_t_11); + __pyx_t_16 = __pyx_t_11; + } + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __pyx_t_16; + __Pyx_INCREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_v_y_max = __pyx_t_9; __pyx_t_9 = 0; /* "dopt_sensor_anomalies/detection.py":148 - * y_max = max(np.max(c[:, 0, 1]) for c in filtered_cnts) + 20 + * y_max = min(max(np.max(c[:, 0, 1]) for c in filtered_cnts) + 20, orig.shape[0]) * * rightmost_x_third = max(filtered_cnts[2][:, 0, 0]) # <<<<<<<<<<<<<< * leftmost_x_fourth = min(filtered_cnts[3][:, 0, 0]) * x_middle = rightmost_x_third + int((leftmost_x_fourth - rightmost_x_third) / 2.0) */ __pyx_t_16 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_11 = __pyx_builtin_max; - __pyx_t_1 = __Pyx_PyObject_GetItem(__Pyx_PyList_GET_ITEM(__pyx_v_filtered_cnts, 2), __pyx_mstate_global->__pyx_tuple[0]); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = __Pyx_PyObject_GetItem(__Pyx_PyList_GET_ITEM(__pyx_v_filtered_cnts, 2), __pyx_mstate_global->__pyx_tuple[0]); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __pyx_t_5 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_t_1}; - __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_t_11}; + __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); @@ -7947,17 +7754,14 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT * */ __pyx_t_11 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_1 = __pyx_builtin_min; __pyx_t_16 = __Pyx_PyObject_GetItem(__Pyx_PyList_GET_ITEM(__pyx_v_filtered_cnts, 3), __pyx_mstate_global->__pyx_tuple[0]); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_16}; - __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } @@ -7973,17 +7777,17 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT */ __pyx_t_9 = PyNumber_Subtract(__pyx_v_leftmost_x_fourth, __pyx_v_rightmost_x_third); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyFloat_TrueDivideObjC(__pyx_t_9, __pyx_mstate_global->__pyx_float_2_0, 2.0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_16 = __Pyx_PyFloat_TrueDivideObjC(__pyx_t_9, __pyx_mstate_global->__pyx_float_2_0, 2.0, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyNumber_Int(__pyx_t_16); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_v_rightmost_x_third, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = PyNumber_Add(__pyx_v_rightmost_x_third, __pyx_t_9); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_v_x_middle = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_x_middle = __pyx_t_16; + __pyx_t_16 = 0; /* "dopt_sensor_anomalies/detection.py":152 * x_middle = rightmost_x_third + int((leftmost_x_fourth - rightmost_x_third) / 2.0) @@ -7992,21 +7796,21 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT * cropped_sensor_right = orig[y_min:y_max, x_middle:x_max] * */ - __pyx_t_1 = PySlice_New(__pyx_v_y_min, __pyx_v_y_max, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_16 = PySlice_New(__pyx_v_y_min, __pyx_v_y_max, Py_None); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); __pyx_t_9 = PySlice_New(__pyx_v_x_min, __pyx_v_x_middle, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 152, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_16); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 152, __pyx_L1_error); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_16); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_16) != (0)) __PYX_ERR(0, 152, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 152, __pyx_L1_error); - __pyx_t_1 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 152, __pyx_L1_error); + __pyx_t_16 = 0; __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_orig, __pyx_t_16); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_orig, __pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_v_cropped_sensor_left = __pyx_t_9; __pyx_t_9 = 0; @@ -8019,21 +7823,21 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT */ __pyx_t_9 = PySlice_New(__pyx_v_y_min, __pyx_v_y_max, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_16 = PySlice_New(__pyx_v_x_middle, __pyx_v_x_max, Py_None); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_11 = PySlice_New(__pyx_v_x_middle, __pyx_v_x_max, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9) != (0)) __PYX_ERR(0, 153, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_16); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_16) != (0)) __PYX_ERR(0, 153, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_9) != (0)) __PYX_ERR(0, 153, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_11); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 153, __pyx_L1_error); __pyx_t_9 = 0; - __pyx_t_16 = 0; - __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_v_orig, __pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_16); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_cropped_sensor_right = __pyx_t_16; - __pyx_t_16 = 0; + __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_v_orig, __pyx_t_16); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_v_cropped_sensor_right = __pyx_t_11; + __pyx_t_11 = 0; /* "dopt_sensor_anomalies/detection.py":155 * cropped_sensor_right = orig[y_min:y_max, x_middle:x_max] @@ -8043,47 +7847,47 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_4measure_length(CYT * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = NULL; + __pyx_t_16 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_t); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_SensorImages); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_SensorImages); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_11); - assert(__pyx_t_1); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_1); + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_1); + assert(__pyx_t_16); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_1, __pyx__function); __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_1, NULL}; + PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_16, NULL}; __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_left, __pyx_v_cropped_sensor_left, __pyx_t_9, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 155, __pyx_L1_error) if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_right, __pyx_v_cropped_sensor_right, __pyx_t_9, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 155, __pyx_L1_error) - __pyx_t_16 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_11, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9); + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_data_csv); __Pyx_GIVEREF(__pyx_v_data_csv); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_data_csv) != (0)) __PYX_ERR(0, 155, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_16); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_16) != (0)) __PYX_ERR(0, 155, __pyx_L1_error); - __pyx_t_16 = 0; - __pyx_r = ((PyObject*)__pyx_t_11); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data_csv) != (0)) __PYX_ERR(0, 155, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_11); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 155, __pyx_L1_error); __pyx_t_11 = 0; + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; goto __pyx_L0; /* "dopt_sensor_anomalies/detection.py":55 @@ -8273,7 +8077,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON PyObject *__pyx_v_input_tensor = NULL; PyObject *__pyx_v_output = NULL; PyObject *__pyx_v_anomaly_score = NULL; - PyObject *__pyx_v_anomaly_label = NULL; + int __pyx_v_anomaly_label; PyObject *__pyx_v_anomaly_map = NULL; PyObject *__pyx_v_img_np = NULL; PyObject *__pyx_v_anomaly_map_resized = NULL; @@ -8323,7 +8127,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; - __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_available, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_is_available, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 162, __pyx_L1_error) @@ -8352,7 +8156,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -8374,7 +8178,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_torch_device}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_to, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_to, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -8413,7 +8217,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_image, __pyx_t_5}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -8450,7 +8254,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_image_rgb}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error) @@ -8471,7 +8275,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_RGB}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_convert, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_convert, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -8506,7 +8310,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_pil_image}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error) @@ -8522,7 +8326,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_astype, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_astype, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -8562,7 +8366,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_image_np}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) @@ -8589,7 +8393,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_int_0}; - __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_unsqueeze, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_unsqueeze, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -8609,7 +8413,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_torch_device}; - __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_to, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_to, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -8629,7 +8433,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; - __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_eval, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_eval, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -8664,7 +8468,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error) @@ -8689,7 +8493,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 175, __pyx_L3_error) @@ -8731,7 +8535,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_input_tensor}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L7_error) @@ -8829,7 +8633,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON * output = model(input_tensor) * * anomaly_score = output.pred_score.item() # <<<<<<<<<<<<<< - * anomaly_label = output.pred_label.item() + * anomaly_label = bool(1 if anomaly_score >= 0.2 else 0) * anomaly_map = output.anomaly_map.squeeze().cpu().numpy() */ if (unlikely(!__pyx_v_output)) { __Pyx_RaiseUnboundLocalError("output"); __PYX_ERR(0, 178, __pyx_L1_error) } @@ -8840,7 +8644,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; - __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_item, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_item, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 178, __pyx_L1_error) @@ -8852,30 +8656,27 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON /* "dopt_sensor_anomalies/detection.py":179 * * anomaly_score = output.pred_score.item() - * anomaly_label = output.pred_label.item() # <<<<<<<<<<<<<< + * anomaly_label = bool(1 if anomaly_score >= 0.2 else 0) # <<<<<<<<<<<<<< * anomaly_map = output.anomaly_map.squeeze().cpu().numpy() * */ - if (unlikely(!__pyx_v_output)) { __Pyx_RaiseUnboundLocalError("output"); __PYX_ERR(0, 179, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_output, __pyx_mstate_global->__pyx_n_u_pred_label); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_t_1; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_9 = 0; - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_item, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_anomaly_score, __pyx_mstate_global->__pyx_float_0_2, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_16) { + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); + __pyx_t_5 = __pyx_mstate_global->__pyx_int_1; + } else { + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_t_5 = __pyx_mstate_global->__pyx_int_0; } - __pyx_v_anomaly_label = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_anomaly_label = (!(!__pyx_t_16)); /* "dopt_sensor_anomalies/detection.py":180 * anomaly_score = output.pred_score.item() - * anomaly_label = output.pred_label.item() + * anomaly_label = bool(1 if anomaly_score >= 0.2 else 0) * anomaly_map = output.anomaly_map.squeeze().cpu().numpy() # <<<<<<<<<<<<<< * * img_np = np.array(pil_image) @@ -8888,7 +8689,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_squeeze, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_squeeze, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 180, __pyx_L1_error) @@ -8899,20 +8700,20 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; - __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_cpu, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_cpu, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_1 = __pyx_t_2; - __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_t_1; + __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; - __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_numpy, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; + __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_numpy, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } @@ -8926,28 +8727,28 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON * anomaly_map_resized = cv2.resize(anomaly_map, (img_np.shape[1], img_np.shape[0])) * */ - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_1 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8); - assert(__pyx_t_2); + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8); + assert(__pyx_t_1); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_pil_image}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_pil_image}; + __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -8963,47 +8764,47 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON * return t.InferenceResult( */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_cv2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_resize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_cv2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_img_np, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_resize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_img_np, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_img_np, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_img_np, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 183, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 183, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 183, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 183, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); assert(__pyx_t_8); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_1, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_anomaly_map, __pyx_t_2}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_anomaly_map, __pyx_t_1}; + __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } @@ -9018,12 +8819,12 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON * anomaly_map_resized=anomaly_map_resized, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_InferenceResult); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_InferenceResult); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "dopt_sensor_anomalies/detection.py":189 * anomaly_map_resized=anomaly_map_resized, @@ -9032,29 +8833,32 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON * ) * */ + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_anomaly_label); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8); - assert(__pyx_t_1); + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8); + assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 4 : 0)] = {__pyx_t_1, NULL}; - __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_img, __pyx_v_img_np, __pyx_t_2, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 185, __pyx_L1_error) - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_anomaly_map_resized, __pyx_v_anomaly_map_resized, __pyx_t_2, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 185, __pyx_L1_error) - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_anomaly_score, __pyx_v_anomaly_score, __pyx_t_2, __pyx_callargs+1, 2) < (0)) __PYX_ERR(0, 185, __pyx_L1_error) - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_anomaly_label, __pyx_v_anomaly_label, __pyx_t_2, __pyx_callargs+1, 3) < (0)) __PYX_ERR(0, 185, __pyx_L1_error) - __pyx_t_5 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_8, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 4 : 0)] = {__pyx_t_2, NULL}; + __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_img, __pyx_v_img_np, __pyx_t_6, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 185, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_anomaly_map_resized, __pyx_v_anomaly_map_resized, __pyx_t_6, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 185, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_anomaly_score, __pyx_v_anomaly_score, __pyx_t_6, __pyx_callargs+1, 2) < (0)) __PYX_ERR(0, 185, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_anomaly_label, __pyx_t_1, __pyx_t_6, __pyx_callargs+1, 3) < (0)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_5 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -9091,7 +8895,6 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_6infer_image(CYTHON __Pyx_XDECREF(__pyx_v_input_tensor); __Pyx_XDECREF(__pyx_v_output); __Pyx_XDECREF(__pyx_v_anomaly_score); - __Pyx_XDECREF(__pyx_v_anomaly_label); __Pyx_XDECREF(__pyx_v_anomaly_map); __Pyx_XDECREF(__pyx_v_img_np); __Pyx_XDECREF(__pyx_v_anomaly_map_resized); @@ -9328,7 +9131,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_8anomaly_detection( if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_backbone, __pyx_t_5, __pyx_t_4, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 202, __pyx_L1_error) if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_layers, __pyx_t_6, __pyx_t_4, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 202, __pyx_L1_error) if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_coreset_sampling_ratio, __pyx_t_7, __pyx_t_4, __pyx_callargs+1, 2) < (0)) __PYX_ERR(0, 202, __pyx_L1_error) - __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4); + __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -9375,10 +9178,10 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_8anomaly_detection( __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_3); } else { - __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); } @@ -9490,7 +9293,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_8anomaly_detection( #endif { PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_5, __pyx_v_image}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -9529,7 +9332,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_8anomaly_detection( #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -9553,7 +9356,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_8anomaly_detection( __pyx_t_8 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5}; - __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_load_state_dict, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_load_state_dict, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 210, __pyx_L1_error) @@ -9585,7 +9388,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_8anomaly_detection( #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_image, __pyx_v_model}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 212, __pyx_L1_error) @@ -9616,7 +9419,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_8anomaly_detection( __pyx_t_8 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5}; - __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_extend, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_extend, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 213, __pyx_L1_error) @@ -9648,7 +9451,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_8anomaly_detection( __pyx_t_8 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_off}; - __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_axis, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_axis, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); @@ -9670,7 +9473,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_8anomaly_detection( __pyx_t_1 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_alpha, __pyx_mstate_global->__pyx_float_0_8, __pyx_t_1, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 217, __pyx_L1_error) - __pyx_t_7 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_imshow, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1); + __pyx_t_7 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_imshow, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 217, __pyx_L1_error) @@ -9696,7 +9499,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_8anomaly_detection( __Pyx_GOTREF(__pyx_t_6); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_cmap, __pyx_mstate_global->__pyx_n_u_jet, __pyx_t_6, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 218, __pyx_L1_error) if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_alpha, __pyx_mstate_global->__pyx_float_0_5, __pyx_t_6, __pyx_callargs+2, 1) < (0)) __PYX_ERR(0, 218, __pyx_L1_error) - __pyx_t_7 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_imshow, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6); + __pyx_t_7 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_imshow, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -9739,7 +9542,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_8anomaly_detection( __Pyx_GOTREF(__pyx_t_7); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_wspace, __pyx_mstate_global->__pyx_int_0, __pyx_t_7, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 220, __pyx_L1_error) if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_hspace, __pyx_mstate_global->__pyx_int_0, __pyx_t_7, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 220, __pyx_L1_error) - __pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7); + __pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -9808,7 +9611,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_8anomaly_detection( __Pyx_GOTREF(__pyx_t_1); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_bbox_inches, __pyx_mstate_global->__pyx_n_u_tight, __pyx_t_1, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 221, __pyx_L1_error) if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_pad_inches, __pyx_mstate_global->__pyx_int_0, __pyx_t_1, __pyx_callargs+2, 1) < (0)) __PYX_ERR(0, 221, __pyx_L1_error) - __pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1); + __pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -9845,7 +9648,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_8anomaly_detection( #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error) @@ -9882,7 +9685,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_8anomaly_detection( #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -9911,7 +9714,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_8anomaly_detection( */ __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_file_stem, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_csv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_csv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_folder_path, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) @@ -9940,7 +9743,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_8anomaly_detection( if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_header, Py_False, __pyx_t_5, __pyx_callargs+2, 2) < (0)) __PYX_ERR(0, 229, __pyx_L1_error) if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_quoting, __pyx_t_6, __pyx_t_5, __pyx_callargs+2, 3) < (0)) __PYX_ERR(0, 229, __pyx_L1_error) if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_sep, __pyx_mstate_global->__pyx_kp_u__4, __pyx_t_5, __pyx_callargs+2, 4) < (0)) __PYX_ERR(0, 229, __pyx_L1_error) - __pyx_t_4 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_to_csv, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5); + __pyx_t_4 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_to_csv, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -10155,7 +9958,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_10pipeline(CYTHON_U #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_user_img_path}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error) @@ -10176,7 +9979,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_10pipeline(CYTHON_U __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_exists, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_exists, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -10194,14 +9997,11 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_10pipeline(CYTHON_U * MODEL_FOLDER: Final[Path] = dopt_sensor_anomalies._find_paths.get_model_folder() */ __pyx_t_3 = NULL; - __Pyx_INCREF(__pyx_builtin_FileNotFoundError); - __pyx_t_2 = __pyx_builtin_FileNotFoundError; __pyx_t_4 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_provided_path_seems_not_to_e}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_FileNotFoundError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } @@ -10225,18 +10025,18 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_10pipeline(CYTHON_U * DETECTION_MODELS: Final[t.DetectionModels] = ( * dopt_sensor_anomalies._find_paths.get_detection_models(MODEL_FOLDER) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_find_paths); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 249, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_find_paths); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __pyx_t_7; - __Pyx_INCREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __pyx_t_7; + __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_model_folder, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_model_folder, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -10251,19 +10051,19 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_10pipeline(CYTHON_U * ) * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_find_paths); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = __pyx_t_3; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_find_paths); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = __pyx_t_2; __Pyx_INCREF(__pyx_t_7); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_MODEL_FOLDER}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_detection_models, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_detection_models, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } @@ -10277,7 +10077,7 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_10pipeline(CYTHON_U * file_path, pixels_per_metric_X, pixels_per_metric_Y * ) */ - __pyx_t_3 = NULL; + __pyx_t_2 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_measure_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); @@ -10288,27 +10088,27 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_10pipeline(CYTHON_U * ) * anomaly_detection( */ - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pixels_per_metric_X); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_pixels_per_metric_X); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = PyFloat_FromDouble(__pyx_v_pixels_per_metric_Y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); - assert(__pyx_t_3); + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); + assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); __pyx_t_4 = 0; } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_file_path, __pyx_t_2, __pyx_t_8}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_4, (4-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_file_path, __pyx_t_3, __pyx_t_8}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_4, (4-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error) @@ -10329,10 +10129,10 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_10pipeline(CYTHON_U __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); } @@ -10345,20 +10145,20 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_10pipeline(CYTHON_U __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, 254, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); - index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_7)) goto __pyx_L4_unpacking_failed; + __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); + index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_3); if (unlikely(!__pyx_t_7)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); - index = 1; __pyx_t_8 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_8)) goto __pyx_L4_unpacking_failed; + index = 1; __pyx_t_8 = __pyx_t_9(__pyx_t_3); if (unlikely(!__pyx_t_8)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_2), 2) < (0)) __PYX_ERR(0, 254, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_3), 2) < (0)) __PYX_ERR(0, 254, __pyx_L1_error) __pyx_t_9 = NULL; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 254, __pyx_L1_error) @@ -10408,15 +10208,15 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_10pipeline(CYTHON_U #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 4 : 0)] = {__pyx_t_8, NULL}; - __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_img_path, __pyx_v_file_path, __pyx_t_2, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 257, __pyx_L1_error) - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_detection_models, __pyx_v_DETECTION_MODELS, __pyx_t_2, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 257, __pyx_L1_error) - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_data_csv, __pyx_v_data_csv, __pyx_t_2, __pyx_callargs+1, 2) < (0)) __PYX_ERR(0, 257, __pyx_L1_error) - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_sensor_images, __pyx_v_sensor_images, __pyx_t_2, __pyx_callargs+1, 3) < (0)) __PYX_ERR(0, 257, __pyx_L1_error) - __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_7, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2); + __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_img_path, __pyx_v_file_path, __pyx_t_3, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 257, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_detection_models, __pyx_v_DETECTION_MODELS, __pyx_t_3, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 257, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_data_csv, __pyx_v_data_csv, __pyx_t_3, __pyx_callargs+1, 2) < (0)) __PYX_ERR(0, 257, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_sensor_images, __pyx_v_sensor_images, __pyx_t_3, __pyx_callargs+1, 3) < (0)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -10456,30 +10256,33 @@ static PyObject *__pyx_pf_21dopt_sensor_anomalies_9detection_10pipeline(CYTHON_U static PyObject *__pyx_tp_new_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length, sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length[--__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length(PyObject *o) { struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length *p = (struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -10488,19 +10291,24 @@ static void __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_stru PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_rbox); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length, sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length)))) + { __pyx_mstate_global->__pyx_freelist_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length[__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length++] = ((struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -10537,7 +10345,7 @@ static PyType_Spec __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_str "dopt_sensor_anomalies.detection.__pyx_scope_struct__measure_length", sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length_slots, }; #else @@ -10548,12 +10356,7 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -10567,7 +10370,7 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length, /*tp_traverse*/ __pyx_tp_clear_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length, /*tp_clear*/ @@ -10602,7 +10405,7 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -10622,30 +10425,33 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st static PyObject *__pyx_tp_new_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr, sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr[--__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr(PyObject *o) { struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -10657,19 +10463,24 @@ static void __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_stru Py_CLEAR(p->__pyx_v_x2); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr, sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr)))) + { __pyx_mstate_global->__pyx_freelist_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr[__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -10705,7 +10516,7 @@ static PyType_Spec __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_str "dopt_sensor_anomalies.detection.__pyx_scope_struct_1_genexpr", sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr_slots, }; #else @@ -10716,12 +10527,7 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -10735,7 +10541,7 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -10770,7 +10576,7 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -10790,30 +10596,33 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st static PyObject *__pyx_tp_new_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr, sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr[--__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr(PyObject *o) { struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -10824,19 +10633,24 @@ static void __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_stru Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_existing); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr, sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr)))) + { __pyx_mstate_global->__pyx_freelist_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr[__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -10869,7 +10683,7 @@ static PyType_Spec __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_str "dopt_sensor_anomalies.detection.__pyx_scope_struct_2_genexpr", sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr_slots, }; #else @@ -10880,12 +10694,7 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -10899,7 +10708,7 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -10934,7 +10743,7 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -10954,30 +10763,33 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st static PyObject *__pyx_tp_new_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr, sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr[--__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr(PyObject *o) { struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -10988,19 +10800,24 @@ static void __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_stru Py_CLEAR(p->__pyx_v_c); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr, sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr)))) + { __pyx_mstate_global->__pyx_freelist_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr[__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -11033,7 +10850,7 @@ static PyType_Spec __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_str "dopt_sensor_anomalies.detection.__pyx_scope_struct_3_genexpr", sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr_slots, }; #else @@ -11044,12 +10861,7 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -11063,7 +10875,7 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -11098,7 +10910,7 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -11118,30 +10930,33 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st static PyObject *__pyx_tp_new_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr, sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr[--__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr(PyObject *o) { struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -11152,19 +10967,24 @@ static void __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_stru Py_CLEAR(p->__pyx_v_c); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr, sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr)))) + { __pyx_mstate_global->__pyx_freelist_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr[__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -11197,7 +11017,7 @@ static PyType_Spec __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_str "dopt_sensor_anomalies.detection.__pyx_scope_struct_4_genexpr", sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr_slots, }; #else @@ -11208,12 +11028,7 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -11227,7 +11042,7 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -11262,7 +11077,7 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -11282,30 +11097,33 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st static PyObject *__pyx_tp_new_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr, sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr[--__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr(PyObject *o) { struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -11316,19 +11134,24 @@ static void __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_stru Py_CLEAR(p->__pyx_v_c); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr, sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr)))) + { __pyx_mstate_global->__pyx_freelist_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr[__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -11361,7 +11184,7 @@ static PyType_Spec __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_str "dopt_sensor_anomalies.detection.__pyx_scope_struct_5_genexpr", sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr_slots, }; #else @@ -11372,12 +11195,7 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -11391,7 +11209,7 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -11426,7 +11244,7 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -11446,30 +11264,33 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st static PyObject *__pyx_tp_new_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr, sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr[--__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr(PyObject *o) { struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -11480,19 +11301,24 @@ static void __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_stru Py_CLEAR(p->__pyx_v_c); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr, sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr)))) + { __pyx_mstate_global->__pyx_freelist_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr[__pyx_mstate_global->__pyx_freecount_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr++] = ((struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -11525,7 +11351,7 @@ static PyType_Spec __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_str "dopt_sensor_anomalies.detection.__pyx_scope_struct_6_genexpr", sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr_slots, }; #else @@ -11536,12 +11362,7 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st sizeof(struct __pyx_obj_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -11555,7 +11376,7 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -11590,7 +11411,7 @@ static PyTypeObject __pyx_type_21dopt_sensor_anomalies_9detection___pyx_scope_st #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -11672,6 +11493,9 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length) < (0)) __PYX_ERR(0, 55, __pyx_L1_error) #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length); + #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length->tp_dictoffset && __pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct__measure_length->tp_getattro = PyObject_GenericGetAttr; @@ -11688,6 +11512,9 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr) < (0)) __PYX_ERR(0, 84, __pyx_L1_error) #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr); + #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_1_genexpr->tp_getattro = PyObject_GenericGetAttr; @@ -11704,6 +11531,9 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr) < (0)) __PYX_ERR(0, 112, __pyx_L1_error) #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr); + #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_2_genexpr->tp_getattro = PyObject_GenericGetAttr; @@ -11720,6 +11550,9 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr) < (0)) __PYX_ERR(0, 143, __pyx_L1_error) #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr); + #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_3_genexpr->tp_getattro = PyObject_GenericGetAttr; @@ -11736,6 +11569,9 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr) < (0)) __PYX_ERR(0, 144, __pyx_L1_error) #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr); + #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_4_genexpr->tp_getattro = PyObject_GenericGetAttr; @@ -11752,6 +11588,9 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr) < (0)) __PYX_ERR(0, 145, __pyx_L1_error) #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr); + #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_5_genexpr->tp_getattro = PyObject_GenericGetAttr; @@ -11768,6 +11607,9 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr) < (0)) __PYX_ERR(0, 146, __pyx_L1_error) #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr); + #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_21dopt_sensor_anomalies_9detection___pyx_scope_struct_6_genexpr->tp_getattro = PyObject_GenericGetAttr; @@ -11876,7 +11718,8 @@ __Pyx_PyMODINIT_FUNC PyInit_detection(void) return PyModuleDef_Init(&__pyx_moduledef); } /* ModuleCreationPEP489 */ -#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 +#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\ + || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000)) static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { { PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think @@ -11906,12 +11749,15 @@ static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { #if !CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { static PY_INT64_T main_interpreter_id = -1; -#if CYTHON_COMPILING_IN_GRAAL +#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000 + PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); +#elif CYTHON_COMPILING_IN_GRAAL PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); -#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x03090000 - PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get()); -#elif CYTHON_COMPILING_IN_LIMITED_API +#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\ + || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000)) PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId(); +#elif CYTHON_COMPILING_IN_LIMITED_API + PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get()); #else PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); #endif @@ -11983,12 +11829,14 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_detection(PyObject *__pyx_pyinit_m __pyx_mstatetype *__pyx_mstate = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - size_t __pyx_t_6; + PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; + size_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -12031,46 +11879,26 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_detection(PyObject *__pyx_pyinit_m if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /* ImportRefnannyAPI */ #if CYTHON_REFNANNY -__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); -if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); -} -#endif - -__Pyx_RefNannySetupContext("PyInit_detection", 0); - if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pxy_PyFrame_Initialize_Offsets - __Pxy_PyFrame_Initialize_Offsets(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } #endif + +__Pyx_RefNannySetupContext("PyInit_detection", 0); + __Pyx_init_runtime_version(); + if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Library function declarations ---*/ /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error) - #if 0 || defined(__Pyx_CyFunction_USED) || defined(__Pyx_FusedFunction_USED) || defined(__Pyx_Coroutine_USED) || defined(__Pyx_Generator_USED) || defined(__Pyx_AsyncGen_USED) - if (__pyx_CommonTypesMetaclass_init(__pyx_m) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init(__pyx_m) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init(__pyx_m) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init(__pyx_m) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init(__pyx_m) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_AsyncGen_USED - if (__pyx_AsyncGen_init(__pyx_m) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ if (__pyx_module_is_main_dopt_sensor_anomalies__detection) { if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) } @@ -12100,7 +11928,8 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * import warnings * from pathlib import Path */ - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_csv_2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_csv_2, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_csv_2, __pyx_t_2) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -12111,7 +11940,8 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * from pathlib import Path * from typing import Any, Final, cast */ - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_warnings, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_warnings, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_warnings, __pyx_t_2) < (0)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -12123,16 +11953,22 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * from typing import Any, Final, cast * */ - __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_Path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Path}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pathlib, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pathlib, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Path}; + __pyx_t_3 = 0; { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 3, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Path, __pyx_t_2) < (0)) __PYX_ERR(0, 3, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "dopt_sensor_anomalies/detection.py":4 * import warnings @@ -12141,23 +11977,21 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * * import cv2 */ - __pyx_t_3 = __Pyx_PyList_Pack(3, __pyx_mstate_global->__pyx_n_u_Any, __pyx_mstate_global->__pyx_n_u_Final, __pyx_mstate_global->__pyx_n_u_cast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_typing, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Any,__pyx_mstate_global->__pyx_n_u_Final,__pyx_mstate_global->__pyx_n_u_cast}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_typing, __pyx_imported_names, 3, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Any, __pyx_t_3) < (0)) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Final); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Final, __pyx_t_3) < (0)) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_cast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_cast, __pyx_t_3) < (0)) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Any,__pyx_mstate_global->__pyx_n_u_Final,__pyx_mstate_global->__pyx_n_u_cast}; + for (__pyx_t_3=0; __pyx_t_3 < 3; __pyx_t_3++) { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "dopt_sensor_anomalies/detection.py":6 @@ -12167,7 +12001,8 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * import imutils * import matplotlib.pyplot as plt */ - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_cv2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_cv2, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error) + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_cv2, __pyx_t_2) < (0)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -12179,7 +12014,8 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * import matplotlib.pyplot as plt * import numpy as np */ - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_imutils, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_imutils, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error) + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_imutils, __pyx_t_2) < (0)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -12191,7 +12027,12 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * import numpy as np * import numpy.typing as npt */ - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_matplotlib_pyplot, __pyx_mstate_global->__pyx_tuple[7]); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_matplotlib_pyplot, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) + __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_pyplot); + Py_DECREF(__pyx_t_1); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 8, __pyx_L1_error) + __pyx_t_1 = __pyx_t_5; + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_plt, __pyx_t_2) < (0)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -12203,7 +12044,8 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * import numpy.typing as npt * import torch */ - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_numpy, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_numpy, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_np, __pyx_t_2) < (0)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -12215,7 +12057,12 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * import torch * from anomalib.models import Patchcore */ - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_numpy_typing, __pyx_mstate_global->__pyx_tuple[8]); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_numpy_typing, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error) + __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_typing); + Py_DECREF(__pyx_t_1); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 10, __pyx_L1_error) + __pyx_t_1 = __pyx_t_5; + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_npt, __pyx_t_2) < (0)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -12227,7 +12074,8 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * from anomalib.models import Patchcore * from dopt_basics import result_pattern */ - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_torch, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_torch, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error) + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_torch, __pyx_t_2) < (0)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -12239,16 +12087,22 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * from dopt_basics import result_pattern * from imutils import contours, perspective */ - __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_Patchcore); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Patchcore}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_anomalib_models, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_anomalib_models, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Patchcore}; + __pyx_t_3 = 0; { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Patchcore); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Patchcore, __pyx_t_2) < (0)) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "dopt_sensor_anomalies/detection.py":13 * import torch @@ -12257,15 +12111,21 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * from imutils import contours, perspective * from pandas import DataFrame */ - __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_result_pattern); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_dopt_basics, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_result_pattern}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_dopt_basics, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_result_pattern); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_result_pattern, __pyx_t_3) < (0)) __PYX_ERR(0, 13, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_result_pattern}; + __pyx_t_3 = 0; { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "dopt_sensor_anomalies/detection.py":14 @@ -12275,20 +12135,22 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * from pandas import DataFrame * from PIL import Image */ - __pyx_t_2 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_n_u_contours, __pyx_mstate_global->__pyx_n_u_perspective); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_contours,__pyx_mstate_global->__pyx_n_u_perspective}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_imutils, __pyx_imported_names, 2, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_imutils, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_contours,__pyx_mstate_global->__pyx_n_u_perspective}; + for (__pyx_t_3=0; __pyx_t_3 < 2; __pyx_t_3++) { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_contours); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_contours, __pyx_t_2) < (0)) __PYX_ERR(0, 14, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_perspective); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_perspective, __pyx_t_2) < (0)) __PYX_ERR(0, 14, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "dopt_sensor_anomalies/detection.py":15 * from dopt_basics import result_pattern @@ -12297,15 +12159,21 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * from PIL import Image * from scipy.spatial import distance as dist */ - __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_DataFrame); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pandas, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_DataFrame}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pandas, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DataFrame); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DataFrame, __pyx_t_3) < (0)) __PYX_ERR(0, 15, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_DataFrame}; + __pyx_t_3 = 0; { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "dopt_sensor_anomalies/detection.py":16 @@ -12315,16 +12183,22 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * from scipy.spatial import distance as dist * */ - __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_Image); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Image}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_PIL, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_PIL, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Image}; + __pyx_t_3 = 0; { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Image); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Image, __pyx_t_2) < (0)) __PYX_ERR(0, 16, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "dopt_sensor_anomalies/detection.py":17 * from pandas import DataFrame @@ -12333,15 +12207,26 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * * import dopt_sensor_anomalies._find_paths */ - __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_distance); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 17, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_scipy_spatial, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_distance}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_scipy_spatial, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_distance); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 17, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_dist, __pyx_t_3) < (0)) __PYX_ERR(0, 17, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_distance}; + __pyx_t_3 = 0; { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + switch (__pyx_t_3) { + case 0: + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_dist, __pyx_t_4) < (0)) __PYX_ERR(0, 17, __pyx_L1_error) + break; + default:; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "dopt_sensor_anomalies/detection.py":19 @@ -12351,7 +12236,8 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * from dopt_sensor_anomalies import constants as const * from dopt_sensor_anomalies import errors */ - __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies__find_path, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies__find_path, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies, __pyx_t_2) < (0)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -12363,16 +12249,27 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * from dopt_sensor_anomalies import errors * from dopt_sensor_anomalies import types as t */ - __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_constants); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_constants}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_constants}; + __pyx_t_3 = 0; { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + switch (__pyx_t_3) { + case 0: + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_const, __pyx_t_4) < (0)) __PYX_ERR(0, 20, __pyx_L1_error) + break; + default:; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_constants); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_const, __pyx_t_2) < (0)) __PYX_ERR(0, 20, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "dopt_sensor_anomalies/detection.py":21 * import dopt_sensor_anomalies._find_paths @@ -12381,15 +12278,21 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * from dopt_sensor_anomalies import types as t * */ - __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_errors}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_errors, __pyx_t_3) < (0)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_errors}; + __pyx_t_3 = 0; { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "dopt_sensor_anomalies/detection.py":22 @@ -12399,16 +12302,27 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * * # Suppress the specific HuggingFace cache symlink warning */ - __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_types}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_types}; + __pyx_t_3 = 0; { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + switch (__pyx_t_3) { + case 0: + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_t, __pyx_t_4) < (0)) __PYX_ERR(0, 22, __pyx_L1_error) + break; + default:; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_t, __pyx_t_2) < (0)) __PYX_ERR(0, 22, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "dopt_sensor_anomalies/detection.py":25 * @@ -12417,12 +12331,12 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * "ignore", * message=".*huggingface_hub.*cache-system uses symlinks.*", */ - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_warnings); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_filterwarnings); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 25, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_warnings); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_filterwarnings); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "dopt_sensor_anomalies/detection.py":28 * "ignore", @@ -12431,21 +12345,21 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * ) * */ - __pyx_t_6 = 1; + __pyx_t_8 = 1; { - PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ignore}; - __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_message, __pyx_mstate_global->__pyx_kp_u_huggingface_hub_cache_system_us, __pyx_t_4, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 25, __pyx_L1_error) - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_category, __pyx_builtin_UserWarning, __pyx_t_4, __pyx_callargs+2, 1) < (0)) __PYX_ERR(0, 25, __pyx_L1_error) - __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ignore}; + __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_message, __pyx_mstate_global->__pyx_kp_u_huggingface_hub_cache_system_us, __pyx_t_6, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 25, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_category, ((PyObject *)(((PyTypeObject*)PyExc_UserWarning))), __pyx_t_6, __pyx_callargs+2, 1) < (0)) __PYX_ERR(0, 25, __pyx_L1_error) + __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "dopt_sensor_anomalies/detection.py":32 * @@ -12454,17 +12368,20 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * pt_A: npt.NDArray[np.floating], * pt_B: npt.NDArray[np.floating], */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_pt_A, __pyx_mstate_global->__pyx_kp_u_npt_NDArray_np_floating) < (0)) __PYX_ERR(0, 32, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_pt_B, __pyx_mstate_global->__pyx_kp_u_npt_NDArray_np_floating) < (0)) __PYX_ERR(0, 32, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_float_float) < (0)) __PYX_ERR(0, 32, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_21dopt_sensor_anomalies_9detection_1midpoint, 0, __pyx_mstate_global->__pyx_n_u_midpoint, NULL, __pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies_detection, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 32, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_midpoint, __pyx_t_5) < (0)) __PYX_ERR(0, 32, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_pt_A, __pyx_mstate_global->__pyx_kp_u_npt_NDArray_np_floating) < (0)) __PYX_ERR(0, 32, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_pt_B, __pyx_mstate_global->__pyx_kp_u_npt_NDArray_np_floating) < (0)) __PYX_ERR(0, 32, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_float_float) < (0)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_21dopt_sensor_anomalies_9detection_1midpoint, 0, __pyx_mstate_global->__pyx_n_u_midpoint, NULL, __pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies_detection, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_midpoint, __pyx_t_7) < (0)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "dopt_sensor_anomalies/detection.py":42 * box_1: t.Box, @@ -12473,8 +12390,8 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * ) -> bool: * c1, s1, _ = box_1 */ - __pyx_t_5 = PyFloat_FromDouble(((double)5.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyFloat_FromDouble(((double)5.0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); /* "dopt_sensor_anomalies/detection.py":39 * @@ -12483,23 +12400,26 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * box_1: t.Box, * box_2: t.Box, */ - __pyx_t_3 = PyTuple_Pack(1, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_box_1, __pyx_mstate_global->__pyx_kp_u_t_Box) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_box_2, __pyx_mstate_global->__pyx_kp_u_t_Box) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_tolerance, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_21dopt_sensor_anomalies_9detection_3check_box_redundancy, 0, __pyx_mstate_global->__pyx_n_u_check_box_redundancy, NULL, __pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies_detection, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_check_box_redundancy, __pyx_t_4) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = PyTuple_Pack(1, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_box_1, __pyx_mstate_global->__pyx_kp_u_t_Box) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_box_2, __pyx_mstate_global->__pyx_kp_u_t_Box) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_tolerance, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_21dopt_sensor_anomalies_9detection_3check_box_redundancy, 0, __pyx_mstate_global->__pyx_n_u_check_box_redundancy, NULL, __pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies_detection, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_t_2); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_check_box_redundancy, __pyx_t_6) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "dopt_sensor_anomalies/detection.py":55 * @@ -12508,18 +12428,21 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * img_path: Path, * pixels_per_metric_X: float, */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_img_path, __pyx_mstate_global->__pyx_n_u_Path) < (0)) __PYX_ERR(0, 55, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pixels_per_metric_X, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(0, 55, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pixels_per_metric_Y, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(0, 55, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_t_CsvData_t_SensorImages) < (0)) __PYX_ERR(0, 55, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_21dopt_sensor_anomalies_9detection_5measure_length, 0, __pyx_mstate_global->__pyx_n_u_measure_length, NULL, __pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies_detection, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 55, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_measure_length, __pyx_t_5) < (0)) __PYX_ERR(0, 55, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_img_path, __pyx_mstate_global->__pyx_n_u_Path) < (0)) __PYX_ERR(0, 55, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_pixels_per_metric_X, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(0, 55, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_pixels_per_metric_Y, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(0, 55, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_t_CsvData_t_SensorImages) < (0)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_21dopt_sensor_anomalies_9detection_5measure_length, 0, __pyx_mstate_global->__pyx_n_u_measure_length, NULL, __pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies_detection, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_measure_length, __pyx_t_7) < (0)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "dopt_sensor_anomalies/detection.py":158 * @@ -12528,17 +12451,20 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * image: npt.NDArray[np.uint8], * model: Patchcore, */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_image, __pyx_mstate_global->__pyx_kp_u_npt_NDArray_np_uint8) < (0)) __PYX_ERR(0, 158, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_model, __pyx_mstate_global->__pyx_n_u_Patchcore) < (0)) __PYX_ERR(0, 158, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_t_InferenceResult) < (0)) __PYX_ERR(0, 158, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_21dopt_sensor_anomalies_9detection_7infer_image, 0, __pyx_mstate_global->__pyx_n_u_infer_image, NULL, __pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies_detection, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_infer_image, __pyx_t_4) < (0)) __PYX_ERR(0, 158, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_image, __pyx_mstate_global->__pyx_kp_u_npt_NDArray_np_uint8) < (0)) __PYX_ERR(0, 158, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_model, __pyx_mstate_global->__pyx_n_u_Patchcore) < (0)) __PYX_ERR(0, 158, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_t_InferenceResult) < (0)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_21dopt_sensor_anomalies_9detection_7infer_image, 0, __pyx_mstate_global->__pyx_n_u_infer_image, NULL, __pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies_detection, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_infer_image, __pyx_t_6) < (0)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "dopt_sensor_anomalies/detection.py":193 * @@ -12547,19 +12473,22 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * img_path: Path, * detection_models: t.DetectionModels, */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_img_path, __pyx_mstate_global->__pyx_n_u_Path) < (0)) __PYX_ERR(0, 193, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_detection_models, __pyx_mstate_global->__pyx_kp_u_t_DetectionModels) < (0)) __PYX_ERR(0, 193, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_data_csv, __pyx_mstate_global->__pyx_kp_u_t_CsvData) < (0)) __PYX_ERR(0, 193, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sensor_images, __pyx_mstate_global->__pyx_kp_u_t_SensorImages) < (0)) __PYX_ERR(0, 193, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(0, 193, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_21dopt_sensor_anomalies_9detection_9anomaly_detection, 0, __pyx_mstate_global->__pyx_n_u_anomaly_detection, NULL, __pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies_detection, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_anomaly_detection, __pyx_t_5) < (0)) __PYX_ERR(0, 193, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_img_path, __pyx_mstate_global->__pyx_n_u_Path) < (0)) __PYX_ERR(0, 193, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_detection_models, __pyx_mstate_global->__pyx_kp_u_t_DetectionModels) < (0)) __PYX_ERR(0, 193, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_data_csv, __pyx_mstate_global->__pyx_kp_u_t_CsvData) < (0)) __PYX_ERR(0, 193, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_sensor_images, __pyx_mstate_global->__pyx_kp_u_t_SensorImages) < (0)) __PYX_ERR(0, 193, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_21dopt_sensor_anomalies_9detection_9anomaly_detection, 0, __pyx_mstate_global->__pyx_n_u_anomaly_detection, NULL, __pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies_detection, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_anomaly_detection, __pyx_t_7) < (0)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "dopt_sensor_anomalies/detection.py":239 * @@ -12568,65 +12497,68 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); * def pipeline( * user_img_path: str, */ + __pyx_t_6 = NULL; __pyx_t_4 = NULL; - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_result_pattern); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_wrap_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_6 = 1; + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_result_pattern); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_wrap_result); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_8 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_int_100}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - __pyx_t_8 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_user_img_path, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(0, 239, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_pixels_per_metric_X, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(0, 239, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_pixels_per_metric_Y, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(0, 239, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(0, 239, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_21dopt_sensor_anomalies_9detection_11pipeline, 0, __pyx_mstate_global->__pyx_n_u_pipeline, NULL, __pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies_detection, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_6 = 1; - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_int_100}; + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pipeline, __pyx_t_5) < (0)) __PYX_ERR(0, 239, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_10 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_user_img_path, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(0, 239, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_pixels_per_metric_X, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(0, 239, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_pixels_per_metric_Y, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(0, 239, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_21dopt_sensor_anomalies_9detection_11pipeline, 0, __pyx_mstate_global->__pyx_n_u_pipeline, NULL, __pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies_detection, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_8 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + } + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pipeline, __pyx_t_7) < (0)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "dopt_sensor_anomalies/detection.py":1 * import csv # <<<<<<<<<<<<<< * import warnings * from pathlib import Path */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_5) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_7) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); if (__pyx_m) { if (__pyx_mstate->__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init dopt_sensor_anomalies.detection", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -12654,357 +12586,22 @@ __Pyx_RefNannySetupContext("PyInit_detection", 0); #endif } /* #### Code section: pystring_table ### */ - -typedef struct { - const char *s; -#if 179 <= 65535 - const unsigned short n; -#elif 179 / 2 < INT_MAX - const unsigned int n; -#elif 179 / 2 < LONG_MAX - const unsigned long n; -#else - const Py_ssize_t n; -#endif -#if 1 <= 31 - const unsigned int encoding : 5; -#elif 1 <= 255 - const unsigned char encoding; -#elif 1 <= 65535 - const unsigned short encoding; -#else - const Py_ssize_t encoding; -#endif - const unsigned int is_unicode : 1; - const unsigned int intern : 1; -} __Pyx_StringTabEntry; -static const char * const __pyx_string_tab_encodings[] = { 0 }; -static const __Pyx_StringTabEntry __pyx_string_tab[] = { - {__pyx_k_, sizeof(__pyx_k_), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ */ - {__pyx_k_1f, sizeof(__pyx_k_1f), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_1f */ - {__pyx_k_3f, sizeof(__pyx_k_3f), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_3f */ - {__pyx_k_Any, sizeof(__pyx_k_Any), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Any */ - {__pyx_k_BACKBONE, sizeof(__pyx_k_BACKBONE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_BACKBONE */ - {__pyx_k_Box, sizeof(__pyx_k_Box), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Box */ - {__pyx_k_CHAIN_APPROX_SIMPLE, sizeof(__pyx_k_CHAIN_APPROX_SIMPLE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CHAIN_APPROX_SIMPLE */ - {__pyx_k_COLOR_BGR2GRAY, sizeof(__pyx_k_COLOR_BGR2GRAY), 0, 1, 1}, /* PyObject cname: __pyx_n_u_COLOR_BGR2GRAY */ - {__pyx_k_COLOR_BGR2RGB, sizeof(__pyx_k_COLOR_BGR2RGB), 0, 1, 1}, /* PyObject cname: __pyx_n_u_COLOR_BGR2RGB */ - {__pyx_k_Canny, sizeof(__pyx_k_Canny), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Canny */ - {__pyx_k_ContourCalculationError, sizeof(__pyx_k_ContourCalculationError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ContourCalculationError */ - {__pyx_k_Contour_detection_not_valid_cont, sizeof(__pyx_k_Contour_detection_not_valid_cont), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Contour_detection_not_valid_cont */ - {__pyx_k_Contour_detection_not_valid_no_c, sizeof(__pyx_k_Contour_detection_not_valid_no_c), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Contour_detection_not_valid_no_c */ - {__pyx_k_DETECTION_MODELS, sizeof(__pyx_k_DETECTION_MODELS), 0, 1, 1}, /* PyObject cname: __pyx_n_u_DETECTION_MODELS */ - {__pyx_k_DataFrame, sizeof(__pyx_k_DataFrame), 0, 1, 1}, /* PyObject cname: __pyx_n_u_DataFrame */ - {__pyx_k_FileNotFoundError, sizeof(__pyx_k_FileNotFoundError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FileNotFoundError */ - {__pyx_k_Final, sizeof(__pyx_k_Final), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Final */ - {__pyx_k_HEATMAP_FILENAME_SUFFIX, sizeof(__pyx_k_HEATMAP_FILENAME_SUFFIX), 0, 1, 1}, /* PyObject cname: __pyx_n_u_HEATMAP_FILENAME_SUFFIX */ - {__pyx_k_Image, sizeof(__pyx_k_Image), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Image */ - {__pyx_k_ImageNotReadError, sizeof(__pyx_k_ImageNotReadError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ImageNotReadError */ - {__pyx_k_Image_could_not_be_read_from, sizeof(__pyx_k_Image_could_not_be_read_from), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Image_could_not_be_read_from */ - {__pyx_k_InferenceResult, sizeof(__pyx_k_InferenceResult), 0, 1, 1}, /* PyObject cname: __pyx_n_u_InferenceResult */ - {__pyx_k_InvalidElectrodeCount, sizeof(__pyx_k_InvalidElectrodeCount), 0, 1, 1}, /* PyObject cname: __pyx_n_u_InvalidElectrodeCount */ - {__pyx_k_LAYERS, sizeof(__pyx_k_LAYERS), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LAYERS */ - {__pyx_k_MODEL_FOLDER, sizeof(__pyx_k_MODEL_FOLDER), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MODEL_FOLDER */ - {__pyx_k_MORPH_CLOSE, sizeof(__pyx_k_MORPH_CLOSE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MORPH_CLOSE */ - {__pyx_k_MORPH_RECT, sizeof(__pyx_k_MORPH_RECT), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MORPH_RECT */ - {__pyx_k_NDArray, sizeof(__pyx_k_NDArray), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NDArray */ - {__pyx_k_NUM_VALID_ELECTRODES, sizeof(__pyx_k_NUM_VALID_ELECTRODES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NUM_VALID_ELECTRODES */ - {__pyx_k_No_contours_were_found_in_the_pr, sizeof(__pyx_k_No_contours_were_found_in_the_pr), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_No_contours_were_found_in_the_pr */ - {__pyx_k_None, sizeof(__pyx_k_None), 0, 1, 1}, /* PyObject cname: __pyx_n_u_None */ - {__pyx_k_Note_that_Cython_is_deliberately, sizeof(__pyx_k_Note_that_Cython_is_deliberately), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Note_that_Cython_is_deliberately */ - {__pyx_k_Number_of_counted_electrodes_doe, sizeof(__pyx_k_Number_of_counted_electrodes_doe), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Number_of_counted_electrodes_doe */ - {__pyx_k_PIL, sizeof(__pyx_k_PIL), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PIL */ - {__pyx_k_Patchcore, sizeof(__pyx_k_Patchcore), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Patchcore */ - {__pyx_k_Path, sizeof(__pyx_k_Path), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Path */ - {__pyx_k_QUOTE_NONE, sizeof(__pyx_k_QUOTE_NONE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_QUOTE_NONE */ - {__pyx_k_RATIO, sizeof(__pyx_k_RATIO), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RATIO */ - {__pyx_k_RETR_TREE, sizeof(__pyx_k_RETR_TREE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RETR_TREE */ - {__pyx_k_RGB, sizeof(__pyx_k_RGB), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RGB */ - {__pyx_k_SensorImages, sizeof(__pyx_k_SensorImages), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SensorImages */ - {__pyx_k_THRESHOLD_BW, sizeof(__pyx_k_THRESHOLD_BW), 0, 1, 1}, /* PyObject cname: __pyx_n_u_THRESHOLD_BW */ - {__pyx_k_THRESH_BINARY, sizeof(__pyx_k_THRESH_BINARY), 0, 1, 1}, /* PyObject cname: __pyx_n_u_THRESH_BINARY */ - {__pyx_k_The_provided_path_seems_not_to_e, sizeof(__pyx_k_The_provided_path_seems_not_to_e), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_provided_path_seems_not_to_e */ - {__pyx_k_UserWarning, sizeof(__pyx_k_UserWarning), 0, 1, 1}, /* PyObject cname: __pyx_n_u_UserWarning */ - {__pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__2 */ - {__pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__3 */ - {__pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__4 */ - {__pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__5 */ - {__pyx_k__8, sizeof(__pyx_k__8), 0, 1, 1}, /* PyObject cname: __pyx_n_u__8 */ - {__pyx_k_accepted_boxes, sizeof(__pyx_k_accepted_boxes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_accepted_boxes */ - {__pyx_k_add_note, sizeof(__pyx_k_add_note), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_add_note */ - {__pyx_k_all, sizeof(__pyx_k_all), 0, 1, 1}, /* PyObject cname: __pyx_n_u_all */ - {__pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 1, 1}, /* PyObject cname: __pyx_n_u_alpha */ - {__pyx_k_anomalib_models, sizeof(__pyx_k_anomalib_models), 0, 1, 1}, /* PyObject cname: __pyx_n_u_anomalib_models */ - {__pyx_k_anomaly_detection, sizeof(__pyx_k_anomaly_detection), 0, 1, 1}, /* PyObject cname: __pyx_n_u_anomaly_detection */ - {__pyx_k_anomaly_label, sizeof(__pyx_k_anomaly_label), 0, 1, 1}, /* PyObject cname: __pyx_n_u_anomaly_label */ - {__pyx_k_anomaly_map, sizeof(__pyx_k_anomaly_map), 0, 1, 1}, /* PyObject cname: __pyx_n_u_anomaly_map */ - {__pyx_k_anomaly_map_resized, sizeof(__pyx_k_anomaly_map_resized), 0, 1, 1}, /* PyObject cname: __pyx_n_u_anomaly_map_resized */ - {__pyx_k_anomaly_score, sizeof(__pyx_k_anomaly_score), 0, 1, 1}, /* PyObject cname: __pyx_n_u_anomaly_score */ - {__pyx_k_array, sizeof(__pyx_k_array), 0, 1, 1}, /* PyObject cname: __pyx_n_u_array */ - {__pyx_k_astype, sizeof(__pyx_k_astype), 0, 1, 1}, /* PyObject cname: __pyx_n_u_astype */ - {__pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 1, 1}, /* PyObject cname: __pyx_n_u_asyncio_coroutines */ - {__pyx_k_ax, sizeof(__pyx_k_ax), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ax */ - {__pyx_k_axes, sizeof(__pyx_k_axes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_axes */ - {__pyx_k_axis, sizeof(__pyx_k_axis), 0, 1, 1}, /* PyObject cname: __pyx_n_u_axis */ - {__pyx_k_backbone, sizeof(__pyx_k_backbone), 0, 1, 1}, /* PyObject cname: __pyx_n_u_backbone */ - {__pyx_k_bbox_inches, sizeof(__pyx_k_bbox_inches), 0, 1, 1}, /* PyObject cname: __pyx_n_u_bbox_inches */ - {__pyx_k_binary, sizeof(__pyx_k_binary), 0, 1, 1}, /* PyObject cname: __pyx_n_u_binary */ - {__pyx_k_bl, sizeof(__pyx_k_bl), 0, 1, 1}, /* PyObject cname: __pyx_n_u_bl */ - {__pyx_k_blbrX, sizeof(__pyx_k_blbrX), 0, 1, 1}, /* PyObject cname: __pyx_n_u_blbrX */ - {__pyx_k_blbrY, sizeof(__pyx_k_blbrY), 0, 1, 1}, /* PyObject cname: __pyx_n_u_blbrY */ - {__pyx_k_bool, sizeof(__pyx_k_bool), 0, 1, 1}, /* PyObject cname: __pyx_n_u_bool */ - {__pyx_k_boundingRect, sizeof(__pyx_k_boundingRect), 0, 1, 1}, /* PyObject cname: __pyx_n_u_boundingRect */ - {__pyx_k_box, sizeof(__pyx_k_box), 0, 1, 1}, /* PyObject cname: __pyx_n_u_box */ - {__pyx_k_boxPoints, sizeof(__pyx_k_boxPoints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_boxPoints */ - {__pyx_k_box_1, sizeof(__pyx_k_box_1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_box_1 */ - {__pyx_k_box_2, sizeof(__pyx_k_box_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_box_2 */ - {__pyx_k_br, sizeof(__pyx_k_br), 0, 1, 1}, /* PyObject cname: __pyx_n_u_br */ - {__pyx_k_c, sizeof(__pyx_k_c), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c */ - {__pyx_k_c1, sizeof(__pyx_k_c1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c1 */ - {__pyx_k_c2, sizeof(__pyx_k_c2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c2 */ - {__pyx_k_cast, sizeof(__pyx_k_cast), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cast */ - {__pyx_k_category, sizeof(__pyx_k_category), 0, 1, 1}, /* PyObject cname: __pyx_n_u_category */ - {__pyx_k_center_dist, sizeof(__pyx_k_center_dist), 0, 1, 1}, /* PyObject cname: __pyx_n_u_center_dist */ - {__pyx_k_check_box_redundancy, sizeof(__pyx_k_check_box_redundancy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_check_box_redundancy */ - {__pyx_k_checkpoint, sizeof(__pyx_k_checkpoint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_checkpoint */ - {__pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_class_getitem */ - {__pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cline_in_traceback */ - {__pyx_k_close, sizeof(__pyx_k_close), 0, 1, 1}, /* PyObject cname: __pyx_n_u_close */ - {__pyx_k_closed, sizeof(__pyx_k_closed), 0, 1, 1}, /* PyObject cname: __pyx_n_u_closed */ - {__pyx_k_cmap, sizeof(__pyx_k_cmap), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cmap */ - {__pyx_k_cnts, sizeof(__pyx_k_cnts), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cnts */ - {__pyx_k_const, sizeof(__pyx_k_const), 0, 1, 1}, /* PyObject cname: __pyx_n_u_const */ - {__pyx_k_constants, sizeof(__pyx_k_constants), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constants */ - {__pyx_k_contours, sizeof(__pyx_k_contours), 0, 1, 1}, /* PyObject cname: __pyx_n_u_contours */ - {__pyx_k_convert, sizeof(__pyx_k_convert), 0, 1, 1}, /* PyObject cname: __pyx_n_u_convert */ - {__pyx_k_copy, sizeof(__pyx_k_copy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_copy */ - {__pyx_k_coreset_sampling_ratio, sizeof(__pyx_k_coreset_sampling_ratio), 0, 1, 1}, /* PyObject cname: __pyx_n_u_coreset_sampling_ratio */ - {__pyx_k_cpu, sizeof(__pyx_k_cpu), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cpu */ - {__pyx_k_cropped, sizeof(__pyx_k_cropped), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cropped */ - {__pyx_k_cropped_sensor_left, sizeof(__pyx_k_cropped_sensor_left), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cropped_sensor_left */ - {__pyx_k_cropped_sensor_right, sizeof(__pyx_k_cropped_sensor_right), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cropped_sensor_right */ - {__pyx_k_csv, sizeof(__pyx_k_csv), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_csv */ - {__pyx_k_csv_2, sizeof(__pyx_k_csv_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_csv_2 */ - {__pyx_k_cuda, sizeof(__pyx_k_cuda), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cuda */ - {__pyx_k_cv2, sizeof(__pyx_k_cv2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cv2 */ - {__pyx_k_cvtColor, sizeof(__pyx_k_cvtColor), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cvtColor */ - {__pyx_k_dA, sizeof(__pyx_k_dA), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dA */ - {__pyx_k_dB, sizeof(__pyx_k_dB), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dB */ - {__pyx_k_data_csv, sizeof(__pyx_k_data_csv), 0, 1, 1}, /* PyObject cname: __pyx_n_u_data_csv */ - {__pyx_k_detection_models, sizeof(__pyx_k_detection_models), 0, 1, 1}, /* PyObject cname: __pyx_n_u_detection_models */ - {__pyx_k_device, sizeof(__pyx_k_device), 0, 1, 1}, /* PyObject cname: __pyx_n_u_device */ - {__pyx_k_df, sizeof(__pyx_k_df), 0, 1, 1}, /* PyObject cname: __pyx_n_u_df */ - {__pyx_k_dimA, sizeof(__pyx_k_dimA), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dimA */ - {__pyx_k_dimB, sizeof(__pyx_k_dimB), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dimB */ - {__pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_disable */ - {__pyx_k_dist, sizeof(__pyx_k_dist), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dist */ - {__pyx_k_distance, sizeof(__pyx_k_distance), 0, 1, 1}, /* PyObject cname: __pyx_n_u_distance */ - {__pyx_k_dopt_basics, sizeof(__pyx_k_dopt_basics), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dopt_basics */ - {__pyx_k_dopt_sensor_anomalies, sizeof(__pyx_k_dopt_sensor_anomalies), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dopt_sensor_anomalies */ - {__pyx_k_dopt_sensor_anomalies__find_path, sizeof(__pyx_k_dopt_sensor_anomalies__find_path), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dopt_sensor_anomalies__find_path */ - {__pyx_k_dopt_sensor_anomalies_detection, sizeof(__pyx_k_dopt_sensor_anomalies_detection), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dopt_sensor_anomalies_detection */ - {__pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dtype */ - {__pyx_k_edged, sizeof(__pyx_k_edged), 0, 1, 1}, /* PyObject cname: __pyx_n_u_edged */ - {__pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_enable */ - {__pyx_k_enter, sizeof(__pyx_k_enter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_enter */ - {__pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_enumerate */ - {__pyx_k_errors, sizeof(__pyx_k_errors), 0, 1, 1}, /* PyObject cname: __pyx_n_u_errors */ - {__pyx_k_euclidean, sizeof(__pyx_k_euclidean), 0, 1, 1}, /* PyObject cname: __pyx_n_u_euclidean */ - {__pyx_k_eval, sizeof(__pyx_k_eval), 0, 1, 1}, /* PyObject cname: __pyx_n_u_eval */ - {__pyx_k_existing, sizeof(__pyx_k_existing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_existing */ - {__pyx_k_exists, sizeof(__pyx_k_exists), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exists */ - {__pyx_k_exit, sizeof(__pyx_k_exit), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exit */ - {__pyx_k_expected, sizeof(__pyx_k_expected), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_expected */ - {__pyx_k_extend, sizeof(__pyx_k_extend), 0, 1, 1}, /* PyObject cname: __pyx_n_u_extend */ - {__pyx_k_figsize, sizeof(__pyx_k_figsize), 0, 1, 1}, /* PyObject cname: __pyx_n_u_figsize */ - {__pyx_k_file_path, sizeof(__pyx_k_file_path), 0, 1, 1}, /* PyObject cname: __pyx_n_u_file_path */ - {__pyx_k_file_stem, sizeof(__pyx_k_file_stem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_file_stem */ - {__pyx_k_filtered_cnts, sizeof(__pyx_k_filtered_cnts), 0, 1, 1}, /* PyObject cname: __pyx_n_u_filtered_cnts */ - {__pyx_k_filterwarnings, sizeof(__pyx_k_filterwarnings), 0, 1, 1}, /* PyObject cname: __pyx_n_u_filterwarnings */ - {__pyx_k_findContours, sizeof(__pyx_k_findContours), 0, 1, 1}, /* PyObject cname: __pyx_n_u_findContours */ - {__pyx_k_find_paths, sizeof(__pyx_k_find_paths), 0, 1, 1}, /* PyObject cname: __pyx_n_u_find_paths */ - {__pyx_k_float, sizeof(__pyx_k_float), 0, 1, 1}, /* PyObject cname: __pyx_n_u_float */ - {__pyx_k_float32, sizeof(__pyx_k_float32), 0, 1, 1}, /* PyObject cname: __pyx_n_u_float32 */ - {__pyx_k_folder_path, sizeof(__pyx_k_folder_path), 0, 1, 1}, /* PyObject cname: __pyx_n_u_folder_path */ - {__pyx_k_from_numpy, sizeof(__pyx_k_from_numpy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_from_numpy */ - {__pyx_k_fromarray, sizeof(__pyx_k_fromarray), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fromarray */ - {__pyx_k_func, sizeof(__pyx_k_func), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func */ - {__pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_gc */ - {__pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_genexpr */ - {__pyx_k_getStructuringElement, sizeof(__pyx_k_getStructuringElement), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getStructuringElement */ - {__pyx_k_get_detection_models, sizeof(__pyx_k_get_detection_models), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_detection_models */ - {__pyx_k_get_model_folder, sizeof(__pyx_k_get_model_folder), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_model_folder */ - {__pyx_k_grab_contours, sizeof(__pyx_k_grab_contours), 0, 1, 1}, /* PyObject cname: __pyx_n_u_grab_contours */ - {__pyx_k_gray, sizeof(__pyx_k_gray), 0, 1, 1}, /* PyObject cname: __pyx_n_u_gray */ - {__pyx_k_header, sizeof(__pyx_k_header), 0, 1, 1}, /* PyObject cname: __pyx_n_u_header */ - {__pyx_k_hspace, sizeof(__pyx_k_hspace), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hspace */ - {__pyx_k_huggingface_hub_cache_system_us, sizeof(__pyx_k_huggingface_hub_cache_system_us), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_huggingface_hub_cache_system_us */ - {__pyx_k_i, sizeof(__pyx_k_i), 0, 1, 1}, /* PyObject cname: __pyx_n_u_i */ - {__pyx_k_ignore, sizeof(__pyx_k_ignore), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ignore */ - {__pyx_k_image, sizeof(__pyx_k_image), 0, 1, 1}, /* PyObject cname: __pyx_n_u_image */ - {__pyx_k_image_np, sizeof(__pyx_k_image_np), 0, 1, 1}, /* PyObject cname: __pyx_n_u_image_np */ - {__pyx_k_image_rgb, sizeof(__pyx_k_image_rgb), 0, 1, 1}, /* PyObject cname: __pyx_n_u_image_rgb */ - {__pyx_k_img, sizeof(__pyx_k_img), 0, 1, 1}, /* PyObject cname: __pyx_n_u_img */ - {__pyx_k_img_np, sizeof(__pyx_k_img_np), 0, 1, 1}, /* PyObject cname: __pyx_n_u_img_np */ - {__pyx_k_img_path, sizeof(__pyx_k_img_path), 0, 1, 1}, /* PyObject cname: __pyx_n_u_img_path */ - {__pyx_k_imread, sizeof(__pyx_k_imread), 0, 1, 1}, /* PyObject cname: __pyx_n_u_imread */ - {__pyx_k_imshow, sizeof(__pyx_k_imshow), 0, 1, 1}, /* PyObject cname: __pyx_n_u_imshow */ - {__pyx_k_imutils, sizeof(__pyx_k_imutils), 0, 1, 1}, /* PyObject cname: __pyx_n_u_imutils */ - {__pyx_k_index, sizeof(__pyx_k_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_index */ - {__pyx_k_infer_image, sizeof(__pyx_k_infer_image), 0, 1, 1}, /* PyObject cname: __pyx_n_u_infer_image */ - {__pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_initializing */ - {__pyx_k_input_tensor, sizeof(__pyx_k_input_tensor), 0, 1, 1}, /* PyObject cname: __pyx_n_u_input_tensor */ - {__pyx_k_int32, sizeof(__pyx_k_int32), 0, 1, 1}, /* PyObject cname: __pyx_n_u_int32 */ - {__pyx_k_is_available, sizeof(__pyx_k_is_available), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_available */ - {__pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_coroutine */ - {__pyx_k_is_duplicate, sizeof(__pyx_k_is_duplicate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_duplicate */ - {__pyx_k_is_sorted, sizeof(__pyx_k_is_sorted), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_sorted */ - {__pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_isenabled */ - {__pyx_k_item, sizeof(__pyx_k_item), 0, 1, 1}, /* PyObject cname: __pyx_n_u_item */ - {__pyx_k_items, sizeof(__pyx_k_items), 0, 1, 1}, /* PyObject cname: __pyx_n_u_items */ - {__pyx_k_jet, sizeof(__pyx_k_jet), 0, 1, 1}, /* PyObject cname: __pyx_n_u_jet */ - {__pyx_k_kernel, sizeof(__pyx_k_kernel), 0, 1, 1}, /* PyObject cname: __pyx_n_u_kernel */ - {__pyx_k_layers, sizeof(__pyx_k_layers), 0, 1, 1}, /* PyObject cname: __pyx_n_u_layers */ - {__pyx_k_left, sizeof(__pyx_k_left), 0, 1, 1}, /* PyObject cname: __pyx_n_u_left */ - {__pyx_k_leftmost_x_fourth, sizeof(__pyx_k_leftmost_x_fourth), 0, 1, 1}, /* PyObject cname: __pyx_n_u_leftmost_x_fourth */ - {__pyx_k_linalg, sizeof(__pyx_k_linalg), 0, 1, 1}, /* PyObject cname: __pyx_n_u_linalg */ - {__pyx_k_load, sizeof(__pyx_k_load), 0, 1, 1}, /* PyObject cname: __pyx_n_u_load */ - {__pyx_k_load_state_dict, sizeof(__pyx_k_load_state_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_load_state_dict */ - {__pyx_k_main, sizeof(__pyx_k_main), 0, 1, 1}, /* PyObject cname: __pyx_n_u_main */ - {__pyx_k_matplotlib, sizeof(__pyx_k_matplotlib), 0, 1, 1}, /* PyObject cname: __pyx_n_u_matplotlib */ - {__pyx_k_matplotlib_pyplot, sizeof(__pyx_k_matplotlib_pyplot), 0, 1, 1}, /* PyObject cname: __pyx_n_u_matplotlib_pyplot */ - {__pyx_k_max, sizeof(__pyx_k_max), 0, 1, 1}, /* PyObject cname: __pyx_n_u_max */ - {__pyx_k_measure_length, sizeof(__pyx_k_measure_length), 0, 1, 1}, /* PyObject cname: __pyx_n_u_measure_length */ - {__pyx_k_measure_length_locals_genexpr, sizeof(__pyx_k_measure_length_locals_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_measure_length_locals_genexpr */ - {__pyx_k_message, sizeof(__pyx_k_message), 0, 1, 1}, /* PyObject cname: __pyx_n_u_message */ - {__pyx_k_midpoint, sizeof(__pyx_k_midpoint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_midpoint */ - {__pyx_k_min, sizeof(__pyx_k_min), 0, 1, 1}, /* PyObject cname: __pyx_n_u_min */ - {__pyx_k_minAreaRect, sizeof(__pyx_k_minAreaRect), 0, 1, 1}, /* PyObject cname: __pyx_n_u_minAreaRect */ - {__pyx_k_mode, sizeof(__pyx_k_mode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mode */ - {__pyx_k_model, sizeof(__pyx_k_model), 0, 1, 1}, /* PyObject cname: __pyx_n_u_model */ - {__pyx_k_model_state_dict, sizeof(__pyx_k_model_state_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_model_state_dict */ - {__pyx_k_module, sizeof(__pyx_k_module), 0, 1, 1}, /* PyObject cname: __pyx_n_u_module */ - {__pyx_k_morphologyEx, sizeof(__pyx_k_morphologyEx), 0, 1, 1}, /* PyObject cname: __pyx_n_u_morphologyEx */ - {__pyx_k_name, sizeof(__pyx_k_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name */ - {__pyx_k_next, sizeof(__pyx_k_next), 0, 1, 1}, /* PyObject cname: __pyx_n_u_next */ - {__pyx_k_no_grad, sizeof(__pyx_k_no_grad), 0, 1, 1}, /* PyObject cname: __pyx_n_u_no_grad */ - {__pyx_k_norm, sizeof(__pyx_k_norm), 0, 1, 1}, /* PyObject cname: __pyx_n_u_norm */ - {__pyx_k_np, sizeof(__pyx_k_np), 0, 1, 1}, /* PyObject cname: __pyx_n_u_np */ - {__pyx_k_npt, sizeof(__pyx_k_npt), 0, 1, 1}, /* PyObject cname: __pyx_n_u_npt */ - {__pyx_k_npt_NDArray_np_floating, sizeof(__pyx_k_npt_NDArray_np_floating), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_npt_NDArray_np_floating */ - {__pyx_k_npt_NDArray_np_uint8, sizeof(__pyx_k_npt_NDArray_np_uint8), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_npt_NDArray_np_uint8 */ - {__pyx_k_num_contours, sizeof(__pyx_k_num_contours), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_contours */ - {__pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_numpy */ - {__pyx_k_numpy_typing, sizeof(__pyx_k_numpy_typing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_numpy_typing */ - {__pyx_k_off, sizeof(__pyx_k_off), 0, 1, 1}, /* PyObject cname: __pyx_n_u_off */ - {__pyx_k_order_points, sizeof(__pyx_k_order_points), 0, 1, 1}, /* PyObject cname: __pyx_n_u_order_points */ - {__pyx_k_orig, sizeof(__pyx_k_orig), 0, 1, 1}, /* PyObject cname: __pyx_n_u_orig */ - {__pyx_k_output, sizeof(__pyx_k_output), 0, 1, 1}, /* PyObject cname: __pyx_n_u_output */ - {__pyx_k_pad_inches, sizeof(__pyx_k_pad_inches), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pad_inches */ - {__pyx_k_pandas, sizeof(__pyx_k_pandas), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pandas */ - {__pyx_k_parent, sizeof(__pyx_k_parent), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parent */ - {__pyx_k_pathlib, sizeof(__pyx_k_pathlib), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pathlib */ - {__pyx_k_permute, sizeof(__pyx_k_permute), 0, 1, 1}, /* PyObject cname: __pyx_n_u_permute */ - {__pyx_k_perspective, sizeof(__pyx_k_perspective), 0, 1, 1}, /* PyObject cname: __pyx_n_u_perspective */ - {__pyx_k_pil_image, sizeof(__pyx_k_pil_image), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pil_image */ - {__pyx_k_pipeline, sizeof(__pyx_k_pipeline), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pipeline */ - {__pyx_k_pixels_per_metric_X, sizeof(__pyx_k_pixels_per_metric_X), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pixels_per_metric_X */ - {__pyx_k_pixels_per_metric_Y, sizeof(__pyx_k_pixels_per_metric_Y), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pixels_per_metric_Y */ - {__pyx_k_plt, sizeof(__pyx_k_plt), 0, 1, 1}, /* PyObject cname: __pyx_n_u_plt */ - {__pyx_k_png, sizeof(__pyx_k_png), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_png */ - {__pyx_k_pop, sizeof(__pyx_k_pop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pop */ - {__pyx_k_pred_label, sizeof(__pyx_k_pred_label), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pred_label */ - {__pyx_k_pred_score, sizeof(__pyx_k_pred_score), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pred_score */ - {__pyx_k_pt_A, sizeof(__pyx_k_pt_A), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pt_A */ - {__pyx_k_pt_B, sizeof(__pyx_k_pt_B), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pt_B */ - {__pyx_k_pyplot, sizeof(__pyx_k_pyplot), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyplot */ - {__pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 1, 1}, /* PyObject cname: __pyx_n_u_qualname */ - {__pyx_k_quoting, sizeof(__pyx_k_quoting), 0, 1, 1}, /* PyObject cname: __pyx_n_u_quoting */ - {__pyx_k_rbox, sizeof(__pyx_k_rbox), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rbox */ - {__pyx_k_resize, sizeof(__pyx_k_resize), 0, 1, 1}, /* PyObject cname: __pyx_n_u_resize */ - {__pyx_k_result, sizeof(__pyx_k_result), 0, 1, 1}, /* PyObject cname: __pyx_n_u_result */ - {__pyx_k_result_pattern, sizeof(__pyx_k_result_pattern), 0, 1, 1}, /* PyObject cname: __pyx_n_u_result_pattern */ - {__pyx_k_return, sizeof(__pyx_k_return), 0, 1, 1}, /* PyObject cname: __pyx_n_u_return */ - {__pyx_k_right, sizeof(__pyx_k_right), 0, 1, 1}, /* PyObject cname: __pyx_n_u_right */ - {__pyx_k_rightmost_x_third, sizeof(__pyx_k_rightmost_x_third), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rightmost_x_third */ - {__pyx_k_s1, sizeof(__pyx_k_s1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_s1 */ - {__pyx_k_s2, sizeof(__pyx_k_s2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_s2 */ - {__pyx_k_savefig, sizeof(__pyx_k_savefig), 0, 1, 1}, /* PyObject cname: __pyx_n_u_savefig */ - {__pyx_k_scipy_spatial, sizeof(__pyx_k_scipy_spatial), 0, 1, 1}, /* PyObject cname: __pyx_n_u_scipy_spatial */ - {__pyx_k_send, sizeof(__pyx_k_send), 0, 1, 1}, /* PyObject cname: __pyx_n_u_send */ - {__pyx_k_sensor_images, sizeof(__pyx_k_sensor_images), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sensor_images */ - {__pyx_k_sep, sizeof(__pyx_k_sep), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sep */ - {__pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_name */ - {__pyx_k_shape, sizeof(__pyx_k_shape), 0, 1, 1}, /* PyObject cname: __pyx_n_u_shape */ - {__pyx_k_side, sizeof(__pyx_k_side), 0, 1, 1}, /* PyObject cname: __pyx_n_u_side */ - {__pyx_k_size_diff, sizeof(__pyx_k_size_diff), 0, 1, 1}, /* PyObject cname: __pyx_n_u_size_diff */ - {__pyx_k_sort_contours, sizeof(__pyx_k_sort_contours), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sort_contours */ - {__pyx_k_spec, sizeof(__pyx_k_spec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_spec */ - {__pyx_k_squeeze, sizeof(__pyx_k_squeeze), 0, 1, 1}, /* PyObject cname: __pyx_n_u_squeeze */ - {__pyx_k_src_dopt_sensor_anomalies_detect, sizeof(__pyx_k_src_dopt_sensor_anomalies_detect), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_src_dopt_sensor_anomalies_detect */ - {__pyx_k_stem, sizeof(__pyx_k_stem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_stem */ - {__pyx_k_str, sizeof(__pyx_k_str), 0, 1, 1}, /* PyObject cname: __pyx_n_u_str */ - {__pyx_k_subplots, sizeof(__pyx_k_subplots), 0, 1, 1}, /* PyObject cname: __pyx_n_u_subplots */ - {__pyx_k_subplots_adjust, sizeof(__pyx_k_subplots_adjust), 0, 1, 1}, /* PyObject cname: __pyx_n_u_subplots_adjust */ - {__pyx_k_t, sizeof(__pyx_k_t), 0, 1, 1}, /* PyObject cname: __pyx_n_u_t */ - {__pyx_k_t_Box, sizeof(__pyx_k_t_Box), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_t_Box */ - {__pyx_k_t_CsvData, sizeof(__pyx_k_t_CsvData), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_t_CsvData */ - {__pyx_k_t_DetectionModels, sizeof(__pyx_k_t_DetectionModels), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_t_DetectionModels */ - {__pyx_k_t_InferenceResult, sizeof(__pyx_k_t_InferenceResult), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_t_InferenceResult */ - {__pyx_k_t_SensorImages, sizeof(__pyx_k_t_SensorImages), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_t_SensorImages */ - {__pyx_k_test, sizeof(__pyx_k_test), 0, 1, 1}, /* PyObject cname: __pyx_n_u_test */ - {__pyx_k_threshold, sizeof(__pyx_k_threshold), 0, 1, 1}, /* PyObject cname: __pyx_n_u_threshold */ - {__pyx_k_throw, sizeof(__pyx_k_throw), 0, 1, 1}, /* PyObject cname: __pyx_n_u_throw */ - {__pyx_k_tight, sizeof(__pyx_k_tight), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tight */ - {__pyx_k_tl, sizeof(__pyx_k_tl), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tl */ - {__pyx_k_tlblX, sizeof(__pyx_k_tlblX), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tlblX */ - {__pyx_k_tlblY, sizeof(__pyx_k_tlblY), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tlblY */ - {__pyx_k_tltrX, sizeof(__pyx_k_tltrX), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tltrX */ - {__pyx_k_tltrY, sizeof(__pyx_k_tltrY), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tltrY */ - {__pyx_k_to, sizeof(__pyx_k_to), 0, 1, 1}, /* PyObject cname: __pyx_n_u_to */ - {__pyx_k_to_csv, sizeof(__pyx_k_to_csv), 0, 1, 1}, /* PyObject cname: __pyx_n_u_to_csv */ - {__pyx_k_tolerance, sizeof(__pyx_k_tolerance), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tolerance */ - {__pyx_k_torch, sizeof(__pyx_k_torch), 0, 1, 1}, /* PyObject cname: __pyx_n_u_torch */ - {__pyx_k_torch_device, sizeof(__pyx_k_torch_device), 0, 1, 1}, /* PyObject cname: __pyx_n_u_torch_device */ - {__pyx_k_tr, sizeof(__pyx_k_tr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tr */ - {__pyx_k_trbrX, sizeof(__pyx_k_trbrX), 0, 1, 1}, /* PyObject cname: __pyx_n_u_trbrX */ - {__pyx_k_trbrY, sizeof(__pyx_k_trbrY), 0, 1, 1}, /* PyObject cname: __pyx_n_u_trbrY */ - {__pyx_k_tuple_float_float, sizeof(__pyx_k_tuple_float_float), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_tuple_float_float */ - {__pyx_k_tuple_t_CsvData_t_SensorImages, sizeof(__pyx_k_tuple_t_CsvData_t_SensorImages), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_tuple_t_CsvData_t_SensorImages */ - {__pyx_k_types, sizeof(__pyx_k_types), 0, 1, 1}, /* PyObject cname: __pyx_n_u_types */ - {__pyx_k_typing, sizeof(__pyx_k_typing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_typing */ - {__pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 1, 1}, /* PyObject cname: __pyx_n_u_uint8 */ - {__pyx_k_unsqueeze, sizeof(__pyx_k_unsqueeze), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unsqueeze */ - {__pyx_k_user_img_path, sizeof(__pyx_k_user_img_path), 0, 1, 1}, /* PyObject cname: __pyx_n_u_user_img_path */ - {__pyx_k_value, sizeof(__pyx_k_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_value */ - {__pyx_k_w, sizeof(__pyx_k_w), 0, 1, 1}, /* PyObject cname: __pyx_n_u_w */ - {__pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 1, 1}, /* PyObject cname: __pyx_n_u_warnings */ - {__pyx_k_wrap_result, sizeof(__pyx_k_wrap_result), 0, 1, 1}, /* PyObject cname: __pyx_n_u_wrap_result */ - {__pyx_k_wspace, sizeof(__pyx_k_wspace), 0, 1, 1}, /* PyObject cname: __pyx_n_u_wspace */ - {__pyx_k_x1, sizeof(__pyx_k_x1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_x1 */ - {__pyx_k_x2, sizeof(__pyx_k_x2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_x2 */ - {__pyx_k_x_coords, sizeof(__pyx_k_x_coords), 0, 1, 1}, /* PyObject cname: __pyx_n_u_x_coords */ - {__pyx_k_x_max, sizeof(__pyx_k_x_max), 0, 1, 1}, /* PyObject cname: __pyx_n_u_x_max */ - {__pyx_k_x_middle, sizeof(__pyx_k_x_middle), 0, 1, 1}, /* PyObject cname: __pyx_n_u_x_middle */ - {__pyx_k_x_min, sizeof(__pyx_k_x_min), 0, 1, 1}, /* PyObject cname: __pyx_n_u_x_min */ - {__pyx_k_y_max, sizeof(__pyx_k_y_max), 0, 1, 1}, /* PyObject cname: __pyx_n_u_y_max */ - {__pyx_k_y_min, sizeof(__pyx_k_y_min), 0, 1, 1}, /* PyObject cname: __pyx_n_u_y_min */ - {__pyx_k_zip, sizeof(__pyx_k_zip), 0, 1, 1}, /* PyObject cname: __pyx_n_u_zip */ - {0, 0, 0, 0, 0} -}; -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names); - /* #### Code section: cached_builtins ### */ static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); - __pyx_builtin_UserWarning = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_UserWarning); if (!__pyx_builtin_UserWarning) __PYX_ERR(0, 28, __pyx_L1_error) __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_min); if (!__pyx_builtin_min) __PYX_ERR(0, 143, __pyx_L1_error) __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_max); if (!__pyx_builtin_max) __PYX_ERR(0, 144, __pyx_L1_error) __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 84, __pyx_L1_error) __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 207, __pyx_L1_error) - __pyx_builtin_FileNotFoundError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_FileNotFoundError); if (!__pyx_builtin_FileNotFoundError) __PYX_ERR(0, 247, __pyx_L1_error) + + /* Cached unbound methods */ + __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items; + __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop; + __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values; return 0; __pyx_L1_error:; return -1; @@ -13019,9 +12616,9 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { /* "dopt_sensor_anomalies/detection.py":143 * ) * - * x_min = min(np.min(c[:, 0, 0]) for c in filtered_cnts) - 20 # <<<<<<<<<<<<<< - * x_max = max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20 - * y_min = min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20 + * x_min = max(min(np.min(c[:, 0, 0]) for c in filtered_cnts) - 20, 0) # <<<<<<<<<<<<<< + * x_max = min(max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20, orig.shape[1]) + * y_min = max(min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20, 0) */ __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); @@ -13031,10 +12628,10 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); /* "dopt_sensor_anomalies/detection.py":145 - * x_min = min(np.min(c[:, 0, 0]) for c in filtered_cnts) - 20 - * x_max = max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20 - * y_min = min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20 # <<<<<<<<<<<<<< - * y_max = max(np.max(c[:, 0, 1]) for c in filtered_cnts) + 20 + * x_min = max(min(np.min(c[:, 0, 0]) for c in filtered_cnts) - 20, 0) + * x_max = min(max(np.max(c[:, 0, 0]) for c in filtered_cnts) + 20, orig.shape[1]) + * y_min = max(min(np.min(c[:, 0, 1]) for c in filtered_cnts) - 20, 0) # <<<<<<<<<<<<<< + * y_max = min(max(np.max(c[:, 0, 1]) for c in filtered_cnts) + 20, orig.shape[0]) * */ __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_slice[0], __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 145, __pyx_L1_error) @@ -13098,39 +12695,30 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { __pyx_mstate_global->__pyx_tuple[6] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_12, __pyx_mstate_global->__pyx_int_6); if (unlikely(!__pyx_mstate_global->__pyx_tuple[6])) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[6]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[6]); - - /* "dopt_sensor_anomalies/detection.py":8 - * import cv2 - * import imutils - * import matplotlib.pyplot as plt # <<<<<<<<<<<<<< - * import numpy as np - * import numpy.typing as npt -*/ - __pyx_mstate_global->__pyx_tuple[7] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_matplotlib, __pyx_mstate_global->__pyx_n_u_pyplot); if (unlikely(!__pyx_mstate_global->__pyx_tuple[7])) __PYX_ERR(0, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[7]); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[7]); - - /* "dopt_sensor_anomalies/detection.py":10 - * import matplotlib.pyplot as plt - * import numpy as np - * import numpy.typing as npt # <<<<<<<<<<<<<< - * import torch - * from anomalib.models import Patchcore -*/ - __pyx_mstate_global->__pyx_tuple[8] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_numpy, __pyx_mstate_global->__pyx_n_u_typing); if (unlikely(!__pyx_mstate_global->__pyx_tuple[8])) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[8]); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[8]); - - /* "dopt_sensor_anomalies/detection.py":19 - * from scipy.spatial import distance as dist - * - * import dopt_sensor_anomalies._find_paths # <<<<<<<<<<<<<< - * from dopt_sensor_anomalies import constants as const - * from dopt_sensor_anomalies import errors -*/ - __pyx_mstate_global->__pyx_tuple[9] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_dopt_sensor_anomalies, __pyx_mstate_global->__pyx_n_u_find_paths); if (unlikely(!__pyx_mstate_global->__pyx_tuple[9])) __PYX_ERR(0, 19, __pyx_L1_error) - __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[9]); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[9]); + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = __pyx_mstate->__pyx_tuple; + for (Py_ssize_t i=0; i<7; ++i) { + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL); + #else + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = __pyx_mstate->__pyx_slice; + for (Py_ssize_t i=0; i<2; ++i) { + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL); + #else + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -13141,47 +12729,120 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); - __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; - __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop; - if (__Pyx_InitStrings(__pyx_string_tab, __pyx_mstate->__pyx_string_tab, __pyx_string_tab_encodings) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_mstate->__pyx_float_0_5 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_mstate->__pyx_float_0_5)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_float_0_8 = PyFloat_FromDouble(0.8); if (unlikely(!__pyx_mstate->__pyx_float_0_8)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_float_2_0 = PyFloat_FromDouble(2.0); if (unlikely(!__pyx_mstate->__pyx_float_2_0)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_float_255_0 = PyFloat_FromDouble(255.0); if (unlikely(!__pyx_mstate->__pyx_float_255_0)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_0 = PyLong_FromLong(0); if (unlikely(!__pyx_mstate->__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_1 = PyLong_FromLong(1); if (unlikely(!__pyx_mstate->__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_2 = PyLong_FromLong(2); if (unlikely(!__pyx_mstate->__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_5 = PyLong_FromLong(5); if (unlikely(!__pyx_mstate->__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_6 = PyLong_FromLong(6); if (unlikely(!__pyx_mstate->__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_12 = PyLong_FromLong(12); if (unlikely(!__pyx_mstate->__pyx_int_12)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_20 = PyLong_FromLong(20); if (unlikely(!__pyx_mstate->__pyx_int_20)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_50 = PyLong_FromLong(50); if (unlikely(!__pyx_mstate->__pyx_int_50)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_100 = PyLong_FromLong(100); if (unlikely(!__pyx_mstate->__pyx_int_100)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_255 = PyLong_FromLong(255); if (unlikely(!__pyx_mstate->__pyx_int_255)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_500 = PyLong_FromLong(500); if (unlikely(!__pyx_mstate->__pyx_int_500)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_1500 = PyLong_FromLong(1500); if (unlikely(!__pyx_mstate->__pyx_int_1500)) __PYX_ERR(0, 1, __pyx_L1_error) + { + const struct { const unsigned int length: 10; } index[] = {{1},{3},{3},{81},{51},{31},{72},{179},{72},{36},{1},{1},{1},{1},{8},{4},{7},{6},{13},{2},{47},{9},{24},{21},{4},{38},{5},{9},{17},{17},{14},{19},{32},{3},{8},{3},{19},{14},{13},{5},{23},{16},{9},{5},{23},{5},{17},{15},{21},{6},{12},{11},{10},{7},{20},{4},{3},{9},{4},{20},{10},{5},{9},{3},{12},{12},{13},{1},{14},{3},{5},{15},{17},{13},{11},{19},{13},{5},{6},{18},{2},{4},{4},{8},{11},{6},{2},{5},{5},{4},{12},{3},{9},{5},{5},{2},{1},{2},{2},{4},{8},{11},{20},{10},{17},{18},{5},{6},{4},{4},{5},{9},{8},{7},{4},{22},{3},{7},{19},{20},{3},{4},{3},{8},{2},{2},{8},{16},{6},{2},{4},{4},{4},{8},{11},{21},{33},{31},{5},{5},{9},{9},{6},{9},{4},{8},{6},{8},{6},{7},{9},{9},{13},{14},{12},{11},{5},{7},{11},{10},{9},{8},{7},{21},{20},{16},{13},{4},{6},{6},{1},{6},{5},{8},{9},{3},{6},{8},{6},{6},{7},{5},{11},{12},{5},{12},{13},{12},{9},{4},{5},{3},{6},{6},{4},{17},{6},{4},{15},{8},{17},{3},{14},{31},{7},{8},{3},{11},{4},{5},{16},{10},{12},{8},{4},{7},{4},{2},{3},{12},{5},{12},{3},{12},{4},{6},{10},{6},{6},{7},{7},{11},{9},{8},{19},{19},{3},{3},{10},{4},{4},{6},{12},{7},{4},{6},{6},{14},{6},{5},{17},{2},{2},{7},{13},{4},{13},{3},{12},{10},{5},{4},{9},{13},{7},{4},{3},{8},{15},{1},{8},{9},{5},{5},{2},{5},{5},{5},{5},{2},{6},{9},{5},{12},{2},{5},{5},{5},{6},{5},{9},{13},{5},{6},{1},{8},{11},{6},{2},{2},{8},{5},{8},{5},{5},{5},{3},{284},{118},{52},{898},{340},{2},{2},{139}}; + #if (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (3091 bytes) */ +const char* const cstring = "BZh91AY&SY\355\244\247\\\000\001\240\177\377\377\377\377\377\377\377\377\377\277\377\377\377\277\377\377\362@@@@@@@@@@@@@\000@\000`\013\035\357\247\337/\033\337e:o\030v\305)\364j>\335V\336\353\331A\353\317\200\037|\032\247\221\020\246\232=#\311\251\355S\301\0314\300\324\236O@\005<\232\232l\243OM#'\265C@z\231\006\023\032\214\200\315&\206\203B\001\030\200\021\242i\351\006S*~E?T\3653Sj~\250\0314\0004\320\000\000\000\030\206\217D\003 jz# E6\247\252\236i\244\375SP\003M\000\030\200\000\032\000\000\000\000\r\0324\003\3244\00050$F\205\017L\247\223I\342Oi& \000\000\000\000\000\006\200\000\000\000\364\215=M4\006j\204MMO)\346\243Si\244\310\311\210\000h\003@\000\0004\000\003A\352\032\000\000\000\000\321I\355H\236\021\250dd\001\220\032\032\003@\000\000\000\000\000\000\000\000\000\002H\300a\316\316\005\017\326\034\377\332\220Cw%\030`3\301\310\352\216\221\212\200\024$\023B\003\372\003\004 L@\304\010M\003@\320\010\000g\361\316\004\200a\001=\004\210\216\344\277\210\032\231i\370/\344 \020 GK\262M\203#\006@\201\240H\022@\n\211%R\244\3237'&\245\025z\341DR\251<\310Nl\0053uIL\207D\367\022\236i\231pS\230-\320\347QJq\251\310\305\270\006\025M!\025X\220H \211\000\220\023\002\242\360\032\200\315\023ws6q\031c\013\023\311-\235\362\320\234\005/\210c\210V\215\022\250\r\342\225\330\032\032)\246k\001k\252U\216G\364W\020\362\025D\t\312Px\nxYq\001\021\230\263C\312\303rS\374i\037\347\326\371\277\025\\)\303\346O\227\317\177\274\322\201\2222\347\216\371.\376\034\311Qb/\373_\370\302R\254\312\003{Jm\006E\301\035\000\320\245,\222\306.\253),\306\021\252V\026\205\310lt\326E\325D\031f\352\240\220\257\357\235\302\263\301^\014\331M:\205\021\001b\314\313*l\347\332\313E\262\263o\n\224\203D)\352\214O\004\251D\261l}\335\241\350ag\006i\311\231\215u\000\013\023\007:\036\036\335\014\005>\2405_KHW\237\266\230/\334yj!\260\271\371\025\242\203\"\300\300h\024\336s\365\304\245\377~\350\234\342)\224\345\203\216\023\201\330}\261\242\210\020\311\2118\215\005\301\240\025\215\005:f4i\263D\316\251\275jI\003\320N\315\241\202\350""\033[\237\\0\260\236>^\351av\362K\211\033\312F\\d\200Y@?S)K+\005\223\230\2643Q\255\r\301O4&\265\235\237\302E\353\242Ye\372.\"1\352\375\354w\230\313\321\347\323\253\317\225\265\365\250;\022\300d-\320\277\220\345:\223\330\356\376\207\032\242\"5\304rq\234}\236\224<\371\305K\357v\306mx@N#/c4\335u\227S\355\221\306O\340Y]w\013\257\231\035\320\2108\033\361\363\301z\n\000v%\302\311J\270\321\333\206c\237\265\253\210\035=y\347af/6u\013zz\255Xr\226-g.\033\030\3359\252\032\1776\266\233\204\304y\330\245z3\311\303\200\257o]\343w\\\203\206\205\214=;\267\250M\332\374e\261(g\213\000\321\342\353\311\205\2604\360\270&S<\260\2458`PW]x\252Sc\332\027u.\026U\t\242\030\210\032\377ojb+\260\274\020\363\rt\310Y\261\023\177@\224Dc\232\240!G\241\355t\326\016f\335\360!\260q\341}|\245g\314\212\306\213\305AD\032\261\306\356\327\367 pm\303\025\265\250\030(\331\330\rP\351\370\313\302\177\221\030d\241\310\213\236\2038\260\326\202\263wm\346+\322\223h[qFr\375t\275ls\211w$e\335#\035\254\350\001_\352\331\203\342\343+?_\313\216\254\261\206\017p;\004\351m\020\265wb\021\261J\305\004\324\031$B\004\266\330\224\020\273\360m%\026 \265\304\\F\271\211\311\355D\000\211\212%\336R\241\270P\"v\252\362&\217\310\225\306\346c\013\210\345\302\242\213=\260\005\214\007tr\356R)\010\300_\253]_\007\375\270\234A\364\031B\352}\376\r\271W[\361\035\262\360)\213\255\2423\221\211\315\336\340]TeCi+\363qS\224\314q\0208\361`\256\200n\213\014\000\212\213\\\315\227\\6\233\t\344\036}\244]\203\257\263\340 _\220\330h\242\36159\267\215\322\327Y\260nen\350}\203i\373\307\001\307\300\274]\346\337^\303\327;\004\024g\337nC^C,\035\313TG?\263\244\254c\362p0\206vh\"\253\271\031;\005*\326\234\025j\342\271\331[\330\352\223K`\002X\021$\350)\307\253hgY\337$w+\013@\221\010K\252\323-\314\364\032q4\254\034\264\321\010\260\336\354\342\254\300\016\305\205\022\246\245\037\236\201m\270\312\344\027\230(\304\332\246\260\177k\257\030d\223\221\232\027\033b\312!S\253\203\2550\216:D\216vD\354K\035\034xe\227\r[5\363$\301\216\\\265X\266\334\307\345\301\202\372w\212""\t\204\361\356\255\254hr\031\240\356\212Pt\016hA\242M{D@\n\213Q\376J\026\033\311\216)AA\032\246\016\325W\301\236M\2640\276\253\260\rl.o\025x\263jM\251\304\030\016*\016\006\252\320Z\226D-\032\034;\311DK\331V\017S\031l&\327\330\322\346}\202\2619;\302\367\213\334\0368\262\336+\261m\322d\315\345p\312\363\311x\006\301\004s\235\265#\354pN\376\022\201\205a\327\020\027M\227\006omU\240m\211\242[\210\241\307%SP\347\3367\353\036^\317Q\3219\320N\330\265\236\314p\025\017\371\266\345\366v\267\235\210b\034\313\244\006x\013\270j!h\025\021\356\247\260\025\246P\251\0102\313\030\361\272\362\024\343\311\222\333jS\n\030\2633j|\335M\255\005\214A\031\020\252D{\330`\212\"\033\224\320\200\226v\2270\254d\315qWRU\300@\037P\247\216a\214,\215\241\252P\014`\016\3059\006\253sPi\214\3366\271\307q^\244\354\345wc\351\256O\362YB\205Ej\336g\331;f\266\035lM\002.v\276\341\240\017`\332\204A\351\327\214\260\257\242\351\206[\270\320\214\242\222A!\013L\267A\035\310+'\233\267g\254SC\2517\226p\326\265\017\254\212I`\272\202\245\007oU\033\267\312\314\242\271^\022\246\274#\n\214\005\"\327{\024\r\331\354!\351\322 A\301\340\030;\016\320\205&\030P\014-\254\202\032\350\246a\031x\361 \300\020NJ \010\262t\013b\036\240m\357\33280[\200\211\262\212\027\244e\331\036\241C\020E\353\n\261\"i\246\235;\344Hv\010H$\022\201\002\326\346Q\253\006\n0H\225\202\"EL\202\234\222\3444\204\3270A\010\006\240k\210+\007a\343\213\002\n\204\242)6h\201\211t\301m\226\203dA\307\001\250\214\315D\245\031\020D\327Q\240\255v\313u\320\363\255\200\313h\245~\024&\032\265\000\025f\000\273\315\013\374\005r\325\026\326\324\247\025bX2\253\273)\2426ST\343\327u\030\301\250\023\245\234\262\302\225\221\031\221R*\224\332&a\241\020Z\365\225\217\013\r\"\232\221\017j\205&3\2426!d\235\265*\352\260\257M\245\t\"\262\302\303T\252\244\013k\r\310q%c\031J\333\216\246\214\245K w\324\271\205\222\017.%\251u\235\003\313\323\017&\332\337X\026\3360'\212\367\264\202:\2277\222\222+\230\202\370)\270 \350\010\010`C\002=Z\327\001V1]\241\222\2260\275\324\310~\016\226\260\257\204""\022\212B\000H\306\221\223-p\251\32152\235_^^%h\243\036\025\225\254lU8\306\3356e\022\240\276\327)\272[)P,%Si)\023\304\314P\004\2562\000n\205q<(I+*\007\210SI\006\032\031\235*Q\205()\213\331\230\331\260\r\323\302\002\271%\033\010\020\2579\302\366\333%\004\201\241\031\030 6\262\273\004\014Q\266BH\210\266\226\312b\r*\256\006$a\254\222\313Sk\341\205c\026\313ZK\214\202fN8\242\002g\213{\337\242\204\270QU\022`h0\310\333[.\n|\203\324\243\261mUV%\253y\260NJ \261\3260\002\265\340\366\372\273\206\341\270p\271\267\201A\346aU\341\237wC\031\320+\330\270\227\235\265#\t\266\003u\267\320=n\333)\013\025\003~B\320 \221:\"\202'\267\225\"\341\202\200\037\t\245\010\300\035#0s\333'\300N\243d\026y\235\240\214\226q]\353\315\200n\215\006\025;b\251\221\231\031\213L\033\273pu\235\253T\036\334o\307\000\035\223%M\004B\263\252\245\030\273\032\324\361m\026\004Wz\2258\200\343DT^\2367A\253\306\312\352\346g\240Zi\313\341\263\335\261\340U\257+p\271\340\303\373k\321\321\302E\221\212}\361\201\271\255?H\312z\005\250\236\024\020\200\267?\205\177P`C\317X\327\343\272\"\350\304Zi\223\013\203M\254\021\017lF\321!\340\226\336\025Q\013\321(a\206\251W\002\212\242\232\"\230\212\361\322\240-\000\032\3123\000\314\005\201\222\301\270\202\020\225\021\341\256\003\000](\254F\267\250\316a1\304\211\003\226\236\030\313]\204+\025f\316\023\365)\361\374\205\376\337\305\371\210!+\257\305\232\313\3646\035~\303\331\0131\227s1r\251\224\007\001\335\364q\341\253\032_(\256\377\314\272%\3362\r@\226\\W1m\226\370\241\t\033\010A\357\000IBYk\234\275J\004\031d #r\311\262\013{\207\230\320\013U\031\277\211\377H\373\3115\002\002\204\n8\320\"\374\254H\350BK\236@\341\223#`\207*\r\261\231gq\t)b\213\024\364\333 \233%\261+O\357i\265d\262s\001L26A16\267?\020A\246i\003\346\232;Z\001\233*\t\251\201\2377\017\032\306'o\2539,\353\315\014\357\374\326\010?\327\005\023g\222}\263\246\332\332\241]\303\027)\334\345|*\020hW\t\235J\205Ji\250\225v\314\022\270\253\177\177tj\325\254\232\233\352\231\304\332\344\257\347\252+\226\241XPU\016\n\247\253v\365\212\264""\342\327\250\200+_Z\365k\356j$l3B\255#\024=\300\212\232\0026\305\35259\316\221\\Rx\014\321f\200\242Zs\no\276\3461\336\303\204]\031\314K-\233\262He\232\222\365%J\220\320+\335\346\270\245\335\345Q\010`JX\357f\251\340\224\244\246\251J\323\321\267r\374\237\345\366\255\215(\326\242\304\265e\245;\235\021`\213\020s,v\341:}\301\376\025\206\265|Wp\023\350z\330\272*\234\030\02060A\237t>\017X\346\0140\363\220\r)R\231\361\001\242\356\315}Q\263Wd8\004)v\332\243\264:x\356\206+\323\260|6\311\344'J\007\260\300_\320\3741'RtT8n\031\313\265e\314(kDxIq\257\005+*\254\316A\200\354H\252\354\346\220\"`\325L+fy2(\033\264\262\321R\232cRbt\205\326Qe+\022\241\312\304\242\036\261\\\301\236\364\260\"\261z\001\301\3510H\216\001\210\332JG'\306\321\3075x\311\003d\351\213\242\315\032S\233,\360\n\351@D\377\361w$S\205\t\016\332Ju\300"; + PyObject *data = __Pyx_DecompressString(cstring, 3091, 2); + if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) + const char* const bytes = __Pyx_PyBytes_AsString(data); + #if !CYTHON_ASSUME_SAFE_MACROS + if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } + #endif + #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (2997 bytes) */ +const char* const cstring = "x\332\215V\313r\333F\026\035\331\224M\333\362C\321#\2663I ?3\036\207\031Jv\036\036')\210\242,N\364\244d[\232\304\203j\002M\0226\010\200h\200\"]\225\252,\271\304\022K,\261\344\222K-\265\344\222K~B>a\316mH\262c;SS$\032\215F\367\355{\317=\3674\036\347\362\325\334B\265\340\330\276\023x\212\301}\256\373\246c+\266\343+-f\231\306#EO_\n\205y\\\216\273\236\343r\317\352(\302\361|n(U\317i(\026\257\372\212\357(\236Y\253\373\271\377i\320v\336\330\364\270\356\324l\36357J\rV\343x\021X\206\234\\\341x\311R\353\217\224\037\326\337Z\264\317\341I\325\tlC1m\305\257sr\251e\032\360\305$+9\245\300\322\035i\211i\007\\a6\263:\302\024\271u\307\347X\302|\245\320\361\353p\314\024\360\3222+\334c>\247\240|\317\324}\356\321$[\331,n~\371\340\333\007Xo\300\235\227\010F(\"\250\350\026\023\202\013\305\251*\225\300\264|r\243\343r\221SJU\245\343\004\212\315\341\014\340p1\357\355\005p\326V\004\367\245\327w\231\r'\031\341\243a\271i\327\356*\206\351\021b-N\253\227\231%xn=h\300;\332\013\350\330\2048\2670\307s\014\0304\0344\024j\203\371z]\232\345m\027\2571\rx\007\374Q\272J\371^\331y\033(\227\371u8\302\033\351jl\306\333\246\360s\367\377\371#3\014\rc<\247\213\226a\nV\2618\267\251\275\377\306\364\367JM\317\335\253\007\265\032\274\2562\235k\365\240\222\273\2473\275\316\277\024\035\341\363\206\022P\300\242\323\260L\373\225\310\3353Ej\305\260]?\267\276\244z\036\353\374l\273\271\252\345\000\002\273\366\342\235\361\300\264\375o_\344\\\273&<\375+\303q}\r\026\3009\215\331N\003T\342\342\253\023~\345\334\216\237[t\332\240\236h-1\200\232[:~\267\006\240,\204V\262\253 \216\255\3632\027\201\345\373\271miN\022O\370\201k\361\237\245/\367\025y{\221\016\235X\274\257\374q\305\013\325\356,\252\205\237\0267\326\213\330\271\260\242\226\3265us\263\274\261\253m\227\3266W\213\205\215\325\215\262\266\370\244<\377\244\254\356\275y*?Y\004A\355\316Q\225\024\230\245\007\226\244A\321\363\034o\251\270S,\354\2246\326\265\265\215\245\342\3526m\276\354\261\006_6\301\342\225\242\272\263\246nj\313\245\325\342\272\272V\324\266\237./\227v\245O\262""\001\303\313(\034i\352\235\220K\266,\301\3421}\n\304\214Uu\257X\336\226[i\313\033\253K\305\362\332FysE+\254nl\027\323n\031\376\034ef\375\351\232\366L]--iE\004\270S\306\262\355u\307\346\233\245\325Mb\240\356x\034\235\272\246mv\332\270\226PL\332:o\303\247\352\326\323\215\235\242\266\016\274\312*\342+\027w\312\332N\271X\004\036o\003\273\263R.n\257\300\023m\361y\332\327\026K\353jyOc\272\316]\320O\2538m.\230e1\313\255\263#:Tr\r\231\350\364\261\243\235p\343x\300b\025n\035?4\230\373VW\363\270 \021:\036\022\024\006\243x\231\240\302f\242c\353\246\223\303\260\023\200\254\330\274\315\310\005\324L\205\351\257*@\240\002\2474\323F\001\210\n\022\345u*\026~\336.5{\025\307\261*\244X z\031na.\376\233\0168.h]\236\232\371\212\247\353y}^\307\246:\324\250\346x\035\235\243\342=\ru\010p\271\376\212B\207\267\006L1[\357\3101\227\314h\232\324\030\255\306}\023\325G\217\360\023\016i\276\207\372$/u\313\021\\6\206\216\240u\354\r\201\204ajX\372$\025\026\367\026\3670\356v\010\010\350\225&X\303\205\301\232\346\021Qu7\320q\n\2700\224\336\216K\223\216\201w\206\344\211\000)\321\003\203\351\255y\275\345\027\034\313\361\014\325X4\300l\215T\3468UZ\232B\203\267L\235\033U\303l\250\270\026)z\272\0201\227BPa\302\324\305\0075\341\203\2039\255j\332\206F\242\367'\023N\\0(\337\334\250!\000-\305\036\267\240!\217\007N5%x\000h\r\316l\216j\222\252\t\\\344]`n\333\364\251\365\271mT\315\032\261\252jZ\\n-;$\215\350\3000v\240\024\244\017\373\314\263aF\220\237G\272 \336rZ*\222l\026\346\253\216e\300-i\021\207\243\006\357\334\016\365$a5\255\032\330\272\006\036\330Pk\017t\330\366\275@\367\003\017\346Q\371\r\004\205A\355]\314iL\366\264\324~\315c\025\355\230\020x\350\324!*\334\253\013\027l2\315\232\rb\310\323V6\232\355\246w\257V1\0335\374\345HMzi6\350$7\033\242\356\354\233\r\324\217%\020\030\220\"u\322R#\266\033\370\232/\263\0022/\314\233Bc-fZtbhx8\251<\364\r\010\263I\005\202~\372\rB\214\247K\274\344\376+\356\331\034\322\320\341\236 :\322\325p\204\257\265\021Y\340\371u\213d\264\006,\r\272\220\020XB\201A\247 \005\250\027\264""\276k9>I\212\333\241^\203\265\033\320\200\300\343 \270]\363\353\177|\312=\266\034\035G\365\017\271#\320\033\\\010\004\3250\rY\232\r\323\306_\005\010T\372\004\262\004:E\373\017\333;F\200pq\367\334:\212\244\326)\2665\315\206\364\243\005\247lGC&\014@\337\260]\034\227\310\374I\212$\013d\223K\277%\234j\025UFD\221*\003\\k@\0200\273\010:\325)H\240\301\320\342\210\360)Q\210\030_v\310\020\307M\270\351\207\210kZi\216\\\323\345\244)\256\331\006_4L\321\032\234\276\226\264\335\367\207\366\\\313w\241\003\304r\251\246(:\025\327b\212\250\2465\003f\245\2215\003\207*\310\203\262\2452\354\311\303*m\211@(\017\333\343`\260-\265D6G\031\005\271\237\334N\202\336\332\301\325\303\311a\346\\w\252\253v\267F\231+\341\351\360\273H\215\236\307\205\2709\304\343x\370oL\036\243\356\271\350j<\031\317\r3\227\273^8\0336\243\363\361\335d2\271\221\374\253W\351\217\245\226/\304\371\270\224\354\366\266zz\177\252\257\2160\3708z\215YsC\331\025\361\\\234\037a\277\231.\033\236\273\324\255\207l\230\235\014gB\0266G\231\351p9\372{\374\224&O\207K\321X4\023\331I!\351\220\365\217\302;\321D\274\222,&F\357Fo\271?7\312\\\354\226\273\255p\013&2\327\243\233\360Y\215\377\323\373\272?\333o\036d\016\226\017\357\0146\267\006[\345Q\346B7?\230\370k\244\016\263\023]4\2627K\033\243\371ml45=\274v\235\376\004\317\2250\023\252\341\3260s\3667\277\373]\370$\312\017\263\227\006\227>'\020F\031e\240<\354""\3752P\313\203\362\36603>\314~\032\3752\370\333\017}\326o\376~\346/\343\227\007\227>\203\3070?5\230\372\"\301\202\031\230B|\223\303\354\265h\362\250'w\035\236\277@\177\332\022Nuw\302\311\360fX\016\375(\037-\305\247\342;I&Q\223\355\336\251\336\255\036\353\371\375\371\376\026\326\\\272\374\226\247\nee\242[\350\356\003<\021\315\301S8\335\352n\207cp\271[\035L\337\211\331\340\356\312\341\330\341\344(s\251\313\303<0=\023U\343b2\2334{\247{\363=\304y\241\373Mx\233\300\277\320]\350\232\310\352\271x*V\311T\007\\x\024m\311\005\237\367\307\373\333\007c\204\371\366\340\n\014\307\"\311\365O\367\261'F\302\213\230V\217\365\344\263^3\365\211\322R\217\214x.\265\333@X\305x&6\222\233\311/D\214t\337\\<\026O\322V\001\2264\217\274\276\017\374&.\022\234\027\272\267@\020\033i\335\"\3225\341\317\367X\361\0218V\210\375\344aO\322\362Tx+4\242\2714c\371\367\214\334$\306\"}\243L\266;\336E6.w} \241\206\317\242\205\310J\346\022\271D\017\257\303E\225\272\225\360\014\000\r\242\345\370F,\007\214p.\\@4,\362\342O\222\237z\277\036\250\007[\243s\027\221\264iX\311\017\317\035\327\306\255\230\375\237\017\243,-\277\036\315\203\265\245\344y\017\033\27530\312\022p\025\320\261\200\354\336\210(\236Q\366:\002U\346\350]^>\317\2065@\017*\317\204\317Q\266[#\204'\302\033\241:<\356\214\262W\302\263a\023\263\207\037M\205\017\302V\264\033o\305\034a\277\377\3700:\025\335B\276W\300\275\247\275\271\337\263\177\031\317~\020\324i\000\202\212%\314\177\205\177A\212\034\246\334C\355b\247\tI=\365`\362\340\366\201\254\214+2{\337\014\256\377\330\367\016\246\017N\362y2\262s8{\330D\301\276\367\342\317\247\2162W\243\323\310\332\232\024\241%\020\032l\374\300\320\345\301\3459\220f!\256\014\276x\324\2771x\274q\350I]\270\216`Y\324\212\237'\313=\220\344\223\350\001\252\374L\\K\366z\214x\373\010$n\200lE*\361\352\201\232V\340\354\307\324B4R\271\310FR\234\276\210@\365\211n)\255\367\231\360U\374q2\236\354\r\276^;|\n\261\030\001\251}\260\354\032\352t!\322\343k\311\255\204\021%3\335\345\360^TB\016\032\220.\250C*@\333QV2\375;\022\223\231\360it;j""\016\224\177\364\306z\230rqp\361Sd\375e2\226L\216\260\333'R\260\325a\232i\310\346\024\006\236Ag%\247&\303\271a\366|\3676@\034\243\316]\214\334\215f\243\346\361\303\235\301\325\\\302{\337\364\357P\201\237\035\234\375\030F\316B\252\241\356\224\3416J\363\334\014\304\311\213&\243{\250F\022\350\3544ql*\314\217\244\350l\221\246_C\241\240\262\206\2313\277\325Pi'k\346\210\334[\304\020F\264l\222\243\247\303\274\224\343h.\036;9\237(\323\022V\302e\t\356\276\351\\\226\356\247\267\021\360\276\005\376\355G\225\370l\034\200\254\345\244\205#\307\350\337\350/R\242\2104)\216\317\243\305\250F\016'\363\311\263^\276\267\324?\205I\313\007s\007y\312\360\003\230\233\300\224\227\220[y\212\375\027x\246\220T"; + PyObject *data = __Pyx_DecompressString(cstring, 2997, 1); + if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) + const char* const bytes = __Pyx_PyBytes_AsString(data); + #if !CYTHON_ASSUME_SAFE_MACROS + if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } + #endif + #else /* compression: none (4941 bytes) */ +const char* const bytes = "<.1f.3fContour detection not valid: contours are not properly sorted from left to right.Contour detection not valid: no contours recognizedImage could not be read from: >No contours were found in the provided image. Can not continue analysis.Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False.Number of counted electrodes does not match the expected value: count = The provided path seems not to exist.,;?add_note.csvdisableenable, expected = gc.*huggingface_hub.*cache-system uses symlinks.*isenablednpt.NDArray[np.floating]npt.NDArray[np.uint8].pngsrc/dopt_sensor_anomalies/detection.pyt.Boxt.CsvDatat.DetectionModelst.InferenceResultt.SensorImagestuple[float, float]tuple[t.CsvData, t.SensorImages]AnyBACKBONEBoxCHAIN_APPROX_SIMPLECOLOR_BGR2GRAYCOLOR_BGR2RGBCannyContourCalculationErrorDETECTION_MODELSDataFrameFinalHEATMAP_FILENAME_SUFFIXImageImageNotReadErrorInferenceResultInvalidElectrodeCountLAYERSMODEL_FOLDERMORPH_CLOSEMORPH_RECTNDArrayNUM_VALID_ELECTRODESNonePILPatchcorePath__Pyx_PyDict_NextRefQUOTE_NONERATIORETR_TREERGBSensorImagesTHRESHOLD_BWTHRESH_BINARY_accepted_boxesallalphaanomalib.modelsanomaly_detectionanomaly_labelanomaly_mapanomaly_map_resizedanomaly_scorearrayastypeasyncio.coroutinesaxaxesaxisbackbonebbox_inchesbinaryblblbrXblbrYboolboundingRectboxboxPointsbox_1box_2brcc1c2castcategorycenter_distcheck_box_redundancycheckpoint__class_getitem__cline_in_tracebackcloseclosedcmapcntsconstconstantscontoursconvertcopycoreset_sampling_ratiocpucroppedcropped_sensor_leftcropped_sensor_rightcsvcudacv2cvtColordAdBdata_csvdetection_modelsdevicedfdimAdimBdistdistancedopt_basicsdopt_sensor_anomaliesdopt_sensor_anomalies._find_pathsdopt_sensor_anomalies.detectiondtypeedged__enter__enumerateerrorseuclideanevalexistingexists__exit__extendfigsizefile_pathfile_stemfiltered_cntsfilterwarningsfindContours_find_pathsfloatfloat32folder_pathfrom_numpyfromar""ray__func__genexprgetStructuringElementget_detection_modelsget_model_foldergrab_contoursgrayheaderhspaceiignoreimageimage_npimage_rgbimgimg_npimg_pathimreadimshowimutilsindexinfer_imageinput_tensorint32is_available_is_coroutineis_duplicateis_sorteditemitemsjetkernellayersleftleftmost_x_fourthlinalgloadload_state_dict__main__matplotlib.pyplotmaxmeasure_lengthmeasure_length..genexprmessagemidpointminminAreaRectmodemodelmodel_state_dict__module__morphologyEx__name__nextno_gradnormnpnptnum_contoursnumpynumpy.typingofforder_pointsorigoutputpad_inchespandasparentpathlibpermuteperspectivepil_imagepipelinepixels_per_metric_Xpixels_per_metric_Ypltpoppred_scorept_Apt_Bpyplot__qualname__quotingrboxresizeresultresult_patternreturnrightrightmost_x_thirds1s2savefigscipy.spatialsendsensor_imagessep__set_name__setdefaultshapesidesize_diffsort_contourssqueezestemstrsubplotssubplots_adjustt__test__thresholdthrowtighttltlblXtlblYtltrXtltrYtoto_csvtolerancetorchtorch_devicetrtrbrXtrbrYtypestypinguint8unsqueezeuser_img_pathvaluevalueswwarningswrap_resultwspacex1x2x_coordsx_maxx_middlex_miny_maxy_minzip\200\001\330\013\014\330\013\014\330\005\006\330\004\023\2205\230\007\230q\240\n\250%\250u\260M\300\030\310\021\330\004\t\210\023\210A\210Q\340\004\020\220\003\2209\230A\230W\240C\240q\330\004\020\220\005\220Z\230q\240\001\330\004\020\220\t\230\030\240\021\240!\330\004\017\210r\220\026\220q\230\n\240'\250\021\250\"\250J\260b\270\001\330\004\023\2205\230\013\2401\240I\250X\260Q\260c\270\023\270A\340\004\023\220<\230z\250\021\250!\330\004\023\220<\230s\240!\2401\340\004\t\210\025\210a\330\t\016\210h\220a\330\010\021\220\025\220a\220q\340\004\024\220F\230+\240U\250!\330\004\024\220D\230\001\230\025\230n\250C\250y\270\001\330\004\022\220&\230\014\240H\250B\250d\260\"\260F\270!\340\004\r\210R\210v\220Q\220a\330\004\032\230#\230W\240A\240^\2606\270\026\270q\300\004\300F\310&\320PQ\320QR\340\004\013\2101\320\014\034\230A\330\010\014\210A\330\010\034\230A\330\010\026\220a\330\010\026\220a""\200\001\340\023\024\330\031\032\330\031\032\330\005\006\330\004\020\220\004\220A\220Q\330\004\007\200t\2109\220G\2301\330\010\016\320\016\037\230q\240\001\340\004 \320 5\260\\\320AR\320RS\330\004\005\330\010\035\230\\\320)>\270a\270q\360\006\000\005\017\320\016\036\230n\250A\330\010\023\320\023(\250\001\340\004\025\220Q\330\010\021\220\021\330\010\031\230\021\330\010\021\220\021\330\010\026\220a\200\001\330\n\013\330\n\013\330\005\006\330\004\014\210A\210T\220\021\220#\220R\220t\2301\230D\240\002\240&\250\004\250A\250S\260\002\260$\260a\260t\2702\270Q\200\001\330\016\017\330\031\032\330\031\032\330\005\006\330\004 \240\001\330\004\014\210C\210w\220a\220s\230!\2301\330\004\007\200v\210S\220\001\330\010\016\210f\320\024&\240a\320'H\310\001\310\021\340\004\016\210e\2201\220D\230\006\230f\240E\250\026\250q\260\003\2602\260Q\330\004\013\2107\220%\220q\340\004\013\2103\210i\220q\230\t\240\023\240A\330\004\007\200y\220\003\220:\230Q\230f\240E\250\037\270\005\270S\300\001\340\004\r\210S\320\020&\240a\240s\250.\270\003\2701\330\004\r\210S\220\r\230Q\230h\240c\250\036\260q\330\004\014\210C\210v\220Q\220h\230d\240!\340\004\013\2103\210m\2301\230E\240\025\240d\250#\250\\\270\023\270A\330\004\013\2107\220.\240\001\240\021\330\004\007\200u\210C\210q\330\010\016\210f\320\024,\250A\330\014\r\360\006\000\005\013\210$\210h\220n\240A\240Q\330\004\017\210q\220\003\220=\240\001\240\022\2401\240C\240t\2505\260\001\330\004\020\220\002\220$\220d\230!\330\004\007\200t\2101\330\010\016\210f\320\024,\250A\330\014\r\360\006\000\005#\240!\330\004\037\230q\340\004\010\210\005\210Q\330\010\017\210t\2201\220A\220V\2303\230l\250!\2501\330\010\016\210c\220\032\2301\230A\330\010\016\210b\220\006\220a\220u\230F\240\"\240A\330\010\016\210d\220!\2203\220h\230a\230r\240\033\250K\260}\300A\300Q\340\t\r\210T\220\024\220V\2301\330\t\020\220\t\230\030\240\021\240$\240a\330\t\020\220\t\230\030\240\021\240$\240a\330\t\020\220\t\230\030\240\021\240$\240a\330\t\020\220\t\230\030\240\021\240$\240a\340\010\r\210T""\220\032\2302\230W\240I\250W\260A\330\010\r\210T\220\032\2302\230W\240I\250W\260A\340\010\013\2103\210b\220\004\220C\220s\230\"\230A\330\014\r\340\010\032\230!\330 !\340\010\013\2101\330\014\r\340\010\026\220g\230Q\230a\330\010\025\220W\230A\230Q\340\010\017\210s\220\"\220A\330\010\017\210s\220\"\220A\340\010\020\220\007\220q\330\014\r\330\022\023\2204\220v\230X\240Q\240e\2501\330\022\023\2204\220v\230X\240Q\240e\2501\330\022\023\2205\230\002\230$\230f\240H\250A\250U\260!\360\010\000\005\010\200t\2101\330\010\016\210f\320\024,\250A\330\014\r\360\006\000\005\024\2203\220a\220q\330\004\007\200}\220C\220u\230A\330\010\016\210f\320\024*\250!\330\014\r\330\014&\240a\320'A\300\021\300%\300q\360\006\000\005\020\210q\220\003\2207\320\032?\270r\300\024\300Q\330\004\017\210q\220\003\2207\320\032?\270r\300\024\300T\310\026\310q\320PQ\330\004\017\210q\220\003\2207\320\032?\270r\300\024\300Q\330\004\017\210q\220\003\2207\320\032?\270r\300\024\300T\310\026\310q\320PQ\340\004\030\230\003\2301\230M\250\021\250\"\250D\260\003\2601\330\004\030\230\003\2301\230M\250\021\250\"\250D\260\003\2601\330\004\017\320\017!\240\022\2403\240b\320(:\270\"\320\270f\300A\200\001\330\016\017\330\026\027\330\016\017\330\023\024\330\005\006\330\004\020\220\010\230\001\330\004\022\220(\230!\340\004\014\210I\220Q\330\010\021\220\025\220k\240\027\250\005\250Y\3206M\310U\320RS\340\004\007\200w\210c\220\031\230!\2303\230c\240\031\250$\250a\340\004\010\210\004\210F\220*\230I\240Q\240m\2606\270\021\330\010\020\220\004\220A\220S\230\010\240\001\240\022\2409\250A\330\010\025\220U\230%\230q\320 0\260\001\260\021\330\010\r\320\r\035\230Q\230j\250\001\250\021\340\010\021\220\033\230A\230W\240A\330\010\020\220\007\220q\230\001\230\023\230A\230V\2401\340\010\r\210T\220\021\220!\330\010\n\210%\210q\220\001\330\010\n\210'\220\021\220'\230\026\230q\330\010\n\210'\220\021\220&""\320\030.\250e\2607\270&\300\001\340\004\007\320\007\027\220q\230\007\230s\240'\250\021\330\004\007\200x\210q\330\t\025\220R\220r\230\021\230*\240A\240U\250!\330\010\024\220A\330\010\023\2201\340\004\007\200v\210Q\340\004\t\210\031\220!\2201\220A\330\004\006\200g\210Q\330\t\025\220R\220r\230\021\230!\330\010\r\210Q\330\010\016\210a\330\010\017\210q\330\010\020\220\003\2201\330\010\014\210A\230!\240\001\200\001\330\013\014\330\013\014\330\004\017\210q\330\005\006\330\004\010\210\004\210D\220\001\330\004\010\210\004\210D\220\001\330\004\017\210q\220\001\330\004\017\210q\220\001\340\004\022\220$\220a\220w\230b\240\007\240u\250A\250R\250v\260Q\260d\270\"\270B\270f\300A\300Q\330\004\020\220\004\220A\220W\230B\230g\240U\250!\2502\250V\2601\260D\270\002\270\"\270F\300!\3001\340\004\013\2104\210q\220\014\230B\230j\250\004\250J\260b\270\001"; + PyObject *data = NULL; + CYTHON_UNUSED_VAR(__Pyx_DecompressString); + #endif + PyObject **stringtab = __pyx_mstate->__pyx_string_tab; + Py_ssize_t pos = 0; + for (int i = 0; i < 307; i++) { + Py_ssize_t bytes_length = index[i].length; + PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL); + if (likely(string) && i >= 33) PyUnicode_InternInPlace(&string); + if (unlikely(!string)) { + Py_XDECREF(data); + __PYX_ERR(0, 1, __pyx_L1_error) + } + stringtab[i] = string; + pos += bytes_length; + } + for (int i = 307; i < 315; i++) { + Py_ssize_t bytes_length = index[i].length; + PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length); + stringtab[i] = string; + pos += bytes_length; + if (unlikely(!string)) { + Py_XDECREF(data); + __PYX_ERR(0, 1, __pyx_L1_error) + } + } + Py_XDECREF(data); + for (Py_ssize_t i = 0; i < 315; i++) { + if (unlikely(PyObject_Hash(stringtab[i]) == -1)) { + __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = stringtab + 307; + for (Py_ssize_t i=0; i<8; ++i) { + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL); + #else + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif + } + { + PyObject **numbertab = __pyx_mstate->__pyx_number_tab; + double const c_constants[] = {0.2,0.5,0.8,2.0,255.0}; + for (int i = 0; i < 5; i++) { + numbertab[i] = PyFloat_FromDouble(c_constants[i]); + if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + { + PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 5; + int8_t const cint_constants_1[] = {0,1,2,5,6,12,20,50,100}; + int16_t const cint_constants_2[] = {255,500,1500}; + for (int i = 0; i < 12; i++) { + numbertab[i] = PyLong_FromLong((i < 9 ? cint_constants_1[i - 0] : cint_constants_2[i - 9])); + if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = __pyx_mstate->__pyx_number_tab; + for (Py_ssize_t i=0; i<17; ++i) { + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL); + #else + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_codeobjects ### */ -\ - typedef struct { - unsigned int argcount : 3; - unsigned int num_posonly_args : 1; - unsigned int num_kwonly_args : 1; - unsigned int nlocals : 6; - unsigned int flags : 10; - unsigned int first_line : 8; - unsigned int line_table_length : 15; - } __Pyx_PyCode_New_function_description; +typedef struct { + unsigned int argcount : 3; + unsigned int num_posonly_args : 1; + unsigned int num_kwonly_args : 1; + unsigned int nlocals : 6; + unsigned int flags : 10; + unsigned int first_line : 8; +} __Pyx_PyCode_New_function_description; /* NewCodeObj.proto */ static PyObject* __Pyx_PyCode_New( const __Pyx_PyCode_New_function_description descr, PyObject * const *varnames, PyObject *filename, PyObject *funcname, - const char *line_table, + PyObject *line_table, PyObject *tuple_dedup_map ); @@ -13190,64 +12851,64 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { PyObject* tuple_dedup_map = PyDict_New(); if (unlikely(!tuple_dedup_map)) return -1; { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 84, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 84}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_x1, __pyx_mstate->__pyx_n_u_x2}; - __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_sensor_anomalies_detect, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_sensor_anomalies_detect, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591__6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 112, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 112}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_existing}; - __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_sensor_anomalies_detect, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_sensor_anomalies_detect, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591__7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 143, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 143}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_c}; - __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_sensor_anomalies_detect, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_sensor_anomalies_detect, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591__6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 144, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 144}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_c}; - __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_sensor_anomalies_detect, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_sensor_anomalies_detect, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591__6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 145, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 145}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_c}; - __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_sensor_anomalies_detect, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_sensor_anomalies_detect, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591__6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 146, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 146}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_c}; - __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_sensor_anomalies_detect, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_sensor_anomalies_detect, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591__6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 32, 52}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 32}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pt_A, __pyx_mstate->__pyx_n_u_pt_B}; - __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_sensor_anomalies_detect, __pyx_mstate->__pyx_n_u_midpoint, __pyx_k_AT_Rt1D_AS_at2Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_sensor_anomalies_detect, __pyx_mstate->__pyx_n_u_midpoint, __pyx_mstate->__pyx_kp_b_iso88591_AT_Rt1D_AS_at2Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 39, 139}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 39}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_box_1, __pyx_mstate->__pyx_n_u_box_2, __pyx_mstate->__pyx_n_u_tolerance, __pyx_mstate->__pyx_n_u_c1, __pyx_mstate->__pyx_n_u_s1, __pyx_mstate->__pyx_n_u__8, __pyx_mstate->__pyx_n_u_c2, __pyx_mstate->__pyx_n_u_s2, __pyx_mstate->__pyx_n_u_center_dist, __pyx_mstate->__pyx_n_u_size_diff}; - __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_sensor_anomalies_detect, __pyx_mstate->__pyx_n_u_check_box_redundancy, __pyx_k_q_D_D_q_q_awb_uARvQd_BfAQ_AWBgU, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_sensor_anomalies_detect, __pyx_mstate->__pyx_n_u_check_box_redundancy, __pyx_mstate->__pyx_kp_b_iso88591_q_D_D_q_q_awb_uARvQd_BfAQ_AWBgU, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 56, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 55, 860}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 56, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 55}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_img_path, __pyx_mstate->__pyx_n_u_pixels_per_metric_X, __pyx_mstate->__pyx_n_u_pixels_per_metric_Y, __pyx_mstate->__pyx_n_u_data_csv, __pyx_mstate->__pyx_n_u_image, __pyx_mstate->__pyx_n_u_cropped, __pyx_mstate->__pyx_n_u_orig, __pyx_mstate->__pyx_n_u_gray, __pyx_mstate->__pyx_n_u__8, __pyx_mstate->__pyx_n_u_binary, __pyx_mstate->__pyx_n_u_kernel, __pyx_mstate->__pyx_n_u_closed, __pyx_mstate->__pyx_n_u_edged, __pyx_mstate->__pyx_n_u_cnts, __pyx_mstate->__pyx_n_u_x_coords, __pyx_mstate->__pyx_n_u_is_sorted, __pyx_mstate->__pyx_n_u_accepted_boxes, __pyx_mstate->__pyx_n_u_filtered_cnts, __pyx_mstate->__pyx_n_u_c, __pyx_mstate->__pyx_n_u_rbox, __pyx_mstate->__pyx_n_u_box, __pyx_mstate->__pyx_n_u_tl, __pyx_mstate->__pyx_n_u_tr, __pyx_mstate->__pyx_n_u_br, __pyx_mstate->__pyx_n_u_bl, __pyx_mstate->__pyx_n_u_tltrX, __pyx_mstate->__pyx_n_u_tltrY, __pyx_mstate->__pyx_n_u_blbrX, __pyx_mstate->__pyx_n_u_blbrY, __pyx_mstate->__pyx_n_u_tlblX, __pyx_mstate->__pyx_n_u_tlblY, __pyx_mstate->__pyx_n_u_trbrX, __pyx_mstate->__pyx_n_u_trbrY, __pyx_mstate->__pyx_n_u_dA, __pyx_mstate->__pyx_n_u_dB, __pyx_mstate->__pyx_n_u_is_duplicate, __pyx_mstate->__pyx_n_u_dimA, __pyx_mstate->__pyx_n_u_dimB, __pyx_mstate->__pyx_n_u_num_contours, __pyx_mstate->__pyx_n_u_x_min, __pyx_mstate->__pyx_n_u_x_max, __pyx_mstate->__pyx_n_u_y_min, __pyx_mstate->__pyx_n_u_y_max, __pyx_mstate->__pyx_n_u_rightmost_x_third, __pyx_mstate->__pyx_n_u_leftmost_x_fourth, __pyx_mstate->__pyx_n_u_x_middle, __pyx_mstate->__pyx_n_u_cropped_sensor_left, __pyx_mstate->__pyx_n_u_cropped_sensor_right, __pyx_mstate->__pyx_n_u_c, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; - __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_sensor_anomalies_detect, __pyx_mstate->__pyx_n_u_measure_length, __pyx_k_Cwas_1_vS_f_ar_LA_e1D_fE_q_2Q_7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_sensor_anomalies_detect, __pyx_mstate->__pyx_n_u_measure_length, __pyx_mstate->__pyx_kp_b_iso88591_Cwas_1_vS_f_a_H_e1D_fE_q_2Q_7_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 158, 278}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 158}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_image, __pyx_mstate->__pyx_n_u_model, __pyx_mstate->__pyx_n_u_torch_device, __pyx_mstate->__pyx_n_u_image_rgb, __pyx_mstate->__pyx_n_u_pil_image, __pyx_mstate->__pyx_n_u_image_np, __pyx_mstate->__pyx_n_u_input_tensor, __pyx_mstate->__pyx_n_u_output, __pyx_mstate->__pyx_n_u_anomaly_score, __pyx_mstate->__pyx_n_u_anomaly_label, __pyx_mstate->__pyx_n_u_anomaly_map, __pyx_mstate->__pyx_n_u_img_np, __pyx_mstate->__pyx_n_u_anomaly_map_resized}; - __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_sensor_anomalies_detect, __pyx_mstate->__pyx_n_u_infer_image, __pyx_k_5_q_uM_AQ_9AWCq_Zq_r_q_Jb_5_1IX, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_sensor_anomalies_detect, __pyx_mstate->__pyx_n_u_infer_image, __pyx_mstate->__pyx_kp_b_iso88591_5_q_uM_AQ_9AWCq_Zq_r_q_Jb_5_1IX, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 193, 338}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 193}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_img_path, __pyx_mstate->__pyx_n_u_detection_models, __pyx_mstate->__pyx_n_u_data_csv, __pyx_mstate->__pyx_n_u_sensor_images, __pyx_mstate->__pyx_n_u_file_stem, __pyx_mstate->__pyx_n_u_folder_path, __pyx_mstate->__pyx_n_u_model, __pyx_mstate->__pyx_n_u__8, __pyx_mstate->__pyx_n_u_axes, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_side, __pyx_mstate->__pyx_n_u_image, __pyx_mstate->__pyx_n_u_checkpoint, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_ax, __pyx_mstate->__pyx_n_u_df}; - __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_sensor_anomalies_detect, __pyx_mstate->__pyx_n_u_anomaly_detection, __pyx_k_IQ_k_Y6MURS_wc_3c_a_F_IQm6_AS_9, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_sensor_anomalies_detect, __pyx_mstate->__pyx_n_u_anomaly_detection, __pyx_mstate->__pyx_kp_b_iso88591_IQ_k_Y6MURS_wc_3c_a_F_IQm6_AS_9, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 239, 118}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 239}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_user_img_path, __pyx_mstate->__pyx_n_u_pixels_per_metric_X, __pyx_mstate->__pyx_n_u_pixels_per_metric_Y, __pyx_mstate->__pyx_n_u_file_path, __pyx_mstate->__pyx_n_u_MODEL_FOLDER, __pyx_mstate->__pyx_n_u_DETECTION_MODELS, __pyx_mstate->__pyx_n_u_data_csv, __pyx_mstate->__pyx_n_u_sensor_images}; - __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_sensor_anomalies_detect, __pyx_mstate->__pyx_n_u_pipeline, __pyx_k_AQ_t9G1_q_5_ARRS_aq_nA_Q_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_sensor_anomalies_detect, __pyx_mstate->__pyx_n_u_pipeline, __pyx_mstate->__pyx_kp_b_iso88591_AQ_t9G1_q_5_ARRS_aq_nA_Q_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad; } Py_DECREF(tuple_dedup_map); return 0; @@ -13260,22 +12921,37 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { static int __Pyx_InitGlobals(void) { /* PythonCompatibility.init */ if (likely(__Pyx_init_co_variables() == 0)); else + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + /* CommonTypesMetaclass.init */ + if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) /* CachedMethodType.init */ #if CYTHON_COMPILING_IN_LIMITED_API -{ - PyObject *typesModule=NULL; - typesModule = PyImport_ImportModule("types"); - if (typesModule) { - __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType"); - Py_DECREF(typesModule); - } -} // error handling follows -#endif + { + PyObject *typesModule=NULL; + typesModule = PyImport_ImportModule("types"); + if (typesModule) { + __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType"); + Py_DECREF(typesModule); + } + } // error handling follows + #endif + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + /* CythonFunctionShared.init */ + if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + /* Generator.init */ + if (likely(__pyx_Generator_init(__pyx_m) == 0)); else + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -13704,119 +13380,6 @@ bad: #endif #endif -/* RaiseDoubleKeywords */ -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); -} - -/* PyFunctionFastCall */ -#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL -static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject *const *args, Py_ssize_t na, - PyObject *globals) { - PyFrameObject *f; - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject **fastlocals; - Py_ssize_t i; - PyObject *result; - assert(globals != NULL); - /* XXX Perhaps we should create a specialized - PyFrame_New() that doesn't take locals, but does - take builtins without sanity checking them. - */ - assert(tstate != NULL); - f = PyFrame_New(tstate, co, globals, NULL); - if (f == NULL) { - return NULL; - } - fastlocals = __Pyx_PyFrame_GetLocalsplus(f); - for (i = 0; i < na; i++) { - Py_INCREF(*args); - fastlocals[i] = *args++; - } - result = PyEval_EvalFrameEx(f,0); - ++tstate->recursion_depth; - Py_DECREF(f); - --tstate->recursion_depth; - return result; -} -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs) { - PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); - PyObject *globals = PyFunction_GET_GLOBALS(func); - PyObject *argdefs = PyFunction_GET_DEFAULTS(func); - PyObject *closure; - PyObject *kwdefs; - PyObject *kwtuple, **k; - PyObject **d; - Py_ssize_t nd; - Py_ssize_t nk; - PyObject *result; - assert(kwargs == NULL || PyDict_Check(kwargs)); - nk = kwargs ? PyDict_Size(kwargs) : 0; - if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { - return NULL; - } - if ( - co->co_kwonlyargcount == 0 && - likely(kwargs == NULL || nk == 0) && - co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { - if (argdefs == NULL && co->co_argcount == nargs) { - result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); - goto done; - } - else if (nargs == 0 && argdefs != NULL - && co->co_argcount == Py_SIZE(argdefs)) { - /* function called with no arguments, but all parameters have - a default value: use default values as arguments .*/ - args = &PyTuple_GET_ITEM(argdefs, 0); - result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); - goto done; - } - } - if (kwargs != NULL) { - Py_ssize_t pos, i; - kwtuple = PyTuple_New(2 * nk); - if (kwtuple == NULL) { - result = NULL; - goto done; - } - k = &PyTuple_GET_ITEM(kwtuple, 0); - pos = i = 0; - while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { - Py_INCREF(k[i]); - Py_INCREF(k[i+1]); - i += 2; - } - nk = i / 2; - } - else { - kwtuple = NULL; - k = NULL; - } - closure = PyFunction_GET_CLOSURE(func); - kwdefs = PyFunction_GET_KW_DEFAULTS(func); - if (argdefs != NULL) { - d = &PyTuple_GET_ITEM(argdefs, 0); - nd = Py_SIZE(argdefs); - } - else { - d = NULL; - nd = 0; - } - result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, kwdefs, closure); - Py_XDECREF(kwtuple); -done: - Py_LeaveRecursiveCall(); - return result; -} -#endif - /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { @@ -13912,38 +13475,16 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj return __Pyx_PyObject_CallMethO(func, args[0]); } #endif - #if PY_VERSION_HEX < 0x030800B1 - #if CYTHON_FAST_PYCCALL - if (PyCFunction_Check(func)) { - if (kwargs) { - return _PyCFunction_FastCallDict(func, args, nargs, kwargs); - } else { - return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); - } - } - if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { - return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); - } - #endif - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(func)) { - return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); - } - #endif - #endif if (kwargs == NULL) { - #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API - vectorcallfunc f = __Pyx_PyVectorcall_Function(func); - if (f) { - return f(func, args, _nargs, NULL); - } - #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL - if (__Pyx_CyFunction_CheckExact(func)) { - __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); - if (f) return f(func, args, _nargs, NULL); - } - #elif CYTHON_COMPILING_IN_LIMITED_API && CYTHON_VECTORCALL - return PyObject_Vectorcall(func, args, _nargs, NULL); + #if CYTHON_VECTORCALL + #if CYTHON_COMPILING_IN_LIMITED_API + return PyObject_Vectorcall(func, args, _nargs, NULL); + #else + vectorcallfunc f = __Pyx_PyVectorcall_Function(func); + if (f) { + return f(func, args, _nargs, NULL); + } + #endif #endif } if (nargs == 0) { @@ -13956,6 +13497,12 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif } +/* PyObjectCallOneArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *args[2] = {NULL, arg}; + return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + /* UnpackUnboundCMethod */ #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { @@ -14041,6 +13588,121 @@ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { return 0; } +/* CallUnboundCMethod0 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { + int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); + if (likely(was_initialized == 2 && cfunc->func)) { + if (likely(cfunc->flag == METH_NOARGS)) + return __Pyx_CallCFunction(cfunc, self, NULL); + if (likely(cfunc->flag == METH_FASTCALL)) + return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0); + if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) + return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL); + if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS))) + return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL); + if (cfunc->flag == METH_VARARGS) + return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple); + return __Pyx__CallUnboundCMethod0(cfunc, self); + } +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + else if (unlikely(was_initialized == 1)) { + __Pyx_CachedCFunction tmp_cfunc = { +#ifndef __cplusplus + 0 +#endif + }; + tmp_cfunc.type = cfunc->type; + tmp_cfunc.method_name = cfunc->method_name; + return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self); + } +#endif + PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self); + __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); + return result; +} +#endif +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { + PyObject *result; + if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; + result = __Pyx_PyObject_CallOneArg(cfunc->method, self); + return result; +} + +/* py_dict_items */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) { + return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d); +} + +/* py_dict_values */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) { + return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d); +} + +/* OwnedDictNext */ +#if CYTHON_AVOID_BORROWED_REFS +static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) { + PyObject *next = NULL; + if (!*ppos) { + if (pvalue) { + PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p); + if (unlikely(!dictview)) goto bad; + *ppos = PyObject_GetIter(dictview); + Py_DECREF(dictview); + } else { + *ppos = PyObject_GetIter(p); + } + if (unlikely(!*ppos)) goto bad; + } + next = PyIter_Next(*ppos); + if (!next) { + if (PyErr_Occurred()) goto bad; + return 0; + } + if (pkey && pvalue) { + *pkey = __Pyx_PySequence_ITEM(next, 0); + if (unlikely(*pkey)) goto bad; + *pvalue = __Pyx_PySequence_ITEM(next, 1); + if (unlikely(*pvalue)) goto bad; + Py_DECREF(next); + } else if (pkey) { + *pkey = next; + } else { + assert(pvalue); + *pvalue = next; + } + return 1; + bad: + Py_XDECREF(next); +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000 + PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef"); +#else + PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef); +#endif + if (pkey) *pkey = NULL; + if (pvalue) *pvalue = NULL; + return 0; +} +#else // !CYTHON_AVOID_BORROWED_REFS +static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) { + int result = PyDict_Next(p, ppos, pkey, pvalue); + if (likely(result == 1)) { + if (pkey) Py_INCREF(*pkey); + if (pvalue) Py_INCREF(*pvalue); + } + return result; +} +#endif + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); +} + /* CallUnboundCMethod2 */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { @@ -14095,7 +13757,7 @@ static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObje } } -/* ParseKeywords */ +/* ParseKeywordsImpl */ static int __Pyx_ValidateDuplicatePosArgs( PyObject *kwds, PyObject ** const argnames[], @@ -14251,16 +13913,23 @@ static void __Pyx_RejectUnknownKeyword( PyObject ** const *first_kw_arg, const char *function_name) { + #if CYTHON_AVOID_BORROWED_REFS + PyObject *pos = NULL; + #else Py_ssize_t pos = 0; + #endif PyObject *key = NULL; __Pyx_BEGIN_CRITICAL_SECTION(kwds); - while (PyDict_Next(kwds, &pos, &key, NULL)) { + while ( + #if CYTHON_AVOID_BORROWED_REFS + __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL) + #else + PyDict_Next(kwds, &pos, &key, NULL) + #endif + ) { PyObject** const *name = first_kw_arg; while (*name && (**name != key)) name++; if (!*name) { - #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); - #endif size_t index_found = 0; int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name); if (cmp != 1) { @@ -14274,12 +13943,15 @@ static void __Pyx_RejectUnknownKeyword( #endif break; } - #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(key); - #endif } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + #endif } __Pyx_END_CRITICAL_SECTION(); + #if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(pos); + #endif assert(PyErr_Occurred()); } static int __Pyx_ParseKeywordDict( @@ -14451,6 +14123,8 @@ bad: #endif return -1; } + +/* ParseKeywords */ static int __Pyx_ParseKeywords( PyObject *kwds, PyObject * const *kwvalues, @@ -14505,69 +14179,77 @@ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + int wraparound, int boundscheck, int unsafe_shared) { + CYTHON_MAYBE_UNUSED_VAR(unsafe_shared); +#if CYTHON_ASSUME_SAFE_SIZE Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } + if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS)) { + return __Pyx_PyList_GetItemRefFast(o, wrapped_i, unsafe_shared); + } else if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; + return __Pyx_NewRef(PyList_GET_ITEM(o, wrapped_i)); } return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); #else + (void)wraparound; + (void)boundscheck; return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS + int wraparound, int boundscheck, int unsafe_shared) { + CYTHON_MAYBE_UNUSED_VAR(unsafe_shared); +#if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; + return __Pyx_NewRef(PyTuple_GET_ITEM(o, wrapped_i)); } return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); #else + (void)wraparound; + (void)boundscheck; return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + int wraparound, int boundscheck, int unsafe_shared) { + CYTHON_MAYBE_UNUSED_VAR(unsafe_shared); +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); - if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { - return __Pyx_PyList_GetItemRef(o, n); + if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)) { + return __Pyx_PyList_GetItemRefFast(o, n, unsafe_shared); + } else if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + return __Pyx_NewRef(PyList_GET_ITEM(o, n)); } - } - else if (PyTuple_CheckExact(o)) { + } else + #if !CYTHON_AVOID_BORROWED_REFS + if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, n); - Py_INCREF(r); - return r; + return __Pyx_NewRef(PyTuple_GET_ITEM(o, n)); } - } else { + } else + #endif +#endif +#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY + { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; - if (mm && mm->mp_subscript) { + if (!is_list && mm && mm->mp_subscript) { PyObject *r, *key = PyLong_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } - if (likely(sm && sm->sq_item)) { + if (is_list || likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { @@ -14586,6 +14268,8 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, return PySequence_GetItem(o, i); } #endif + (void)wraparound; + (void)boundscheck; return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); } @@ -14845,12 +14529,6 @@ static void __Pyx_RaiseClosureNameError(const char *varname) { PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); } -/* PyObjectCallOneArg */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *args[2] = {NULL, arg}; - return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); -} - /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { @@ -14858,7 +14536,7 @@ static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { Py_ssize_t key_value; key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { - return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(index)); @@ -15097,96 +14775,68 @@ static PyObject* __Pyx_Unpacked___Pyx_PyLong_SubtractObjC(PyObject *op1, PyObjec CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); const long b = intval; - long a, x; -#ifdef HAVE_LONG_LONG + long a; const PY_LONG_LONG llb = intval; - PY_LONG_LONG lla, llx; -#endif + PY_LONG_LONG lla; if (unlikely(__Pyx_PyLong_IsZero(op1))) { return PyLong_FromLong(-intval); } - if (unlikely(!__Pyx_PyLong_CompactAsLong(op1, &a))) { - const digit* digits = __Pyx_PyLong_Digits(op1); - const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); + const int is_positive = __Pyx_PyLong_IsPos(op1); + const digit* digits = __Pyx_PyLong_Digits(op1); + const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); + if (likely(size == 1)) { + a = (long) digits[0]; + if (!is_positive) a *= -1; + } else { switch (size) { - case -2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG + if (!is_positive) a *= -1; + goto calculate_long; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif + if (!is_positive) lla *= -1; + goto calculate_long_long; } - CYTHON_FALLTHROUGH; - case -3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; + break; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG + if (!is_positive) a *= -1; + goto calculate_long; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif + if (!is_positive) lla *= -1; + goto calculate_long_long; } - CYTHON_FALLTHROUGH; - case -4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; + break; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG + if (!is_positive) a *= -1; + goto calculate_long; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif + if (!is_positive) lla *= -1; + goto calculate_long_long; } - CYTHON_FALLTHROUGH; - default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); + break; } + return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } + calculate_long: + { + long x; x = a - b; - return PyLong_FromLong(x); -#ifdef HAVE_LONG_LONG - long_long: + return PyLong_FromLong(x); + } + calculate_long_long: + { + PY_LONG_LONG llx; llx = lla - llb; - return PyLong_FromLongLong(llx); -#endif - return __Pyx_Fallback___Pyx_PyLong_SubtractObjC(op1, op2, inplace); - + return PyLong_FromLongLong(llx); + } } #endif @@ -15560,96 +15210,68 @@ static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); const long b = intval; - long a, x; -#ifdef HAVE_LONG_LONG + long a; const PY_LONG_LONG llb = intval; - PY_LONG_LONG lla, llx; -#endif + PY_LONG_LONG lla; if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op2); } - if (unlikely(!__Pyx_PyLong_CompactAsLong(op1, &a))) { - const digit* digits = __Pyx_PyLong_Digits(op1); - const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); + const int is_positive = __Pyx_PyLong_IsPos(op1); + const digit* digits = __Pyx_PyLong_Digits(op1); + const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); + if (likely(size == 1)) { + a = (long) digits[0]; + if (!is_positive) a *= -1; + } else { switch (size) { - case -2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG + if (!is_positive) a *= -1; + goto calculate_long; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif + if (!is_positive) lla *= -1; + goto calculate_long_long; } - CYTHON_FALLTHROUGH; - case -3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; + break; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG + if (!is_positive) a *= -1; + goto calculate_long; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif + if (!is_positive) lla *= -1; + goto calculate_long_long; } - CYTHON_FALLTHROUGH; - case -4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; + break; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG + if (!is_positive) a *= -1; + goto calculate_long; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif + if (!is_positive) lla *= -1; + goto calculate_long_long; } - CYTHON_FALLTHROUGH; - default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + break; } + return PyLong_Type.tp_as_number->nb_add(op1, op2); } + calculate_long: + { + long x; x = a + b; - return PyLong_FromLong(x); -#ifdef HAVE_LONG_LONG - long_long: + return PyLong_FromLong(x); + } + calculate_long_long: + { + PY_LONG_LONG llx; llx = lla + llb; - return PyLong_FromLongLong(llx); -#endif - return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace); - + return PyLong_FromLongLong(llx); + } } #endif @@ -15857,6 +15479,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { } /* PyObjectGetMethod */ +#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))) static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP @@ -15945,12 +15568,12 @@ try_unpack: *method = attr; return 0; } +#endif /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { #if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)) PyObject *args[1] = {obj}; - (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_CallNoArg; return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); @@ -16111,7 +15734,7 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_di } return PyObject_GetIter(iterable); } -#if !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_AVOID_BORROWED_REFS static CYTHON_INLINE int __Pyx_dict_iter_next_source_is_dict( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem) { @@ -16162,7 +15785,7 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { PyObject* next_item; -#if !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_AVOID_BORROWED_REFS if (source_is_dict) { int result; #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API @@ -16196,17 +15819,8 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( #endif if (unlikely(pos >= list_size)) return 0; *ppos = pos + 1; - #if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - next_item = PyList_GetItemRef(iter_obj, pos); + next_item = __Pyx_PyList_GetItemRef(iter_obj, pos); if (unlikely(!next_item)) return -1; - #elif CYTHON_ASSUME_SAFE_MACROS - next_item = PyList_GET_ITEM(iter_obj, pos); - Py_INCREF(next_item); - #else - next_item = PyList_GetItem(iter_obj, pos); - if (unlikely(!next_item)) return -1; - Py_INCREF(next_item); - #endif } else #endif { @@ -16263,17 +15877,21 @@ static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, P /* UnicodeConcatInPlace */ # if CYTHON_COMPILING_IN_CPYTHON static int -__Pyx_unicode_modifiable(PyObject *unicode) +__Pyx_unicode_modifiable(PyObject *unicode, int unsafe_shared) { - if (Py_REFCNT(unicode) != 1) + if (!__Pyx_IS_UNIQUELY_REFERENCED(unicode, unsafe_shared)) return 0; +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030F0000 + if (PyUnstable_Unicode_GET_CACHED_HASH(unicode) != -1) + return 0; +#endif if (!PyUnicode_CheckExact(unicode)) return 0; if (PyUnicode_CHECK_INTERNED(unicode)) return 0; return 1; } -static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right, int unsafe_shared #if CYTHON_REFNANNY , void* __pyx_refnanny #endif @@ -16300,7 +15918,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_le return NULL; } new_len = left_len + right_len; - if (__Pyx_unicode_modifiable(left) + if (__Pyx_unicode_modifiable(left, unsafe_shared) && PyUnicode_CheckExact(right) && PyUnicode_KIND(right) <= PyUnicode_KIND(left) && !(PyUnicode_IS_ASCII(left) && !PyUnicode_IS_ASCII(right))) { @@ -16324,7 +15942,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_le } #endif -/* ArgTypeTest */ +/* ArgTypeTestFunc */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; @@ -16372,6 +15990,28 @@ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *nam return 0; } +/* AllocateExtensionType */ +static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final) { + if (is_final || likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { + allocfunc alloc_func = __Pyx_PyType_GetSlot(t, tp_alloc, allocfunc); + return alloc_func(t, 0); + } else { + newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc); + #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + if (!tp_new) { + PyObject *new_str = PyUnicode_FromString("__new__"); + if (likely(new_str)) { + PyObject *o = PyObject_CallMethodObjArgs((PyObject *)&PyBaseObject_Type, new_str, t, NULL); + Py_DECREF(new_str); + return o; + } else + return NULL; + } else + #endif + return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0); + } +} + /* CallTypeTraverse */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) #else @@ -16484,11 +16124,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); -#if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; -#else - type->tp_print = (printfunc) memb->offset; -#endif changed = 1; } #endif // CYTHON_METH_FASTCALL @@ -16545,6 +16181,8 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject ++getset; } } +#else + CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); #endif // !CYTHON_COMPILING_IN_PYPY if (changed) PyType_Modified(type); @@ -16722,14 +16360,116 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { #endif } +/* HasAttr */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d0000 +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { + PyObject *r; + if (unlikely(!PyUnicode_Check(n))) { + PyErr_SetString(PyExc_TypeError, + "hasattr(): attribute name must be string"); + return -1; + } + r = __Pyx_PyObject_GetAttrStrNoError(o, n); + if (!r) { + return (unlikely(PyErr_Occurred())) ? -1 : 0; + } else { + Py_DECREF(r); + return 1; + } +} +#endif + /* Import */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { +static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) { + PyObject *imported_module = PyImport_GetModule(qualname); + if (unlikely(!imported_module)) { + *module = NULL; + if (PyErr_Occurred()) { + return -1; + } + return 0; + } + *module = imported_module; + return 1; +} +static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) { + PyObject *imported_module; + PyObject *top_level_package_name; + Py_ssize_t i; + int status, module_found; + Py_ssize_t dot_index; + module_found = __Pyx__Import_GetModule(qualname, &imported_module); + if (unlikely(!module_found || module_found == -1)) { + *module = NULL; + return module_found; + } + if (imported_names) { + for (i = 0; i < len_imported_names; i++) { + PyObject *imported_name = imported_names[i]; +#if __PYX_LIMITED_VERSION_HEX < 0x030d0000 + int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name); +#else + int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name); + if (unlikely(has_imported_attribute == -1)) goto error; +#endif + if (!has_imported_attribute) { + goto not_found; + } + } + *module = imported_module; + return 1; + } + dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1); + if (dot_index == -1) { + *module = imported_module; + return 1; + } + if (unlikely(dot_index == -2)) goto error; + top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index); + if (unlikely(!top_level_package_name)) goto error; + Py_DECREF(imported_module); + status = __Pyx__Import_GetModule(top_level_package_name, module); + Py_DECREF(top_level_package_name); + return status; +error: + Py_DECREF(imported_module); + *module = NULL; + return -1; +not_found: + Py_DECREF(imported_module); + *module = NULL; + return 0; +} +static PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level) { PyObject *module = 0; PyObject *empty_dict = 0; - PyObject *empty_list = 0; + PyObject *from_list = 0; + int module_found; + if (!qualname) { + qualname = name; + } + module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module); + if (likely(module_found == 1)) { + return module; + } else if (unlikely(module_found == -1)) { + return NULL; + } empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; + if (imported_names) { +#if CYTHON_COMPILING_IN_CPYTHON + from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names); + if (unlikely(!from_list)) + goto bad; +#else + from_list = PyList_New(len_imported_names); + if (unlikely(!from_list)) goto bad; + for (Py_ssize_t i=0; i__pyx_d, empty_dict, from_list, level); } bad: + Py_XDECREF(from_list); Py_XDECREF(empty_dict); - Py_XDECREF(empty_list); return module; } -/* ImportDottedModule */ -static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { - PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; - Py_ssize_t size; - if (unlikely(PyErr_Occurred())) { - PyErr_Clear(); - } -#if CYTHON_ASSUME_SAFE_SIZE - size = PyTuple_GET_SIZE(parts_tuple); -#else - size = PyTuple_Size(parts_tuple); - if (size < 0) goto bad; -#endif - if (likely(size == count)) { - partial_name = name; - } else { - slice = PySequence_GetSlice(parts_tuple, 0, count); - if (unlikely(!slice)) - goto bad; - sep = PyUnicode_FromStringAndSize(".", 1); - if (unlikely(!sep)) - goto bad; - partial_name = PyUnicode_Join(sep, slice); - } - PyErr_Format( - PyExc_ModuleNotFoundError, - "No module named '%U'", partial_name); -bad: - Py_XDECREF(sep); - Py_XDECREF(slice); - Py_XDECREF(partial_name); - return NULL; -} -static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { - PyObject *imported_module; -#if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ - CYTHON_COMPILING_IN_GRAAL - PyObject *modules = PyImport_GetModuleDict(); - if (unlikely(!modules)) - return NULL; - imported_module = __Pyx_PyDict_GetItemStr(modules, name); - Py_XINCREF(imported_module); -#else - imported_module = PyImport_GetModule(name); -#endif - return imported_module; -} -static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { - Py_ssize_t i, nparts; -#if CYTHON_ASSUME_SAFE_SIZE - nparts = PyTuple_GET_SIZE(parts_tuple); -#else - nparts = PyTuple_Size(parts_tuple); - if (nparts < 0) return NULL; -#endif - for (i=1; i < nparts && module; i++) { - PyObject *part, *submodule; -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - part = PyTuple_GET_ITEM(parts_tuple, i); -#else - part = __Pyx_PySequence_ITEM(parts_tuple, i); - if (!part) return NULL; -#endif - submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); -#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) - Py_DECREF(part); -#endif - Py_DECREF(module); - module = submodule; - } - if (unlikely(!module)) { - return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); - } - return module; -} -static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { - PyObject *imported_module; - PyObject *module = __Pyx_Import(name, NULL, 0); - if (!parts_tuple || unlikely(!module)) - return module; - imported_module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(imported_module)) { - Py_DECREF(module); - return imported_module; - } - PyErr_Clear(); - return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); -} -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if CYTHON_COMPILING_IN_CPYTHON - PyObject *module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(module)) { - PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_mstate_global->__pyx_n_u_spec); - if (likely(spec)) { - PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_mstate_global->__pyx_n_u_initializing); - if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { - Py_DECREF(spec); - spec = NULL; - } - Py_XDECREF(unsafe); - } - if (likely(!spec)) { - PyErr_Clear(); - return module; - } - Py_DECREF(spec); - Py_DECREF(module); - } else if (PyErr_Occurred()) { - PyErr_Clear(); - } -#endif - return __Pyx__ImportDottedModule(name, parts_tuple); -} - -/* ListPack */ -static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...) { - va_list va; - PyObject *l = PyList_New(n); - va_start(va, n); - if (unlikely(!l)) goto end; - for (Py_ssize_t i=0; i= 0x030C0000 + PyObject *args[] = {d, key, default_value}; + value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); +#elif CYTHON_COMPILING_IN_LIMITED_API + value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL); #elif PY_VERSION_HEX >= 0x030d0000 PyDict_SetDefaultRef(d, key, default_value, &value); #else @@ -16947,6 +16550,56 @@ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *ke return value; } +/* AddModuleRef */ +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) { + PyObject *module_dict = PyImport_GetModuleDict(); + PyObject *m; + if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) { + return NULL; + } + if (m != NULL && PyModule_Check(m)) { + return m; + } + Py_XDECREF(m); + m = PyModule_NewObject(name); + if (m == NULL) + return NULL; + if (PyDict_CheckExact(module_dict)) { + PyObject *new_m; + (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m); + Py_DECREF(m); + return new_m; + } else { + if (PyObject_SetItem(module_dict, name, m) != 0) { + Py_DECREF(m); + return NULL; + } + return m; + } + } + static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *py_name = PyUnicode_FromString(name); + if (!py_name) return NULL; + PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name); + Py_DECREF(py_name); + return module; + } +#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) +#else + static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *module = PyImport_AddModule(name); + Py_XINCREF(module); + return module; + } +#endif + +/* FetchSharedCythonModule */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void) { + return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME); +} + /* FetchCommonType */ #if __PYX_LIMITED_VERSION_HEX < 0x030C0000 static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) { @@ -17020,11 +16673,13 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyOb } else if (unlikely(get_item_ref_result == -1)) { goto bad; } - CYTHON_UNUSED_VAR(module); - cached_type = __Pyx_PyType_FromMetaclass(metaclass, abi_module, spec, bases); + cached_type = __Pyx_PyType_FromMetaclass( + metaclass, + CYTHON_USE_MODULE_STATE ? module : abi_module, + spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; - new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type, 1); + new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type); if (unlikely(new_cached_type != cached_type)) { if (unlikely(!new_cached_type)) goto bad; Py_DECREF(cached_type); @@ -17054,22 +16709,35 @@ bad: static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) { return PyUnicode_FromString(__PYX_ABI_MODULE_NAME); } +#if __PYX_LIMITED_VERSION_HEX < 0x030A0000 +static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) { + PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types"); + return NULL; +} +static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) { + PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable"); + return -1; +} +#endif static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = { {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL}, {0, 0, 0, 0, 0} }; static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = { {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset}, + #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 + {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call}, + {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call}, + {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr}, + #endif {0, 0} }; static PyType_Spec __pyx_CommonTypesMetaclass_spec = { __PYX_TYPE_MODULE_PREFIX "_common_types_metatype", 0, 0, -#if PY_VERSION_HEX >= 0x030A0000 Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | -#endif Py_TPFLAGS_DEFAULT, __pyx_CommonTypesMetaclass_slots }; @@ -17114,14 +16782,19 @@ static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *ty #endif /* PyVectorcallFastCallDict */ -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; - Py_ssize_t i, pos; + Py_ssize_t i; + #if CYTHON_AVOID_BORROWED_REFS + PyObject *pos; + #else + Py_ssize_t pos; + #endif size_t j; PyObject *key, *value; unsigned long keys_are_strings; @@ -17143,17 +16816,16 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector return NULL; } kwvalues = newargs + nargs; - pos = i = 0; + pos = 0; + i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; - while (PyDict_Next(kw, &pos, &key, &value)) { + while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) { keys_are_strings &= #if CYTHON_COMPILING_IN_LIMITED_API PyType_GetFlags(Py_TYPE(key)); #else Py_TYPE(key)->tp_flags; #endif - Py_INCREF(key); - Py_INCREF(value); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup; #else @@ -17168,6 +16840,9 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector } res = vc(func, newargs, nargs, kwnames); cleanup: + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(pos); + #endif Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); @@ -17348,9 +17023,11 @@ __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void __Pyx_END_CRITICAL_SECTION(); return 0; } +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 static PyObject * -__Pyx_CyFunction_get_dict_locked(__pyx_CyFunctionObject *op) +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { + CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) @@ -17359,36 +17036,7 @@ __Pyx_CyFunction_get_dict_locked(__pyx_CyFunctionObject *op) Py_INCREF(op->func_dict); return op->func_dict; } -static PyObject * -__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - PyObject *result; - __Pyx_BEGIN_CRITICAL_SECTION(op); - result = __Pyx_CyFunction_get_dict_locked(op); - __Pyx_END_CRITICAL_SECTION(); - return result; -} -static int -__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(value == NULL)) { - PyErr_SetString(PyExc_TypeError, - "function's dictionary may not be deleted"); - return -1; - } - if (unlikely(!PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "setting function's dictionary to a non-dict"); - return -1; - } - Py_INCREF(value); - __Pyx_BEGIN_CRITICAL_SECTION(op); - __Pyx_Py_XDECREF_SET(op->func_dict, value); - __Pyx_END_CRITICAL_SECTION(); - return 0; -} +#endif static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { @@ -17650,8 +17298,13 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = { {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, - {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0}, + {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0}, +#else + {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0}, + {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0}, +#endif {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, @@ -17672,9 +17325,11 @@ static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, +#endif #if CYTHON_METH_FASTCALL -#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, @@ -17730,7 +17385,9 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef * Py_XINCREF(module); cf->m_module = module; #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API op->func_dict = NULL; +#endif op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; @@ -17784,7 +17441,13 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func_dict); +#elif PY_VERSION_HEX < 0x030d0000 + _PyObject_ClearManagedDict((PyObject*)m); +#else + PyObject_ClearManagedDict((PyObject*)m); +#endif Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); @@ -17832,7 +17495,20 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func_dict); +#else + { + int e = +#if PY_VERSION_HEX < 0x030d0000 + _PyObject_VisitManagedDict +#else + PyObject_VisitManagedDict +#endif + ((PyObject*)m, visit, arg); + if (e != 0) return e; + } +#endif __Pyx_VISIT_CONST(m->func_name); __Pyx_VISIT_CONST(m->func_qualname); Py_VISIT(m->func_doc); @@ -17944,7 +17620,7 @@ static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *a static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE @@ -17983,7 +17659,7 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P } return result; } -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; @@ -18005,11 +17681,7 @@ static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionO static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); @@ -18044,11 +17716,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); @@ -18083,11 +17751,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); @@ -18118,11 +17782,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); @@ -18147,7 +17807,12 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject default: return NULL; } - return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, (size_t)nargs, kwnames); + #if PY_VERSION_HEX < 0x030e00A6 + size_t nargs_value = (size_t) nargs; + #else + Py_ssize_t nargs_value = nargs; + #endif + return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames); } #endif static PyType_Slot __pyx_CyFunctionType_slots[] = { @@ -18176,9 +17841,10 @@ static PyType_Spec __pyx_CyFunctionType_spec = { _Py_TPFLAGS_HAVE_VECTORCALL | #endif #endif // CYTHON_METH_FASTCALL -#if PY_VERSION_HEX >= 0x030A0000 - Py_TPFLAGS_IMMUTABLETYPE | +#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_TPFLAGS_MANAGED_DICT | #endif + Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; @@ -18229,47 +17895,36 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qual /* CLineInTraceback */ #if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME -static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { - PyObject *use_cline; - PyObject *ptype, *pvalue, *ptraceback; -#if CYTHON_COMPILING_IN_CPYTHON - PyObject **cython_runtime_dict; +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 +#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o)) +#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL); +#else +PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) { + PyObject **dict_ptr = _PyObject_GetDictPtr(o); + return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL; +} #endif +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline = NULL; + PyObject *ptype, *pvalue, *ptraceback; + PyObject *cython_runtime_dict; CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); -#if CYTHON_COMPILING_IN_CPYTHON - cython_runtime_dict = _PyObject_GetDictPtr(__pyx_mstate_global->__pyx_cython_runtime); + cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime); if (likely(cython_runtime_dict)) { - __Pyx_BEGIN_CRITICAL_SECTION(*cython_runtime_dict); __PYX_PY_DICT_LOOKUP_IF_MODIFIED( - use_cline, *cython_runtime_dict, - __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback)) - Py_XINCREF(use_cline); - __Pyx_END_CRITICAL_SECTION(); - } else -#endif - { - PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback); - if (use_cline_obj) { - use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; - Py_INCREF(use_cline); - Py_DECREF(use_cline_obj); - } else { - PyErr_Clear(); - use_cline = NULL; - } + use_cline, cython_runtime_dict, + __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False)) } - if (!use_cline) { - c_line = 0; - (void) PyObject_SetAttr(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False); - } - else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } Py_XDECREF(use_cline); + Py_XDECREF(cython_runtime_dict); __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } @@ -18427,8 +18082,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { - (void) __pyx_cfilenm; - (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); + c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = __pyx_find_code_object(c_line ? -c_line : py_line); @@ -18437,7 +18091,11 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; - py_funcname = PyUnicode_FromString(funcname); + if (c_line) { + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + } else { + py_funcname = PyUnicode_FromString(funcname); + } if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; @@ -18545,7 +18203,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { return PyLong_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); -#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_COMPILING_IN_PYPY } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif @@ -18553,10 +18211,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { } else { if (sizeof(long) <= sizeof(long)) { return PyLong_FromLong((long) value); -#ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif } } { @@ -18735,10 +18391,8 @@ static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif } } else { #if CYTHON_USE_PYLONG_INTERNALS @@ -18807,10 +18461,8 @@ static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif } } { @@ -18989,10 +18641,8 @@ static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif } } else { #if CYTHON_USE_PYLONG_INTERNALS @@ -19061,10 +18711,8 @@ static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif } } { @@ -19256,6 +18904,39 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj } #endif +/* GetRuntimeVersion */ +#if __PYX_LIMITED_VERSION_HEX < 0x030b0000 +void __Pyx_init_runtime_version(void) { + if (__Pyx_cached_runtime_version == 0) { + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; + } + version += factor * digit; + if (rt_version[i] != '.') + break; + digit = 0; + factor >>= 8; + ++i; + } + __Pyx_cached_runtime_version = version; + } +} +#endif +static unsigned long __Pyx_get_runtime_version(void) { +#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 + return Py_Version & ~0xFFUL; +#else + return __Pyx_cached_runtime_version; +#endif +} + /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { @@ -19350,7 +19031,6 @@ static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { #if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)) PyObject *args[2] = {obj, arg}; - (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_Call2Args; return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); @@ -20104,7 +19784,9 @@ static int __Pyx_Coroutine_clear(PyObject *self) { static void __Pyx_Coroutine_dealloc(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; PyObject_GC_UnTrack(gen); + #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API if (gen->gi_weakreflist != NULL) + #endif PyObject_ClearWeakRefs(self); if (gen->resume_label >= 0) { PyObject_GC_Track(self); @@ -20305,7 +19987,9 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( #if CYTHON_USE_EXC_INFO_STACK gen->gi_exc_state.previous_item = NULL; #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API gen->gi_weakreflist = NULL; +#endif Py_XINCREF(qualname); gen->gi_qualname = qualname; Py_XINCREF(name); @@ -20394,7 +20078,9 @@ static PyMemberDef __pyx_Generator_memberlist[] = { PyDoc_STR("object being iterated by 'yield from', or None")}, {"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, {"__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, +#endif {0, 0, 0, 0, 0} }; static PyGetSetDef __pyx_Generator_getsets[] = { @@ -20428,10 +20114,11 @@ static PyType_Spec __pyx_GeneratorType_spec = { __PYX_TYPE_MODULE_PREFIX "generator", sizeof(__pyx_CoroutineObject), 0, -#if PY_VERSION_HEX >= 0x030A0000 - Py_TPFLAGS_IMMUTABLETYPE | +#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_TPFLAGS_MANAGED_WEAKREF | #endif - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE | __Pyx_TPFLAGS_HAVE_AM_SEND, + Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | __Pyx_TPFLAGS_HAVE_AM_SEND, __pyx_GeneratorType_slots }; #if __PYX_HAS_PY_AM_SEND == 2 @@ -20463,36 +20150,6 @@ static PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self) { return retval; } -/* GetRuntimeVersion */ -static unsigned long __Pyx_get_runtime_version(void) { -#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 - return Py_Version & ~0xFFUL; -#else - static unsigned long __Pyx_cached_runtime_version = 0; - if (__Pyx_cached_runtime_version == 0) { - const char* rt_version = Py_GetVersion(); - unsigned long version = 0; - unsigned long factor = 0x01000000UL; - unsigned int digit = 0; - int i = 0; - while (factor) { - while ('0' <= rt_version[i] && rt_version[i] <= '9') { - digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); - ++i; - } - version += factor * digit; - if (rt_version[i] != '.') - break; - digit = 0; - factor >>= 8; - ++i; - } - __Pyx_cached_runtime_version = version; - } - return __Pyx_cached_runtime_version; -#endif -} - /* CheckBinaryVersion */ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; @@ -20582,7 +20239,7 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt #endif return result; } -#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY +#elif !CYTHON_COMPILING_IN_PYPY #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else @@ -20594,10 +20251,10 @@ static PyObject* __Pyx_PyCode_New( PyObject * const *varnames, PyObject *filename, PyObject *funcname, - const char *line_table, + PyObject *line_table, PyObject *tuple_dedup_map ) { - PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL, *line_table_bytes = NULL; + PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL; Py_ssize_t var_count = (Py_ssize_t) descr.nlocals; PyObject *varnames_tuple = PyTuple_New(var_count); if (unlikely(!varnames_tuple)) return NULL; @@ -20618,11 +20275,12 @@ static PyObject* __Pyx_PyCode_New( #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(varnames_tuple_dedup); #endif - if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL - && !CYTHON_COMPILING_IN_GRAAL) { - line_table_bytes = PyBytes_FromStringAndSize(line_table, descr.line_table_length); - if (unlikely(!line_table_bytes)) goto done; - Py_ssize_t code_len = (descr.line_table_length * 2 + 4) & ~3; + if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) { + Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(line_table_length == -1)) goto done; + #endif + Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL; code_bytes = PyBytes_FromStringAndSize(NULL, code_len); if (unlikely(!code_bytes)) goto done; char* c_code_bytes = PyBytes_AsString(code_bytes); @@ -20645,11 +20303,10 @@ static PyObject* __Pyx_PyCode_New( filename, funcname, (int) descr.first_line, - (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table_bytes) ? line_table_bytes : __pyx_mstate_global->__pyx_empty_bytes + (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes ); done: Py_XDECREF(code_bytes); - Py_XDECREF(line_table_bytes); #if CYTHON_AVOID_BORROWED_REFS Py_XDECREF(varnames_tuple_dedup); #endif @@ -20657,30 +20314,68 @@ done: return code_obj; } -/* InitStrings */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names) { - while (t->s) { - PyObject *str; - if (t->is_unicode) { - if (t->intern) { - str = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - str = PyUnicode_Decode(t->s, t->n - 1, encoding_names[t->encoding], NULL); - } else { - str = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - str = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - if (!str) - return -1; - *target = str; - if (PyObject_Hash(str) == -1) - return -1; - ++t; - ++target; +/* DecompressString */ +static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) { + PyObject *module, *decompress, *compressed_bytes, *decompressed; + const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib"; + PyObject *methodname = PyUnicode_FromString("decompress"); + if (unlikely(!methodname)) return NULL; + #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000 + if (algo == 3) { + PyObject *fromlist = Py_BuildValue("[O]", methodname); + if (unlikely(!fromlist)) return NULL; + module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0); + Py_DECREF(fromlist); + } else + #endif + module = PyImport_ImportModule(module_name); + if (unlikely(!module)) goto import_failed; + decompress = PyObject_GetAttr(module, methodname); + if (unlikely(!decompress)) goto import_failed; + { + #ifdef __cplusplus + char *memview_bytes = const_cast(s); + #else + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wcast-qual" + #elif !defined(__INTEL_COMPILER) && defined(__GNUC__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wcast-qual" + #endif + char *memview_bytes = (char*) s; + #if defined(__clang__) + #pragma clang diagnostic pop + #elif !defined(__INTEL_COMPILER) && defined(__GNUC__) + #pragma GCC diagnostic pop + #endif + #endif + #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ) + int memview_flags = 0x100; + #else + int memview_flags = PyBUF_READ; + #endif + compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags); } - return 0; + if (unlikely(!compressed_bytes)) { + Py_DECREF(decompress); + goto bad; + } + decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL); + Py_DECREF(compressed_bytes); + Py_DECREF(decompress); + Py_DECREF(module); + Py_DECREF(methodname); + return decompressed; +import_failed: + PyErr_Format(PyExc_ImportError, + "Failed to import '%.20s.decompress' - cannot initialise module strings. " + "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.", + module_name, algo); +bad: + Py_XDECREF(module); + Py_DECREF(methodname); + return NULL; } #include @@ -20902,22 +20597,11 @@ static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) { return __Pyx_NewRef(Py_None); } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { - return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); + return __Pyx_NewRef(b ? Py_True: Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) { return PyLong_FromSize_t(ival); } -#if CYTHON_USE_PYLONG_INTERNALS -static CYTHON_INLINE int __Pyx_PyLong_CompactAsLong(PyObject *x, long *return_value) { - if (unlikely(!__Pyx_PyLong_IsCompact(x))) - return 0; - Py_ssize_t value = __Pyx_PyLong_CompactValue(x); - if ((sizeof(long) < sizeof(Py_ssize_t)) && unlikely(value != (long) value)) - return 0; - *return_value = (long) value; - return 1; -} -#endif /* MultiPhaseInitModuleState */ diff --git a/tests/test_interface.py b/tests/test_interface.py index df8703c..1920452 100644 --- a/tests/test_interface.py +++ b/tests/test_interface.py @@ -1,23 +1,61 @@ import shutil +from io import StringIO from unittest.mock import patch import pytest +from dopt_basics.result_pattern import wrap_result -from dopt_sensor_anomalies import _interface, constants, errors +from dopt_sensor_anomalies import _interface, constants + + +def test_print_error_state_WrongState(): + from dopt_basics.result_pattern import STATUS_HANDLER + + MSG = "to treat state as error" + with pytest.raises(RuntimeError, match=MSG): + _interface._print_error_state(STATUS_HANDLER.SUCCESS, out_stream=StringIO()) + + +def test_print_error_state(tmp_path): + @wrap_result(100) + def error_func() -> None: + # do something + raise RuntimeError("Oops, error occurred") + + err_state = error_func().status + output_file = tmp_path / "t_output.txt" + output_file.touch() + + with open(output_file, "w") as stream: + _interface._print_error_state(err_state, stream) + + lines: list[str] + with open(output_file, "r") as file: + lines = file.readlines() + + assert "following exception" in lines[0] + assert "Type: RuntimeError" in lines[1] + assert "Description:" in lines[2] + assert "Message: Oops, error occurred" in lines[3] @patch("dopt_sensor_anomalies._find_paths.STOP_FOLDER_NAME", "lib") def test_sensor_anomalies_detection_FailImagePath(setup_temp_dir): img_path = str(setup_temp_dir / "not-existing.bmp") + pixels_per_metric_X: float = 0.251 pixels_per_metric_Y: float = 0.251 MESSAGE = "The provided path seems not to exist" - with pytest.raises(FileNotFoundError, match=MESSAGE): - _interface.sensor_anomalies_detection( + with patch("sys.stderr", new_callable=StringIO) as mock_err: + ret = _interface.sensor_anomalies_detection( img_path, pixels_per_metric_X, pixels_per_metric_Y ) + captured = mock_err.getvalue() + assert ret != 0 + assert "FileNotFoundError" in captured + assert MESSAGE in captured @patch("dopt_sensor_anomalies._find_paths.STOP_FOLDER_NAME", "lib") @@ -28,10 +66,14 @@ def test_sensor_anomalies_detection_FailElectrodeCount(path_img_with_failure_Ele MESSAGE = "Number of counted electrodes does not match the" - with pytest.raises(errors.InvalidElectrodeCount, match=MESSAGE): - _interface.sensor_anomalies_detection( + with patch("sys.stderr", new_callable=StringIO) as mock_err: + ret = _interface.sensor_anomalies_detection( img_path, pixels_per_metric_X, pixels_per_metric_Y ) + captured = mock_err.getvalue() + assert ret != 0 + assert "InvalidElectrodeCount" in captured + assert MESSAGE in captured @patch("dopt_sensor_anomalies._find_paths.STOP_FOLDER_NAME", "lib") @@ -52,8 +94,11 @@ def test_sensor_anomalies_detection_Success( pixels_per_metric_X: float = 0.251 pixels_per_metric_Y: float = 0.251 - _interface.sensor_anomalies_detection(img_path, pixels_per_metric_X, pixels_per_metric_Y) + ret = _interface.sensor_anomalies_detection( + img_path, pixels_per_metric_X, pixels_per_metric_Y + ) + assert ret == 0 assert csv_file.exists() assert heatmap_file.exists() target_folder = results_folder / "csharp_interface"