Created
July 13, 2018 18:28
-
-
Save chris-b1/cd974fb6b4165285a48b6d6c12129b40 to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Generated by Cython 0.28.3 */ | |
#define PY_SSIZE_T_CLEAN | |
#include "Python.h" | |
#ifndef Py_PYTHON_H | |
#error Python headers needed to compile C extensions, please install development version of Python. | |
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) | |
#error Cython requires Python 2.6+ or Python 3.3+. | |
#else | |
#define CYTHON_ABI "0_28_3" | |
#define CYTHON_FUTURE_DIVISION 0 | |
#include <stddef.h> | |
#ifndef offsetof | |
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) | |
#endif | |
#if !defined(WIN32) && !defined(MS_WINDOWS) | |
#ifndef __stdcall | |
#define __stdcall | |
#endif | |
#ifndef __cdecl | |
#define __cdecl | |
#endif | |
#ifndef __fastcall | |
#define __fastcall | |
#endif | |
#endif | |
#ifndef DL_IMPORT | |
#define DL_IMPORT(t) t | |
#endif | |
#ifndef DL_EXPORT | |
#define DL_EXPORT(t) t | |
#endif | |
#define __PYX_COMMA , | |
#ifndef HAVE_LONG_LONG | |
#if PY_VERSION_HEX >= 0x02070000 | |
#define HAVE_LONG_LONG | |
#endif | |
#endif | |
#ifndef PY_LONG_LONG | |
#define PY_LONG_LONG LONG_LONG | |
#endif | |
#ifndef Py_HUGE_VAL | |
#define Py_HUGE_VAL HUGE_VAL | |
#endif | |
#ifdef PYPY_VERSION | |
#define CYTHON_COMPILING_IN_PYPY 1 | |
#define CYTHON_COMPILING_IN_PYSTON 0 | |
#define CYTHON_COMPILING_IN_CPYTHON 0 | |
#undef CYTHON_USE_TYPE_SLOTS | |
#define CYTHON_USE_TYPE_SLOTS 0 | |
#undef CYTHON_USE_PYTYPE_LOOKUP | |
#define CYTHON_USE_PYTYPE_LOOKUP 0 | |
#if PY_VERSION_HEX < 0x03050000 | |
#undef CYTHON_USE_ASYNC_SLOTS | |
#define CYTHON_USE_ASYNC_SLOTS 0 | |
#elif !defined(CYTHON_USE_ASYNC_SLOTS) | |
#define CYTHON_USE_ASYNC_SLOTS 1 | |
#endif | |
#undef CYTHON_USE_PYLIST_INTERNALS | |
#define CYTHON_USE_PYLIST_INTERNALS 0 | |
#undef CYTHON_USE_UNICODE_INTERNALS | |
#define CYTHON_USE_UNICODE_INTERNALS 0 | |
#undef CYTHON_USE_UNICODE_WRITER | |
#define CYTHON_USE_UNICODE_WRITER 0 | |
#undef CYTHON_USE_PYLONG_INTERNALS | |
#define CYTHON_USE_PYLONG_INTERNALS 0 | |
#undef CYTHON_AVOID_BORROWED_REFS | |
#define CYTHON_AVOID_BORROWED_REFS 1 | |
#undef CYTHON_ASSUME_SAFE_MACROS | |
#define CYTHON_ASSUME_SAFE_MACROS 0 | |
#undef CYTHON_UNPACK_METHODS | |
#define CYTHON_UNPACK_METHODS 0 | |
#undef CYTHON_FAST_THREAD_STATE | |
#define CYTHON_FAST_THREAD_STATE 0 | |
#undef CYTHON_FAST_PYCALL | |
#define CYTHON_FAST_PYCALL 0 | |
#undef CYTHON_PEP489_MULTI_PHASE_INIT | |
#define CYTHON_PEP489_MULTI_PHASE_INIT 0 | |
#undef CYTHON_USE_TP_FINALIZE | |
#define CYTHON_USE_TP_FINALIZE 0 | |
#elif defined(PYSTON_VERSION) | |
#define CYTHON_COMPILING_IN_PYPY 0 | |
#define CYTHON_COMPILING_IN_PYSTON 1 | |
#define CYTHON_COMPILING_IN_CPYTHON 0 | |
#ifndef CYTHON_USE_TYPE_SLOTS | |
#define CYTHON_USE_TYPE_SLOTS 1 | |
#endif | |
#undef CYTHON_USE_PYTYPE_LOOKUP | |
#define CYTHON_USE_PYTYPE_LOOKUP 0 | |
#undef CYTHON_USE_ASYNC_SLOTS | |
#define CYTHON_USE_ASYNC_SLOTS 0 | |
#undef CYTHON_USE_PYLIST_INTERNALS | |
#define CYTHON_USE_PYLIST_INTERNALS 0 | |
#ifndef CYTHON_USE_UNICODE_INTERNALS | |
#define CYTHON_USE_UNICODE_INTERNALS 1 | |
#endif | |
#undef CYTHON_USE_UNICODE_WRITER | |
#define CYTHON_USE_UNICODE_WRITER 0 | |
#undef CYTHON_USE_PYLONG_INTERNALS | |
#define CYTHON_USE_PYLONG_INTERNALS 0 | |
#ifndef CYTHON_AVOID_BORROWED_REFS | |
#define CYTHON_AVOID_BORROWED_REFS 0 | |
#endif | |
#ifndef CYTHON_ASSUME_SAFE_MACROS | |
#define CYTHON_ASSUME_SAFE_MACROS 1 | |
#endif | |
#ifndef CYTHON_UNPACK_METHODS | |
#define CYTHON_UNPACK_METHODS 1 | |
#endif | |
#undef CYTHON_FAST_THREAD_STATE | |
#define CYTHON_FAST_THREAD_STATE 0 | |
#undef CYTHON_FAST_PYCALL | |
#define CYTHON_FAST_PYCALL 0 | |
#undef CYTHON_PEP489_MULTI_PHASE_INIT | |
#define CYTHON_PEP489_MULTI_PHASE_INIT 0 | |
#undef CYTHON_USE_TP_FINALIZE | |
#define CYTHON_USE_TP_FINALIZE 0 | |
#else | |
#define CYTHON_COMPILING_IN_PYPY 0 | |
#define CYTHON_COMPILING_IN_PYSTON 0 | |
#define CYTHON_COMPILING_IN_CPYTHON 1 | |
#ifndef CYTHON_USE_TYPE_SLOTS | |
#define CYTHON_USE_TYPE_SLOTS 1 | |
#endif | |
#if PY_VERSION_HEX < 0x02070000 | |
#undef CYTHON_USE_PYTYPE_LOOKUP | |
#define CYTHON_USE_PYTYPE_LOOKUP 0 | |
#elif !defined(CYTHON_USE_PYTYPE_LOOKUP) | |
#define CYTHON_USE_PYTYPE_LOOKUP 1 | |
#endif | |
#if PY_MAJOR_VERSION < 3 | |
#undef CYTHON_USE_ASYNC_SLOTS | |
#define CYTHON_USE_ASYNC_SLOTS 0 | |
#elif !defined(CYTHON_USE_ASYNC_SLOTS) | |
#define CYTHON_USE_ASYNC_SLOTS 1 | |
#endif | |
#if PY_VERSION_HEX < 0x02070000 | |
#undef CYTHON_USE_PYLONG_INTERNALS | |
#define CYTHON_USE_PYLONG_INTERNALS 0 | |
#elif !defined(CYTHON_USE_PYLONG_INTERNALS) | |
#define CYTHON_USE_PYLONG_INTERNALS 1 | |
#endif | |
#ifndef CYTHON_USE_PYLIST_INTERNALS | |
#define CYTHON_USE_PYLIST_INTERNALS 1 | |
#endif | |
#ifndef CYTHON_USE_UNICODE_INTERNALS | |
#define CYTHON_USE_UNICODE_INTERNALS 1 | |
#endif | |
#if PY_VERSION_HEX < 0x030300F0 | |
#undef CYTHON_USE_UNICODE_WRITER | |
#define CYTHON_USE_UNICODE_WRITER 0 | |
#elif !defined(CYTHON_USE_UNICODE_WRITER) | |
#define CYTHON_USE_UNICODE_WRITER 1 | |
#endif | |
#ifndef CYTHON_AVOID_BORROWED_REFS | |
#define CYTHON_AVOID_BORROWED_REFS 0 | |
#endif | |
#ifndef CYTHON_ASSUME_SAFE_MACROS | |
#define CYTHON_ASSUME_SAFE_MACROS 1 | |
#endif | |
#ifndef CYTHON_UNPACK_METHODS | |
#define CYTHON_UNPACK_METHODS 1 | |
#endif | |
#ifndef CYTHON_FAST_THREAD_STATE | |
#define CYTHON_FAST_THREAD_STATE 1 | |
#endif | |
#ifndef CYTHON_FAST_PYCALL | |
#define CYTHON_FAST_PYCALL 1 | |
#endif | |
#ifndef CYTHON_PEP489_MULTI_PHASE_INIT | |
#define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000) | |
#endif | |
#ifndef CYTHON_USE_TP_FINALIZE | |
#define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) | |
#endif | |
#endif | |
#if !defined(CYTHON_FAST_PYCCALL) | |
#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) | |
#endif | |
#if CYTHON_USE_PYLONG_INTERNALS | |
#include "longintrepr.h" | |
#undef SHIFT | |
#undef BASE | |
#undef MASK | |
#endif | |
#ifndef __has_attribute | |
#define __has_attribute(x) 0 | |
#endif | |
#ifndef __has_cpp_attribute | |
#define __has_cpp_attribute(x) 0 | |
#endif | |
#ifndef CYTHON_RESTRICT | |
#if defined(__GNUC__) | |
#define CYTHON_RESTRICT __restrict__ | |
#elif defined(_MSC_VER) && _MSC_VER >= 1400 | |
#define CYTHON_RESTRICT __restrict | |
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L | |
#define CYTHON_RESTRICT restrict | |
#else | |
#define CYTHON_RESTRICT | |
#endif | |
#endif | |
#ifndef CYTHON_UNUSED | |
# if defined(__GNUC__) | |
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) | |
# define CYTHON_UNUSED __attribute__ ((__unused__)) | |
# else | |
# define CYTHON_UNUSED | |
# endif | |
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) | |
# define CYTHON_UNUSED __attribute__ ((__unused__)) | |
# else | |
# define CYTHON_UNUSED | |
# endif | |
#endif | |
#ifndef CYTHON_MAYBE_UNUSED_VAR | |
# if defined(__cplusplus) | |
template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } | |
# else | |
# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) | |
# endif | |
#endif | |
#ifndef CYTHON_NCP_UNUSED | |
# if CYTHON_COMPILING_IN_CPYTHON | |
# define CYTHON_NCP_UNUSED | |
# else | |
# define CYTHON_NCP_UNUSED CYTHON_UNUSED | |
# endif | |
#endif | |
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) | |
#ifdef _MSC_VER | |
#ifndef _MSC_STDINT_H_ | |
#if _MSC_VER < 1300 | |
typedef unsigned char uint8_t; | |
typedef unsigned int uint32_t; | |
#else | |
typedef unsigned __int8 uint8_t; | |
typedef unsigned __int32 uint32_t; | |
#endif | |
#endif | |
#else | |
#include <stdint.h> | |
#endif | |
#ifndef CYTHON_FALLTHROUGH | |
#if defined(__cplusplus) && __cplusplus >= 201103L | |
#if __has_cpp_attribute(fallthrough) | |
#define CYTHON_FALLTHROUGH [[fallthrough]] | |
#elif __has_cpp_attribute(clang::fallthrough) | |
#define CYTHON_FALLTHROUGH [[clang::fallthrough]] | |
#elif __has_cpp_attribute(gnu::fallthrough) | |
#define CYTHON_FALLTHROUGH [[gnu::fallthrough]] | |
#endif | |
#endif | |
#ifndef CYTHON_FALLTHROUGH | |
#if __has_attribute(fallthrough) | |
#define CYTHON_FALLTHROUGH __attribute__((fallthrough)) | |
#else | |
#define CYTHON_FALLTHROUGH | |
#endif | |
#endif | |
#if defined(__clang__ ) && defined(__apple_build_version__) | |
#if __apple_build_version__ < 7000000 | |
#undef CYTHON_FALLTHROUGH | |
#define CYTHON_FALLTHROUGH | |
#endif | |
#endif | |
#endif | |
#ifndef __cplusplus | |
#error "Cython files generated with the C++ option must be compiled with a C++ compiler." | |
#endif | |
#ifndef CYTHON_INLINE | |
#if defined(__clang__) | |
#define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) | |
#else | |
#define CYTHON_INLINE inline | |
#endif | |
#endif | |
template<typename T> | |
void __Pyx_call_destructor(T& x) { | |
x.~T(); | |
} | |
template<typename T> | |
class __Pyx_FakeReference { | |
public: | |
__Pyx_FakeReference() : ptr(NULL) { } | |
__Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { } | |
T *operator->() { return ptr; } | |
T *operator&() { return ptr; } | |
operator T&() { return *ptr; } | |
template<typename U> bool operator ==(U other) { return *ptr == other; } | |
template<typename U> bool operator !=(U other) { return *ptr != other; } | |
private: | |
T *ptr; | |
}; | |
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) | |
#define Py_OptimizeFlag 0 | |
#endif | |
#define __PYX_BUILD_PY_SSIZE_T "n" | |
#define CYTHON_FORMAT_SSIZE_T "z" | |
#if PY_MAJOR_VERSION < 3 | |
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__" | |
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ | |
PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) | |
#define __Pyx_DefaultClassType PyClass_Type | |
#else | |
#define __Pyx_BUILTIN_MODULE_NAME "builtins" | |
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ | |
PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) | |
#define __Pyx_DefaultClassType PyType_Type | |
#endif | |
#ifndef Py_TPFLAGS_CHECKTYPES | |
#define Py_TPFLAGS_CHECKTYPES 0 | |
#endif | |
#ifndef Py_TPFLAGS_HAVE_INDEX | |
#define Py_TPFLAGS_HAVE_INDEX 0 | |
#endif | |
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER | |
#define Py_TPFLAGS_HAVE_NEWBUFFER 0 | |
#endif | |
#ifndef Py_TPFLAGS_HAVE_FINALIZE | |
#define Py_TPFLAGS_HAVE_FINALIZE 0 | |
#endif | |
#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) | |
#ifndef METH_FASTCALL | |
#define METH_FASTCALL 0x80 | |
#endif | |
typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); | |
typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, | |
Py_ssize_t nargs, PyObject *kwnames); | |
#else | |
#define __Pyx_PyCFunctionFast _PyCFunctionFast | |
#define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords | |
#endif | |
#if CYTHON_FAST_PYCCALL | |
#define __Pyx_PyFastCFunction_Check(func)\ | |
((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))))) | |
#else | |
#define __Pyx_PyFastCFunction_Check(func) 0 | |
#endif | |
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) | |
#define PyObject_Malloc(s) PyMem_Malloc(s) | |
#define PyObject_Free(p) PyMem_Free(p) | |
#define PyObject_Realloc(p) PyMem_Realloc(p) | |
#endif | |
#if CYTHON_COMPILING_IN_PYSTON | |
#define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) | |
#define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) | |
#else | |
#define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) | |
#define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) | |
#endif | |
#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 | |
#define __Pyx_PyThreadState_Current PyThreadState_GET() | |
#elif PY_VERSION_HEX >= 0x03060000 | |
#define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() | |
#elif PY_VERSION_HEX >= 0x03000000 | |
#define __Pyx_PyThreadState_Current PyThreadState_GET() | |
#else | |
#define __Pyx_PyThreadState_Current _PyThreadState_Current | |
#endif | |
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) | |
#include "pythread.h" | |
#define Py_tss_NEEDS_INIT 0 | |
typedef int Py_tss_t; | |
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { | |
*key = PyThread_create_key(); | |
return 0; // PyThread_create_key reports success always | |
} | |
static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { | |
Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); | |
*key = Py_tss_NEEDS_INIT; | |
return key; | |
} | |
static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { | |
PyObject_Free(key); | |
} | |
static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { | |
return *key != Py_tss_NEEDS_INIT; | |
} | |
static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { | |
PyThread_delete_key(*key); | |
*key = Py_tss_NEEDS_INIT; | |
} | |
static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { | |
return PyThread_set_key_value(*key, value); | |
} | |
static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { | |
return PyThread_get_key_value(*key); | |
} | |
#endif // TSS (Thread Specific Storage) API | |
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) | |
#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) | |
#else | |
#define __Pyx_PyDict_NewPresized(n) PyDict_New() | |
#endif | |
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION | |
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) | |
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) | |
#else | |
#define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) | |
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) | |
#endif | |
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS | |
#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) | |
#else | |
#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) | |
#endif | |
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) | |
#define CYTHON_PEP393_ENABLED 1 | |
#define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ | |
0 : _PyUnicode_Ready((PyObject *)(op))) | |
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) | |
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) | |
#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) | |
#define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) | |
#define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) | |
#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) | |
#define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) | |
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) | |
#else | |
#define CYTHON_PEP393_ENABLED 0 | |
#define PyUnicode_1BYTE_KIND 1 | |
#define PyUnicode_2BYTE_KIND 2 | |
#define PyUnicode_4BYTE_KIND 4 | |
#define __Pyx_PyUnicode_READY(op) (0) | |
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) | |
#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) | |
#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) | |
#define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) | |
#define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) | |
#define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) | |
#define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) | |
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) | |
#endif | |
#if CYTHON_COMPILING_IN_PYPY | |
#define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) | |
#define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) | |
#else | |
#define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) | |
#define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ | |
PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) | |
#endif | |
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) | |
#define PyUnicode_Contains(u, s) PySequence_Contains(u, s) | |
#endif | |
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) | |
#define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) | |
#endif | |
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) | |
#define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) | |
#endif | |
#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) | |
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) | |
#if PY_MAJOR_VERSION >= 3 | |
#define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) | |
#else | |
#define __Pyx_PyString_Format(a, b) PyString_Format(a, b) | |
#endif | |
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) | |
#define PyObject_ASCII(o) PyObject_Repr(o) | |
#endif | |
#if PY_MAJOR_VERSION >= 3 | |
#define PyBaseString_Type PyUnicode_Type | |
#define PyStringObject PyUnicodeObject | |
#define PyString_Type PyUnicode_Type | |
#define PyString_Check PyUnicode_Check | |
#define PyString_CheckExact PyUnicode_CheckExact | |
#define PyObject_Unicode PyObject_Str | |
#endif | |
#if PY_MAJOR_VERSION >= 3 | |
#define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) | |
#define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) | |
#else | |
#define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) | |
#define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) | |
#endif | |
#ifndef PySet_CheckExact | |
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) | |
#endif | |
#if CYTHON_ASSUME_SAFE_MACROS | |
#define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) | |
#else | |
#define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) | |
#endif | |
#if PY_MAJOR_VERSION >= 3 | |
#define PyIntObject PyLongObject | |
#define PyInt_Type PyLong_Type | |
#define PyInt_Check(op) PyLong_Check(op) | |
#define PyInt_CheckExact(op) PyLong_CheckExact(op) | |
#define PyInt_FromString PyLong_FromString | |
#define PyInt_FromUnicode PyLong_FromUnicode | |
#define PyInt_FromLong PyLong_FromLong | |
#define PyInt_FromSize_t PyLong_FromSize_t | |
#define PyInt_FromSsize_t PyLong_FromSsize_t | |
#define PyInt_AsLong PyLong_AsLong | |
#define PyInt_AS_LONG PyLong_AS_LONG | |
#define PyInt_AsSsize_t PyLong_AsSsize_t | |
#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask | |
#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask | |
#define PyNumber_Int PyNumber_Long | |
#endif | |
#if PY_MAJOR_VERSION >= 3 | |
#define PyBoolObject PyLongObject | |
#endif | |
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY | |
#ifndef PyUnicode_InternFromString | |
#define PyUnicode_InternFromString(s) PyUnicode_FromString(s) | |
#endif | |
#endif | |
#if PY_VERSION_HEX < 0x030200A4 | |
typedef long Py_hash_t; | |
#define __Pyx_PyInt_FromHash_t PyInt_FromLong | |
#define __Pyx_PyInt_AsHash_t PyInt_AsLong | |
#else | |
#define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t | |
#define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t | |
#endif | |
#if PY_MAJOR_VERSION >= 3 | |
#define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) | |
#else | |
#define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) | |
#endif | |
#if CYTHON_USE_ASYNC_SLOTS | |
#if PY_VERSION_HEX >= 0x030500B1 | |
#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods | |
#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) | |
#else | |
#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) | |
#endif | |
#else | |
#define __Pyx_PyType_AsAsync(obj) NULL | |
#endif | |
#ifndef __Pyx_PyAsyncMethodsStruct | |
typedef struct { | |
unaryfunc am_await; | |
unaryfunc am_aiter; | |
unaryfunc am_anext; | |
} __Pyx_PyAsyncMethodsStruct; | |
#endif | |
#if defined(WIN32) || defined(MS_WINDOWS) | |
#define _USE_MATH_DEFINES | |
#endif | |
#include <math.h> | |
#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 | |
#define __Pyx_truncl truncl | |
#endif | |
#define __PYX_ERR(f_index, lineno, Ln_error) \ | |
{ \ | |
__pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ | |
} | |
#ifndef __PYX_EXTERN_C | |
#ifdef __cplusplus | |
#define __PYX_EXTERN_C extern "C" | |
#else | |
#define __PYX_EXTERN_C extern | |
#endif | |
#endif | |
#define __PYX_HAVE__pandas___libs__window | |
#define __PYX_HAVE_API__pandas___libs__window | |
/* Early includes */ | |
#include "ios" | |
#include "new" | |
#include "stdexcept" | |
#include "typeinfo" | |
#include <deque> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include "numpy/arrayobject.h" | |
#include "numpy/ufuncobject.h" | |
#include "../src/headers/cmath" | |
#include "pythread.h" | |
#include "numpy/ndarrayobject.h" | |
#include "numpy_helper.h" | |
#include "headers/stdint.h" | |
#include "src/skiplist.h" | |
#include "pystate.h" | |
#ifdef _OPENMP | |
#include <omp.h> | |
#endif /* _OPENMP */ | |
#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) | |
#define CYTHON_WITHOUT_ASSERTIONS | |
#endif | |
typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; | |
const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; | |
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 | |
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 | |
#define __PYX_DEFAULT_STRING_ENCODING "" | |
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString | |
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize | |
#define __Pyx_uchar_cast(c) ((unsigned char)c) | |
#define __Pyx_long_cast(x) ((long)x) | |
#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ | |
(sizeof(type) < sizeof(Py_ssize_t)) ||\ | |
(sizeof(type) > sizeof(Py_ssize_t) &&\ | |
likely(v < (type)PY_SSIZE_T_MAX ||\ | |
v == (type)PY_SSIZE_T_MAX) &&\ | |
(!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ | |
v == (type)PY_SSIZE_T_MIN))) ||\ | |
(sizeof(type) == sizeof(Py_ssize_t) &&\ | |
(is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ | |
v == (type)PY_SSIZE_T_MAX))) ) | |
#if defined (__cplusplus) && __cplusplus >= 201103L | |
#include <cstdlib> | |
#define __Pyx_sst_abs(value) std::abs(value) | |
#elif SIZEOF_INT >= SIZEOF_SIZE_T | |
#define __Pyx_sst_abs(value) abs(value) | |
#elif SIZEOF_LONG >= SIZEOF_SIZE_T | |
#define __Pyx_sst_abs(value) labs(value) | |
#elif defined (_MSC_VER) | |
#define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) | |
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L | |
#define __Pyx_sst_abs(value) llabs(value) | |
#elif defined (__GNUC__) | |
#define __Pyx_sst_abs(value) __builtin_llabs(value) | |
#else | |
#define __Pyx_sst_abs(value) ((value<0) ? -value : value) | |
#endif | |
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); | |
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); | |
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) | |
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) | |
#define __Pyx_PyBytes_FromString PyBytes_FromString | |
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize | |
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); | |
#if PY_MAJOR_VERSION < 3 | |
#define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString | |
#define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize | |
#else | |
#define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString | |
#define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize | |
#endif | |
#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) | |
#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) | |
#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) | |
#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) | |
#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) | |
#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) | |
#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) | |
#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) | |
#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) | |
#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) | |
#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) | |
#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) | |
#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) | |
#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) | |
#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) | |
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) | |
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { | |
const Py_UNICODE *u_end = u; | |
while (*u_end++) ; | |
return (size_t)(u_end - u - 1); | |
} | |
#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) | |
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode | |
#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode | |
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) | |
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) | |
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); | |
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); | |
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); | |
#define __Pyx_PySequence_Tuple(obj)\ | |
(likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) | |
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); | |
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); | |
#if CYTHON_ASSUME_SAFE_MACROS | |
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) | |
#else | |
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) | |
#endif | |
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) | |
#if PY_MAJOR_VERSION >= 3 | |
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) | |
#else | |
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) | |
#endif | |
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) | |
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII | |
static int __Pyx_sys_getdefaultencoding_not_ascii; | |
static int __Pyx_init_sys_getdefaultencoding_params(void) { | |
PyObject* sys; | |
PyObject* default_encoding = NULL; | |
PyObject* ascii_chars_u = NULL; | |
PyObject* ascii_chars_b = NULL; | |
const char* default_encoding_c; | |
sys = PyImport_ImportModule("sys"); | |
if (!sys) goto bad; | |
default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); | |
Py_DECREF(sys); | |
if (!default_encoding) goto bad; | |
default_encoding_c = PyBytes_AsString(default_encoding); | |
if (!default_encoding_c) goto bad; | |
if (strcmp(default_encoding_c, "ascii") == 0) { | |
__Pyx_sys_getdefaultencoding_not_ascii = 0; | |
} else { | |
char ascii_chars[128]; | |
int c; | |
for (c = 0; c < 128; c++) { | |
ascii_chars[c] = c; | |
} | |
__Pyx_sys_getdefaultencoding_not_ascii = 1; | |
ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); | |
if (!ascii_chars_u) goto bad; | |
ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); | |
if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { | |
PyErr_Format( | |
PyExc_ValueError, | |
"This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", | |
default_encoding_c); | |
goto bad; | |
} | |
Py_DECREF(ascii_chars_u); | |
Py_DECREF(ascii_chars_b); | |
} | |
Py_DECREF(default_encoding); | |
return 0; | |
bad: | |
Py_XDECREF(default_encoding); | |
Py_XDECREF(ascii_chars_u); | |
Py_XDECREF(ascii_chars_b); | |
return -1; | |
} | |
#endif | |
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 | |
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) | |
#else | |
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) | |
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT | |
static char* __PYX_DEFAULT_STRING_ENCODING; | |
static int __Pyx_init_sys_getdefaultencoding_params(void) { | |
PyObject* sys; | |
PyObject* default_encoding = NULL; | |
char* default_encoding_c; | |
sys = PyImport_ImportModule("sys"); | |
if (!sys) goto bad; | |
default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); | |
Py_DECREF(sys); | |
if (!default_encoding) goto bad; | |
default_encoding_c = PyBytes_AsString(default_encoding); | |
if (!default_encoding_c) goto bad; | |
__PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); | |
if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; | |
strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); | |
Py_DECREF(default_encoding); | |
return 0; | |
bad: | |
Py_XDECREF(default_encoding); | |
return -1; | |
} | |
#endif | |
#endif | |
/* Test for GCC > 2.95 */ | |
#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) | |
#define likely(x) __builtin_expect(!!(x), 1) | |
#define unlikely(x) __builtin_expect(!!(x), 0) | |
#else /* !__GNUC__ or GCC < 2.95 */ | |
#define likely(x) (x) | |
#define unlikely(x) (x) | |
#endif /* __GNUC__ */ | |
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } | |
static PyObject *__pyx_m = NULL; | |
static PyObject *__pyx_d; | |
static PyObject *__pyx_b; | |
static PyObject *__pyx_cython_runtime = NULL; | |
static PyObject *__pyx_empty_tuple; | |
static PyObject *__pyx_empty_bytes; | |
static PyObject *__pyx_empty_unicode; | |
static int __pyx_lineno; | |
static int __pyx_clineno = 0; | |
static const char * __pyx_cfilenm= __FILE__; | |
static const char *__pyx_filename; | |
/* Header.proto */ | |
#if !defined(CYTHON_CCOMPLEX) | |
#if defined(__cplusplus) | |
#define CYTHON_CCOMPLEX 1 | |
#elif defined(_Complex_I) | |
#define CYTHON_CCOMPLEX 1 | |
#else | |
#define CYTHON_CCOMPLEX 0 | |
#endif | |
#endif | |
#if CYTHON_CCOMPLEX | |
#ifdef __cplusplus | |
#include <complex> | |
#else | |
#include <complex.h> | |
#endif | |
#endif | |
#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) | |
#undef _Complex_I | |
#define _Complex_I 1.0fj | |
#endif | |
static const char *__pyx_f[] = { | |
"pandas\\_libs\\window.pyx", | |
"stringsource", | |
"__init__.pxd", | |
"pandas/_libs/src\\util.pxd", | |
"type.pxd", | |
"bool.pxd", | |
"complex.pxd", | |
"pandas\\_libs\\skiplist.pxd", | |
}; | |
/* BufferFormatStructs.proto */ | |
#define IS_UNSIGNED(type) (((type) -1) > 0) | |
struct __Pyx_StructField_; | |
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) | |
typedef struct { | |
const char* name; | |
struct __Pyx_StructField_* fields; | |
size_t size; | |
size_t arraysize[8]; | |
int ndim; | |
char typegroup; | |
char is_unsigned; | |
int flags; | |
} __Pyx_TypeInfo; | |
typedef struct __Pyx_StructField_ { | |
__Pyx_TypeInfo* type; | |
const char* name; | |
size_t offset; | |
} __Pyx_StructField; | |
typedef struct { | |
__Pyx_StructField* field; | |
size_t parent_offset; | |
} __Pyx_BufFmt_StackElem; | |
typedef struct { | |
__Pyx_StructField root; | |
__Pyx_BufFmt_StackElem* head; | |
size_t fmt_offset; | |
size_t new_count, enc_count; | |
size_t struct_alignment; | |
int is_complex; | |
char enc_type; | |
char new_packmode; | |
char enc_packmode; | |
char is_valid_array; | |
} __Pyx_BufFmt_Context; | |
/* NoFastGil.proto */ | |
#define __Pyx_PyGILState_Ensure PyGILState_Ensure | |
#define __Pyx_PyGILState_Release PyGILState_Release | |
#define __Pyx_FastGIL_Remember() | |
#define __Pyx_FastGIL_Forget() | |
#define __Pyx_FastGilFuncInit() | |
/* ForceInitThreads.proto */ | |
#ifndef __PYX_FORCE_INIT_THREADS | |
#define __PYX_FORCE_INIT_THREADS 0 | |
#endif | |
/* Atomics.proto */ | |
#include <pythread.h> | |
#ifndef CYTHON_ATOMICS | |
#define CYTHON_ATOMICS 1 | |
#endif | |
#define __pyx_atomic_int_type int | |
#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\ | |
(__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\ | |
!defined(__i386__) | |
#define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1) | |
#define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1) | |
#ifdef __PYX_DEBUG_ATOMICS | |
#warning "Using GNU atomics" | |
#endif | |
#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0 | |
#include <Windows.h> | |
#undef __pyx_atomic_int_type | |
#define __pyx_atomic_int_type LONG | |
#define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value) | |
#define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value) | |
#ifdef __PYX_DEBUG_ATOMICS | |
#pragma message ("Using MSVC atomics") | |
#endif | |
#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0 | |
#define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value) | |
#define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value) | |
#ifdef __PYX_DEBUG_ATOMICS | |
#warning "Using Intel atomics" | |
#endif | |
#else | |
#undef CYTHON_ATOMICS | |
#define CYTHON_ATOMICS 0 | |
#ifdef __PYX_DEBUG_ATOMICS | |
#warning "Not using atomics" | |
#endif | |
#endif | |
typedef volatile __pyx_atomic_int_type __pyx_atomic_int; | |
#if CYTHON_ATOMICS | |
#define __pyx_add_acquisition_count(memview)\ | |
__pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) | |
#define __pyx_sub_acquisition_count(memview)\ | |
__pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) | |
#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) | |
#endif | |
/* MemviewSliceStruct.proto */ | |
struct __pyx_memoryview_obj; | |
typedef struct { | |
struct __pyx_memoryview_obj *memview; | |
char *data; | |
Py_ssize_t shape[8]; | |
Py_ssize_t strides[8]; | |
Py_ssize_t suboffsets[8]; | |
} __Pyx_memviewslice; | |
#define __Pyx_MemoryView_Len(m) (m.shape[0]) | |
/* "../../../AppData/Local/Continuum/Anaconda3/envs/pandas-dev/lib/site-packages/Cython/Includes/numpy/__init__.pxd":730 | |
* # in Cython to enable them only on the right systems. | |
* | |
* ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< | |
* ctypedef npy_int16 int16_t | |
* ctypedef npy_int32 int32_t | |
*/ | |
typedef npy_int8 __pyx_t_5numpy_int8_t; | |
/* "../../../AppData/Local/Continuum/Anaconda3/envs/pandas-dev/lib/site-packages/Cython/Includes/numpy/__init__.pxd":731 | |
* | |
* ctypedef npy_int8 int8_t | |
* ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< | |
* ctypedef npy_int32 int32_t | |
* ctypedef npy_int64 int64_t | |
*/ | |
typedef npy_int16 __pyx_t_5numpy_int16_t; | |
/* "../../../AppData/Local/Continuum/Anaconda3/envs/pandas-dev/lib/site-packages/Cython/Includes/numpy/__init__.pxd":732 | |
* ctypedef npy_int8 int8_t | |
* ctypedef npy_int16 int16_t | |
* ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< | |
* ctypedef npy_int64 int64_t | |
* #ctypedef npy_int96 int96_t | |
*/ | |
typedef npy_int32 __pyx_t_5numpy_int32_t; | |
/* "../../../AppData/Local/Continuum/Anaconda3/envs/pandas-dev/lib/site-packages/Cython/Includes/numpy/__init__.pxd":733 | |
* ctypedef npy_int16 int16_t | |
* ctypedef npy_int32 int32_t | |
* ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< | |
* #ctypedef npy_int96 int96_t | |
* #ctypedef npy_int128 int128_t | |
*/ | |
typedef npy_int64 __pyx_t_5numpy_int64_t; | |
/* "../../../AppData/Local/Continuum/Anaconda3/envs/pandas-dev/lib/site-packages/Cython/Includes/numpy/__init__.pxd":737 | |
* #ctypedef npy_int128 int128_t | |
* | |
* ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< | |
* ctypedef npy_uint16 uint16_t | |
* ctypedef npy_uint32 uint32_t | |
*/ | |
typedef npy_uint8 __pyx_t_5numpy_uint8_t; | |
/* "../../../AppData/Local/Continuum/Anaconda3/envs/pandas-dev/lib/site-packages/Cython/Includes/numpy/__init__.pxd":738 | |
* | |
* ctypedef npy_uint8 uint8_t | |
* ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< | |
* ctypedef npy_uint32 uint32_t | |
* ctypedef npy_uint64 uint64_t | |
*/ | |
typedef npy_uint16 __pyx_t_5numpy_uint16_t; | |
/* "../../../AppData/Local/Continuum/Anaconda3/envs/pandas-dev/lib/site-packages/Cython/Includes/numpy/__init__.pxd":739 | |
* ctypedef npy_uint8 uint8_t | |
* ctypedef npy_uint16 uint16_t | |
* ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< | |
* ctypedef npy_uint64 uint64_t | |
* #ctypedef npy_uint96 uint96_t | |
*/ | |
typedef npy_uint32 __pyx_t_5numpy_uint32_t; | |
/* "../../../AppData/Local/Continuum/Anaconda3/envs/pandas-dev/lib/site-packages/Cython/Includes/numpy/__init__.pxd":740 | |
* ctypedef npy_uint16 uint16_t | |
* ctypedef npy_uint32 uint32_t | |
* ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< | |
* #ctypedef npy_uint96 uint96_t | |
* #ctypedef npy_uint128 uint128_t | |
*/ | |
typedef npy_uint64 __pyx_t_5numpy_uint64_t; | |
/* "../../../AppData/Local/Continuum/Anaconda3/envs/pandas-dev/lib/site-packages/Cython/Includes/numpy/__init__.pxd":744 | |
* #ctypedef npy_uint128 uint128_t | |
* | |
* ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< | |
* ctypedef npy_float64 float64_t | |
* #ctypedef npy_float80 float80_t | |
*/ | |
typedef npy_float32 __pyx_t_5numpy_float32_t; | |
/* "../../../AppData/Local/Continuum/Anaconda3/envs/pandas-dev/lib/site-packages/Cython/Includes/numpy/__init__.pxd":745 | |
* | |
* ctypedef npy_float32 float32_t | |
* ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< | |
* #ctypedef npy_float80 float80_t | |
* #ctypedef npy_float128 float128_t | |
*/ | |
typedef npy_float64 __pyx_t_5numpy_float64_t; | |
/* "../../../AppData/Local/Continuum/Anaconda3/envs/pandas-dev/lib/site-packages/Cython/Includes/numpy/__init__.pxd":754 | |
* # The int types are mapped a bit surprising -- | |
* # numpy.int corresponds to 'l' and numpy.long to 'q' | |
* ctypedef npy_long int_t # <<<<<<<<<<<<<< | |
* ctypedef npy_longlong long_t | |
* ctypedef npy_longlong longlong_t | |
*/ | |
typedef npy_long __pyx_t_5numpy_int_t; | |
/* "../../../AppData/Local/Continuum/Anaconda3/envs/pandas-dev/lib/site-packages/Cython/Includes/numpy/__init__.pxd":755 | |
* # numpy.int corresponds to 'l' and numpy.long to 'q' | |
* ctypedef npy_long int_t | |
* ctypedef npy_longlong long_t # <<<<<<<<<<<<<< | |
* ctypedef npy_longlong longlong_t | |
* | |
*/ | |
typedef npy_longlong __pyx_t_5numpy_long_t; | |
/* "../../../AppData/Local/Continuum/Anaconda3/envs/pandas-dev/lib/site-packages/Cython/Includes/numpy/__init__.pxd":756 | |
* ctypedef npy_long int_t | |
* ctypedef npy_longlong long_t | |
* ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< | |
* | |
* ctypedef npy_ulong uint_t | |
*/ | |
typedef npy_longlong __pyx_t_5numpy_longlong_t; | |
/* "../../../AppData/Local/Continuum/Anaconda3/envs/pandas-dev/lib/site-packages/Cython/Includes/numpy/__init__.pxd":758 | |
* ctypedef npy_longlong longlong_t | |
* | |
* ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< | |
* ctypedef npy_ulonglong ulong_t | |
* ctypedef npy_ulonglong ulonglong_t | |
*/ | |
typedef npy_ulong __pyx_t_5numpy_uint_t; | |
/* "../../../AppData/Local/Continuum/Anaconda3/envs/pandas-dev/lib/site-packages/Cython/Includes/numpy/__init__.pxd":759 | |
* | |
* ctypedef npy_ulong uint_t | |
* ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< | |
* ctypedef npy_ulonglong ulonglong_t | |
* | |
*/ | |
typedef npy_ulonglong __pyx_t_5numpy_ulong_t; | |
/* "../../../AppData/Local/Continuum/Anaconda3/envs/pandas-dev/lib/site-packages/Cython/Includes/numpy/__init__.pxd":760 | |
* ctypedef npy_ulong uint_t | |
* ctypedef npy_ulonglong ulong_t | |
* ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< | |
* | |
* ctypedef npy_intp intp_t | |
*/ | |
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; | |
/* "../../../AppData/Local/Continuum/Anaconda3/envs/pandas-dev/lib/site-packages/Cython/Includes/numpy/__init__.pxd":762 | |
* ctypedef npy_ulonglong ulonglong_t | |
* | |
* ctypedef npy_intp intp_t # <<<<<<<<<<<<<< | |
* ctypedef npy_uintp uintp_t | |
* | |
*/ | |
typedef npy_intp __pyx_t_5numpy_intp_t; | |
/* "../../../AppData/Local/Continuum/Anaconda3/envs/pandas-dev/lib/site-packages/Cython/Includes/numpy/__init__.pxd":763 | |
* | |
* ctypedef npy_intp intp_t | |
* ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< | |
* | |
* ctypedef npy_double float_t | |
*/ | |
typedef npy_uintp __pyx_t_5numpy_uintp_t; | |
/* "../../../AppData/Local/Continuum/Anaconda3/envs/pandas-dev/lib/site-packages/Cython/Includes/numpy/__init__.pxd":765 | |
* ctypedef npy_uintp uintp_t | |
* | |
* ctypedef npy_double float_t # <<<<<<<<<<<<<< | |
* ctypedef npy_double double_t | |
* ctypedef npy_longdouble longdouble_t | |
*/ | |
typedef npy_double __pyx_t_5numpy_float_t; | |
/* "../../../AppData/Local/Continuum/Anaconda3/envs/pandas-dev/lib/site-packages/Cython/Includes/numpy/__init__.pxd":766 | |
* | |
* ctypedef npy_double float_t | |
* ctypedef npy_double double_t # <<<<<<<<<<<<<< | |
* ctypedef npy_longdouble longdouble_t | |
* | |
*/ | |
typedef npy_double __pyx_t_5numpy_double_t; | |
/* "../../../AppData/Local/Continuum/Anaconda3/envs/pandas-dev/lib/site-packages/Cython/Includes/numpy/__init__.pxd":767 | |
* ctypedef npy_double float_t | |
* ctypedef npy_double double_t | |
* ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< | |
* | |
* ctypedef npy_cfloat cfloat_t | |
*/ | |
typedef npy_longdouble __pyx_t_5numpy_longdouble_t; | |
/* Declarations.proto */ | |
#if CYTHON_CCOMPLEX | |
#ifdef __cplusplus | |
typedef ::std::complex< float > __pyx_t_float_complex; | |
#else | |
typedef float _Complex __pyx_t_float_complex; | |
#endif | |
#else | |
typedef struct { float real, imag; } __pyx_t_float_complex; | |
#endif | |
static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); | |
/* Declarations.proto */ | |
#if CYTHON_CCOMPLEX | |
#ifdef __cplusplus | |
typedef ::std::complex< double > __pyx_t_double_complex; | |
#else | |
typedef double _Complex __pyx_t_double_complex; | |
#endif | |
#else | |
typedef struct { double real, imag; } __pyx_t_double_complex; | |
#endif | |
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); | |
/*--- Type declarations ---*/ | |
struct __pyx_obj_6pandas_5_libs_8skiplist_Node; | |
struct __pyx_obj_6pandas_5_libs_8skiplist_IndexableSkiplist; | |
struct __pyx_obj_6pandas_5_libs_6window_WindowIndexer; | |
struct __pyx_obj_6pandas_5_libs_6window_MockFixedWindowIndexer; | |
struct __pyx_obj_6pandas_5_libs_6window_FixedWindowIndexer; | |
struct __pyx_obj_6pandas_5_libs_6window_VariableWindowIndexer; | |
struct __pyx_array_obj; | |
struct __pyx_MemviewEnum_obj; | |
struct __pyx_memoryview_obj; | |
struct __pyx_memoryviewslice_obj; | |
/* "../../../AppData/Local/Continuum/Anaconda3/envs/pandas-dev/lib/site-packages/Cython/Includes/numpy/__init__.pxd":769 | |
* ctypedef npy_longdouble longdouble_t | |
* | |
* ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< | |
* ctypedef npy_cdouble cdouble_t | |
* ctypedef npy_clongdouble clongdouble_t | |
*/ | |
typedef npy_cfloat __pyx_t_5numpy_cfloat_t; | |
/* "../../../AppData/Local/Continuum/Anaconda3/envs/pandas-dev/lib/site-packages/Cython/Includes/numpy/__init__.pxd":770 | |
* | |
* ctypedef npy_cfloat cfloat_t | |
* ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< | |
* ctypedef npy_clongdouble clongdouble_t | |
* | |
*/ | |
typedef npy_cdouble __pyx_t_5numpy_cdouble_t; | |
/* "../../../AppData/Local/Continuum/Anaconda3/envs/pandas-dev/lib/site-packages/Cython/Includes/numpy/__init__.pxd":771 | |
* ctypedef npy_cfloat cfloat_t | |
* ctypedef npy_cdouble cdouble_t | |
* ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< | |
* | |
* ctypedef npy_cdouble complex_t | |
*/ | |
typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; | |
/* "../../../AppData/Local/Continuum/Anaconda3/envs/pandas-dev/lib/site-packages/Cython/Includes/numpy/__init__.pxd":773 | |
* ctypedef npy_clongdouble clongdouble_t | |
* | |
* ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< | |
* | |
* cdef inline object PyArray_MultiIterNew1(a): | |
*/ | |
typedef npy_cdouble __pyx_t_5numpy_complex_t; | |
/* "pandas/_libs/window.pyx":1358 | |
* | |
* | |
* cdef enum InterpolationType: # <<<<<<<<<<<<<< | |
* LINEAR, | |
* LOWER, | |
*/ | |
enum __pyx_t_6pandas_5_libs_6window_InterpolationType { | |
__pyx_e_6pandas_5_libs_6window_LINEAR, | |
__pyx_e_6pandas_5_libs_6window_LOWER, | |
__pyx_e_6pandas_5_libs_6window_HIGHER, | |
__pyx_e_6pandas_5_libs_6window_NEAREST, | |
__pyx_e_6pandas_5_libs_6window_MIDPOINT | |
}; | |
/* "skiplist.pxd":34 | |
* # Note: Node is declared here so that IndexableSkiplist can be exposed; | |
* # Node itself not intended to be exposed. | |
* cdef class Node: # <<<<<<<<<<<<<< | |
* cdef public: | |
* double_t value | |
*/ | |
struct __pyx_obj_6pandas_5_libs_8skiplist_Node { | |
PyObject_HEAD | |
__pyx_t_5numpy_double_t value; | |
PyObject *next; | |
PyObject *width; | |
}; | |
/* "skiplist.pxd":41 | |
* | |
* | |
* cdef class IndexableSkiplist: # <<<<<<<<<<<<<< | |
* cdef: | |
* Py_ssize_t size, maxlevels | |
*/ | |
struct __pyx_obj_6pandas_5_libs_8skiplist_IndexableSkiplist { | |
PyObject_HEAD | |
struct __pyx_vtabstruct_6pandas_5_libs_8skiplist_IndexableSkiplist *__pyx_vtab; | |
Py_ssize_t size; | |
Py_ssize_t maxlevels; | |
struct __pyx_obj_6pandas_5_libs_8skiplist_Node *head; | |
}; | |
/* "pandas/_libs/window.pyx":102 | |
* | |
* | |
* cdef class WindowIndexer: # <<<<<<<<<<<<<< | |
* | |
* cdef: | |
*/ | |
struct __pyx_obj_6pandas_5_libs_6window_WindowIndexer { | |
PyObject_HEAD | |
PyArrayObject *start; | |
PyArrayObject *end; | |
__pyx_t_5numpy_int64_t N; | |
__pyx_t_5numpy_int64_t minp; | |
__pyx_t_5numpy_int64_t win; | |
int is_variable; | |
}; | |
/* "pandas/_libs/window.pyx":115 | |
* | |
* | |
* cdef class MockFixedWindowIndexer(WindowIndexer): # <<<<<<<<<<<<<< | |
* """ | |
* | |
*/ | |
struct __pyx_obj_6pandas_5_libs_6window_MockFixedWindowIndexer { | |
struct __pyx_obj_6pandas_5_libs_6window_WindowIndexer __pyx_base; | |
}; | |
/* "pandas/_libs/window.pyx":153 | |
* | |
* | |
* cdef class FixedWindowIndexer(WindowIndexer): # <<<<<<<<<<<<<< | |
* """ | |
* create a fixed length window indexer object | |
*/ | |
struct __pyx_obj_6pandas_5_libs_6window_FixedWindowIndexer { | |
struct __pyx_obj_6pandas_5_libs_6window_WindowIndexer __pyx_base; | |
}; | |
/* "pandas/_libs/window.pyx":198 | |
* | |
* | |
* cdef class VariableWindowIndexer(WindowIndexer): # <<<<<<<<<<<<<< | |
* """ | |
* create a variable length window indexer object | |
*/ | |
struct __pyx_obj_6pandas_5_libs_6window_VariableWindowIndexer { | |
struct __pyx_obj_6pandas_5_libs_6window_WindowIndexer __pyx_base; | |
}; | |
/* "View.MemoryView":104 | |
* | |
* @cname("__pyx_array") | |
* cdef class array: # <<<<<<<<<<<<<< | |
* | |
* cdef: | |
*/ | |
struct __pyx_array_obj { | |
PyObject_HEAD | |
struct __pyx_vtabstruct_array *__pyx_vtab; | |
char *data; | |
Py_ssize_t len; | |
char *format; | |
int ndim; | |
Py_ssize_t *_shape; | |
Py_ssize_t *_strides; | |
Py_ssize_t itemsize; | |
PyObject *mode; | |
PyObject *_format; | |
void (*callback_free_data)(void *); | |
int free_data; | |
int dtype_is_object; | |
}; | |
/* "View.MemoryView":278 | |
* | |
* @cname('__pyx_MemviewEnum') | |
* cdef class Enum(object): # <<<<<<<<<<<<<< | |
* cdef object name | |
* def __init__(self, name): | |
*/ | |
struct __pyx_MemviewEnum_obj { | |
PyObject_HEAD | |
PyObject *name; | |
}; | |
/* "View.MemoryView":329 | |
* | |
* @cname('__pyx_memoryview') | |
* cdef class memoryview(object): # <<<<<<<<<<<<<< | |
* | |
* cdef object obj | |
*/ | |
struct __pyx_memoryview_obj { | |
PyObject_HEAD | |
struct __pyx_vtabstruct_memoryview *__pyx_vtab; | |
PyObject *obj; | |
PyObject *_size; | |
PyObject *_array_interface; | |
PyThread_type_lock lock; | |
__pyx_atomic_int acquisition_count[2]; | |
__pyx_atomic_int *acquisition_count_aligned_p; | |
Py_buffer view; | |
int flags; | |
int dtype_is_object; | |
__Pyx_TypeInfo *typeinfo; | |
}; | |
/* "View.MemoryView":960 | |
* | |
* @cname('__pyx_memoryviewslice') | |
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< | |
* "Internal class for passing memoryview slices to Python" | |
* | |
*/ | |
struct __pyx_memoryviewslice_obj { | |
struct __pyx_memoryview_obj __pyx_base; | |
__Pyx_memviewslice from_slice; | |
PyObject *from_object; | |
PyObject *(*to_object_func)(char *); | |
int (*to_dtype_func)(char *, PyObject *); | |
}; | |
/* "skiplist.pxd":41 | |
* | |
* | |
* cdef class IndexableSkiplist: # <<<<<<<<<<<<<< | |
* cdef: | |
* Py_ssize_t size, maxlevels | |
*/ | |
struct __pyx_vtabstruct_6pandas_5_libs_8skiplist_IndexableSkiplist { | |
PyObject *(*get)(struct __pyx_obj_6pandas_5_libs_8skiplist_IndexableSkiplist *, Py_ssize_t, int __pyx_skip_dispatch); | |
PyObject *(*insert)(struct __pyx_obj_6pandas_5_libs_8skiplist_IndexableSkiplist *, double, int __pyx_skip_dispatch); | |
PyObject *(*remove)(struct __pyx_obj_6pandas_5_libs_8skiplist_IndexableSkiplist *, double, int __pyx_skip_dispatch); | |
}; | |
static struct __pyx_vtabstruct_6pandas_5_libs_8skiplist_IndexableSkiplist *__pyx_vtabptr_6pandas_5_libs_8skiplist_IndexableSkiplist; | |
/* "View.MemoryView":104 | |
* | |
* @cname("__pyx_array") | |
* cdef class array: # <<<<<<<<<<<<<< | |
* | |
* cdef: | |
*/ | |
struct __pyx_vtabstruct_array { | |
PyObject *(*get_memview)(struct __pyx_array_obj *); | |
}; | |
static struct __pyx_vtabstruct_array *__pyx_vtabptr_array; | |
/* "View.MemoryView":329 | |
* | |
* @cname('__pyx_memoryview') | |
* cdef class memoryview(object): # <<<<<<<<<<<<<< | |
* | |
* cdef object obj | |
*/ | |
struct __pyx_vtabstruct_memoryview { | |
char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *); | |
PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *); | |
PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); | |
PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *); | |
PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); | |
PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *); | |
PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *); | |
}; | |
static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview; | |
/* "View.MemoryView":960 | |
* | |
* @cname('__pyx_memoryviewslice') | |
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< | |
* "Internal class for passing memoryview slices to Python" | |
* | |
*/ | |
struct __pyx_vtabstruct__memoryviewslice { | |
struct __pyx_vtabstruct_memoryview __pyx_base; | |
}; | |
static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice; | |
/* --- Runtime support code (head) --- */ | |
/* Refnanny.proto */ | |
#ifndef CYTHON_REFNANNY | |
#define CYTHON_REFNANNY 0 | |
#endif | |
#if CYTHON_REFNANNY | |
typedef struct { | |
void (*INCREF)(void*, PyObject*, int); | |
void (*DECREF)(void*, PyObject*, int); | |
void (*GOTREF)(void*, PyObject*, int); | |
void (*GIVEREF)(void*, PyObject*, int); | |
void* (*SetupContext)(const char*, int, const char*); | |
void (*FinishContext)(void**); | |
} __Pyx_RefNannyAPIStruct; | |
static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; | |
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); | |
#define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; | |
#ifdef WITH_THREAD | |
#define __Pyx_RefNannySetupContext(name, acquire_gil)\ | |
if (acquire_gil) {\ | |
PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ | |
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ | |
PyGILState_Release(__pyx_gilstate_save);\ | |
} else {\ | |
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ | |
} | |
#else | |
#define __Pyx_RefNannySetupContext(name, acquire_gil)\ | |
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) | |
#endif | |
#define __Pyx_RefNannyFinishContext()\ | |
__Pyx_RefNanny->FinishContext(&__pyx_refnanny) | |
#define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) | |
#define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) | |
#define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) | |
#define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) | |
#define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) | |
#define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) | |
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) | |
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) | |
#else | |
#define __Pyx_RefNannyDeclarations | |
#define __Pyx_RefNannySetupContext(name, acquire_gil) | |
#define __Pyx_RefNannyFinishContext() | |
#define __Pyx_INCREF(r) Py_INCREF(r) | |
#define __Pyx_DECREF(r) Py_DECREF(r) | |
#define __Pyx_GOTREF(r) | |
#define __Pyx_GIVEREF(r) | |
#define __Pyx_XINCREF(r) Py_XINCREF(r) | |
#define __Pyx_XDECREF(r) Py_XDECREF(r) | |
#define __Pyx_XGOTREF(r) | |
#define __Pyx_XGIVEREF(r) | |
#endif | |
#define __Pyx_XDECREF_SET(r, v) do {\ | |
PyObject *tmp = (PyObject *) r;\ | |
r = v; __Pyx_XDECREF(tmp);\ | |
} while (0) | |
#define __Pyx_DECREF_SET(r, v) do {\ | |
PyObject *tmp = (PyObject *) r;\ | |
r = v; __Pyx_DECREF(tmp);\ | |
} while (0) | |
#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) | |
#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) | |
/* PyObjectGetAttrStr.proto */ | |
#if CYTHON_USE_TYPE_SLOTS | |
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); | |
#else | |
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) | |
#endif | |
/* GetBuiltinName.proto */ | |
static PyObject *__Pyx_GetBuiltinName(PyObject *name); | |
/* 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); | |
/* RaiseDoubleKeywords.proto */ | |
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); | |
/* ParseKeywords.proto */ | |
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ | |
PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ | |
const char* function_name); | |
/* PyObjectCall.proto */ | |
#if CYTHON_COMPILING_IN_CPYTHON | |
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); | |
#else | |
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) | |
#endif | |
/* PyThreadStateGet.proto */ | |
#if CYTHON_FAST_THREAD_STATE | |
#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; | |
#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; | |
#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type | |
#else | |
#define __Pyx_PyThreadState_declare | |
#define __Pyx_PyThreadState_assign | |
#define __Pyx_PyErr_Occurred() PyErr_Occurred() | |
#endif | |
/* PyErrFetchRestore.proto */ | |
#if CYTHON_FAST_THREAD_STATE | |
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) | |
#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) | |
#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) | |
#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) | |
#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) | |
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); | |
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); | |
#if CYTHON_COMPILING_IN_CPYTHON | |
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) | |
#else | |
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) | |
#endif | |
#else | |
#define __Pyx_PyErr_Clear() PyErr_Clear() | |
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) | |
#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) | |
#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) | |
#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) | |
#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) | |
#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) | |
#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) | |
#endif | |
/* RaiseException.proto */ | |
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); | |
/* PyCFunctionFastCall.proto */ | |
#if CYTHON_FAST_PYCCALL | |
static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); | |
#else | |
#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) | |
#endif | |
/* PyFunctionFastCall.proto */ | |
#if CYTHON_FAST_PYCALL | |
#define __Pyx_PyFunction_FastCall(func, args, nargs)\ | |
__Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) | |
#if 1 || PY_VERSION_HEX < 0x030600B1 | |
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); | |
#else | |
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) | |
#endif | |
#endif | |
/* PyObjectCallMethO.proto */ | |
#if CYTHON_COMPILING_IN_CPYTHON | |
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); | |
#endif | |
/* PyObjectCallOneArg.proto */ | |
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); | |
/* PyIntBinop.proto */ | |
#if !CYTHON_COMPILING_IN_PYPY | |
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace); | |
#else | |
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\ | |
(inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) | |
#endif | |
/* PyErrExceptionMatches.proto */ | |
#if CYTHON_FAST_THREAD_STATE | |
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) | |
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); | |
#else | |
#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) | |
#endif | |
/* GetAttr.proto */ | |
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); | |
/* GetAttr3.proto */ | |
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); | |
/* GetModuleGlobalName.proto */ | |
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); | |
/* ArgTypeTest.proto */ | |
#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ | |
((likely((Py_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); | |
/* ExtTypeTest.proto */ | |
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); | |
/* PyObjectCallNoArg.proto */ | |
#if CYTHON_COMPILING_IN_CPYTHON | |
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); | |
#else | |
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) | |
#endif | |
/* IsLittleEndian.proto */ | |
static CYTHON_INLINE int __Pyx_Is_Little_Endian(void); | |
/* BufferFormatCheck.proto */ | |
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); | |
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, | |
__Pyx_BufFmt_StackElem* stack, | |
__Pyx_TypeInfo* type); | |
/* BufferGetAndValidate.proto */ | |
#define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\ | |
((obj == Py_None || obj == NULL) ?\ | |
(__Pyx_ZeroBuffer(buf), 0) :\ | |
__Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)) | |
static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj, | |
__Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); | |
static void __Pyx_ZeroBuffer(Py_buffer* buf); | |
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); | |
static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 }; | |
static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; | |
/* BufferFallbackError.proto */ | |
static void __Pyx_RaiseBufferFallbackError(void); | |
#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) | |
/* IncludeStringH.proto */ | |
#include <string.h> | |
/* BytesEquals.proto */ | |
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); | |
/* UnicodeEquals.proto */ | |
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); | |
/* StrEquals.proto */ | |
#if PY_MAJOR_VERSION >= 3 | |
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals | |
#else | |
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals | |
#endif | |
/* RaiseTooManyValuesToUnpack.proto */ | |
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); | |
/* RaiseNeedMoreValuesToUnpack.proto */ | |
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); | |
/* IterFinish.proto */ | |
static CYTHON_INLINE int __Pyx_IterFinish(void); | |
/* UnpackItemEndCheck.proto */ | |
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); | |
/* PyDictContains.proto */ | |
static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { | |
int result = PyDict_Contains(dict, item); | |
return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); | |
} | |
/* DictGetItem.proto */ | |
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY | |
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); | |
#define __Pyx_PyObject_Dict_GetItem(obj, name)\ | |
(likely(PyDict_CheckExact(obj)) ?\ | |
__Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) | |
#else | |
#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) | |
#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) | |
#endif | |
/* UnicodeAsUCS4.proto */ | |
static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject*); | |
/* object_ord.proto */ | |
#if PY_MAJOR_VERSION >= 3 | |
#define __Pyx_PyObject_Ord(c)\ | |
(likely(PyUnicode_Check(c)) ? (long)__Pyx_PyUnicode_AsPy_UCS4(c) : __Pyx__PyObject_Ord(c)) | |
#else | |
#define __Pyx_PyObject_Ord(c) __Pyx__PyObject_Ord(c) | |
#endif | |
static long __Pyx__PyObject_Ord(PyObject* c); | |
/* SetItemInt.proto */ | |
#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ | |
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ | |
__Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ | |
(is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ | |
__Pyx_SetItemInt_Generic(o, to_py_func(i), v))) | |
static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v); | |
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, | |
int is_list, int wraparound, int boundscheck); | |
/* PyObjectCallMethod0.proto */ | |
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); | |
/* RaiseNoneIterError.proto */ | |
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); | |
/* UnpackTupleError.proto */ | |
static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); | |
/* UnpackTuple2.proto */ | |
#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ | |
(likely(is_tuple || PyTuple_Check(tuple)) ?\ | |
(likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ | |
__Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ | |
(__Pyx_UnpackTupleError(tuple, 2), -1)) :\ | |
__Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) | |
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( | |
PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); | |
static int __Pyx_unpack_tuple2_generic( | |
PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple); | |
/* dict_iter.proto */ | |
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, | |
Py_ssize_t* p_orig_length, int* p_is_dict); | |
static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, | |
PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); | |
/* GetItemInt.proto */ | |
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ | |
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ | |
__Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ | |
(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)\ | |
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ | |
__Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ | |
(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)\ | |
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ | |
__Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ | |
(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); | |
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); | |
/* ListAppend.proto */ | |
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS | |
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { | |
PyListObject* L = (PyListObject*) list; | |
Py_ssize_t len = Py_SIZE(list); | |
if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { | |
Py_INCREF(x); | |
PyList_SET_ITEM(list, len, x); | |
Py_SIZE(list) = len+1; | |
return 0; | |
} | |
return PyList_Append(list, x); | |
} | |
#else | |
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) | |
#endif | |
/* SaveResetException.proto */ | |
#if CYTHON_FAST_THREAD_STATE | |
#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) | |
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); | |
#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) | |
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); | |
#else | |
#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) | |
#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) | |
#endif | |
/* GetException.proto */ | |
#if CYTHON_FAST_THREAD_STATE | |
#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) | |
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); | |
#else | |
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); | |
#endif | |
/* SliceObject.proto */ | |
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( | |
PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, | |
PyObject** py_start, PyObject** py_stop, PyObject** py_slice, | |
int has_cstart, int has_cstop, int wraparound); | |
/* ObjectGetItem.proto */ | |
#if CYTHON_USE_TYPE_SLOTS | |
static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); | |
#else | |
#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) | |
#endif | |
/* Import.proto */ | |
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); | |
/* ImportFrom.proto */ | |
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); | |
/* HasAttr.proto */ | |
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); | |
/* WriteUnraisableException.proto */ | |
static void __Pyx_WriteUnraisable(const char *name, int clineno, | |
int lineno, const char *filename, | |
int full_traceback, int nogil); | |
/* UnaryNegOverflows.proto */ | |
#define UNARY_NEG_WOULD_OVERFLOW(x)\ | |
(((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) | |
static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ | |
static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/ | |
/* decode_c_string_utf16.proto */ | |
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { | |
int byteorder = 0; | |
return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); | |
} | |
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { | |
int byteorder = -1; | |
return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); | |
} | |
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { | |
int byteorder = 1; | |
return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); | |
} | |
/* decode_c_string.proto */ | |
static CYTHON_INLINE PyObject* __Pyx_decode_c_string( | |
const char* cstring, Py_ssize_t start, Py_ssize_t stop, | |
const char* encoding, const char* errors, | |
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); | |
/* SwapException.proto */ | |
#if CYTHON_FAST_THREAD_STATE | |
#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) | |
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); | |
#else | |
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); | |
#endif | |
/* FastTypeChecks.proto */ | |
#if CYTHON_COMPILING_IN_CPYTHON | |
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) | |
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); | |
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); | |
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); | |
#else | |
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) | |
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) | |
#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) | |
#endif | |
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) | |
static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ | |
/* ListCompAppend.proto */ | |
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS | |
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { | |
PyListObject* L = (PyListObject*) list; | |
Py_ssize_t len = Py_SIZE(list); | |
if (likely(L->allocated > len)) { | |
Py_INCREF(x); | |
PyList_SET_ITEM(list, len, x); | |
Py_SIZE(list) = len+1; | |
return 0; | |
} | |
return PyList_Append(list, x); | |
} | |
#else | |
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) | |
#endif | |
/* ListExtend.proto */ | |
static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { | |
#if CYTHON_COMPILING_IN_CPYTHON | |
PyObject* none = _PyList_Extend((PyListObject*)L, v); | |
if (unlikely(!none)) | |
return -1; | |
Py_DECREF(none); | |
return 0; | |
#else | |
return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v); | |
#endif | |
} | |
/* None.proto */ | |
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); | |
/* PyObject_GenericGetAttrNoDict.proto */ | |
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 | |
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); | |
#else | |
#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr | |
#endif | |
/* PyObject_GenericGetAttr.proto */ | |
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 | |
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); | |
#else | |
#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr | |
#endif | |
/* SetupReduce.proto */ | |
static int __Pyx_setup_reduce(PyObject* type_obj); | |
/* SetVTable.proto */ | |
static int __Pyx_SetVtable(PyObject *dict, void *vtable); | |
/* GetVTable.proto */ | |
static void* __Pyx_GetVtable(PyObject *dict); | |
/* FetchCommonType.proto */ | |
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); | |
/* CythonFunction.proto */ | |
#define __Pyx_CyFunction_USED 1 | |
#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 | |
#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 | |
#define __Pyx_CYFUNCTION_CCLASS 0x04 | |
#define __Pyx_CyFunction_GetClosure(f)\ | |
(((__pyx_CyFunctionObject *) (f))->func_closure) | |
#define __Pyx_CyFunction_GetClassObj(f)\ | |
(((__pyx_CyFunctionObject *) (f))->func_classobj) | |
#define __Pyx_CyFunction_Defaults(type, f)\ | |
((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) | |
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ | |
((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) | |
typedef struct { | |
PyCFunctionObject func; | |
#if PY_VERSION_HEX < 0x030500A0 | |
PyObject *func_weakreflist; | |
#endif | |
PyObject *func_dict; | |
PyObject *func_name; | |
PyObject *func_qualname; | |
PyObject *func_doc; | |
PyObject *func_globals; | |
PyObject *func_code; | |
PyObject *func_closure; | |
PyObject *func_classobj; | |
void *defaults; | |
int defaults_pyobjects; | |
int flags; | |
PyObject *defaults_tuple; | |
PyObject *defaults_kwdict; | |
PyObject *(*defaults_getter)(PyObject *); | |
PyObject *func_annotations; | |
} __pyx_CyFunctionObject; | |
static PyTypeObject *__pyx_CyFunctionType = 0; | |
#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ | |
__Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) | |
static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, | |
int flags, PyObject* qualname, | |
PyObject *self, | |
PyObject *module, PyObject *globals, | |
PyObject* code); | |
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, | |
size_t size, | |
int pyobjects); | |
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, | |
PyObject *tuple); | |
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, | |
PyObject *dict); | |
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, | |
PyObject *dict); | |
static int __pyx_CyFunction_init(void); | |
/* FusedFunction.proto */ | |
typedef struct { | |
__pyx_CyFunctionObject func; | |
PyObject *__signatures__; | |
PyObject *type; | |
PyObject *self; | |
} __pyx_FusedFunctionObject; | |
#define __pyx_FusedFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ | |
__pyx_FusedFunction_New(__pyx_FusedFunctionType, ml, flags, qualname, self, module, globals, code) | |
static PyObject *__pyx_FusedFunction_New(PyTypeObject *type, | |
PyMethodDef *ml, int flags, | |
PyObject *qualname, PyObject *self, | |
PyObject *module, PyObject *globals, | |
PyObject *code); | |
static int __pyx_FusedFunction_clear(__pyx_FusedFunctionObject *self); | |
static PyTypeObject *__pyx_FusedFunctionType = NULL; | |
static int __pyx_FusedFunction_init(void); | |
#define __Pyx_FusedFunction_USED | |
/* CLineInTraceback.proto */ | |
#ifdef CYTHON_CLINE_IN_TRACEBACK | |
#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) | |
#else | |
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); | |
#endif | |
/* CodeObjectCache.proto */ | |
typedef struct { | |
PyCodeObject* code_object; | |
int code_line; | |
} __Pyx_CodeObjectCacheEntry; | |
struct __Pyx_CodeObjectCache { | |
int count; | |
int max_count; | |
__Pyx_CodeObjectCacheEntry* entries; | |
}; | |
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; | |
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); | |
static PyCodeObject *__pyx_find_code_object(int code_line); | |
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); | |
/* AddTraceback.proto */ | |
static void __Pyx_AddTraceback(const char *funcname, int c_line, | |
int py_line, const char *filename); | |
/* CIntToPy.proto */ | |
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); | |
#if PY_MAJOR_VERSION < 3 | |
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); | |
static void __Pyx_ReleaseBuffer(Py_buffer *view); | |
#else | |
#define __Pyx_GetBuffer PyObject_GetBuffer | |
#define __Pyx_ReleaseBuffer PyBuffer_Release | |
#endif | |
/* BufferStructDeclare.proto */ | |
typedef struct { | |
Py_ssize_t shape, strides, suboffsets; | |
} __Pyx_Buf_DimInfo; | |
typedef struct { | |
size_t refcount; | |
Py_buffer pybuffer; | |
} __Pyx_Buffer; | |
typedef struct { | |
__Pyx_Buffer *rcbuffer; | |
char *data; | |
__Pyx_Buf_DimInfo diminfo[8]; | |
} __Pyx_LocalBuf_ND; | |
/* MemviewSliceIsContig.proto */ | |
static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim); | |
/* OverlappingSlices.proto */ | |
static int __pyx_slices_overlap(__Pyx_memviewslice *slice1, | |
__Pyx_memviewslice *slice2, | |
int ndim, size_t itemsize); | |
/* Capsule.proto */ | |
static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig); | |
/* TypeInfoCompare.proto */ | |
static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b); | |
/* MemviewSliceValidateAndInit.proto */ | |
static int __Pyx_ValidateAndInit_memviewslice( | |
int *axes_specs, | |
int c_or_f_flag, | |
int buf_flags, | |
int ndim, | |
__Pyx_TypeInfo *dtype, | |
__Pyx_BufFmt_StackElem stack[], | |
__Pyx_memviewslice *memviewslice, | |
PyObject *original_obj); | |
/* ObjectToMemviewSlice.proto */ | |
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(PyObject *, int writable_flag); | |
/* ObjectToMemviewSlice.proto */ | |
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(PyObject *, int writable_flag); | |
/* ObjectToMemviewSlice.proto */ | |
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *, int writable_flag); | |
/* ObjectToMemviewSlice.proto */ | |
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *, int writable_flag); | |
/* ObjectToMemviewSlice.proto */ | |
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(PyObject *, int writable_flag); | |
/* ObjectToMemviewSlice.proto */ | |
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(PyObject *, int writable_flag); | |
/* ObjectToMemviewSlice.proto */ | |
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(PyObject *, int writable_flag); | |
/* ObjectToMemviewSlice.proto */ | |
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(PyObject *, int writable_flag); | |
/* ObjectToMemviewSlice.proto */ | |
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(PyObject *, int writable_flag); | |
/* ObjectToMemviewSlice.proto */ | |
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *, int writable_flag); | |
/* CIntToPy.proto */ | |
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_6pandas_5_libs_6window_InterpolationType(enum __pyx_t_6pandas_5_libs_6window_InterpolationType value); | |
/* CIntToPy.proto */ | |
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); | |
/* CppExceptionConversion.proto */ | |
#ifndef __Pyx_CppExn2PyErr | |
#include <new> | |
#include <typeinfo> | |
#include <stdexcept> | |
#include <ios> | |
static void __Pyx_CppExn2PyErr() { | |
try { | |
if (PyErr_Occurred()) | |
; // let the latest Python exn pass through and ignore the current one | |
else | |
throw; | |
} catch (const std::bad_alloc& exn) { | |
PyErr_SetString(PyExc_MemoryError, exn.what()); | |
} catch (const std::bad_cast& exn) { | |
PyErr_SetString(PyExc_TypeError, exn.what()); | |
} catch (const std::bad_typeid& exn) { | |
PyErr_SetString(PyExc_TypeError, exn.what()); | |
} catch (const std::domain_error& exn) { | |
PyErr_SetString(PyExc_ValueError, exn.what()); | |
} catch (const std::invalid_argument& exn) { | |
PyErr_SetString(PyExc_ValueError, exn.what()); | |
} catch (const std::ios_base::failure& exn) { | |
PyErr_SetString(PyExc_IOError, exn.what()); | |
} catch (const std::out_of_range& exn) { | |
PyErr_SetString(PyExc_IndexError, exn.what()); | |
} catch (const std::overflow_error& exn) { | |
PyErr_SetString(PyExc_OverflowError, exn.what()); | |
} catch (const std::range_error& exn) { | |
PyErr_SetString(PyExc_ArithmeticError, exn.what()); | |
} catch (const std::underflow_error& exn) { | |
PyErr_SetString(PyExc_ArithmeticError, exn.what()); | |
} catch (const std::exception& exn) { | |
PyErr_SetString(PyExc_RuntimeError, exn.what()); | |
} | |
catch (...) | |
{ | |
PyErr_SetString(PyExc_RuntimeError, "Unknown exception"); | |
} | |
} | |
#endif | |
/* CIntToPy.proto */ | |
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); | |
/* RealImag.proto */ | |
#if CYTHON_CCOMPLEX | |
#ifdef __cplusplus | |
#define __Pyx_CREAL(z) ((z).real()) | |
#define __Pyx_CIMAG(z) ((z).imag()) | |
#else | |
#define __Pyx_CREAL(z) (__real__(z)) | |
#define __Pyx_CIMAG(z) (__imag__(z)) | |
#endif | |
#else | |
#define __Pyx_CREAL(z) ((z).real) | |
#define __Pyx_CIMAG(z) ((z).imag) | |
#endif | |
#if defined(__cplusplus) && CYTHON_CCOMPLEX\ | |
&& (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) | |
#define __Pyx_SET_CREAL(z,x) ((z).real(x)) | |
#define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) | |
#else | |
#define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) | |
#define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) | |
#endif | |
/* Arithmetic.proto */ | |
#if CYTHON_CCOMPLEX | |
#define __Pyx_c_eq_float(a, b) ((a)==(b)) | |
#define __Pyx_c_sum_float(a, b) ((a)+(b)) | |
#define __Pyx_c_diff_float(a, b) ((a)-(b)) | |
#define __Pyx_c_prod_float(a, b) ((a)*(b)) | |
#define __Pyx_c_quot_float(a, b) ((a)/(b)) | |
#define __Pyx_c_neg_float(a) (-(a)) | |
#ifdef __cplusplus | |
#define __Pyx_c_is_zero_float(z) ((z)==(float)0) | |
#define __Pyx_c_conj_float(z) (::std::conj(z)) | |
#if 1 | |
#define __Pyx_c_abs_float(z) (::std::abs(z)) | |
#define __Pyx_c_pow_float(a, b) (::std::pow(a, b)) | |
#endif | |
#else | |
#define __Pyx_c_is_zero_float(z) ((z)==0) | |
#define __Pyx_c_conj_float(z) (conjf(z)) | |
#if 1 | |
#define __Pyx_c_abs_float(z) (cabsf(z)) | |
#define __Pyx_c_pow_float(a, b) (cpowf(a, b)) | |
#endif | |
#endif | |
#else | |
static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex); | |
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex); | |
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex); | |
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex); | |
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex); | |
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex); | |
static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex); | |
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex); | |
#if 1 | |
static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex); | |
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex); | |
#endif | |
#endif | |
/* Arithmetic.proto */ | |
#if CYTHON_CCOMPLEX | |
#define __Pyx_c_eq_double(a, b) ((a)==(b)) | |
#define __Pyx_c_sum_double(a, b) ((a)+(b)) | |
#define __Pyx_c_diff_double(a, b) ((a)-(b)) | |
#define __Pyx_c_prod_double(a, b) ((a)*(b)) | |
#define __Pyx_c_quot_double(a, b) ((a)/(b)) | |
#define __Pyx_c_neg_double(a) (-(a)) | |
#ifdef __cplusplus | |
#define __Pyx_c_is_zero_double(z) ((z)==(double)0) | |
#define __Pyx_c_conj_double(z) (::std::conj(z)) | |
#if 1 | |
#define __Pyx_c_abs_double(z) (::std::abs(z)) | |
#define __Pyx_c_pow_double(a, b) (::std::pow(a, b)) | |
#endif | |
#else | |
#define __Pyx_c_is_zero_double(z) ((z)==0) | |
#define __Pyx_c_conj_double(z) (conj(z)) | |
#if 1 | |
#define __Pyx_c_abs_double(z) (cabs(z)) | |
#define __Pyx_c_pow_double(a, b) (cpow(a, b)) | |
#endif | |
#endif | |
#else | |
static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex); | |
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex); | |
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex); | |
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex); | |
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex); | |
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex); | |
static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex); | |
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex); | |
#if 1 | |
static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex); | |
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex); | |
#endif | |
#endif | |
/* CIntToPy.proto */ | |
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value); | |
/* CIntFromPy.proto */ | |
static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); | |
/* MemviewSliceCopyTemplate.proto */ | |
static __Pyx_memviewslice | |
__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, | |
const char *mode, int ndim, | |
size_t sizeof_dtype, int contig_flag, | |
int dtype_is_object); | |
/* MemviewSliceInit.proto */ | |
#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d | |
#define __Pyx_MEMVIEW_DIRECT 1 | |
#define __Pyx_MEMVIEW_PTR 2 | |
#define __Pyx_MEMVIEW_FULL 4 | |
#define __Pyx_MEMVIEW_CONTIG 8 | |
#define __Pyx_MEMVIEW_STRIDED 16 | |
#define __Pyx_MEMVIEW_FOLLOW 32 | |
#define __Pyx_IS_C_CONTIG 1 | |
#define __Pyx_IS_F_CONTIG 2 | |
static int __Pyx_init_memviewslice( | |
struct __pyx_memoryview_obj *memview, | |
int ndim, | |
__Pyx_memviewslice *memviewslice, | |
int memview_is_new_reference); | |
static CYTHON_INLINE int __pyx_add_acquisition_count_locked( | |
__pyx_atomic_int *acquisition_count, PyThread_type_lock lock); | |
static CYTHON_INLINE int __pyx_sub_acquisition_count_locked( | |
__pyx_atomic_int *acquisition_count, PyThread_type_lock lock); | |
#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p) | |
#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview)) | |
#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__) | |
#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__) | |
static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int); | |
static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int); | |
/* CIntFromPy.proto */ | |
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); | |
/* CIntFromPy.proto */ | |
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); | |
/* CIntFromPy.proto */ | |
static CYTHON_INLINE enum __pyx_t_6pandas_5_libs_6window_InterpolationType __Pyx_PyInt_As_enum____pyx_t_6pandas_5_libs_6window_InterpolationType(PyObject *); | |
/* BytesContains.proto */ | |
static CYTHON_INLINE int __Pyx_BytesContains(PyObject* bytes, char character); | |
/* ImportNumPyArray.proto */ | |
static PyObject *__pyx_numpy_ndarray = NULL; | |
static PyObject* __Pyx_ImportNumPyArrayTypeIfAvailable(void); | |
/* CIntFromPy.proto */ | |
static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); | |
/* CheckBinaryVersion.proto */ | |
static int __Pyx_check_binary_version(void); | |
/* PyIdentifierFromString.proto */ | |
#if !defined(__Pyx_PyIdentifier_FromString) | |
#if PY_MAJOR_VERSION < 3 | |
#define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) | |
#else | |
#define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) | |
#endif | |
#endif | |
/* ModuleImport.proto */ | |
static PyObject *__Pyx_ImportModule(const char *name); | |
/* TypeImport.proto */ | |
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); | |
/* InitStrings.proto */ | |
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); | |
static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/ | |
static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/ | |
static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/ | |
static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/ | |
static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/ | |
static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/ | |
static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/ | |
static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/ | |
static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/ | |
static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/ | |
/* Module declarations from 'cython' */ | |
/* Module declarations from 'libcpp.deque' */ | |
/* Module declarations from 'libc.string' */ | |
/* Module declarations from 'libc.stdlib' */ | |
/* Module declarations from 'cpython.buffer' */ | |
/* Module declarations from 'libc.stdio' */ | |
/* Module declarations from '__builtin__' */ | |
/* Module declarations from 'cpython.type' */ | |
static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; | |
/* Module declarations from 'cpython.version' */ | |
/* Module declarations from 'cpython.exc' */ | |
/* Module declarations from 'cpython.module' */ | |
/* Module declarations from 'cpython.mem' */ | |
/* Module declarations from 'cpython.tuple' */ | |
/* Module declarations from 'cpython.list' */ | |
/* Module declarations from 'cpython.sequence' */ | |
/* Module declarations from 'cpython.mapping' */ | |
/* Module declarations from 'cpython.iterator' */ | |
/* Module declarations from 'cpython.number' */ | |
/* Module declarations from 'cpython.int' */ | |
/* Module declarations from '__builtin__' */ | |
/* Module declarations from 'cpython.bool' */ | |
static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; | |
/* Module declarations from 'cpython.long' */ | |
/* Module declarations from 'cpython.float' */ | |
/* Module declarations from '__builtin__' */ | |
/* Module declarations from 'cpython.complex' */ | |
static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; | |
/* Module declarations from 'cpython.string' */ | |
/* Module declarations from 'cpython.unicode' */ | |
/* Module declarations from 'cpython.dict' */ | |
/* Module declarations from 'cpython.instance' */ | |
/* Module declarations from 'cpython.function' */ | |
/* Module declarations from 'cpython.method' */ | |
/* Module declarations from 'cpython.weakref' */ | |
/* Module declarations from 'cpython.getargs' */ | |
/* Module declarations from 'cpython.pythread' */ | |
/* Module declarations from 'cpython.pystate' */ | |
/* Module declarations from 'cpython.cobject' */ | |
/* Module declarations from 'cpython.oldbuffer' */ | |
/* Module declarations from 'cpython.set' */ | |
/* Module declarations from 'cpython.bytes' */ | |
/* Module declarations from 'cpython.pycapsule' */ | |
/* Module declarations from 'cpython' */ | |
/* Module declarations from 'cpython.object' */ | |
/* Module declarations from 'cpython.ref' */ | |
/* Module declarations from 'numpy' */ | |
/* Module declarations from 'numpy' */ | |
static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; | |
static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; | |
static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; | |
static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; | |
static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; | |
static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ | |
static CYTHON_INLINE int __pyx_f_5numpy_import_array(void); /*proto*/ | |
/* Module declarations from 'util' */ | |
static CYTHON_INLINE int __pyx_f_4util_is_integer_object(PyObject *); /*proto*/ | |
static CYTHON_INLINE int __pyx_f_4util_is_float_object(PyObject *); /*proto*/ | |
static CYTHON_INLINE PyObject *__pyx_f_4util_set_value_at_unsafe(PyArrayObject *, PyObject *, PyObject *); /*proto*/ | |
/* Module declarations from 'pandas._libs.skiplist' */ | |
static PyTypeObject *__pyx_ptype_6pandas_5_libs_8skiplist_Node = 0; | |
static PyTypeObject *__pyx_ptype_6pandas_5_libs_8skiplist_IndexableSkiplist = 0; | |
/* Module declarations from 'pandas._libs.window' */ | |
static PyTypeObject *__pyx_ptype_6pandas_5_libs_6window_WindowIndexer = 0; | |
static PyTypeObject *__pyx_ptype_6pandas_5_libs_6window_MockFixedWindowIndexer = 0; | |
static PyTypeObject *__pyx_ptype_6pandas_5_libs_6window_FixedWindowIndexer = 0; | |
static PyTypeObject *__pyx_ptype_6pandas_5_libs_6window_VariableWindowIndexer = 0; | |
static PyTypeObject *__pyx_array_type = 0; | |
static PyTypeObject *__pyx_MemviewEnum_type = 0; | |
static PyTypeObject *__pyx_memoryview_type = 0; | |
static PyTypeObject *__pyx_memoryviewslice_type = 0; | |
static __pyx_t_5numpy_float32_t __pyx_v_6pandas_5_libs_6window_MINfloat32; | |
static __pyx_t_5numpy_float64_t __pyx_v_6pandas_5_libs_6window_MINfloat64; | |
static __pyx_t_5numpy_float32_t __pyx_v_6pandas_5_libs_6window_MAXfloat32; | |
static __pyx_t_5numpy_float64_t __pyx_v_6pandas_5_libs_6window_MAXfloat64; | |
static double __pyx_v_6pandas_5_libs_6window_NaN; | |
static PyObject *generic = 0; | |
static PyObject *strided = 0; | |
static PyObject *indirect = 0; | |
static PyObject *contiguous = 0; | |
static PyObject *indirect_contiguous = 0; | |
static int __pyx_memoryview_thread_locks_used; | |
static PyThread_type_lock __pyx_memoryview_thread_locks[8]; | |
static CYTHON_INLINE int __pyx_f_6pandas_5_libs_6window_int_max(int, int); /*proto*/ | |
static CYTHON_INLINE int __pyx_f_6pandas_5_libs_6window_int_min(int, int); /*proto*/ | |
static CYTHON_INLINE double __pyx_f_6pandas_5_libs_6window_calc_sum(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, double); /*proto*/ | |
static CYTHON_INLINE void __pyx_f_6pandas_5_libs_6window_add_sum(double, __pyx_t_5numpy_int64_t *, double *); /*proto*/ | |
static CYTHON_INLINE void __pyx_f_6pandas_5_libs_6window_remove_sum(double, __pyx_t_5numpy_int64_t *, double *); /*proto*/ | |
static CYTHON_INLINE double __pyx_f_6pandas_5_libs_6window_calc_mean(__pyx_t_5numpy_int64_t, Py_ssize_t, Py_ssize_t, double); /*proto*/ | |
static CYTHON_INLINE void __pyx_f_6pandas_5_libs_6window_add_mean(double, Py_ssize_t *, double *, Py_ssize_t *); /*proto*/ | |
static CYTHON_INLINE void __pyx_f_6pandas_5_libs_6window_remove_mean(double, Py_ssize_t *, double *, Py_ssize_t *); /*proto*/ | |
static CYTHON_INLINE double __pyx_f_6pandas_5_libs_6window_calc_var(__pyx_t_5numpy_int64_t, int, double, double); /*proto*/ | |
static CYTHON_INLINE void __pyx_f_6pandas_5_libs_6window_add_var(double, double *, double *, double *); /*proto*/ | |
static CYTHON_INLINE void __pyx_f_6pandas_5_libs_6window_remove_var(double, double *, double *, double *); /*proto*/ | |
static CYTHON_INLINE double __pyx_f_6pandas_5_libs_6window_calc_skew(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, double, double, double); /*proto*/ | |
static CYTHON_INLINE void __pyx_f_6pandas_5_libs_6window_add_skew(double, __pyx_t_5numpy_int64_t *, double *, double *, double *); /*proto*/ | |
static CYTHON_INLINE void __pyx_f_6pandas_5_libs_6window_remove_skew(double, __pyx_t_5numpy_int64_t *, double *, double *, double *); /*proto*/ | |
static CYTHON_INLINE double __pyx_f_6pandas_5_libs_6window_calc_kurt(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, double, double, double, double); /*proto*/ | |
static CYTHON_INLINE void __pyx_f_6pandas_5_libs_6window_add_kurt(double, __pyx_t_5numpy_int64_t *, double *, double *, double *, double *); /*proto*/ | |
static CYTHON_INLINE void __pyx_f_6pandas_5_libs_6window_remove_kurt(double, __pyx_t_5numpy_int64_t *, double *, double *, double *, double *); /*proto*/ | |
static PyObject *__pyx_f_6pandas_5_libs_6window___pyx_unpickle_WindowIndexer__set_state(struct __pyx_obj_6pandas_5_libs_6window_WindowIndexer *, PyObject *); /*proto*/ | |
static PyObject *__pyx_f_6pandas_5_libs_6window___pyx_unpickle_MockFixedWindowIndexer__set_state(struct __pyx_obj_6pandas_5_libs_6window_MockFixedWindowIndexer *, PyObject *); /*proto*/ | |
static PyObject *__pyx_f_6pandas_5_libs_6window___pyx_unpickle_FixedWindowIndexer__set_state(struct __pyx_obj_6pandas_5_libs_6window_FixedWindowIndexer *, PyObject *); /*proto*/ | |
static PyObject *__pyx_f_6pandas_5_libs_6window___pyx_unpickle_VariableWindowIndexer__set_state(struct __pyx_obj_6pandas_5_libs_6window_VariableWindowIndexer *, PyObject *); /*proto*/ | |
static CYTHON_INLINE __pyx_t_5numpy_int8_t __pyx_fuse_0__pyx_f_6pandas_5_libs_6window_init_mm(__pyx_t_5numpy_int8_t, Py_ssize_t *, int); /*proto*/ | |
static CYTHON_INLINE __pyx_t_5numpy_int16_t __pyx_fuse_1__pyx_f_6pandas_5_libs_6window_init_mm(__pyx_t_5numpy_int16_t, Py_ssize_t *, int); /*proto*/ | |
static CYTHON_INLINE __pyx_t_5numpy_int32_t __pyx_fuse_2__pyx_f_6pandas_5_libs_6window_init_mm(__pyx_t_5numpy_int32_t, Py_ssize_t *, int); /*proto*/ | |
static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_fuse_3__pyx_f_6pandas_5_libs_6window_init_mm(__pyx_t_5numpy_int64_t, Py_ssize_t *, int); /*proto*/ | |
static CYTHON_INLINE __pyx_t_5numpy_uint8_t __pyx_fuse_4__pyx_f_6pandas_5_libs_6window_init_mm(__pyx_t_5numpy_uint8_t, Py_ssize_t *, int); /*proto*/ | |
static CYTHON_INLINE __pyx_t_5numpy_uint16_t __pyx_fuse_5__pyx_f_6pandas_5_libs_6window_init_mm(__pyx_t_5numpy_uint16_t, Py_ssize_t *, int); /*proto*/ | |
static CYTHON_INLINE __pyx_t_5numpy_uint32_t __pyx_fuse_6__pyx_f_6pandas_5_libs_6window_init_mm(__pyx_t_5numpy_uint32_t, Py_ssize_t *, int); /*proto*/ | |
static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_fuse_7__pyx_f_6pandas_5_libs_6window_init_mm(__pyx_t_5numpy_uint64_t, Py_ssize_t *, int); /*proto*/ | |
static CYTHON_INLINE __pyx_t_5numpy_float32_t __pyx_fuse_8__pyx_f_6pandas_5_libs_6window_init_mm(__pyx_t_5numpy_float32_t, Py_ssize_t *, int); /*proto*/ | |
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_fuse_9__pyx_f_6pandas_5_libs_6window_init_mm(__pyx_t_5numpy_float64_t, Py_ssize_t *, int); /*proto*/ | |
static CYTHON_INLINE void __pyx_fuse_0__pyx_f_6pandas_5_libs_6window_remove_mm(__pyx_t_5numpy_int8_t, Py_ssize_t *); /*proto*/ | |
static CYTHON_INLINE void __pyx_fuse_1__pyx_f_6pandas_5_libs_6window_remove_mm(__pyx_t_5numpy_int16_t, Py_ssize_t *); /*proto*/ | |
static CYTHON_INLINE void __pyx_fuse_2__pyx_f_6pandas_5_libs_6window_remove_mm(__pyx_t_5numpy_int32_t, Py_ssize_t *); /*proto*/ | |
static CYTHON_INLINE void __pyx_fuse_3__pyx_f_6pandas_5_libs_6window_remove_mm(__pyx_t_5numpy_int64_t, Py_ssize_t *); /*proto*/ | |
static CYTHON_INLINE void __pyx_fuse_4__pyx_f_6pandas_5_libs_6window_remove_mm(__pyx_t_5numpy_uint8_t, Py_ssize_t *); /*proto*/ | |
static CYTHON_INLINE void __pyx_fuse_5__pyx_f_6pandas_5_libs_6window_remove_mm(__pyx_t_5numpy_uint16_t, Py_ssize_t *); /*proto*/ | |
static CYTHON_INLINE void __pyx_fuse_6__pyx_f_6pandas_5_libs_6window_remove_mm(__pyx_t_5numpy_uint32_t, Py_ssize_t *); /*proto*/ | |
static CYTHON_INLINE void __pyx_fuse_7__pyx_f_6pandas_5_libs_6window_remove_mm(__pyx_t_5numpy_uint64_t, Py_ssize_t *); /*proto*/ | |
static CYTHON_INLINE void __pyx_fuse_8__pyx_f_6pandas_5_libs_6window_remove_mm(__pyx_t_5numpy_float32_t, Py_ssize_t *); /*proto*/ | |
static CYTHON_INLINE void __pyx_fuse_9__pyx_f_6pandas_5_libs_6window_remove_mm(__pyx_t_5numpy_float64_t, Py_ssize_t *); /*proto*/ | |
static CYTHON_INLINE __pyx_t_5numpy_int8_t __pyx_fuse_0__pyx_f_6pandas_5_libs_6window_calc_mm(__pyx_t_5numpy_int64_t, Py_ssize_t, __pyx_t_5numpy_int8_t); /*proto*/ | |
static CYTHON_INLINE __pyx_t_5numpy_int16_t __pyx_fuse_1__pyx_f_6pandas_5_libs_6window_calc_mm(__pyx_t_5numpy_int64_t, Py_ssize_t, __pyx_t_5numpy_int16_t); /*proto*/ | |
static CYTHON_INLINE __pyx_t_5numpy_int32_t __pyx_fuse_2__pyx_f_6pandas_5_libs_6window_calc_mm(__pyx_t_5numpy_int64_t, Py_ssize_t, __pyx_t_5numpy_int32_t); /*proto*/ | |
static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_fuse_3__pyx_f_6pandas_5_libs_6window_calc_mm(__pyx_t_5numpy_int64_t, Py_ssize_t, __pyx_t_5numpy_int64_t); /*proto*/ | |
static CYTHON_INLINE __pyx_t_5numpy_uint8_t __pyx_fuse_4__pyx_f_6pandas_5_libs_6window_calc_mm(__pyx_t_5numpy_int64_t, Py_ssize_t, __pyx_t_5numpy_uint8_t); /*proto*/ | |
static CYTHON_INLINE __pyx_t_5numpy_uint16_t __pyx_fuse_5__pyx_f_6pandas_5_libs_6window_calc_mm(__pyx_t_5numpy_int64_t, Py_ssize_t, __pyx_t_5numpy_uint16_t); /*proto*/ | |
static CYTHON_INLINE __pyx_t_5numpy_uint32_t __pyx_fuse_6__pyx_f_6pandas_5_libs_6window_calc_mm(__pyx_t_5numpy_int64_t, Py_ssize_t, __pyx_t_5numpy_uint32_t); /*proto*/ | |
static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_fuse_7__pyx_f_6pandas_5_libs_6window_calc_mm(__pyx_t_5numpy_int64_t, Py_ssize_t, __pyx_t_5numpy_uint64_t); /*proto*/ | |
static CYTHON_INLINE __pyx_t_5numpy_float32_t __pyx_fuse_8__pyx_f_6pandas_5_libs_6window_calc_mm(__pyx_t_5numpy_int64_t, Py_ssize_t, __pyx_t_5numpy_float32_t); /*proto*/ | |
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_fuse_9__pyx_f_6pandas_5_libs_6window_calc_mm(__pyx_t_5numpy_int64_t, Py_ssize_t, __pyx_t_5numpy_float64_t); /*proto*/ | |
static PyObject *__pyx_fuse_0__pyx_f_6pandas_5_libs_6window__roll_min_max(PyArrayObject *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, PyObject *, PyObject *, int); /*proto*/ | |
static PyObject *__pyx_fuse_1__pyx_f_6pandas_5_libs_6window__roll_min_max(PyArrayObject *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, PyObject *, PyObject *, int); /*proto*/ | |
static PyObject *__pyx_fuse_2__pyx_f_6pandas_5_libs_6window__roll_min_max(PyArrayObject *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, PyObject *, PyObject *, int); /*proto*/ | |
static PyObject *__pyx_fuse_3__pyx_f_6pandas_5_libs_6window__roll_min_max(PyArrayObject *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, PyObject *, PyObject *, int); /*proto*/ | |
static PyObject *__pyx_fuse_4__pyx_f_6pandas_5_libs_6window__roll_min_max(PyArrayObject *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, PyObject *, PyObject *, int); /*proto*/ | |
static PyObject *__pyx_fuse_5__pyx_f_6pandas_5_libs_6window__roll_min_max(PyArrayObject *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, PyObject *, PyObject *, int); /*proto*/ | |
static PyObject *__pyx_fuse_6__pyx_f_6pandas_5_libs_6window__roll_min_max(PyArrayObject *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, PyObject *, PyObject *, int); /*proto*/ | |
static PyObject *__pyx_fuse_7__pyx_f_6pandas_5_libs_6window__roll_min_max(PyArrayObject *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, PyObject *, PyObject *, int); /*proto*/ | |
static PyObject *__pyx_fuse_8__pyx_f_6pandas_5_libs_6window__roll_min_max(PyArrayObject *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, PyObject *, PyObject *, int); /*proto*/ | |
static PyObject *__pyx_fuse_9__pyx_f_6pandas_5_libs_6window__roll_min_max(PyArrayObject *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, PyObject *, PyObject *, int); /*proto*/ | |
static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ | |
static void *__pyx_align_pointer(void *, size_t); /*proto*/ | |
static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/ | |
static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/ | |
static PyObject *_unellipsify(PyObject *, int); /*proto*/ | |
static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/ | |
static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/ | |
static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/ | |
static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/ | |
static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/ | |
static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/ | |
static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ | |
static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ | |
static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/ | |
static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ | |
static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/ | |
static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/ | |
static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/ | |
static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/ | |
static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/ | |
static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/ | |
static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/ | |
static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/ | |
static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/ | |
static int __pyx_memoryview_err(PyObject *, char *); /*proto*/ | |
static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/ | |
static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/ | |
static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/ | |
static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ | |
static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ | |
static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/ | |
static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/ | |
static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/ | |
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 }; | |
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_double_t = { "double_t", NULL, sizeof(__pyx_t_5numpy_double_t), { 0 }, 0, 'R', 0, 0 }; | |
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 }; | |
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t = { "int8_t", NULL, sizeof(__pyx_t_5numpy_int8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int8_t), 0 }; | |
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t = { "int16_t", NULL, sizeof(__pyx_t_5numpy_int16_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int16_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int16_t), 0 }; | |
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 }; | |
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 }; | |
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint16_t = { "uint16_t", NULL, sizeof(__pyx_t_5numpy_uint16_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint16_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint16_t), 0 }; | |
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint32_t = { "uint32_t", NULL, sizeof(__pyx_t_5numpy_uint32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint32_t), 0 }; | |
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t = { "uint64_t", NULL, sizeof(__pyx_t_5numpy_uint64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint64_t), 0 }; | |
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t = { "float32_t", NULL, sizeof(__pyx_t_5numpy_float32_t), { 0 }, 0, 'R', 0, 0 }; | |
#define __Pyx_MODULE_NAME "pandas._libs.window" | |
extern int __pyx_module_is_main_pandas___libs__window; | |
int __pyx_module_is_main_pandas___libs__window = 0; | |
/* Implementation of 'pandas._libs.window' */ | |
static PyObject *__pyx_builtin_ValueError; | |
static PyObject *__pyx_builtin_range; | |
static PyObject *__pyx_builtin_MemoryError; | |
static PyObject *__pyx_builtin_TypeError; | |
static PyObject *__pyx_builtin_KeyError; | |
static PyObject *__pyx_builtin_RuntimeError; | |
static PyObject *__pyx_builtin_ImportError; | |
static PyObject *__pyx_builtin_IndexError; | |
static PyObject *__pyx_builtin_enumerate; | |
static PyObject *__pyx_builtin_Ellipsis; | |
static PyObject *__pyx_builtin_id; | |
static const char __pyx_k_C[] = "C"; | |
static const char __pyx_k_N[] = "N"; | |
static const char __pyx_k_O[] = "O"; | |
static const char __pyx_k_c[] = "c"; | |
static const char __pyx_k_e[] = "e"; | |
static const char __pyx_k_i[] = "i"; | |
static const char __pyx_k_j[] = "j"; | |
static const char __pyx_k_n[] = "n"; | |
static const char __pyx_k_s[] = "s"; | |
static const char __pyx_k_w[] = "w"; | |
static const char __pyx_k_x[] = "x"; | |
static const char __pyx_k__9[] = "()"; | |
static const char __pyx_k_id[] = "id"; | |
static const char __pyx_k_np[] = "np"; | |
static const char __pyx_k_sl[] = "sl"; | |
static const char __pyx_k_xx[] = "xx"; | |
static const char __pyx_k_NaN[] = "NaN"; | |
static const char __pyx_k__11[] = "|"; | |
static const char __pyx_k__59[] = "_"; | |
static const char __pyx_k_arr[] = "arr"; | |
static const char __pyx_k_avg[] = "avg"; | |
static const char __pyx_k_buf[] = "buf"; | |
static const char __pyx_k_com[] = "com"; | |
static const char __pyx_k_cov[] = "cov"; | |
static const char __pyx_k_cur[] = "cur"; | |
static const char __pyx_k_end[] = "end"; | |
static const char __pyx_k_err[] = "err"; | |
static const char __pyx_k_idx[] = "idx"; | |
static const char __pyx_k_inf[] = "inf"; | |
static const char __pyx_k_max[] = "max"; | |
static const char __pyx_k_new[] = "__new__"; | |
static const char __pyx_k_obj[] = "obj"; | |
static const char __pyx_k_raw[] = "raw"; | |
static const char __pyx_k_res[] = "res"; | |
static const char __pyx_k_ret[] = "ret"; | |
static const char __pyx_k_typ[] = "_typ"; | |
static const char __pyx_k_val[] = "val"; | |
static const char __pyx_k_win[] = "win"; | |
static const char __pyx_k_xxx[] = "xxx"; | |
static const char __pyx_k_NINF[] = "NINF"; | |
static const char __pyx_k_args[] = "args"; | |
static const char __pyx_k_base[] = "base"; | |
static const char __pyx_k_bias[] = "bias"; | |
static const char __pyx_k_both[] = "both"; | |
static const char __pyx_k_copy[] = "copy"; | |
static const char __pyx_k_ddof[] = "ddof"; | |
static const char __pyx_k_dict[] = "__dict__"; | |
static const char __pyx_k_ewma[] = "ewma"; | |
static const char __pyx_k_fill[] = "fill"; | |
static const char __pyx_k_func[] = "func"; | |
static const char __pyx_k_iloc[] = "iloc"; | |
static const char __pyx_k_in_i[] = "in_i"; | |
static const char __pyx_k_in_k[] = "in_k"; | |
static const char __pyx_k_in_n[] = "in_n"; | |
static const char __pyx_k_kind[] = "kind"; | |
static const char __pyx_k_left[] = "left"; | |
static const char __pyx_k_main[] = "__main__"; | |
static const char __pyx_k_minp[] = "minp"; | |
static const char __pyx_k_mode[] = "mode"; | |
static const char __pyx_k_name[] = "name"; | |
static const char __pyx_k_ndim[] = "ndim"; | |
static const char __pyx_k_nobs[] = "nobs"; | |
static const char __pyx_k_pack[] = "pack"; | |
static const char __pyx_k_prev[] = "prev"; | |
static const char __pyx_k_size[] = "size"; | |
static const char __pyx_k_step[] = "step"; | |
static const char __pyx_k_stop[] = "stop"; | |
static const char __pyx_k_test[] = "__test__"; | |
static const char __pyx_k_vlow[] = "vlow"; | |
static const char __pyx_k_xxxx[] = "xxxx"; | |
static const char __pyx_k_ASCII[] = "ASCII"; | |
static const char __pyx_k_alpha[] = "alpha"; | |
static const char __pyx_k_array[] = "array"; | |
static const char __pyx_k_build[] = "build"; | |
static const char __pyx_k_class[] = "__class__"; | |
static const char __pyx_k_cur_x[] = "cur_x"; | |
static const char __pyx_k_cur_y[] = "cur_y"; | |
static const char __pyx_k_delta[] = "delta"; | |
static const char __pyx_k_dtype[] = "dtype"; | |
static const char __pyx_k_empty[] = "empty"; | |
static const char __pyx_k_error[] = "error"; | |
static const char __pyx_k_flags[] = "flags"; | |
static const char __pyx_k_floor[] = "floor"; | |
static const char __pyx_k_index[] = "index"; | |
static const char __pyx_k_input[] = "input"; | |
static const char __pyx_k_int64[] = "int64"; | |
static const char __pyx_k_lower[] = "lower"; | |
static const char __pyx_k_numpy[] = "numpy"; | |
static const char __pyx_k_range[] = "range"; | |
static const char __pyx_k_right[] = "right"; | |
static const char __pyx_k_shape[] = "shape"; | |
static const char __pyx_k_split[] = "split"; | |
static const char __pyx_k_start[] = "start"; | |
static const char __pyx_k_strip[] = "strip"; | |
static const char __pyx_k_sum_x[] = "sum_x"; | |
static const char __pyx_k_vhigh[] = "vhigh"; | |
static const char __pyx_k_win_i[] = "win_i"; | |
static const char __pyx_k_win_k[] = "win_k"; | |
static const char __pyx_k_win_n[] = "win_n"; | |
static const char __pyx_k_zeros[] = "zeros"; | |
static const char __pyx_k_adjust[] = "adjust"; | |
static const char __pyx_k_arange[] = "arange"; | |
static const char __pyx_k_astype[] = "astype"; | |
static const char __pyx_k_bufarr[] = "bufarr"; | |
static const char __pyx_k_closed[] = "closed"; | |
static const char __pyx_k_counts[] = "counts"; | |
static const char __pyx_k_encode[] = "encode"; | |
static const char __pyx_k_ewmcov[] = "ewmcov"; | |
static const char __pyx_k_format[] = "format"; | |
static const char __pyx_k_higher[] = "higher"; | |
static const char __pyx_k_import[] = "__import__"; | |
static const char __pyx_k_int8_t[] = "int8_t"; | |
static const char __pyx_k_kwargs[] = "kwargs"; | |
static const char __pyx_k_linear[] = "linear"; | |
static const char __pyx_k_mean_x[] = "mean_x"; | |
static const char __pyx_k_mean_y[] = "mean_y"; | |
static const char __pyx_k_name_2[] = "__name__"; | |
static const char __pyx_k_neg_ct[] = "neg_ct"; | |
static const char __pyx_k_new_wt[] = "new_wt"; | |
static const char __pyx_k_offset[] = "offset"; | |
static const char __pyx_k_old_wt[] = "old_wt"; | |
static const char __pyx_k_oldbuf[] = "oldbuf"; | |
static const char __pyx_k_output[] = "output"; | |
static const char __pyx_k_period[] = "period"; | |
static const char __pyx_k_pickle[] = "pickle"; | |
static const char __pyx_k_prev_x[] = "prev_x"; | |
static const char __pyx_k_reduce[] = "__reduce__"; | |
static const char __pyx_k_result[] = "result"; | |
static const char __pyx_k_struct[] = "struct"; | |
static const char __pyx_k_sum_wt[] = "sum_wt"; | |
static const char __pyx_k_unpack[] = "unpack"; | |
static const char __pyx_k_update[] = "update"; | |
static const char __pyx_k_val_in[] = "val_in"; | |
static const char __pyx_k_asarray[] = "asarray"; | |
static const char __pyx_k_count_x[] = "count_x"; | |
static const char __pyx_k_fortran[] = "fortran"; | |
static const char __pyx_k_indexer[] = "indexer"; | |
static const char __pyx_k_input_x[] = "input_x"; | |
static const char __pyx_k_input_y[] = "input_y"; | |
static const char __pyx_k_int16_t[] = "int16_t"; | |
static const char __pyx_k_int32_t[] = "int32_t"; | |
static const char __pyx_k_int64_t[] = "int64_t"; | |
static const char __pyx_k_memview[] = "memview"; | |
static const char __pyx_k_nearest[] = "nearest"; | |
static const char __pyx_k_neither[] = "neither"; | |
static const char __pyx_k_ssqdm_x[] = "ssqdm_x"; | |
static const char __pyx_k_sum_wt2[] = "sum_wt2"; | |
static const char __pyx_k_tot_wgt[] = "tot_wgt"; | |
static const char __pyx_k_uint8_t[] = "uint8_t"; | |
static const char __pyx_k_val_win[] = "val_win"; | |
static const char __pyx_k_weights[] = "weights"; | |
static const char __pyx_k_Ellipsis[] = "Ellipsis"; | |
static const char __pyx_k_KeyError[] = "KeyError"; | |
static const char __pyx_k_defaults[] = "defaults"; | |
static const char __pyx_k_get_data[] = "get_data"; | |
static const char __pyx_k_getstate[] = "__getstate__"; | |
static const char __pyx_k_isfinite[] = "isfinite"; | |
static const char __pyx_k_itemsize[] = "itemsize"; | |
static const char __pyx_k_midpoint[] = "midpoint"; | |
static const char __pyx_k_pyx_type[] = "__pyx_type"; | |
static const char __pyx_k_quantile[] = "quantile"; | |
static const char __pyx_k_roll_max[] = "roll_max"; | |
static const char __pyx_k_roll_min[] = "roll_min"; | |
static const char __pyx_k_roll_sum[] = "roll_sum"; | |
static const char __pyx_k_roll_var[] = "roll_var"; | |
static const char __pyx_k_setstate[] = "__setstate__"; | |
static const char __pyx_k_skiplist[] = "skiplist"; | |
static const char __pyx_k_uint16_t[] = "uint16_t"; | |
static const char __pyx_k_uint32_t[] = "uint32_t"; | |
static const char __pyx_k_uint64_t[] = "uint64_t"; | |
static const char __pyx_k_use_mock[] = "use_mock"; | |
static const char __pyx_k_TypeError[] = "TypeError"; | |
static const char __pyx_k_enumerate[] = "enumerate"; | |
static const char __pyx_k_float32_t[] = "float32_t"; | |
static const char __pyx_k_float64_t[] = "float64_t"; | |
static const char __pyx_k_ignore_na[] = "ignore_na"; | |
static const char __pyx_k_numerator[] = "numerator"; | |
static const char __pyx_k_pyx_state[] = "__pyx_state"; | |
static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; | |
static const char __pyx_k_roll_kurt[] = "roll_kurt"; | |
static const char __pyx_k_roll_mean[] = "roll_mean"; | |
static const char __pyx_k_roll_skew[] = "roll_skew"; | |
static const char __pyx_k_IndexError[] = "IndexError"; | |
static const char __pyx_k_ValueError[] = "ValueError"; | |
static const char __pyx_k_check_minp[] = "_check_minp"; | |
static const char __pyx_k_dateoffset[] = "dateoffset"; | |
static const char __pyx_k_mean_x_old[] = "mean_x_old"; | |
static const char __pyx_k_old_mean_x[] = "old_mean_x"; | |
static const char __pyx_k_old_mean_y[] = "old_mean_y"; | |
static const char __pyx_k_pyx_result[] = "__pyx_result"; | |
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; | |
static const char __pyx_k_roll_count[] = "roll_count"; | |
static const char __pyx_k_signatures[] = "signatures"; | |
static const char __pyx_k_ImportError[] = "ImportError"; | |
static const char __pyx_k_MemoryError[] = "MemoryError"; | |
static const char __pyx_k_PickleError[] = "PickleError"; | |
static const char __pyx_k_concatenate[] = "concatenate"; | |
static const char __pyx_k_denominator[] = "denominator"; | |
static const char __pyx_k_is_variable[] = "is_variable"; | |
static const char __pyx_k_left_closed[] = "left_closed"; | |
static const char __pyx_k_roll_window[] = "roll_window"; | |
static const char __pyx_k_RuntimeError[] = "RuntimeError"; | |
static const char __pyx_k_c_contiguous[] = "c_contiguous"; | |
static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; | |
static const char __pyx_k_right_closed[] = "right_closed"; | |
static const char __pyx_k_roll_generic[] = "roll_generic"; | |
static const char __pyx_k_stringsource[] = "stringsource"; | |
static const char __pyx_k_weighted_avg[] = "weighted_avg"; | |
static const char __pyx_k_interpolation[] = "interpolation"; | |
static const char __pyx_k_old_wt_factor[] = "old_wt_factor"; | |
static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; | |
static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; | |
static const char __pyx_k_roll_median_c[] = "roll_median_c"; | |
static const char __pyx_k_roll_quantile[] = "roll_quantile"; | |
static const char __pyx_k_is_observation[] = "is_observation"; | |
static const char __pyx_k_range_endpoint[] = "range_endpoint"; | |
static const char __pyx_k_View_MemoryView[] = "View.MemoryView"; | |
static const char __pyx_k_allocate_buffer[] = "allocate_buffer"; | |
static const char __pyx_k_dtype_is_object[] = "dtype_is_object"; | |
static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; | |
static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; | |
static const char __pyx_k_idx_with_fraction[] = "idx_with_fraction"; | |
static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; | |
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; | |
static const char __pyx_k_get_window_indexer[] = "get_window_indexer"; | |
static const char __pyx_k_interpolation_type[] = "interpolation_type"; | |
static const char __pyx_k_strided_and_direct[] = "<strided and direct>"; | |
static const char __pyx_k_index_out_of_bounds[] = "index out of bounds"; | |
static const char __pyx_k_interpolation_types[] = "interpolation_types"; | |
static const char __pyx_k_pandas__libs_window[] = "pandas._libs.window"; | |
static const char __pyx_k_skiplist_init_failed[] = "skiplist_init failed"; | |
static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>"; | |
static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>"; | |
static const char __pyx_k_min_periods_must_be_0[] = "min_periods must be >= 0"; | |
static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>"; | |
static const char __pyx_k_skiplist_insert_failed[] = "skiplist_insert failed"; | |
static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>"; | |
static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>"; | |
static const char __pyx_k_pandas__libs_window_pyx[] = "pandas\\_libs\\window.pyx"; | |
static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'"; | |
static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d."; | |
static const char __pyx_k_pyx_unpickle_WindowIndexer[] = "__pyx_unpickle_WindowIndexer"; | |
static const char __pyx_k_No_matching_signature_found[] = "No matching signature found"; | |
static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array"; | |
static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; | |
static const char __pyx_k_quantile_value_0_not_in_0_1[] = "quantile value {0} not in [0, 1]"; | |
static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; | |
static const char __pyx_k_Interpolation_is_not_supported[] = "Interpolation '{}' is not supported"; | |
static const char __pyx_k_min_periods_d_must_be_window_d[] = "min_periods (%d) must be <= window (%d)"; | |
static const char __pyx_k_min_periods_must_be_an_integer[] = "min_periods must be an integer"; | |
static const char __pyx_k_pyx_unpickle_FixedWindowIndexe[] = "__pyx_unpickle_FixedWindowIndexer"; | |
static const char __pyx_k_pyx_unpickle_MockFixedWindowIn[] = "__pyx_unpickle_MockFixedWindowIndexer"; | |
static const char __pyx_k_pyx_unpickle_VariableWindowInd[] = "__pyx_unpickle_VariableWindowIndexer"; | |
static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>"; | |
static const char __pyx_k_arrays_are_of_different_lengths[] = "arrays are of different lengths (%d and %d)"; | |
static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; | |
static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; | |
static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; | |
static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; | |
static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview"; | |
static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview"; | |
static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; | |
static const char __pyx_k_Expected_at_least_d_argument_s_g[] = "Expected at least %d argument%s, got %d"; | |
static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; | |
static const char __pyx_k_Function_call_with_ambiguous_arg[] = "Function call with ambiguous argument types"; | |
static const char __pyx_k_Incompatible_checksums_s_vs_0x58[] = "Incompatible checksums (%s vs 0x5834fb3 = (N, end, is_variable, minp, start, win))"; | |
static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))"; | |
static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported"; | |
static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s"; | |
static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; | |
static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)"; | |
static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object"; | |
static const char __pyx_k_assignment_destination_is_read_o[] = "assignment destination is read-only"; | |
static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)"; | |
static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; | |
static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; | |
static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import"; | |
static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides."; | |
static const char __pyx_k_unable_to_roll_generic_with_a_no[] = "unable to roll_generic with a non-zero offset"; | |
static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; | |
static PyObject *__pyx_n_s_ASCII; | |
static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri; | |
static PyObject *__pyx_n_s_C; | |
static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is; | |
static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor; | |
static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi; | |
static PyObject *__pyx_kp_s_Cannot_index_with_type_s; | |
static PyObject *__pyx_n_s_Ellipsis; | |
static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr; | |
static PyObject *__pyx_kp_s_Expected_at_least_d_argument_s_g; | |
static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; | |
static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; | |
static PyObject *__pyx_kp_s_Function_call_with_ambiguous_arg; | |
static PyObject *__pyx_n_s_ImportError; | |
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x58; | |
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0; | |
static PyObject *__pyx_n_s_IndexError; | |
static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte; | |
static PyObject *__pyx_kp_s_Interpolation_is_not_supported; | |
static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr; | |
static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d; | |
static PyObject *__pyx_n_s_KeyError; | |
static PyObject *__pyx_n_s_MemoryError; | |
static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x; | |
static PyObject *__pyx_kp_s_MemoryView_of_r_object; | |
static PyObject *__pyx_n_s_N; | |
static PyObject *__pyx_n_s_NINF; | |
static PyObject *__pyx_n_s_NaN; | |
static PyObject *__pyx_kp_s_No_matching_signature_found; | |
static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; | |
static PyObject *__pyx_n_b_O; | |
static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a; | |
static PyObject *__pyx_n_s_PickleError; | |
static PyObject *__pyx_n_s_RuntimeError; | |
static PyObject *__pyx_n_s_TypeError; | |
static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; | |
static PyObject *__pyx_n_s_ValueError; | |
static PyObject *__pyx_n_s_View_MemoryView; | |
static PyObject *__pyx_kp_s__11; | |
static PyObject *__pyx_n_s__59; | |
static PyObject *__pyx_kp_s__9; | |
static PyObject *__pyx_n_s_adjust; | |
static PyObject *__pyx_n_s_allocate_buffer; | |
static PyObject *__pyx_n_s_alpha; | |
static PyObject *__pyx_n_s_arange; | |
static PyObject *__pyx_n_s_args; | |
static PyObject *__pyx_n_s_arr; | |
static PyObject *__pyx_n_s_array; | |
static PyObject *__pyx_kp_s_arrays_are_of_different_lengths; | |
static PyObject *__pyx_n_s_asarray; | |
static PyObject *__pyx_kp_s_assignment_destination_is_read_o; | |
static PyObject *__pyx_n_s_astype; | |
static PyObject *__pyx_n_s_avg; | |
static PyObject *__pyx_n_s_base; | |
static PyObject *__pyx_n_s_bias; | |
static PyObject *__pyx_n_s_both; | |
static PyObject *__pyx_n_s_buf; | |
static PyObject *__pyx_n_s_bufarr; | |
static PyObject *__pyx_n_s_build; | |
static PyObject *__pyx_n_s_c; | |
static PyObject *__pyx_n_u_c; | |
static PyObject *__pyx_n_s_c_contiguous; | |
static PyObject *__pyx_n_s_check_minp; | |
static PyObject *__pyx_n_s_class; | |
static PyObject *__pyx_n_s_cline_in_traceback; | |
static PyObject *__pyx_n_s_closed; | |
static PyObject *__pyx_n_s_com; | |
static PyObject *__pyx_n_s_concatenate; | |
static PyObject *__pyx_kp_s_contiguous_and_direct; | |
static PyObject *__pyx_kp_s_contiguous_and_indirect; | |
static PyObject *__pyx_n_s_copy; | |
static PyObject *__pyx_n_s_count_x; | |
static PyObject *__pyx_n_s_counts; | |
static PyObject *__pyx_n_s_cov; | |
static PyObject *__pyx_n_s_cur; | |
static PyObject *__pyx_n_s_cur_x; | |
static PyObject *__pyx_n_s_cur_y; | |
static PyObject *__pyx_n_s_dateoffset; | |
static PyObject *__pyx_n_s_ddof; | |
static PyObject *__pyx_n_s_defaults; | |
static PyObject *__pyx_n_s_delta; | |
static PyObject *__pyx_n_s_denominator; | |
static PyObject *__pyx_n_s_dict; | |
static PyObject *__pyx_n_s_dtype; | |
static PyObject *__pyx_n_s_dtype_is_object; | |
static PyObject *__pyx_n_s_e; | |
static PyObject *__pyx_n_s_empty; | |
static PyObject *__pyx_n_s_encode; | |
static PyObject *__pyx_n_s_end; | |
static PyObject *__pyx_n_s_enumerate; | |
static PyObject *__pyx_n_s_err; | |
static PyObject *__pyx_n_s_error; | |
static PyObject *__pyx_n_s_ewma; | |
static PyObject *__pyx_n_s_ewmcov; | |
static PyObject *__pyx_n_s_fill; | |
static PyObject *__pyx_n_s_flags; | |
static PyObject *__pyx_n_s_float32_t; | |
static PyObject *__pyx_n_s_float64_t; | |
static PyObject *__pyx_n_s_floor; | |
static PyObject *__pyx_n_s_format; | |
static PyObject *__pyx_n_s_fortran; | |
static PyObject *__pyx_n_u_fortran; | |
static PyObject *__pyx_n_s_func; | |
static PyObject *__pyx_n_s_get_data; | |
static PyObject *__pyx_n_s_get_window_indexer; | |
static PyObject *__pyx_n_s_getstate; | |
static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi; | |
static PyObject *__pyx_n_s_higher; | |
static PyObject *__pyx_n_s_i; | |
static PyObject *__pyx_n_s_id; | |
static PyObject *__pyx_n_s_idx; | |
static PyObject *__pyx_n_s_idx_with_fraction; | |
static PyObject *__pyx_n_s_ignore_na; | |
static PyObject *__pyx_n_s_iloc; | |
static PyObject *__pyx_n_s_import; | |
static PyObject *__pyx_n_s_in_i; | |
static PyObject *__pyx_n_s_in_k; | |
static PyObject *__pyx_n_s_in_n; | |
static PyObject *__pyx_n_s_index; | |
static PyObject *__pyx_kp_s_index_out_of_bounds; | |
static PyObject *__pyx_n_s_indexer; | |
static PyObject *__pyx_n_s_inf; | |
static PyObject *__pyx_n_s_input; | |
static PyObject *__pyx_n_s_input_x; | |
static PyObject *__pyx_n_s_input_y; | |
static PyObject *__pyx_n_s_int16_t; | |
static PyObject *__pyx_n_s_int32_t; | |
static PyObject *__pyx_n_s_int64; | |
static PyObject *__pyx_n_s_int64_t; | |
static PyObject *__pyx_n_s_int8_t; | |
static PyObject *__pyx_n_s_interpolation; | |
static PyObject *__pyx_n_s_interpolation_type; | |
static PyObject *__pyx_n_s_interpolation_types; | |
static PyObject *__pyx_n_s_is_observation; | |
static PyObject *__pyx_n_s_is_variable; | |
static PyObject *__pyx_n_s_isfinite; | |
static PyObject *__pyx_n_s_itemsize; | |
static PyObject *__pyx_kp_s_itemsize_0_for_cython_array; | |
static PyObject *__pyx_n_s_j; | |
static PyObject *__pyx_n_s_kind; | |
static PyObject *__pyx_n_s_kwargs; | |
static PyObject *__pyx_n_s_left; | |
static PyObject *__pyx_n_s_left_closed; | |
static PyObject *__pyx_n_s_linear; | |
static PyObject *__pyx_n_s_lower; | |
static PyObject *__pyx_n_s_main; | |
static PyObject *__pyx_n_s_max; | |
static PyObject *__pyx_n_s_mean_x; | |
static PyObject *__pyx_n_s_mean_x_old; | |
static PyObject *__pyx_n_s_mean_y; | |
static PyObject *__pyx_n_s_memview; | |
static PyObject *__pyx_n_s_midpoint; | |
static PyObject *__pyx_kp_s_min_periods_d_must_be_window_d; | |
static PyObject *__pyx_kp_s_min_periods_must_be_0; | |
static PyObject *__pyx_kp_s_min_periods_must_be_an_integer; | |
static PyObject *__pyx_n_s_minp; | |
static PyObject *__pyx_n_s_mode; | |
static PyObject *__pyx_n_s_n; | |
static PyObject *__pyx_n_s_name; | |
static PyObject *__pyx_n_s_name_2; | |
static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; | |
static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; | |
static PyObject *__pyx_n_s_ndim; | |
static PyObject *__pyx_n_s_nearest; | |
static PyObject *__pyx_n_s_neg_ct; | |
static PyObject *__pyx_n_s_neither; | |
static PyObject *__pyx_n_s_new; | |
static PyObject *__pyx_n_s_new_wt; | |
static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; | |
static PyObject *__pyx_n_s_nobs; | |
static PyObject *__pyx_n_s_np; | |
static PyObject *__pyx_n_s_numerator; | |
static PyObject *__pyx_n_s_numpy; | |
static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to; | |
static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor; | |
static PyObject *__pyx_n_s_obj; | |
static PyObject *__pyx_n_s_offset; | |
static PyObject *__pyx_n_s_old_mean_x; | |
static PyObject *__pyx_n_s_old_mean_y; | |
static PyObject *__pyx_n_s_old_wt; | |
static PyObject *__pyx_n_s_old_wt_factor; | |
static PyObject *__pyx_n_s_oldbuf; | |
static PyObject *__pyx_n_s_output; | |
static PyObject *__pyx_n_s_pack; | |
static PyObject *__pyx_n_s_pandas__libs_window; | |
static PyObject *__pyx_kp_s_pandas__libs_window_pyx; | |
static PyObject *__pyx_n_s_period; | |
static PyObject *__pyx_n_s_pickle; | |
static PyObject *__pyx_n_s_prev; | |
static PyObject *__pyx_n_s_prev_x; | |
static PyObject *__pyx_n_s_pyx_PickleError; | |
static PyObject *__pyx_n_s_pyx_checksum; | |
static PyObject *__pyx_n_s_pyx_getbuffer; | |
static PyObject *__pyx_n_s_pyx_result; | |
static PyObject *__pyx_n_s_pyx_state; | |
static PyObject *__pyx_n_s_pyx_type; | |
static PyObject *__pyx_n_s_pyx_unpickle_Enum; | |
static PyObject *__pyx_n_s_pyx_unpickle_FixedWindowIndexe; | |
static PyObject *__pyx_n_s_pyx_unpickle_MockFixedWindowIn; | |
static PyObject *__pyx_n_s_pyx_unpickle_VariableWindowInd; | |
static PyObject *__pyx_n_s_pyx_unpickle_WindowIndexer; | |
static PyObject *__pyx_n_s_pyx_vtable; | |
static PyObject *__pyx_n_s_quantile; | |
static PyObject *__pyx_kp_s_quantile_value_0_not_in_0_1; | |
static PyObject *__pyx_n_s_range; | |
static PyObject *__pyx_n_s_range_endpoint; | |
static PyObject *__pyx_n_s_raw; | |
static PyObject *__pyx_n_s_reduce; | |
static PyObject *__pyx_n_s_reduce_cython; | |
static PyObject *__pyx_n_s_reduce_ex; | |
static PyObject *__pyx_n_s_res; | |
static PyObject *__pyx_n_s_result; | |
static PyObject *__pyx_n_s_ret; | |
static PyObject *__pyx_n_s_right; | |
static PyObject *__pyx_n_s_right_closed; | |
static PyObject *__pyx_n_s_roll_count; | |
static PyObject *__pyx_n_s_roll_generic; | |
static PyObject *__pyx_n_s_roll_kurt; | |
static PyObject *__pyx_n_s_roll_max; | |
static PyObject *__pyx_n_s_roll_mean; | |
static PyObject *__pyx_n_s_roll_median_c; | |
static PyObject *__pyx_n_s_roll_min; | |
static PyObject *__pyx_n_s_roll_quantile; | |
static PyObject *__pyx_n_s_roll_skew; | |
static PyObject *__pyx_n_s_roll_sum; | |
static PyObject *__pyx_n_s_roll_var; | |
static PyObject *__pyx_n_s_roll_window; | |
static PyObject *__pyx_n_s_s; | |
static PyObject *__pyx_n_s_setstate; | |
static PyObject *__pyx_n_s_setstate_cython; | |
static PyObject *__pyx_n_s_shape; | |
static PyObject *__pyx_n_s_signatures; | |
static PyObject *__pyx_n_s_size; | |
static PyObject *__pyx_n_s_skiplist; | |
static PyObject *__pyx_kp_s_skiplist_init_failed; | |
static PyObject *__pyx_kp_s_skiplist_insert_failed; | |
static PyObject *__pyx_n_s_sl; | |
static PyObject *__pyx_n_s_split; | |
static PyObject *__pyx_n_s_ssqdm_x; | |
static PyObject *__pyx_n_s_start; | |
static PyObject *__pyx_n_s_step; | |
static PyObject *__pyx_n_s_stop; | |
static PyObject *__pyx_kp_s_strided_and_direct; | |
static PyObject *__pyx_kp_s_strided_and_direct_or_indirect; | |
static PyObject *__pyx_kp_s_strided_and_indirect; | |
static PyObject *__pyx_kp_s_stringsource; | |
static PyObject *__pyx_n_s_strip; | |
static PyObject *__pyx_n_s_struct; | |
static PyObject *__pyx_n_s_sum_wt; | |
static PyObject *__pyx_n_s_sum_wt2; | |
static PyObject *__pyx_n_s_sum_x; | |
static PyObject *__pyx_n_s_test; | |
static PyObject *__pyx_n_s_tot_wgt; | |
static PyObject *__pyx_n_s_typ; | |
static PyObject *__pyx_n_s_uint16_t; | |
static PyObject *__pyx_n_s_uint32_t; | |
static PyObject *__pyx_n_s_uint64_t; | |
static PyObject *__pyx_n_s_uint8_t; | |
static PyObject *__pyx_kp_s_unable_to_allocate_array_data; | |
static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str; | |
static PyObject *__pyx_kp_s_unable_to_roll_generic_with_a_no; | |
static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; | |
static PyObject *__pyx_n_s_unpack; | |
static PyObject *__pyx_n_s_update; | |
static PyObject *__pyx_n_s_use_mock; | |
static PyObject *__pyx_n_s_val; | |
static PyObject *__pyx_n_s_val_in; | |
static PyObject *__pyx_n_s_val_win; | |
static PyObject *__pyx_n_s_vhigh; | |
static PyObject *__pyx_n_s_vlow; | |
static PyObject *__pyx_n_s_w; | |
static PyObject *__pyx_n_s_weighted_avg; | |
static PyObject *__pyx_n_s_weights; | |
static PyObject *__pyx_n_s_win; | |
static PyObject *__pyx_n_s_win_i; | |
static PyObject *__pyx_n_s_win_k; | |
static PyObject *__pyx_n_s_win_n; | |
static PyObject *__pyx_n_s_x; | |
static PyObject *__pyx_n_s_xx; | |
static PyObject *__pyx_n_s_xxx; | |
static PyObject *__pyx_n_s_xxxx; | |
static PyObject *__pyx_n_s_zeros; | |
static PyObject *__pyx_pf_6pandas_5_libs_6window__check_minp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_win, PyObject *__pyx_v_minp, PyObject *__pyx_v_N, PyObject *__pyx_v_floor); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_13WindowIndexer_get_data(struct __pyx_obj_6pandas_5_libs_6window_WindowIndexer *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_13WindowIndexer_2__reduce_cython__(struct __pyx_obj_6pandas_5_libs_6window_WindowIndexer *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_13WindowIndexer_4__setstate_cython__(struct __pyx_obj_6pandas_5_libs_6window_WindowIndexer *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ | |
static int __pyx_pf_6pandas_5_libs_6window_22MockFixedWindowIndexer___init__(struct __pyx_obj_6pandas_5_libs_6window_MockFixedWindowIndexer *__pyx_v_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, CYTHON_UNUSED int __pyx_v_left_closed, CYTHON_UNUSED int __pyx_v_right_closed, PyObject *__pyx_v_index, PyObject *__pyx_v_floor); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_22MockFixedWindowIndexer_2__reduce_cython__(struct __pyx_obj_6pandas_5_libs_6window_MockFixedWindowIndexer *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_22MockFixedWindowIndexer_4__setstate_cython__(struct __pyx_obj_6pandas_5_libs_6window_MockFixedWindowIndexer *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ | |
static int __pyx_pf_6pandas_5_libs_6window_18FixedWindowIndexer___init__(struct __pyx_obj_6pandas_5_libs_6window_FixedWindowIndexer *__pyx_v_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, CYTHON_UNUSED int __pyx_v_left_closed, CYTHON_UNUSED int __pyx_v_right_closed, PyObject *__pyx_v_index, PyObject *__pyx_v_floor); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_18FixedWindowIndexer_2__reduce_cython__(struct __pyx_obj_6pandas_5_libs_6window_FixedWindowIndexer *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_18FixedWindowIndexer_4__setstate_cython__(struct __pyx_obj_6pandas_5_libs_6window_FixedWindowIndexer *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ | |
static int __pyx_pf_6pandas_5_libs_6window_21VariableWindowIndexer___init__(struct __pyx_obj_6pandas_5_libs_6window_VariableWindowIndexer *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, int __pyx_v_left_closed, int __pyx_v_right_closed, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_floor); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_21VariableWindowIndexer_2build(struct __pyx_obj_6pandas_5_libs_6window_VariableWindowIndexer *__pyx_v_self, PyArrayObject *__pyx_v_index, __pyx_t_5numpy_int64_t __pyx_v_win, int __pyx_v_left_closed, int __pyx_v_right_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_21VariableWindowIndexer_4__reduce_cython__(struct __pyx_obj_6pandas_5_libs_6window_VariableWindowIndexer *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_21VariableWindowIndexer_6__setstate_cython__(struct __pyx_obj_6pandas_5_libs_6window_VariableWindowIndexer *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_2get_window_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_win, PyObject *__pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed, PyObject *__pyx_v_floor, PyObject *__pyx_v_use_mock); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_4roll_count(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_6roll_sum(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_8roll_mean(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_10roll_var(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed, int __pyx_v_ddof); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_12roll_skew(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_14roll_kurt(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_16roll_median_c(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_18roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_40roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_42roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_44roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_46roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_48roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_50roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_52roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_54roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_56roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_58roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_20roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_62roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_64roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_66roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_68roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_70roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_72roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_74roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_76roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_78roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_80roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_22roll_quantile(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed, double __pyx_v_quantile, PyObject *__pyx_v_interpolation); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_24roll_generic(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed, int __pyx_v_offset, PyObject *__pyx_v_func, int __pyx_v_raw, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_26roll_window(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, PyArrayObject *__pyx_v_weights, int __pyx_v_minp, int __pyx_v_avg); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_28ewma(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_double_t __pyx_v_com, int __pyx_v_adjust, int __pyx_v_ignore_na, int __pyx_v_minp); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_30ewmcov(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input_x, PyArrayObject *__pyx_v_input_y, __pyx_t_5numpy_double_t __pyx_v_com, int __pyx_v_adjust, int __pyx_v_ignore_na, int __pyx_v_minp, int __pyx_v_bias); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_32__pyx_unpickle_WindowIndexer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_34__pyx_unpickle_MockFixedWindowIndexer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_36__pyx_unpickle_FixedWindowIndexer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_38__pyx_unpickle_VariableWindowIndexer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ | |
static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ | |
static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ | |
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */ | |
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ | |
static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */ | |
static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ | |
static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ | |
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ | |
static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ | |
static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ | |
static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ | |
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */ | |
static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ | |
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */ | |
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ | |
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ | |
static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ | |
static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ | |
static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ | |
static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ | |
static PyObject *__pyx_tp_new_6pandas_5_libs_6window_WindowIndexer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
static PyObject *__pyx_tp_new_6pandas_5_libs_6window_MockFixedWindowIndexer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
static PyObject *__pyx_tp_new_6pandas_5_libs_6window_FixedWindowIndexer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
static PyObject *__pyx_tp_new_6pandas_5_libs_6window_VariableWindowIndexer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
static PyObject *__pyx_float_0_; | |
static PyObject *__pyx_int_0; | |
static PyObject *__pyx_int_1; | |
static PyObject *__pyx_int_5; | |
static PyObject *__pyx_int_92491699; | |
static PyObject *__pyx_int_184977713; | |
static PyObject *__pyx_int_neg_1; | |
static PyObject *__pyx_tuple_; | |
static PyObject *__pyx_tuple__2; | |
static PyObject *__pyx_tuple__3; | |
static PyObject *__pyx_tuple__4; | |
static PyObject *__pyx_tuple__5; | |
static PyObject *__pyx_tuple__6; | |
static PyObject *__pyx_tuple__7; | |
static PyObject *__pyx_tuple__8; | |
static PyObject *__pyx_slice__49; | |
static PyObject *__pyx_slice__50; | |
static PyObject *__pyx_slice__51; | |
static PyObject *__pyx_tuple__10; | |
static PyObject *__pyx_tuple__12; | |
static PyObject *__pyx_tuple__13; | |
static PyObject *__pyx_tuple__14; | |
static PyObject *__pyx_tuple__15; | |
static PyObject *__pyx_tuple__16; | |
static PyObject *__pyx_tuple__17; | |
static PyObject *__pyx_tuple__18; | |
static PyObject *__pyx_tuple__19; | |
static PyObject *__pyx_tuple__20; | |
static PyObject *__pyx_tuple__21; | |
static PyObject *__pyx_tuple__22; | |
static PyObject *__pyx_tuple__23; | |
static PyObject *__pyx_tuple__24; | |
static PyObject *__pyx_tuple__25; | |
static PyObject *__pyx_tuple__26; | |
static PyObject *__pyx_tuple__27; | |
static PyObject *__pyx_tuple__28; | |
static PyObject *__pyx_tuple__29; | |
static PyObject *__pyx_tuple__30; | |
static PyObject *__pyx_tuple__31; | |
static PyObject *__pyx_tuple__32; | |
static PyObject *__pyx_tuple__33; | |
static PyObject *__pyx_tuple__34; | |
static PyObject *__pyx_tuple__35; | |
static PyObject *__pyx_tuple__36; | |
static PyObject *__pyx_tuple__37; | |
static PyObject *__pyx_tuple__38; | |
static PyObject *__pyx_tuple__39; | |
static PyObject *__pyx_tuple__40; | |
static PyObject *__pyx_tuple__41; | |
static PyObject *__pyx_tuple__42; | |
static PyObject *__pyx_tuple__43; | |
static PyObject *__pyx_tuple__44; | |
static PyObject *__pyx_tuple__45; | |
static PyObject *__pyx_tuple__46; | |
static PyObject *__pyx_tuple__47; | |
static PyObject *__pyx_tuple__48; | |
static PyObject *__pyx_tuple__52; | |
static PyObject *__pyx_tuple__53; | |
static PyObject *__pyx_tuple__54; | |
static PyObject *__pyx_tuple__55; | |
static PyObject *__pyx_tuple__57; | |
static PyObject *__pyx_tuple__60; | |
static PyObject *__pyx_tuple__62; | |
static PyObject *__pyx_tuple__64; | |
static PyObject *__pyx_tuple__66; | |
static PyObject *__pyx_tuple__68; | |
static PyObject *__pyx_tuple__70; | |
static PyObject *__pyx_tuple__72; | |
static PyObject *__pyx_tuple__74; | |
static PyObject *__pyx_tuple__76; | |
static PyObject *__pyx_tuple__78; | |
static PyObject *__pyx_tuple__80; | |
static PyObject *__pyx_tuple__82; | |
static PyObject *__pyx_tuple__84; | |
static PyObject *__pyx_tuple__86; | |
static PyObject *__pyx_tuple__88; | |
static PyObject *__pyx_tuple__90; | |
static PyObject *__pyx_tuple__92; | |
static PyObject *__pyx_tuple__94; | |
static PyObject *__pyx_tuple__96; | |
static PyObject *__pyx_tuple__97; | |
static PyObject *__pyx_tuple__98; | |
static PyObject *__pyx_tuple__99; | |
static PyObject *__pyx_tuple__100; | |
static PyObject *__pyx_tuple__101; | |
static PyObject *__pyx_codeobj__56; | |
static PyObject *__pyx_codeobj__58; | |
static PyObject *__pyx_codeobj__61; | |
static PyObject *__pyx_codeobj__63; | |
static PyObject *__pyx_codeobj__65; | |
static PyObject *__pyx_codeobj__67; | |
static PyObject *__pyx_codeobj__69; | |
static PyObject *__pyx_codeobj__71; | |
static PyObject *__pyx_codeobj__73; | |
static PyObject *__pyx_codeobj__75; | |
static PyObject *__pyx_codeobj__77; | |
static PyObject *__pyx_codeobj__79; | |
static PyObject *__pyx_codeobj__81; | |
static PyObject *__pyx_codeobj__83; | |
static PyObject *__pyx_codeobj__85; | |
static PyObject *__pyx_codeobj__87; | |
static PyObject *__pyx_codeobj__89; | |
static PyObject *__pyx_codeobj__91; | |
static PyObject *__pyx_codeobj__93; | |
static PyObject *__pyx_codeobj__95; | |
static PyObject *__pyx_codeobj__102; | |
/* Late includes */ | |
/* "pandas/_libs/window.pyx":36 | |
* cdef double NaN = <double> np.NaN | |
* | |
* cdef inline int int_max(int a, int b): return a if a >= b else b # <<<<<<<<<<<<<< | |
* cdef inline int int_min(int a, int b): return a if a <= b else b | |
* | |
*/ | |
static CYTHON_INLINE int __pyx_f_6pandas_5_libs_6window_int_max(int __pyx_v_a, int __pyx_v_b) { | |
int __pyx_r; | |
__Pyx_RefNannyDeclarations | |
int __pyx_t_1; | |
__Pyx_RefNannySetupContext("int_max", 0); | |
if (((__pyx_v_a >= __pyx_v_b) != 0)) { | |
__pyx_t_1 = __pyx_v_a; | |
} else { | |
__pyx_t_1 = __pyx_v_b; | |
} | |
__pyx_r = __pyx_t_1; | |
goto __pyx_L0; | |
/* function exit code */ | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "pandas/_libs/window.pyx":37 | |
* | |
* cdef inline int int_max(int a, int b): return a if a >= b else b | |
* cdef inline int int_min(int a, int b): return a if a <= b else b # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
static CYTHON_INLINE int __pyx_f_6pandas_5_libs_6window_int_min(int __pyx_v_a, int __pyx_v_b) { | |
int __pyx_r; | |
__Pyx_RefNannyDeclarations | |
int __pyx_t_1; | |
__Pyx_RefNannySetupContext("int_min", 0); | |
if (((__pyx_v_a <= __pyx_v_b) != 0)) { | |
__pyx_t_1 = __pyx_v_a; | |
} else { | |
__pyx_t_1 = __pyx_v_b; | |
} | |
__pyx_r = __pyx_t_1; | |
goto __pyx_L0; | |
/* function exit code */ | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "pandas/_libs/window.pyx":51 | |
* | |
* | |
* def _check_minp(win, minp, N, floor=None): # <<<<<<<<<<<<<< | |
* """ | |
* Parameters | |
*/ | |
/* Python wrapper */ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_1_check_minp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static char __pyx_doc_6pandas_5_libs_6window__check_minp[] = "\n Parameters\n ----------\n win: int\n minp: int or None\n N: len of window\n floor: int, optional\n default 1\n\n Returns\n -------\n minimum period\n "; | |
static PyMethodDef __pyx_mdef_6pandas_5_libs_6window_1_check_minp = {"_check_minp", (PyCFunction)__pyx_pw_6pandas_5_libs_6window_1_check_minp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6window__check_minp}; | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_1_check_minp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyObject *__pyx_v_win = 0; | |
PyObject *__pyx_v_minp = 0; | |
PyObject *__pyx_v_N = 0; | |
PyObject *__pyx_v_floor = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("_check_minp (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_N,&__pyx_n_s_floor,0}; | |
PyObject* values[4] = {0,0,0,0}; | |
values[3] = ((PyObject *)Py_None); | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("_check_minp", 0, 3, 4, 1); __PYX_ERR(0, 51, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("_check_minp", 0, 3, 4, 2); __PYX_ERR(0, 51, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (kw_args > 0) { | |
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_floor); | |
if (value) { values[3] = value; kw_args--; } | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_check_minp") < 0)) __PYX_ERR(0, 51, __pyx_L3_error) | |
} | |
} else { | |
switch (PyTuple_GET_SIZE(__pyx_args)) { | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
} | |
__pyx_v_win = values[0]; | |
__pyx_v_minp = values[1]; | |
__pyx_v_N = values[2]; | |
__pyx_v_floor = values[3]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("_check_minp", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 51, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window._check_minp", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window__check_minp(__pyx_self, __pyx_v_win, __pyx_v_minp, __pyx_v_N, __pyx_v_floor); | |
/* function exit code */ | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window__check_minp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_win, PyObject *__pyx_v_minp, PyObject *__pyx_v_N, PyObject *__pyx_v_floor) { | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
int __pyx_t_1; | |
int __pyx_t_2; | |
PyObject *__pyx_t_3 = NULL; | |
PyObject *__pyx_t_4 = NULL; | |
PyObject *__pyx_t_5 = NULL; | |
PyObject *__pyx_t_6 = NULL; | |
__Pyx_RefNannySetupContext("_check_minp", 0); | |
__Pyx_INCREF(__pyx_v_minp); | |
__Pyx_INCREF(__pyx_v_floor); | |
/* "pandas/_libs/window.pyx":66 | |
* """ | |
* | |
* if minp is None: # <<<<<<<<<<<<<< | |
* minp = 1 | |
* if not util.is_integer_object(minp): | |
*/ | |
__pyx_t_1 = (__pyx_v_minp == Py_None); | |
__pyx_t_2 = (__pyx_t_1 != 0); | |
if (__pyx_t_2) { | |
/* "pandas/_libs/window.pyx":67 | |
* | |
* if minp is None: | |
* minp = 1 # <<<<<<<<<<<<<< | |
* if not util.is_integer_object(minp): | |
* raise ValueError("min_periods must be an integer") | |
*/ | |
__Pyx_INCREF(__pyx_int_1); | |
__Pyx_DECREF_SET(__pyx_v_minp, __pyx_int_1); | |
/* "pandas/_libs/window.pyx":66 | |
* """ | |
* | |
* if minp is None: # <<<<<<<<<<<<<< | |
* minp = 1 | |
* if not util.is_integer_object(minp): | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":68 | |
* if minp is None: | |
* minp = 1 | |
* if not util.is_integer_object(minp): # <<<<<<<<<<<<<< | |
* raise ValueError("min_periods must be an integer") | |
* if minp > win: | |
*/ | |
__pyx_t_2 = ((!(__pyx_f_4util_is_integer_object(__pyx_v_minp) != 0)) != 0); | |
if (unlikely(__pyx_t_2)) { | |
/* "pandas/_libs/window.pyx":69 | |
* minp = 1 | |
* if not util.is_integer_object(minp): | |
* raise ValueError("min_periods must be an integer") # <<<<<<<<<<<<<< | |
* if minp > win: | |
* raise ValueError("min_periods (%d) must be <= " | |
*/ | |
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__Pyx_Raise(__pyx_t_3, 0, 0, 0); | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
__PYX_ERR(0, 69, __pyx_L1_error) | |
/* "pandas/_libs/window.pyx":68 | |
* if minp is None: | |
* minp = 1 | |
* if not util.is_integer_object(minp): # <<<<<<<<<<<<<< | |
* raise ValueError("min_periods must be an integer") | |
* if minp > win: | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":70 | |
* if not util.is_integer_object(minp): | |
* raise ValueError("min_periods must be an integer") | |
* if minp > win: # <<<<<<<<<<<<<< | |
* raise ValueError("min_periods (%d) must be <= " | |
* "window (%d)" % (minp, win)) | |
*/ | |
__pyx_t_3 = PyObject_RichCompare(__pyx_v_minp, __pyx_v_win, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) | |
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 70, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
if (unlikely(__pyx_t_2)) { | |
/* "pandas/_libs/window.pyx":72 | |
* if minp > win: | |
* raise ValueError("min_periods (%d) must be <= " | |
* "window (%d)" % (minp, win)) # <<<<<<<<<<<<<< | |
* elif minp > N: | |
* minp = N + 1 | |
*/ | |
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__Pyx_INCREF(__pyx_v_minp); | |
__Pyx_GIVEREF(__pyx_v_minp); | |
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_minp); | |
__Pyx_INCREF(__pyx_v_win); | |
__Pyx_GIVEREF(__pyx_v_win); | |
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_win); | |
__pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_min_periods_d_must_be_window_d, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
/* "pandas/_libs/window.pyx":71 | |
* raise ValueError("min_periods must be an integer") | |
* if minp > win: | |
* raise ValueError("min_periods (%d) must be <= " # <<<<<<<<<<<<<< | |
* "window (%d)" % (minp, win)) | |
* elif minp > N: | |
*/ | |
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
__Pyx_Raise(__pyx_t_3, 0, 0, 0); | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
__PYX_ERR(0, 71, __pyx_L1_error) | |
/* "pandas/_libs/window.pyx":70 | |
* if not util.is_integer_object(minp): | |
* raise ValueError("min_periods must be an integer") | |
* if minp > win: # <<<<<<<<<<<<<< | |
* raise ValueError("min_periods (%d) must be <= " | |
* "window (%d)" % (minp, win)) | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":73 | |
* raise ValueError("min_periods (%d) must be <= " | |
* "window (%d)" % (minp, win)) | |
* elif minp > N: # <<<<<<<<<<<<<< | |
* minp = N + 1 | |
* elif minp < 0: | |
*/ | |
__pyx_t_3 = PyObject_RichCompare(__pyx_v_minp, __pyx_v_N, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) | |
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 73, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
if (__pyx_t_2) { | |
/* "pandas/_libs/window.pyx":74 | |
* "window (%d)" % (minp, win)) | |
* elif minp > N: | |
* minp = N + 1 # <<<<<<<<<<<<<< | |
* elif minp < 0: | |
* raise ValueError('min_periods must be >= 0') | |
*/ | |
__pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_N, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__Pyx_DECREF_SET(__pyx_v_minp, __pyx_t_3); | |
__pyx_t_3 = 0; | |
/* "pandas/_libs/window.pyx":73 | |
* raise ValueError("min_periods (%d) must be <= " | |
* "window (%d)" % (minp, win)) | |
* elif minp > N: # <<<<<<<<<<<<<< | |
* minp = N + 1 | |
* elif minp < 0: | |
*/ | |
goto __pyx_L5; | |
} | |
/* "pandas/_libs/window.pyx":75 | |
* elif minp > N: | |
* minp = N + 1 | |
* elif minp < 0: # <<<<<<<<<<<<<< | |
* raise ValueError('min_periods must be >= 0') | |
* if floor is None: | |
*/ | |
__pyx_t_3 = PyObject_RichCompare(__pyx_v_minp, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) | |
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 75, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
if (unlikely(__pyx_t_2)) { | |
/* "pandas/_libs/window.pyx":76 | |
* minp = N + 1 | |
* elif minp < 0: | |
* raise ValueError('min_periods must be >= 0') # <<<<<<<<<<<<<< | |
* if floor is None: | |
* floor = 1 | |
*/ | |
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__Pyx_Raise(__pyx_t_3, 0, 0, 0); | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
__PYX_ERR(0, 76, __pyx_L1_error) | |
/* "pandas/_libs/window.pyx":75 | |
* elif minp > N: | |
* minp = N + 1 | |
* elif minp < 0: # <<<<<<<<<<<<<< | |
* raise ValueError('min_periods must be >= 0') | |
* if floor is None: | |
*/ | |
} | |
__pyx_L5:; | |
/* "pandas/_libs/window.pyx":77 | |
* elif minp < 0: | |
* raise ValueError('min_periods must be >= 0') | |
* if floor is None: # <<<<<<<<<<<<<< | |
* floor = 1 | |
* | |
*/ | |
__pyx_t_2 = (__pyx_v_floor == Py_None); | |
__pyx_t_1 = (__pyx_t_2 != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":78 | |
* raise ValueError('min_periods must be >= 0') | |
* if floor is None: | |
* floor = 1 # <<<<<<<<<<<<<< | |
* | |
* return max(minp, floor) | |
*/ | |
__Pyx_INCREF(__pyx_int_1); | |
__Pyx_DECREF_SET(__pyx_v_floor, __pyx_int_1); | |
/* "pandas/_libs/window.pyx":77 | |
* elif minp < 0: | |
* raise ValueError('min_periods must be >= 0') | |
* if floor is None: # <<<<<<<<<<<<<< | |
* floor = 1 | |
* | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":80 | |
* floor = 1 | |
* | |
* return max(minp, floor) # <<<<<<<<<<<<<< | |
* | |
* # original C implementation by N. Devillard. | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__Pyx_INCREF(__pyx_v_floor); | |
__pyx_t_3 = __pyx_v_floor; | |
__Pyx_INCREF(__pyx_v_minp); | |
__pyx_t_4 = __pyx_v_minp; | |
__pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 80, __pyx_L1_error) | |
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 80, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
if (__pyx_t_1) { | |
__Pyx_INCREF(__pyx_t_3); | |
__pyx_t_5 = __pyx_t_3; | |
} else { | |
__Pyx_INCREF(__pyx_t_4); | |
__pyx_t_5 = __pyx_t_4; | |
} | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
__Pyx_INCREF(__pyx_t_5); | |
__pyx_r = __pyx_t_5; | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":51 | |
* | |
* | |
* def _check_minp(win, minp, N, floor=None): # <<<<<<<<<<<<<< | |
* """ | |
* Parameters | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_3); | |
__Pyx_XDECREF(__pyx_t_4); | |
__Pyx_XDECREF(__pyx_t_5); | |
__Pyx_XDECREF(__pyx_t_6); | |
__Pyx_AddTraceback("pandas._libs.window._check_minp", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_XDECREF(__pyx_v_minp); | |
__Pyx_XDECREF(__pyx_v_floor); | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "pandas/_libs/window.pyx":109 | |
* bint is_variable | |
* | |
* def get_data(self): # <<<<<<<<<<<<<< | |
* return (self.start, self.end, <int64_t>self.N, | |
* <int64_t>self.win, <int64_t>self.minp, | |
*/ | |
/* Python wrapper */ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_13WindowIndexer_1get_data(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_13WindowIndexer_1get_data(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("get_data (wrapper)", 0); | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_13WindowIndexer_get_data(((struct __pyx_obj_6pandas_5_libs_6window_WindowIndexer *)__pyx_v_self)); | |
/* function exit code */ | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_13WindowIndexer_get_data(struct __pyx_obj_6pandas_5_libs_6window_WindowIndexer *__pyx_v_self) { | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
PyObject *__pyx_t_2 = NULL; | |
PyObject *__pyx_t_3 = NULL; | |
PyObject *__pyx_t_4 = NULL; | |
PyObject *__pyx_t_5 = NULL; | |
__Pyx_RefNannySetupContext("get_data", 0); | |
/* "pandas/_libs/window.pyx":110 | |
* | |
* def get_data(self): | |
* return (self.start, self.end, <int64_t>self.N, # <<<<<<<<<<<<<< | |
* <int64_t>self.win, <int64_t>self.minp, | |
* self.is_variable) | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_1 = __Pyx_PyInt_From_npy_int64(((__pyx_t_5numpy_int64_t)__pyx_v_self->N)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
/* "pandas/_libs/window.pyx":111 | |
* def get_data(self): | |
* return (self.start, self.end, <int64_t>self.N, | |
* <int64_t>self.win, <int64_t>self.minp, # <<<<<<<<<<<<<< | |
* self.is_variable) | |
* | |
*/ | |
__pyx_t_2 = __Pyx_PyInt_From_npy_int64(((__pyx_t_5numpy_int64_t)__pyx_v_self->win)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_2); | |
__pyx_t_3 = __Pyx_PyInt_From_npy_int64(((__pyx_t_5numpy_int64_t)__pyx_v_self->minp)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
/* "pandas/_libs/window.pyx":112 | |
* return (self.start, self.end, <int64_t>self.N, | |
* <int64_t>self.win, <int64_t>self.minp, | |
* self.is_variable) # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->is_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
/* "pandas/_libs/window.pyx":110 | |
* | |
* def get_data(self): | |
* return (self.start, self.end, <int64_t>self.N, # <<<<<<<<<<<<<< | |
* <int64_t>self.win, <int64_t>self.minp, | |
* self.is_variable) | |
*/ | |
__pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 110, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_INCREF(((PyObject *)__pyx_v_self->start)); | |
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->start)); | |
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_self->start)); | |
__Pyx_INCREF(((PyObject *)__pyx_v_self->end)); | |
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->end)); | |
PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_self->end)); | |
__Pyx_GIVEREF(__pyx_t_1); | |
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_1); | |
__Pyx_GIVEREF(__pyx_t_2); | |
PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_2); | |
__Pyx_GIVEREF(__pyx_t_3); | |
PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_3); | |
__Pyx_GIVEREF(__pyx_t_4); | |
PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_4); | |
__pyx_t_1 = 0; | |
__pyx_t_2 = 0; | |
__pyx_t_3 = 0; | |
__pyx_t_4 = 0; | |
__pyx_r = __pyx_t_5; | |
__pyx_t_5 = 0; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":109 | |
* bint is_variable | |
* | |
* def get_data(self): # <<<<<<<<<<<<<< | |
* return (self.start, self.end, <int64_t>self.N, | |
* <int64_t>self.win, <int64_t>self.minp, | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
__Pyx_XDECREF(__pyx_t_2); | |
__Pyx_XDECREF(__pyx_t_3); | |
__Pyx_XDECREF(__pyx_t_4); | |
__Pyx_XDECREF(__pyx_t_5); | |
__Pyx_AddTraceback("pandas._libs.window.WindowIndexer.get_data", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "(tree fragment)":1 | |
* def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
* cdef bint use_setstate | |
* state = (self.N, self.end, self.is_variable, self.minp, self.start, self.win) | |
*/ | |
/* Python wrapper */ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_13WindowIndexer_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_13WindowIndexer_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_13WindowIndexer_2__reduce_cython__(((struct __pyx_obj_6pandas_5_libs_6window_WindowIndexer *)__pyx_v_self)); | |
/* function exit code */ | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_13WindowIndexer_2__reduce_cython__(struct __pyx_obj_6pandas_5_libs_6window_WindowIndexer *__pyx_v_self) { | |
int __pyx_v_use_setstate; | |
PyObject *__pyx_v_state = NULL; | |
PyObject *__pyx_v__dict = NULL; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
PyObject *__pyx_t_2 = NULL; | |
PyObject *__pyx_t_3 = NULL; | |
PyObject *__pyx_t_4 = NULL; | |
PyObject *__pyx_t_5 = NULL; | |
int __pyx_t_6; | |
int __pyx_t_7; | |
int __pyx_t_8; | |
__Pyx_RefNannySetupContext("__reduce_cython__", 0); | |
/* "(tree fragment)":3 | |
* def __reduce_cython__(self): | |
* cdef bint use_setstate | |
* state = (self.N, self.end, self.is_variable, self.minp, self.start, self.win) # <<<<<<<<<<<<<< | |
* _dict = getattr(self, '__dict__', None) | |
* if _dict is not None: | |
*/ | |
__pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->N); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->is_variable); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_2); | |
__pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->minp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->win); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_GIVEREF(__pyx_t_1); | |
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); | |
__Pyx_INCREF(((PyObject *)__pyx_v_self->end)); | |
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->end)); | |
PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_self->end)); | |
__Pyx_GIVEREF(__pyx_t_2); | |
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2); | |
__Pyx_GIVEREF(__pyx_t_3); | |
PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_3); | |
__Pyx_INCREF(((PyObject *)__pyx_v_self->start)); | |
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->start)); | |
PyTuple_SET_ITEM(__pyx_t_5, 4, ((PyObject *)__pyx_v_self->start)); | |
__Pyx_GIVEREF(__pyx_t_4); | |
PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_4); | |
__pyx_t_1 = 0; | |
__pyx_t_2 = 0; | |
__pyx_t_3 = 0; | |
__pyx_t_4 = 0; | |
__pyx_v_state = ((PyObject*)__pyx_t_5); | |
__pyx_t_5 = 0; | |
/* "(tree fragment)":4 | |
* cdef bint use_setstate | |
* state = (self.N, self.end, self.is_variable, self.minp, self.start, self.win) | |
* _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< | |
* if _dict is not None: | |
* state += (_dict,) | |
*/ | |
__pyx_t_5 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 4, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__pyx_v__dict = __pyx_t_5; | |
__pyx_t_5 = 0; | |
/* "(tree fragment)":5 | |
* state = (self.N, self.end, self.is_variable, self.minp, self.start, self.win) | |
* _dict = getattr(self, '__dict__', None) | |
* if _dict is not None: # <<<<<<<<<<<<<< | |
* state += (_dict,) | |
* use_setstate = True | |
*/ | |
__pyx_t_6 = (__pyx_v__dict != Py_None); | |
__pyx_t_7 = (__pyx_t_6 != 0); | |
if (__pyx_t_7) { | |
/* "(tree fragment)":6 | |
* _dict = getattr(self, '__dict__', None) | |
* if _dict is not None: | |
* state += (_dict,) # <<<<<<<<<<<<<< | |
* use_setstate = True | |
* else: | |
*/ | |
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_INCREF(__pyx_v__dict); | |
__Pyx_GIVEREF(__pyx_v__dict); | |
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v__dict); | |
__pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); | |
__pyx_t_4 = 0; | |
/* "(tree fragment)":7 | |
* if _dict is not None: | |
* state += (_dict,) | |
* use_setstate = True # <<<<<<<<<<<<<< | |
* else: | |
* use_setstate = self.end is not None or self.start is not None | |
*/ | |
__pyx_v_use_setstate = 1; | |
/* "(tree fragment)":5 | |
* state = (self.N, self.end, self.is_variable, self.minp, self.start, self.win) | |
* _dict = getattr(self, '__dict__', None) | |
* if _dict is not None: # <<<<<<<<<<<<<< | |
* state += (_dict,) | |
* use_setstate = True | |
*/ | |
goto __pyx_L3; | |
} | |
/* "(tree fragment)":9 | |
* use_setstate = True | |
* else: | |
* use_setstate = self.end is not None or self.start is not None # <<<<<<<<<<<<<< | |
* if use_setstate: | |
* return __pyx_unpickle_WindowIndexer, (type(self), 0x5834fb3, None), state | |
*/ | |
/*else*/ { | |
__pyx_t_6 = (((PyObject *)__pyx_v_self->end) != Py_None); | |
__pyx_t_8 = (__pyx_t_6 != 0); | |
if (!__pyx_t_8) { | |
} else { | |
__pyx_t_7 = __pyx_t_8; | |
goto __pyx_L4_bool_binop_done; | |
} | |
__pyx_t_8 = (((PyObject *)__pyx_v_self->start) != Py_None); | |
__pyx_t_6 = (__pyx_t_8 != 0); | |
__pyx_t_7 = __pyx_t_6; | |
__pyx_L4_bool_binop_done:; | |
__pyx_v_use_setstate = __pyx_t_7; | |
} | |
__pyx_L3:; | |
/* "(tree fragment)":10 | |
* else: | |
* use_setstate = self.end is not None or self.start is not None | |
* if use_setstate: # <<<<<<<<<<<<<< | |
* return __pyx_unpickle_WindowIndexer, (type(self), 0x5834fb3, None), state | |
* else: | |
*/ | |
__pyx_t_7 = (__pyx_v_use_setstate != 0); | |
if (__pyx_t_7) { | |
/* "(tree fragment)":11 | |
* use_setstate = self.end is not None or self.start is not None | |
* if use_setstate: | |
* return __pyx_unpickle_WindowIndexer, (type(self), 0x5834fb3, None), state # <<<<<<<<<<<<<< | |
* else: | |
* return __pyx_unpickle_WindowIndexer, (type(self), 0x5834fb3, state) | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_WindowIndexer); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 11, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 11, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
__Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
__Pyx_INCREF(__pyx_int_92491699); | |
__Pyx_GIVEREF(__pyx_int_92491699); | |
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_92491699); | |
__Pyx_INCREF(Py_None); | |
__Pyx_GIVEREF(Py_None); | |
PyTuple_SET_ITEM(__pyx_t_5, 2, Py_None); | |
__pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 11, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__Pyx_GIVEREF(__pyx_t_4); | |
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); | |
__Pyx_GIVEREF(__pyx_t_5); | |
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); | |
__Pyx_INCREF(__pyx_v_state); | |
__Pyx_GIVEREF(__pyx_v_state); | |
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state); | |
__pyx_t_4 = 0; | |
__pyx_t_5 = 0; | |
__pyx_r = __pyx_t_3; | |
__pyx_t_3 = 0; | |
goto __pyx_L0; | |
/* "(tree fragment)":10 | |
* else: | |
* use_setstate = self.end is not None or self.start is not None | |
* if use_setstate: # <<<<<<<<<<<<<< | |
* return __pyx_unpickle_WindowIndexer, (type(self), 0x5834fb3, None), state | |
* else: | |
*/ | |
} | |
/* "(tree fragment)":13 | |
* return __pyx_unpickle_WindowIndexer, (type(self), 0x5834fb3, None), state | |
* else: | |
* return __pyx_unpickle_WindowIndexer, (type(self), 0x5834fb3, state) # <<<<<<<<<<<<<< | |
* def __setstate_cython__(self, __pyx_state): | |
* __pyx_unpickle_WindowIndexer__set_state(self, __pyx_state) | |
*/ | |
/*else*/ { | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_WindowIndexer); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
__Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
__Pyx_INCREF(__pyx_int_92491699); | |
__Pyx_GIVEREF(__pyx_int_92491699); | |
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_92491699); | |
__Pyx_INCREF(__pyx_v_state); | |
__Pyx_GIVEREF(__pyx_v_state); | |
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); | |
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__Pyx_GIVEREF(__pyx_t_3); | |
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); | |
__Pyx_GIVEREF(__pyx_t_5); | |
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); | |
__pyx_t_3 = 0; | |
__pyx_t_5 = 0; | |
__pyx_r = __pyx_t_4; | |
__pyx_t_4 = 0; | |
goto __pyx_L0; | |
} | |
/* "(tree fragment)":1 | |
* def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
* cdef bint use_setstate | |
* state = (self.N, self.end, self.is_variable, self.minp, self.start, self.win) | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
__Pyx_XDECREF(__pyx_t_2); | |
__Pyx_XDECREF(__pyx_t_3); | |
__Pyx_XDECREF(__pyx_t_4); | |
__Pyx_XDECREF(__pyx_t_5); | |
__Pyx_AddTraceback("pandas._libs.window.WindowIndexer.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_XDECREF(__pyx_v_state); | |
__Pyx_XDECREF(__pyx_v__dict); | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "(tree fragment)":14 | |
* else: | |
* return __pyx_unpickle_WindowIndexer, (type(self), 0x5834fb3, state) | |
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
* __pyx_unpickle_WindowIndexer__set_state(self, __pyx_state) | |
*/ | |
/* Python wrapper */ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_13WindowIndexer_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_13WindowIndexer_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_13WindowIndexer_4__setstate_cython__(((struct __pyx_obj_6pandas_5_libs_6window_WindowIndexer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); | |
/* function exit code */ | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_13WindowIndexer_4__setstate_cython__(struct __pyx_obj_6pandas_5_libs_6window_WindowIndexer *__pyx_v_self, PyObject *__pyx_v___pyx_state) { | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
__Pyx_RefNannySetupContext("__setstate_cython__", 0); | |
/* "(tree fragment)":15 | |
* return __pyx_unpickle_WindowIndexer, (type(self), 0x5834fb3, state) | |
* def __setstate_cython__(self, __pyx_state): | |
* __pyx_unpickle_WindowIndexer__set_state(self, __pyx_state) # <<<<<<<<<<<<<< | |
*/ | |
if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 15, __pyx_L1_error) | |
__pyx_t_1 = __pyx_f_6pandas_5_libs_6window___pyx_unpickle_WindowIndexer__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
/* "(tree fragment)":14 | |
* else: | |
* return __pyx_unpickle_WindowIndexer, (type(self), 0x5834fb3, state) | |
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
* __pyx_unpickle_WindowIndexer__set_state(self, __pyx_state) | |
*/ | |
/* function exit code */ | |
__pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
__Pyx_AddTraceback("pandas._libs.window.WindowIndexer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "pandas/_libs/window.pyx":140 | |
* | |
* """ | |
* def __init__(self, ndarray input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* bint left_closed, bint right_closed, | |
* object index=None, object floor=None): | |
*/ | |
/* Python wrapper */ | |
static int __pyx_pw_6pandas_5_libs_6window_22MockFixedWindowIndexer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static int __pyx_pw_6pandas_5_libs_6window_22MockFixedWindowIndexer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
CYTHON_UNUSED int __pyx_v_left_closed; | |
CYTHON_UNUSED int __pyx_v_right_closed; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_floor = 0; | |
int __pyx_r; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_left_closed,&__pyx_n_s_right_closed,&__pyx_n_s_index,&__pyx_n_s_floor,0}; | |
PyObject* values[7] = {0,0,0,0,0,0,0}; | |
/* "pandas/_libs/window.pyx":142 | |
* def __init__(self, ndarray input, int64_t win, int64_t minp, | |
* bint left_closed, bint right_closed, | |
* object index=None, object floor=None): # <<<<<<<<<<<<<< | |
* | |
* assert index is None | |
*/ | |
values[5] = ((PyObject *)Py_None); | |
values[6] = ((PyObject *)Py_None); | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); | |
CYTHON_FALLTHROUGH; | |
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); | |
CYTHON_FALLTHROUGH; | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 7, 1); __PYX_ERR(0, 140, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 7, 2); __PYX_ERR(0, 140, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_left_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 7, 3); __PYX_ERR(0, 140, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_right_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 7, 4); __PYX_ERR(0, 140, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 5: | |
if (kw_args > 0) { | |
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index); | |
if (value) { values[5] = value; kw_args--; } | |
} | |
CYTHON_FALLTHROUGH; | |
case 6: | |
if (kw_args > 0) { | |
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_floor); | |
if (value) { values[6] = value; kw_args--; } | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 140, __pyx_L3_error) | |
} | |
} else { | |
switch (PyTuple_GET_SIZE(__pyx_args)) { | |
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); | |
CYTHON_FALLTHROUGH; | |
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); | |
CYTHON_FALLTHROUGH; | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L3_error) | |
__pyx_v_left_closed = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_left_closed == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L3_error) | |
__pyx_v_right_closed = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_right_closed == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L3_error) | |
__pyx_v_index = values[5]; | |
__pyx_v_floor = values[6]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 140, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.MockFixedWindowIndexer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return -1; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 140, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_22MockFixedWindowIndexer___init__(((struct __pyx_obj_6pandas_5_libs_6window_MockFixedWindowIndexer *)__pyx_v_self), __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_left_closed, __pyx_v_right_closed, __pyx_v_index, __pyx_v_floor); | |
/* "pandas/_libs/window.pyx":140 | |
* | |
* """ | |
* def __init__(self, ndarray input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* bint left_closed, bint right_closed, | |
* object index=None, object floor=None): | |
*/ | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = -1; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static int __pyx_pf_6pandas_5_libs_6window_22MockFixedWindowIndexer___init__(struct __pyx_obj_6pandas_5_libs_6window_MockFixedWindowIndexer *__pyx_v_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, CYTHON_UNUSED int __pyx_v_left_closed, CYTHON_UNUSED int __pyx_v_right_closed, PyObject *__pyx_v_index, PyObject *__pyx_v_floor) { | |
int __pyx_r; | |
__Pyx_RefNannyDeclarations | |
int __pyx_t_1; | |
Py_ssize_t __pyx_t_2; | |
PyObject *__pyx_t_3 = NULL; | |
PyObject *__pyx_t_4 = NULL; | |
PyObject *__pyx_t_5 = NULL; | |
PyObject *__pyx_t_6 = NULL; | |
PyObject *__pyx_t_7 = NULL; | |
__pyx_t_5numpy_int64_t __pyx_t_8; | |
__Pyx_RefNannySetupContext("__init__", 0); | |
/* "pandas/_libs/window.pyx":144 | |
* object index=None, object floor=None): | |
* | |
* assert index is None # <<<<<<<<<<<<<< | |
* self.is_variable = 0 | |
* self.N = len(input) | |
*/ | |
#ifndef CYTHON_WITHOUT_ASSERTIONS | |
if (unlikely(!Py_OptimizeFlag)) { | |
__pyx_t_1 = (__pyx_v_index == Py_None); | |
if (unlikely(!(__pyx_t_1 != 0))) { | |
PyErr_SetNone(PyExc_AssertionError); | |
__PYX_ERR(0, 144, __pyx_L1_error) | |
} | |
} | |
#endif | |
/* "pandas/_libs/window.pyx":145 | |
* | |
* assert index is None | |
* self.is_variable = 0 # <<<<<<<<<<<<<< | |
* self.N = len(input) | |
* self.minp = _check_minp(win, minp, self.N, floor=floor) | |
*/ | |
__pyx_v_self->__pyx_base.is_variable = 0; | |
/* "pandas/_libs/window.pyx":146 | |
* assert index is None | |
* self.is_variable = 0 | |
* self.N = len(input) # <<<<<<<<<<<<<< | |
* self.minp = _check_minp(win, minp, self.N, floor=floor) | |
* self.start = np.empty(0, dtype='int64') | |
*/ | |
__pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 146, __pyx_L1_error) | |
__pyx_v_self->__pyx_base.N = __pyx_t_2; | |
/* "pandas/_libs/window.pyx":147 | |
* self.is_variable = 0 | |
* self.N = len(input) | |
* self.minp = _check_minp(win, minp, self.N, floor=floor) # <<<<<<<<<<<<<< | |
* self.start = np.empty(0, dtype='int64') | |
* self.end = np.empty(0, dtype='int64') | |
*/ | |
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_win); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_minp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__pyx_t_6 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.N); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 147, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 147, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_7); | |
__Pyx_GIVEREF(__pyx_t_4); | |
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); | |
__Pyx_GIVEREF(__pyx_t_5); | |
PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5); | |
__Pyx_GIVEREF(__pyx_t_6); | |
PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6); | |
__pyx_t_4 = 0; | |
__pyx_t_5 = 0; | |
__pyx_t_6 = 0; | |
__pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 147, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_floor, __pyx_v_floor) < 0) __PYX_ERR(0, 147, __pyx_L1_error) | |
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_DECREF(__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; | |
__pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_8 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__pyx_v_self->__pyx_base.minp = __pyx_t_8; | |
/* "pandas/_libs/window.pyx":148 | |
* self.N = len(input) | |
* self.minp = _check_minp(win, minp, self.N, floor=floor) | |
* self.start = np.empty(0, dtype='int64') # <<<<<<<<<<<<<< | |
* self.end = np.empty(0, dtype='int64') | |
* self.win = win | |
*/ | |
__pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 148, __pyx_L1_error) | |
__pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 148, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_7); | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 148, __pyx_L1_error) | |
__Pyx_GIVEREF(__pyx_t_7); | |
__Pyx_GOTREF(__pyx_v_self->__pyx_base.start); | |
__Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.start)); | |
__pyx_v_self->__pyx_base.start = ((PyArrayObject *)__pyx_t_7); | |
__pyx_t_7 = 0; | |
/* "pandas/_libs/window.pyx":149 | |
* self.minp = _check_minp(win, minp, self.N, floor=floor) | |
* self.start = np.empty(0, dtype='int64') | |
* self.end = np.empty(0, dtype='int64') # <<<<<<<<<<<<<< | |
* self.win = win | |
* | |
*/ | |
__pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 149, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_7); | |
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
__pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 149, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_7); | |
if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 149, __pyx_L1_error) | |
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__4, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 149, __pyx_L1_error) | |
__Pyx_GIVEREF(__pyx_t_6); | |
__Pyx_GOTREF(__pyx_v_self->__pyx_base.end); | |
__Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.end)); | |
__pyx_v_self->__pyx_base.end = ((PyArrayObject *)__pyx_t_6); | |
__pyx_t_6 = 0; | |
/* "pandas/_libs/window.pyx":150 | |
* self.start = np.empty(0, dtype='int64') | |
* self.end = np.empty(0, dtype='int64') | |
* self.win = win # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_v_self->__pyx_base.win = __pyx_v_win; | |
/* "pandas/_libs/window.pyx":140 | |
* | |
* """ | |
* def __init__(self, ndarray input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* bint left_closed, bint right_closed, | |
* object index=None, object floor=None): | |
*/ | |
/* function exit code */ | |
__pyx_r = 0; | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__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_AddTraceback("pandas._libs.window.MockFixedWindowIndexer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = -1; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "(tree fragment)":1 | |
* def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
* cdef bint use_setstate | |
* state = (self.N, self.end, self.is_variable, self.minp, self.start, self.win) | |
*/ | |
/* Python wrapper */ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_22MockFixedWindowIndexer_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_22MockFixedWindowIndexer_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_22MockFixedWindowIndexer_2__reduce_cython__(((struct __pyx_obj_6pandas_5_libs_6window_MockFixedWindowIndexer *)__pyx_v_self)); | |
/* function exit code */ | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_22MockFixedWindowIndexer_2__reduce_cython__(struct __pyx_obj_6pandas_5_libs_6window_MockFixedWindowIndexer *__pyx_v_self) { | |
int __pyx_v_use_setstate; | |
PyObject *__pyx_v_state = NULL; | |
PyObject *__pyx_v__dict = NULL; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
PyObject *__pyx_t_2 = NULL; | |
PyObject *__pyx_t_3 = NULL; | |
PyObject *__pyx_t_4 = NULL; | |
PyObject *__pyx_t_5 = NULL; | |
int __pyx_t_6; | |
int __pyx_t_7; | |
int __pyx_t_8; | |
__Pyx_RefNannySetupContext("__reduce_cython__", 0); | |
/* "(tree fragment)":3 | |
* def __reduce_cython__(self): | |
* cdef bint use_setstate | |
* state = (self.N, self.end, self.is_variable, self.minp, self.start, self.win) # <<<<<<<<<<<<<< | |
* _dict = getattr(self, '__dict__', None) | |
* if _dict is not None: | |
*/ | |
__pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.N); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base.is_variable); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_2); | |
__pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.minp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.win); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_GIVEREF(__pyx_t_1); | |
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); | |
__Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.end)); | |
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.end)); | |
PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_self->__pyx_base.end)); | |
__Pyx_GIVEREF(__pyx_t_2); | |
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2); | |
__Pyx_GIVEREF(__pyx_t_3); | |
PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_3); | |
__Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.start)); | |
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.start)); | |
PyTuple_SET_ITEM(__pyx_t_5, 4, ((PyObject *)__pyx_v_self->__pyx_base.start)); | |
__Pyx_GIVEREF(__pyx_t_4); | |
PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_4); | |
__pyx_t_1 = 0; | |
__pyx_t_2 = 0; | |
__pyx_t_3 = 0; | |
__pyx_t_4 = 0; | |
__pyx_v_state = ((PyObject*)__pyx_t_5); | |
__pyx_t_5 = 0; | |
/* "(tree fragment)":4 | |
* cdef bint use_setstate | |
* state = (self.N, self.end, self.is_variable, self.minp, self.start, self.win) | |
* _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< | |
* if _dict is not None: | |
* state += (_dict,) | |
*/ | |
__pyx_t_5 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 4, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__pyx_v__dict = __pyx_t_5; | |
__pyx_t_5 = 0; | |
/* "(tree fragment)":5 | |
* state = (self.N, self.end, self.is_variable, self.minp, self.start, self.win) | |
* _dict = getattr(self, '__dict__', None) | |
* if _dict is not None: # <<<<<<<<<<<<<< | |
* state += (_dict,) | |
* use_setstate = True | |
*/ | |
__pyx_t_6 = (__pyx_v__dict != Py_None); | |
__pyx_t_7 = (__pyx_t_6 != 0); | |
if (__pyx_t_7) { | |
/* "(tree fragment)":6 | |
* _dict = getattr(self, '__dict__', None) | |
* if _dict is not None: | |
* state += (_dict,) # <<<<<<<<<<<<<< | |
* use_setstate = True | |
* else: | |
*/ | |
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_INCREF(__pyx_v__dict); | |
__Pyx_GIVEREF(__pyx_v__dict); | |
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v__dict); | |
__pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); | |
__pyx_t_4 = 0; | |
/* "(tree fragment)":7 | |
* if _dict is not None: | |
* state += (_dict,) | |
* use_setstate = True # <<<<<<<<<<<<<< | |
* else: | |
* use_setstate = self.end is not None or self.start is not None | |
*/ | |
__pyx_v_use_setstate = 1; | |
/* "(tree fragment)":5 | |
* state = (self.N, self.end, self.is_variable, self.minp, self.start, self.win) | |
* _dict = getattr(self, '__dict__', None) | |
* if _dict is not None: # <<<<<<<<<<<<<< | |
* state += (_dict,) | |
* use_setstate = True | |
*/ | |
goto __pyx_L3; | |
} | |
/* "(tree fragment)":9 | |
* use_setstate = True | |
* else: | |
* use_setstate = self.end is not None or self.start is not None # <<<<<<<<<<<<<< | |
* if use_setstate: | |
* return __pyx_unpickle_MockFixedWindowIndexer, (type(self), 0x5834fb3, None), state | |
*/ | |
/*else*/ { | |
__pyx_t_6 = (((PyObject *)__pyx_v_self->__pyx_base.end) != Py_None); | |
__pyx_t_8 = (__pyx_t_6 != 0); | |
if (!__pyx_t_8) { | |
} else { | |
__pyx_t_7 = __pyx_t_8; | |
goto __pyx_L4_bool_binop_done; | |
} | |
__pyx_t_8 = (((PyObject *)__pyx_v_self->__pyx_base.start) != Py_None); | |
__pyx_t_6 = (__pyx_t_8 != 0); | |
__pyx_t_7 = __pyx_t_6; | |
__pyx_L4_bool_binop_done:; | |
__pyx_v_use_setstate = __pyx_t_7; | |
} | |
__pyx_L3:; | |
/* "(tree fragment)":10 | |
* else: | |
* use_setstate = self.end is not None or self.start is not None | |
* if use_setstate: # <<<<<<<<<<<<<< | |
* return __pyx_unpickle_MockFixedWindowIndexer, (type(self), 0x5834fb3, None), state | |
* else: | |
*/ | |
__pyx_t_7 = (__pyx_v_use_setstate != 0); | |
if (__pyx_t_7) { | |
/* "(tree fragment)":11 | |
* use_setstate = self.end is not None or self.start is not None | |
* if use_setstate: | |
* return __pyx_unpickle_MockFixedWindowIndexer, (type(self), 0x5834fb3, None), state # <<<<<<<<<<<<<< | |
* else: | |
* return __pyx_unpickle_MockFixedWindowIndexer, (type(self), 0x5834fb3, state) | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_MockFixedWindowIn); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 11, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 11, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
__Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
__Pyx_INCREF(__pyx_int_92491699); | |
__Pyx_GIVEREF(__pyx_int_92491699); | |
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_92491699); | |
__Pyx_INCREF(Py_None); | |
__Pyx_GIVEREF(Py_None); | |
PyTuple_SET_ITEM(__pyx_t_5, 2, Py_None); | |
__pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 11, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__Pyx_GIVEREF(__pyx_t_4); | |
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); | |
__Pyx_GIVEREF(__pyx_t_5); | |
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); | |
__Pyx_INCREF(__pyx_v_state); | |
__Pyx_GIVEREF(__pyx_v_state); | |
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state); | |
__pyx_t_4 = 0; | |
__pyx_t_5 = 0; | |
__pyx_r = __pyx_t_3; | |
__pyx_t_3 = 0; | |
goto __pyx_L0; | |
/* "(tree fragment)":10 | |
* else: | |
* use_setstate = self.end is not None or self.start is not None | |
* if use_setstate: # <<<<<<<<<<<<<< | |
* return __pyx_unpickle_MockFixedWindowIndexer, (type(self), 0x5834fb3, None), state | |
* else: | |
*/ | |
} | |
/* "(tree fragment)":13 | |
* return __pyx_unpickle_MockFixedWindowIndexer, (type(self), 0x5834fb3, None), state | |
* else: | |
* return __pyx_unpickle_MockFixedWindowIndexer, (type(self), 0x5834fb3, state) # <<<<<<<<<<<<<< | |
* def __setstate_cython__(self, __pyx_state): | |
* __pyx_unpickle_MockFixedWindowIndexer__set_state(self, __pyx_state) | |
*/ | |
/*else*/ { | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_MockFixedWindowIn); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
__Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
__Pyx_INCREF(__pyx_int_92491699); | |
__Pyx_GIVEREF(__pyx_int_92491699); | |
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_92491699); | |
__Pyx_INCREF(__pyx_v_state); | |
__Pyx_GIVEREF(__pyx_v_state); | |
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); | |
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__Pyx_GIVEREF(__pyx_t_3); | |
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); | |
__Pyx_GIVEREF(__pyx_t_5); | |
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); | |
__pyx_t_3 = 0; | |
__pyx_t_5 = 0; | |
__pyx_r = __pyx_t_4; | |
__pyx_t_4 = 0; | |
goto __pyx_L0; | |
} | |
/* "(tree fragment)":1 | |
* def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
* cdef bint use_setstate | |
* state = (self.N, self.end, self.is_variable, self.minp, self.start, self.win) | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
__Pyx_XDECREF(__pyx_t_2); | |
__Pyx_XDECREF(__pyx_t_3); | |
__Pyx_XDECREF(__pyx_t_4); | |
__Pyx_XDECREF(__pyx_t_5); | |
__Pyx_AddTraceback("pandas._libs.window.MockFixedWindowIndexer.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_XDECREF(__pyx_v_state); | |
__Pyx_XDECREF(__pyx_v__dict); | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "(tree fragment)":14 | |
* else: | |
* return __pyx_unpickle_MockFixedWindowIndexer, (type(self), 0x5834fb3, state) | |
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
* __pyx_unpickle_MockFixedWindowIndexer__set_state(self, __pyx_state) | |
*/ | |
/* Python wrapper */ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_22MockFixedWindowIndexer_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_22MockFixedWindowIndexer_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_22MockFixedWindowIndexer_4__setstate_cython__(((struct __pyx_obj_6pandas_5_libs_6window_MockFixedWindowIndexer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); | |
/* function exit code */ | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_22MockFixedWindowIndexer_4__setstate_cython__(struct __pyx_obj_6pandas_5_libs_6window_MockFixedWindowIndexer *__pyx_v_self, PyObject *__pyx_v___pyx_state) { | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
__Pyx_RefNannySetupContext("__setstate_cython__", 0); | |
/* "(tree fragment)":15 | |
* return __pyx_unpickle_MockFixedWindowIndexer, (type(self), 0x5834fb3, state) | |
* def __setstate_cython__(self, __pyx_state): | |
* __pyx_unpickle_MockFixedWindowIndexer__set_state(self, __pyx_state) # <<<<<<<<<<<<<< | |
*/ | |
if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 15, __pyx_L1_error) | |
__pyx_t_1 = __pyx_f_6pandas_5_libs_6window___pyx_unpickle_MockFixedWindowIndexer__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
/* "(tree fragment)":14 | |
* else: | |
* return __pyx_unpickle_MockFixedWindowIndexer, (type(self), 0x5834fb3, state) | |
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
* __pyx_unpickle_MockFixedWindowIndexer__set_state(self, __pyx_state) | |
*/ | |
/* function exit code */ | |
__pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
__Pyx_AddTraceback("pandas._libs.window.MockFixedWindowIndexer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "pandas/_libs/window.pyx":178 | |
* | |
* """ | |
* def __init__(self, ndarray input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* bint left_closed, bint right_closed, | |
* object index=None, object floor=None): | |
*/ | |
/* Python wrapper */ | |
static int __pyx_pw_6pandas_5_libs_6window_18FixedWindowIndexer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static int __pyx_pw_6pandas_5_libs_6window_18FixedWindowIndexer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
CYTHON_UNUSED int __pyx_v_left_closed; | |
CYTHON_UNUSED int __pyx_v_right_closed; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_floor = 0; | |
int __pyx_r; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_left_closed,&__pyx_n_s_right_closed,&__pyx_n_s_index,&__pyx_n_s_floor,0}; | |
PyObject* values[7] = {0,0,0,0,0,0,0}; | |
/* "pandas/_libs/window.pyx":180 | |
* def __init__(self, ndarray input, int64_t win, int64_t minp, | |
* bint left_closed, bint right_closed, | |
* object index=None, object floor=None): # <<<<<<<<<<<<<< | |
* cdef ndarray start_s, start_e, end_s, end_e | |
* | |
*/ | |
values[5] = ((PyObject *)Py_None); | |
values[6] = ((PyObject *)Py_None); | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); | |
CYTHON_FALLTHROUGH; | |
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); | |
CYTHON_FALLTHROUGH; | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 7, 1); __PYX_ERR(0, 178, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 7, 2); __PYX_ERR(0, 178, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_left_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 7, 3); __PYX_ERR(0, 178, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_right_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 7, 4); __PYX_ERR(0, 178, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 5: | |
if (kw_args > 0) { | |
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index); | |
if (value) { values[5] = value; kw_args--; } | |
} | |
CYTHON_FALLTHROUGH; | |
case 6: | |
if (kw_args > 0) { | |
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_floor); | |
if (value) { values[6] = value; kw_args--; } | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 178, __pyx_L3_error) | |
} | |
} else { | |
switch (PyTuple_GET_SIZE(__pyx_args)) { | |
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); | |
CYTHON_FALLTHROUGH; | |
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); | |
CYTHON_FALLTHROUGH; | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L3_error) | |
__pyx_v_left_closed = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_left_closed == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L3_error) | |
__pyx_v_right_closed = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_right_closed == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L3_error) | |
__pyx_v_index = values[5]; | |
__pyx_v_floor = values[6]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 178, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.FixedWindowIndexer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return -1; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 178, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_18FixedWindowIndexer___init__(((struct __pyx_obj_6pandas_5_libs_6window_FixedWindowIndexer *)__pyx_v_self), __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_left_closed, __pyx_v_right_closed, __pyx_v_index, __pyx_v_floor); | |
/* "pandas/_libs/window.pyx":178 | |
* | |
* """ | |
* def __init__(self, ndarray input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* bint left_closed, bint right_closed, | |
* object index=None, object floor=None): | |
*/ | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = -1; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static int __pyx_pf_6pandas_5_libs_6window_18FixedWindowIndexer___init__(struct __pyx_obj_6pandas_5_libs_6window_FixedWindowIndexer *__pyx_v_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, CYTHON_UNUSED int __pyx_v_left_closed, CYTHON_UNUSED int __pyx_v_right_closed, PyObject *__pyx_v_index, PyObject *__pyx_v_floor) { | |
PyArrayObject *__pyx_v_start_s = 0; | |
PyArrayObject *__pyx_v_start_e = 0; | |
PyArrayObject *__pyx_v_end_s = 0; | |
PyArrayObject *__pyx_v_end_e = 0; | |
int __pyx_r; | |
__Pyx_RefNannyDeclarations | |
int __pyx_t_1; | |
Py_ssize_t __pyx_t_2; | |
PyObject *__pyx_t_3 = NULL; | |
PyObject *__pyx_t_4 = NULL; | |
PyObject *__pyx_t_5 = NULL; | |
PyObject *__pyx_t_6 = NULL; | |
PyObject *__pyx_t_7 = NULL; | |
__pyx_t_5numpy_int64_t __pyx_t_8; | |
__Pyx_RefNannySetupContext("__init__", 0); | |
/* "pandas/_libs/window.pyx":183 | |
* cdef ndarray start_s, start_e, end_s, end_e | |
* | |
* assert index is None # <<<<<<<<<<<<<< | |
* self.is_variable = 0 | |
* self.N = len(input) | |
*/ | |
#ifndef CYTHON_WITHOUT_ASSERTIONS | |
if (unlikely(!Py_OptimizeFlag)) { | |
__pyx_t_1 = (__pyx_v_index == Py_None); | |
if (unlikely(!(__pyx_t_1 != 0))) { | |
PyErr_SetNone(PyExc_AssertionError); | |
__PYX_ERR(0, 183, __pyx_L1_error) | |
} | |
} | |
#endif | |
/* "pandas/_libs/window.pyx":184 | |
* | |
* assert index is None | |
* self.is_variable = 0 # <<<<<<<<<<<<<< | |
* self.N = len(input) | |
* self.minp = _check_minp(win, minp, self.N, floor=floor) | |
*/ | |
__pyx_v_self->__pyx_base.is_variable = 0; | |
/* "pandas/_libs/window.pyx":185 | |
* assert index is None | |
* self.is_variable = 0 | |
* self.N = len(input) # <<<<<<<<<<<<<< | |
* self.minp = _check_minp(win, minp, self.N, floor=floor) | |
* | |
*/ | |
__pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 185, __pyx_L1_error) | |
__pyx_v_self->__pyx_base.N = __pyx_t_2; | |
/* "pandas/_libs/window.pyx":186 | |
* self.is_variable = 0 | |
* self.N = len(input) | |
* self.minp = _check_minp(win, minp, self.N, floor=floor) # <<<<<<<<<<<<<< | |
* | |
* start_s = np.zeros(win, dtype='int64') | |
*/ | |
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_win); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_minp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__pyx_t_6 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.N); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 186, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_7); | |
__Pyx_GIVEREF(__pyx_t_4); | |
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); | |
__Pyx_GIVEREF(__pyx_t_5); | |
PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5); | |
__Pyx_GIVEREF(__pyx_t_6); | |
PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6); | |
__pyx_t_4 = 0; | |
__pyx_t_5 = 0; | |
__pyx_t_6 = 0; | |
__pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_floor, __pyx_v_floor) < 0) __PYX_ERR(0, 186, __pyx_L1_error) | |
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_DECREF(__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; | |
__pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_8 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__pyx_v_self->__pyx_base.minp = __pyx_t_8; | |
/* "pandas/_libs/window.pyx":188 | |
* self.minp = _check_minp(win, minp, self.N, floor=floor) | |
* | |
* start_s = np.zeros(win, dtype='int64') # <<<<<<<<<<<<<< | |
* start_e = np.arange(win, self.N, dtype='int64') - win + 1 | |
* self.start = np.concatenate([start_s, start_e]) | |
*/ | |
__pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 188, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 188, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_win); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 188, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 188, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_7); | |
__Pyx_GIVEREF(__pyx_t_5); | |
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); | |
__pyx_t_5 = 0; | |
__pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 188, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 188, __pyx_L1_error) | |
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 188, __pyx_L1_error) | |
__pyx_v_start_s = ((PyArrayObject *)__pyx_t_3); | |
__pyx_t_3 = 0; | |
/* "pandas/_libs/window.pyx":189 | |
* | |
* start_s = np.zeros(win, dtype='int64') | |
* start_e = np.arange(win, self.N, dtype='int64') - win + 1 # <<<<<<<<<<<<<< | |
* self.start = np.concatenate([start_s, start_e]) | |
* | |
*/ | |
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_arange); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 189, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
__pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_win); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__pyx_t_7 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.N); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 189, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_7); | |
__pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 189, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_GIVEREF(__pyx_t_3); | |
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); | |
__Pyx_GIVEREF(__pyx_t_7); | |
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7); | |
__pyx_t_3 = 0; | |
__pyx_t_7 = 0; | |
__pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 189, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_7); | |
if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 189, __pyx_L1_error) | |
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
__pyx_t_7 = __Pyx_PyInt_From_npy_int64(__pyx_v_win); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 189, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_7); | |
__pyx_t_6 = PyNumber_Subtract(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 189, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
__pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 189, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_7); | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 189, __pyx_L1_error) | |
__pyx_v_start_e = ((PyArrayObject *)__pyx_t_7); | |
__pyx_t_7 = 0; | |
/* "pandas/_libs/window.pyx":190 | |
* start_s = np.zeros(win, dtype='int64') | |
* start_e = np.arange(win, self.N, dtype='int64') - win + 1 | |
* self.start = np.concatenate([start_s, start_e]) # <<<<<<<<<<<<<< | |
* | |
* end_s = np.arange(win, dtype='int64') + 1 | |
*/ | |
__pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_INCREF(((PyObject *)__pyx_v_start_s)); | |
__Pyx_GIVEREF(((PyObject *)__pyx_v_start_s)); | |
PyList_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_start_s)); | |
__Pyx_INCREF(((PyObject *)__pyx_v_start_e)); | |
__Pyx_GIVEREF(((PyObject *)__pyx_v_start_e)); | |
PyList_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_start_e)); | |
__pyx_t_5 = NULL; | |
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { | |
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); | |
if (likely(__pyx_t_5)) { | |
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
__Pyx_INCREF(__pyx_t_5); | |
__Pyx_INCREF(function); | |
__Pyx_DECREF_SET(__pyx_t_3, function); | |
} | |
} | |
if (!__pyx_t_5) { | |
__pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 190, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__Pyx_GOTREF(__pyx_t_7); | |
} else { | |
#if CYTHON_FAST_PYCALL | |
if (PyFunction_Check(__pyx_t_3)) { | |
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6}; | |
__pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 190, __pyx_L1_error) | |
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_GOTREF(__pyx_t_7); | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
} else | |
#endif | |
#if CYTHON_FAST_PYCCALL | |
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { | |
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6}; | |
__pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 190, __pyx_L1_error) | |
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_GOTREF(__pyx_t_7); | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
} else | |
#endif | |
{ | |
__pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL; | |
__Pyx_GIVEREF(__pyx_t_6); | |
PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_6); | |
__pyx_t_6 = 0; | |
__pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 190, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_7); | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
} | |
} | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 190, __pyx_L1_error) | |
__Pyx_GIVEREF(__pyx_t_7); | |
__Pyx_GOTREF(__pyx_v_self->__pyx_base.start); | |
__Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.start)); | |
__pyx_v_self->__pyx_base.start = ((PyArrayObject *)__pyx_t_7); | |
__pyx_t_7 = 0; | |
/* "pandas/_libs/window.pyx":192 | |
* self.start = np.concatenate([start_s, start_e]) | |
* | |
* end_s = np.arange(win, dtype='int64') + 1 # <<<<<<<<<<<<<< | |
* end_e = start_e + win | |
* self.end = np.concatenate([end_s, end_e]) | |
*/ | |
__pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 192, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_7); | |
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_arange); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
__pyx_t_7 = __Pyx_PyInt_From_npy_int64(__pyx_v_win); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 192, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_7); | |
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__Pyx_GIVEREF(__pyx_t_7); | |
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); | |
__pyx_t_7 = 0; | |
__pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 192, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_7); | |
if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 192, __pyx_L1_error) | |
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 192, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
__pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 192, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_7); | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 192, __pyx_L1_error) | |
__pyx_v_end_s = ((PyArrayObject *)__pyx_t_7); | |
__pyx_t_7 = 0; | |
/* "pandas/_libs/window.pyx":193 | |
* | |
* end_s = np.arange(win, dtype='int64') + 1 | |
* end_e = start_e + win # <<<<<<<<<<<<<< | |
* self.end = np.concatenate([end_s, end_e]) | |
* self.win = win | |
*/ | |
__pyx_t_7 = __Pyx_PyInt_From_npy_int64(__pyx_v_win); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 193, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_7); | |
__pyx_t_6 = PyNumber_Add(((PyObject *)__pyx_v_start_e), __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 193, __pyx_L1_error) | |
__pyx_v_end_e = ((PyArrayObject *)__pyx_t_6); | |
__pyx_t_6 = 0; | |
/* "pandas/_libs/window.pyx":194 | |
* end_s = np.arange(win, dtype='int64') + 1 | |
* end_e = start_e + win | |
* self.end = np.concatenate([end_s, end_e]) # <<<<<<<<<<<<<< | |
* self.win = win | |
* | |
*/ | |
__pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 194, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_7); | |
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
__pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 194, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_7); | |
__Pyx_INCREF(((PyObject *)__pyx_v_end_s)); | |
__Pyx_GIVEREF(((PyObject *)__pyx_v_end_s)); | |
PyList_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_end_s)); | |
__Pyx_INCREF(((PyObject *)__pyx_v_end_e)); | |
__Pyx_GIVEREF(((PyObject *)__pyx_v_end_e)); | |
PyList_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_v_end_e)); | |
__pyx_t_3 = NULL; | |
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { | |
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); | |
if (likely(__pyx_t_3)) { | |
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); | |
__Pyx_INCREF(__pyx_t_3); | |
__Pyx_INCREF(function); | |
__Pyx_DECREF_SET(__pyx_t_4, function); | |
} | |
} | |
if (!__pyx_t_3) { | |
__pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 194, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
__Pyx_GOTREF(__pyx_t_6); | |
} else { | |
#if CYTHON_FAST_PYCALL | |
if (PyFunction_Check(__pyx_t_4)) { | |
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_7}; | |
__pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 194, __pyx_L1_error) | |
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
} else | |
#endif | |
#if CYTHON_FAST_PYCCALL | |
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { | |
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_7}; | |
__pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 194, __pyx_L1_error) | |
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
} else | |
#endif | |
{ | |
__pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 194, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; | |
__Pyx_GIVEREF(__pyx_t_7); | |
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_7); | |
__pyx_t_7 = 0; | |
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 194, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
} | |
} | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 194, __pyx_L1_error) | |
__Pyx_GIVEREF(__pyx_t_6); | |
__Pyx_GOTREF(__pyx_v_self->__pyx_base.end); | |
__Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.end)); | |
__pyx_v_self->__pyx_base.end = ((PyArrayObject *)__pyx_t_6); | |
__pyx_t_6 = 0; | |
/* "pandas/_libs/window.pyx":195 | |
* end_e = start_e + win | |
* self.end = np.concatenate([end_s, end_e]) | |
* self.win = win # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_v_self->__pyx_base.win = __pyx_v_win; | |
/* "pandas/_libs/window.pyx":178 | |
* | |
* """ | |
* def __init__(self, ndarray input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* bint left_closed, bint right_closed, | |
* object index=None, object floor=None): | |
*/ | |
/* function exit code */ | |
__pyx_r = 0; | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__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_AddTraceback("pandas._libs.window.FixedWindowIndexer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = -1; | |
__pyx_L0:; | |
__Pyx_XDECREF((PyObject *)__pyx_v_start_s); | |
__Pyx_XDECREF((PyObject *)__pyx_v_start_e); | |
__Pyx_XDECREF((PyObject *)__pyx_v_end_s); | |
__Pyx_XDECREF((PyObject *)__pyx_v_end_e); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "(tree fragment)":1 | |
* def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
* cdef bint use_setstate | |
* state = (self.N, self.end, self.is_variable, self.minp, self.start, self.win) | |
*/ | |
/* Python wrapper */ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_18FixedWindowIndexer_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_18FixedWindowIndexer_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_18FixedWindowIndexer_2__reduce_cython__(((struct __pyx_obj_6pandas_5_libs_6window_FixedWindowIndexer *)__pyx_v_self)); | |
/* function exit code */ | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_18FixedWindowIndexer_2__reduce_cython__(struct __pyx_obj_6pandas_5_libs_6window_FixedWindowIndexer *__pyx_v_self) { | |
int __pyx_v_use_setstate; | |
PyObject *__pyx_v_state = NULL; | |
PyObject *__pyx_v__dict = NULL; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
PyObject *__pyx_t_2 = NULL; | |
PyObject *__pyx_t_3 = NULL; | |
PyObject *__pyx_t_4 = NULL; | |
PyObject *__pyx_t_5 = NULL; | |
int __pyx_t_6; | |
int __pyx_t_7; | |
int __pyx_t_8; | |
__Pyx_RefNannySetupContext("__reduce_cython__", 0); | |
/* "(tree fragment)":3 | |
* def __reduce_cython__(self): | |
* cdef bint use_setstate | |
* state = (self.N, self.end, self.is_variable, self.minp, self.start, self.win) # <<<<<<<<<<<<<< | |
* _dict = getattr(self, '__dict__', None) | |
* if _dict is not None: | |
*/ | |
__pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.N); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base.is_variable); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_2); | |
__pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.minp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.win); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_GIVEREF(__pyx_t_1); | |
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); | |
__Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.end)); | |
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.end)); | |
PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_self->__pyx_base.end)); | |
__Pyx_GIVEREF(__pyx_t_2); | |
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2); | |
__Pyx_GIVEREF(__pyx_t_3); | |
PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_3); | |
__Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.start)); | |
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.start)); | |
PyTuple_SET_ITEM(__pyx_t_5, 4, ((PyObject *)__pyx_v_self->__pyx_base.start)); | |
__Pyx_GIVEREF(__pyx_t_4); | |
PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_4); | |
__pyx_t_1 = 0; | |
__pyx_t_2 = 0; | |
__pyx_t_3 = 0; | |
__pyx_t_4 = 0; | |
__pyx_v_state = ((PyObject*)__pyx_t_5); | |
__pyx_t_5 = 0; | |
/* "(tree fragment)":4 | |
* cdef bint use_setstate | |
* state = (self.N, self.end, self.is_variable, self.minp, self.start, self.win) | |
* _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< | |
* if _dict is not None: | |
* state += (_dict,) | |
*/ | |
__pyx_t_5 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 4, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__pyx_v__dict = __pyx_t_5; | |
__pyx_t_5 = 0; | |
/* "(tree fragment)":5 | |
* state = (self.N, self.end, self.is_variable, self.minp, self.start, self.win) | |
* _dict = getattr(self, '__dict__', None) | |
* if _dict is not None: # <<<<<<<<<<<<<< | |
* state += (_dict,) | |
* use_setstate = True | |
*/ | |
__pyx_t_6 = (__pyx_v__dict != Py_None); | |
__pyx_t_7 = (__pyx_t_6 != 0); | |
if (__pyx_t_7) { | |
/* "(tree fragment)":6 | |
* _dict = getattr(self, '__dict__', None) | |
* if _dict is not None: | |
* state += (_dict,) # <<<<<<<<<<<<<< | |
* use_setstate = True | |
* else: | |
*/ | |
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_INCREF(__pyx_v__dict); | |
__Pyx_GIVEREF(__pyx_v__dict); | |
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v__dict); | |
__pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); | |
__pyx_t_4 = 0; | |
/* "(tree fragment)":7 | |
* if _dict is not None: | |
* state += (_dict,) | |
* use_setstate = True # <<<<<<<<<<<<<< | |
* else: | |
* use_setstate = self.end is not None or self.start is not None | |
*/ | |
__pyx_v_use_setstate = 1; | |
/* "(tree fragment)":5 | |
* state = (self.N, self.end, self.is_variable, self.minp, self.start, self.win) | |
* _dict = getattr(self, '__dict__', None) | |
* if _dict is not None: # <<<<<<<<<<<<<< | |
* state += (_dict,) | |
* use_setstate = True | |
*/ | |
goto __pyx_L3; | |
} | |
/* "(tree fragment)":9 | |
* use_setstate = True | |
* else: | |
* use_setstate = self.end is not None or self.start is not None # <<<<<<<<<<<<<< | |
* if use_setstate: | |
* return __pyx_unpickle_FixedWindowIndexer, (type(self), 0x5834fb3, None), state | |
*/ | |
/*else*/ { | |
__pyx_t_6 = (((PyObject *)__pyx_v_self->__pyx_base.end) != Py_None); | |
__pyx_t_8 = (__pyx_t_6 != 0); | |
if (!__pyx_t_8) { | |
} else { | |
__pyx_t_7 = __pyx_t_8; | |
goto __pyx_L4_bool_binop_done; | |
} | |
__pyx_t_8 = (((PyObject *)__pyx_v_self->__pyx_base.start) != Py_None); | |
__pyx_t_6 = (__pyx_t_8 != 0); | |
__pyx_t_7 = __pyx_t_6; | |
__pyx_L4_bool_binop_done:; | |
__pyx_v_use_setstate = __pyx_t_7; | |
} | |
__pyx_L3:; | |
/* "(tree fragment)":10 | |
* else: | |
* use_setstate = self.end is not None or self.start is not None | |
* if use_setstate: # <<<<<<<<<<<<<< | |
* return __pyx_unpickle_FixedWindowIndexer, (type(self), 0x5834fb3, None), state | |
* else: | |
*/ | |
__pyx_t_7 = (__pyx_v_use_setstate != 0); | |
if (__pyx_t_7) { | |
/* "(tree fragment)":11 | |
* use_setstate = self.end is not None or self.start is not None | |
* if use_setstate: | |
* return __pyx_unpickle_FixedWindowIndexer, (type(self), 0x5834fb3, None), state # <<<<<<<<<<<<<< | |
* else: | |
* return __pyx_unpickle_FixedWindowIndexer, (type(self), 0x5834fb3, state) | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_FixedWindowIndexe); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 11, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 11, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
__Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
__Pyx_INCREF(__pyx_int_92491699); | |
__Pyx_GIVEREF(__pyx_int_92491699); | |
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_92491699); | |
__Pyx_INCREF(Py_None); | |
__Pyx_GIVEREF(Py_None); | |
PyTuple_SET_ITEM(__pyx_t_5, 2, Py_None); | |
__pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 11, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__Pyx_GIVEREF(__pyx_t_4); | |
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); | |
__Pyx_GIVEREF(__pyx_t_5); | |
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); | |
__Pyx_INCREF(__pyx_v_state); | |
__Pyx_GIVEREF(__pyx_v_state); | |
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state); | |
__pyx_t_4 = 0; | |
__pyx_t_5 = 0; | |
__pyx_r = __pyx_t_3; | |
__pyx_t_3 = 0; | |
goto __pyx_L0; | |
/* "(tree fragment)":10 | |
* else: | |
* use_setstate = self.end is not None or self.start is not None | |
* if use_setstate: # <<<<<<<<<<<<<< | |
* return __pyx_unpickle_FixedWindowIndexer, (type(self), 0x5834fb3, None), state | |
* else: | |
*/ | |
} | |
/* "(tree fragment)":13 | |
* return __pyx_unpickle_FixedWindowIndexer, (type(self), 0x5834fb3, None), state | |
* else: | |
* return __pyx_unpickle_FixedWindowIndexer, (type(self), 0x5834fb3, state) # <<<<<<<<<<<<<< | |
* def __setstate_cython__(self, __pyx_state): | |
* __pyx_unpickle_FixedWindowIndexer__set_state(self, __pyx_state) | |
*/ | |
/*else*/ { | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_FixedWindowIndexe); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
__Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
__Pyx_INCREF(__pyx_int_92491699); | |
__Pyx_GIVEREF(__pyx_int_92491699); | |
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_92491699); | |
__Pyx_INCREF(__pyx_v_state); | |
__Pyx_GIVEREF(__pyx_v_state); | |
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); | |
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__Pyx_GIVEREF(__pyx_t_3); | |
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); | |
__Pyx_GIVEREF(__pyx_t_5); | |
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); | |
__pyx_t_3 = 0; | |
__pyx_t_5 = 0; | |
__pyx_r = __pyx_t_4; | |
__pyx_t_4 = 0; | |
goto __pyx_L0; | |
} | |
/* "(tree fragment)":1 | |
* def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
* cdef bint use_setstate | |
* state = (self.N, self.end, self.is_variable, self.minp, self.start, self.win) | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
__Pyx_XDECREF(__pyx_t_2); | |
__Pyx_XDECREF(__pyx_t_3); | |
__Pyx_XDECREF(__pyx_t_4); | |
__Pyx_XDECREF(__pyx_t_5); | |
__Pyx_AddTraceback("pandas._libs.window.FixedWindowIndexer.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_XDECREF(__pyx_v_state); | |
__Pyx_XDECREF(__pyx_v__dict); | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "(tree fragment)":14 | |
* else: | |
* return __pyx_unpickle_FixedWindowIndexer, (type(self), 0x5834fb3, state) | |
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
* __pyx_unpickle_FixedWindowIndexer__set_state(self, __pyx_state) | |
*/ | |
/* Python wrapper */ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_18FixedWindowIndexer_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_18FixedWindowIndexer_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_18FixedWindowIndexer_4__setstate_cython__(((struct __pyx_obj_6pandas_5_libs_6window_FixedWindowIndexer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); | |
/* function exit code */ | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_18FixedWindowIndexer_4__setstate_cython__(struct __pyx_obj_6pandas_5_libs_6window_FixedWindowIndexer *__pyx_v_self, PyObject *__pyx_v___pyx_state) { | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
__Pyx_RefNannySetupContext("__setstate_cython__", 0); | |
/* "(tree fragment)":15 | |
* return __pyx_unpickle_FixedWindowIndexer, (type(self), 0x5834fb3, state) | |
* def __setstate_cython__(self, __pyx_state): | |
* __pyx_unpickle_FixedWindowIndexer__set_state(self, __pyx_state) # <<<<<<<<<<<<<< | |
*/ | |
if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 15, __pyx_L1_error) | |
__pyx_t_1 = __pyx_f_6pandas_5_libs_6window___pyx_unpickle_FixedWindowIndexer__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
/* "(tree fragment)":14 | |
* else: | |
* return __pyx_unpickle_FixedWindowIndexer, (type(self), 0x5834fb3, state) | |
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
* __pyx_unpickle_FixedWindowIndexer__set_state(self, __pyx_state) | |
*/ | |
/* function exit code */ | |
__pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
__Pyx_AddTraceback("pandas._libs.window.FixedWindowIndexer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "pandas/_libs/window.pyx":224 | |
* unit for flooring the unit | |
* """ | |
* def __init__(self, ndarray input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* bint left_closed, bint right_closed, ndarray index, | |
* object floor=None): | |
*/ | |
/* Python wrapper */ | |
static int __pyx_pw_6pandas_5_libs_6window_21VariableWindowIndexer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static int __pyx_pw_6pandas_5_libs_6window_21VariableWindowIndexer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
CYTHON_UNUSED PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
int __pyx_v_left_closed; | |
int __pyx_v_right_closed; | |
PyArrayObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_floor = 0; | |
int __pyx_r; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_left_closed,&__pyx_n_s_right_closed,&__pyx_n_s_index,&__pyx_n_s_floor,0}; | |
PyObject* values[7] = {0,0,0,0,0,0,0}; | |
/* "pandas/_libs/window.pyx":226 | |
* def __init__(self, ndarray input, int64_t win, int64_t minp, | |
* bint left_closed, bint right_closed, ndarray index, | |
* object floor=None): # <<<<<<<<<<<<<< | |
* | |
* self.is_variable = 1 | |
*/ | |
values[6] = ((PyObject *)Py_None); | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); | |
CYTHON_FALLTHROUGH; | |
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); | |
CYTHON_FALLTHROUGH; | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 1); __PYX_ERR(0, 224, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 2); __PYX_ERR(0, 224, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_left_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 3); __PYX_ERR(0, 224, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_right_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 4); __PYX_ERR(0, 224, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 5: | |
if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 5); __PYX_ERR(0, 224, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 6: | |
if (kw_args > 0) { | |
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_floor); | |
if (value) { values[6] = value; kw_args--; } | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 224, __pyx_L3_error) | |
} | |
} else { | |
switch (PyTuple_GET_SIZE(__pyx_args)) { | |
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); | |
CYTHON_FALLTHROUGH; | |
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L3_error) | |
__pyx_v_left_closed = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_left_closed == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L3_error) | |
__pyx_v_right_closed = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_right_closed == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L3_error) | |
__pyx_v_index = ((PyArrayObject *)values[5]); | |
__pyx_v_floor = values[6]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 224, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.VariableWindowIndexer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return -1; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 224, __pyx_L1_error) | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) __PYX_ERR(0, 225, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_21VariableWindowIndexer___init__(((struct __pyx_obj_6pandas_5_libs_6window_VariableWindowIndexer *)__pyx_v_self), __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_left_closed, __pyx_v_right_closed, __pyx_v_index, __pyx_v_floor); | |
/* "pandas/_libs/window.pyx":224 | |
* unit for flooring the unit | |
* """ | |
* def __init__(self, ndarray input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* bint left_closed, bint right_closed, ndarray index, | |
* object floor=None): | |
*/ | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = -1; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static int __pyx_pf_6pandas_5_libs_6window_21VariableWindowIndexer___init__(struct __pyx_obj_6pandas_5_libs_6window_VariableWindowIndexer *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, int __pyx_v_left_closed, int __pyx_v_right_closed, PyArrayObject *__pyx_v_index, PyObject *__pyx_v_floor) { | |
int __pyx_r; | |
__Pyx_RefNannyDeclarations | |
Py_ssize_t __pyx_t_1; | |
PyObject *__pyx_t_2 = NULL; | |
PyObject *__pyx_t_3 = NULL; | |
PyObject *__pyx_t_4 = NULL; | |
PyObject *__pyx_t_5 = NULL; | |
PyObject *__pyx_t_6 = NULL; | |
__pyx_t_5numpy_int64_t __pyx_t_7; | |
PyObject *__pyx_t_8 = NULL; | |
int __pyx_t_9; | |
PyObject *__pyx_t_10 = NULL; | |
__Pyx_RefNannySetupContext("__init__", 0); | |
/* "pandas/_libs/window.pyx":228 | |
* object floor=None): | |
* | |
* self.is_variable = 1 # <<<<<<<<<<<<<< | |
* self.N = len(index) | |
* self.minp = _check_minp(win, minp, self.N, floor=floor) | |
*/ | |
__pyx_v_self->__pyx_base.is_variable = 1; | |
/* "pandas/_libs/window.pyx":229 | |
* | |
* self.is_variable = 1 | |
* self.N = len(index) # <<<<<<<<<<<<<< | |
* self.minp = _check_minp(win, minp, self.N, floor=floor) | |
* | |
*/ | |
__pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 229, __pyx_L1_error) | |
__pyx_v_self->__pyx_base.N = __pyx_t_1; | |
/* "pandas/_libs/window.pyx":230 | |
* self.is_variable = 1 | |
* self.N = len(index) | |
* self.minp = _check_minp(win, minp, self.N, floor=floor) # <<<<<<<<<<<<<< | |
* | |
* self.start = np.empty(self.N, dtype='int64') | |
*/ | |
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_minp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_2); | |
__pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_win); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_minp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 230, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 230, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 230, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_GIVEREF(__pyx_t_3); | |
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); | |
__Pyx_GIVEREF(__pyx_t_4); | |
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); | |
__Pyx_GIVEREF(__pyx_t_5); | |
PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5); | |
__pyx_t_3 = 0; | |
__pyx_t_4 = 0; | |
__pyx_t_5 = 0; | |
__pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 230, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_floor, __pyx_v_floor) < 0) __PYX_ERR(0, 230, __pyx_L1_error) | |
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 230, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__pyx_t_7 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_7 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
__pyx_v_self->__pyx_base.minp = __pyx_t_7; | |
/* "pandas/_libs/window.pyx":232 | |
* self.minp = _check_minp(win, minp, self.N, floor=floor) | |
* | |
* self.start = np.empty(self.N, dtype='int64') # <<<<<<<<<<<<<< | |
* self.start.fill(-1) | |
* | |
*/ | |
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 232, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
__pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.N); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_GIVEREF(__pyx_t_4); | |
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); | |
__pyx_t_4 = 0; | |
__pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 232, __pyx_L1_error) | |
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_2); | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 232, __pyx_L1_error) | |
__Pyx_GIVEREF(__pyx_t_2); | |
__Pyx_GOTREF(__pyx_v_self->__pyx_base.start); | |
__Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.start)); | |
__pyx_v_self->__pyx_base.start = ((PyArrayObject *)__pyx_t_2); | |
__pyx_t_2 = 0; | |
/* "pandas/_libs/window.pyx":233 | |
* | |
* self.start = np.empty(self.N, dtype='int64') | |
* self.start.fill(-1) # <<<<<<<<<<<<<< | |
* | |
* self.end = np.empty(self.N, dtype='int64') | |
*/ | |
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.start), __pyx_n_s_fill); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_2); | |
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
/* "pandas/_libs/window.pyx":235 | |
* self.start.fill(-1) | |
* | |
* self.end = np.empty(self.N, dtype='int64') # <<<<<<<<<<<<<< | |
* self.end.fill(-1) | |
* | |
*/ | |
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_2); | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
__pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.N); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_GIVEREF(__pyx_t_4); | |
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); | |
__pyx_t_4 = 0; | |
__pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 235, __pyx_L1_error) | |
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 235, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 235, __pyx_L1_error) | |
__Pyx_GIVEREF(__pyx_t_5); | |
__Pyx_GOTREF(__pyx_v_self->__pyx_base.end); | |
__Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.end)); | |
__pyx_v_self->__pyx_base.end = ((PyArrayObject *)__pyx_t_5); | |
__pyx_t_5 = 0; | |
/* "pandas/_libs/window.pyx":236 | |
* | |
* self.end = np.empty(self.N, dtype='int64') | |
* self.end.fill(-1) # <<<<<<<<<<<<<< | |
* | |
* self.build(index, win, left_closed, right_closed) | |
*/ | |
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.end), __pyx_n_s_fill); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 236, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
/* "pandas/_libs/window.pyx":238 | |
* self.end.fill(-1) | |
* | |
* self.build(index, win, left_closed, right_closed) # <<<<<<<<<<<<<< | |
* | |
* # max window size | |
*/ | |
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_build); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 238, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__pyx_t_6 = __Pyx_PyInt_From_npy_int64(__pyx_v_win); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_left_closed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_2); | |
__pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_right_closed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__pyx_t_8 = NULL; | |
__pyx_t_9 = 0; | |
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { | |
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); | |
if (likely(__pyx_t_8)) { | |
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); | |
__Pyx_INCREF(__pyx_t_8); | |
__Pyx_INCREF(function); | |
__Pyx_DECREF_SET(__pyx_t_5, function); | |
__pyx_t_9 = 1; | |
} | |
} | |
#if CYTHON_FAST_PYCALL | |
if (PyFunction_Check(__pyx_t_5)) { | |
PyObject *__pyx_temp[5] = {__pyx_t_8, ((PyObject *)__pyx_v_index), __pyx_t_6, __pyx_t_2, __pyx_t_3}; | |
__pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 4+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error) | |
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; | |
__Pyx_GOTREF(__pyx_t_4); | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
} else | |
#endif | |
#if CYTHON_FAST_PYCCALL | |
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { | |
PyObject *__pyx_temp[5] = {__pyx_t_8, ((PyObject *)__pyx_v_index), __pyx_t_6, __pyx_t_2, __pyx_t_3}; | |
__pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 4+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error) | |
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; | |
__Pyx_GOTREF(__pyx_t_4); | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
} else | |
#endif | |
{ | |
__pyx_t_10 = PyTuple_New(4+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 238, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_10); | |
if (__pyx_t_8) { | |
__Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; | |
} | |
__Pyx_INCREF(((PyObject *)__pyx_v_index)); | |
__Pyx_GIVEREF(((PyObject *)__pyx_v_index)); | |
PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, ((PyObject *)__pyx_v_index)); | |
__Pyx_GIVEREF(__pyx_t_6); | |
PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_6); | |
__Pyx_GIVEREF(__pyx_t_2); | |
PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_2); | |
__Pyx_GIVEREF(__pyx_t_3); | |
PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_9, __pyx_t_3); | |
__pyx_t_6 = 0; | |
__pyx_t_2 = 0; | |
__pyx_t_3 = 0; | |
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; | |
} | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
/* "pandas/_libs/window.pyx":241 | |
* | |
* # max window size | |
* self.win = (self.end - self.start).max() # <<<<<<<<<<<<<< | |
* | |
* def build(self, ndarray[int64_t] index, int64_t win, bint left_closed, | |
*/ | |
__pyx_t_5 = PyNumber_Subtract(((PyObject *)__pyx_v_self->__pyx_base.end), ((PyObject *)__pyx_v_self->__pyx_base.start)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 241, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_max); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 241, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_10); | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__pyx_t_5 = NULL; | |
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) { | |
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10); | |
if (likely(__pyx_t_5)) { | |
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); | |
__Pyx_INCREF(__pyx_t_5); | |
__Pyx_INCREF(function); | |
__Pyx_DECREF_SET(__pyx_t_10, function); | |
} | |
} | |
if (__pyx_t_5) { | |
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
} else { | |
__pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error) | |
} | |
__Pyx_GOTREF(__pyx_t_4); | |
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; | |
__pyx_t_7 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_7 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 241, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
__pyx_v_self->__pyx_base.win = __pyx_t_7; | |
/* "pandas/_libs/window.pyx":224 | |
* unit for flooring the unit | |
* """ | |
* def __init__(self, ndarray input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* bint left_closed, bint right_closed, ndarray index, | |
* object floor=None): | |
*/ | |
/* function exit code */ | |
__pyx_r = 0; | |
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_8); | |
__Pyx_XDECREF(__pyx_t_10); | |
__Pyx_AddTraceback("pandas._libs.window.VariableWindowIndexer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = -1; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "pandas/_libs/window.pyx":243 | |
* self.win = (self.end - self.start).max() | |
* | |
* def build(self, ndarray[int64_t] index, int64_t win, bint left_closed, # <<<<<<<<<<<<<< | |
* bint right_closed): | |
* | |
*/ | |
/* Python wrapper */ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_21VariableWindowIndexer_3build(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_21VariableWindowIndexer_3build(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_index = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
int __pyx_v_left_closed; | |
int __pyx_v_right_closed; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("build (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_win,&__pyx_n_s_left_closed,&__pyx_n_s_right_closed,0}; | |
PyObject* values[4] = {0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("build", 1, 4, 4, 1); __PYX_ERR(0, 243, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_left_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("build", 1, 4, 4, 2); __PYX_ERR(0, 243, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_right_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("build", 1, 4, 4, 3); __PYX_ERR(0, 243, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "build") < 0)) __PYX_ERR(0, 243, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 4) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
} | |
__pyx_v_index = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 243, __pyx_L3_error) | |
__pyx_v_left_closed = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_left_closed == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 243, __pyx_L3_error) | |
__pyx_v_right_closed = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_right_closed == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L3_error) | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("build", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 243, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.VariableWindowIndexer.build", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) __PYX_ERR(0, 243, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_21VariableWindowIndexer_2build(((struct __pyx_obj_6pandas_5_libs_6window_VariableWindowIndexer *)__pyx_v_self), __pyx_v_index, __pyx_v_win, __pyx_v_left_closed, __pyx_v_right_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_21VariableWindowIndexer_2build(struct __pyx_obj_6pandas_5_libs_6window_VariableWindowIndexer *__pyx_v_self, PyArrayObject *__pyx_v_index, __pyx_t_5numpy_int64_t __pyx_v_win, int __pyx_v_left_closed, int __pyx_v_right_closed) { | |
PyArrayObject *__pyx_v_start = 0; | |
PyArrayObject *__pyx_v_end = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_start_bound; | |
__pyx_t_5numpy_int64_t __pyx_v_end_bound; | |
__pyx_t_5numpy_int64_t __pyx_v_N; | |
Py_ssize_t __pyx_v_i; | |
Py_ssize_t __pyx_v_j; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_end; | |
__Pyx_Buffer __pyx_pybuffer_end; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_index; | |
__Pyx_Buffer __pyx_pybuffer_index; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_start; | |
__Pyx_Buffer __pyx_pybuffer_start; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
int __pyx_t_2; | |
PyObject *__pyx_t_3 = NULL; | |
PyObject *__pyx_t_4 = NULL; | |
PyObject *__pyx_t_5 = NULL; | |
__pyx_t_5numpy_int64_t __pyx_t_6; | |
Py_ssize_t __pyx_t_7; | |
int __pyx_t_8; | |
Py_ssize_t __pyx_t_9; | |
Py_ssize_t __pyx_t_10; | |
__pyx_t_5numpy_int64_t __pyx_t_11; | |
Py_ssize_t __pyx_t_12; | |
Py_ssize_t __pyx_t_13; | |
Py_ssize_t __pyx_t_14; | |
Py_ssize_t __pyx_t_15; | |
Py_ssize_t __pyx_t_16; | |
Py_ssize_t __pyx_t_17; | |
Py_ssize_t __pyx_t_18; | |
Py_ssize_t __pyx_t_19; | |
Py_ssize_t __pyx_t_20; | |
Py_ssize_t __pyx_t_21; | |
Py_ssize_t __pyx_t_22; | |
__pyx_t_5numpy_int64_t __pyx_t_23; | |
Py_ssize_t __pyx_t_24; | |
Py_ssize_t __pyx_t_25; | |
Py_ssize_t __pyx_t_26; | |
Py_ssize_t __pyx_t_27; | |
__Pyx_RefNannySetupContext("build", 0); | |
__pyx_pybuffer_start.pybuffer.buf = NULL; | |
__pyx_pybuffer_start.refcount = 0; | |
__pyx_pybuffernd_start.data = NULL; | |
__pyx_pybuffernd_start.rcbuffer = &__pyx_pybuffer_start; | |
__pyx_pybuffer_end.pybuffer.buf = NULL; | |
__pyx_pybuffer_end.refcount = 0; | |
__pyx_pybuffernd_end.data = NULL; | |
__pyx_pybuffernd_end.rcbuffer = &__pyx_pybuffer_end; | |
__pyx_pybuffer_index.pybuffer.buf = NULL; | |
__pyx_pybuffer_index.refcount = 0; | |
__pyx_pybuffernd_index.data = NULL; | |
__pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 243, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":251 | |
* Py_ssize_t i, j | |
* | |
* start = self.start # <<<<<<<<<<<<<< | |
* end = self.end | |
* N = self.N | |
*/ | |
__pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.start); | |
__Pyx_INCREF(__pyx_t_1); | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start.rcbuffer->pybuffer); | |
__pyx_t_2 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_start.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); | |
if (unlikely(__pyx_t_2 < 0)) { | |
PyErr_Fetch(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_start.rcbuffer->pybuffer, (PyObject*)__pyx_v_start, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { | |
Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); | |
__Pyx_RaiseBufferFallbackError(); | |
} else { | |
PyErr_Restore(__pyx_t_3, __pyx_t_4, __pyx_t_5); | |
} | |
__pyx_t_3 = __pyx_t_4 = __pyx_t_5 = 0; | |
} | |
__pyx_pybuffernd_start.diminfo[0].strides = __pyx_pybuffernd_start.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_start.diminfo[0].shape = __pyx_pybuffernd_start.rcbuffer->pybuffer.shape[0]; | |
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 251, __pyx_L1_error) | |
} | |
__pyx_v_start = ((PyArrayObject *)__pyx_t_1); | |
__pyx_t_1 = 0; | |
/* "pandas/_libs/window.pyx":252 | |
* | |
* start = self.start | |
* end = self.end # <<<<<<<<<<<<<< | |
* N = self.N | |
* | |
*/ | |
__pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.end); | |
__Pyx_INCREF(__pyx_t_1); | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end.rcbuffer->pybuffer); | |
__pyx_t_2 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_end.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); | |
if (unlikely(__pyx_t_2 < 0)) { | |
PyErr_Fetch(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3); | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_end.rcbuffer->pybuffer, (PyObject*)__pyx_v_end, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { | |
Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); | |
__Pyx_RaiseBufferFallbackError(); | |
} else { | |
PyErr_Restore(__pyx_t_5, __pyx_t_4, __pyx_t_3); | |
} | |
__pyx_t_5 = __pyx_t_4 = __pyx_t_3 = 0; | |
} | |
__pyx_pybuffernd_end.diminfo[0].strides = __pyx_pybuffernd_end.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_end.diminfo[0].shape = __pyx_pybuffernd_end.rcbuffer->pybuffer.shape[0]; | |
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 252, __pyx_L1_error) | |
} | |
__pyx_v_end = ((PyArrayObject *)__pyx_t_1); | |
__pyx_t_1 = 0; | |
/* "pandas/_libs/window.pyx":253 | |
* start = self.start | |
* end = self.end | |
* N = self.N # <<<<<<<<<<<<<< | |
* | |
* start[0] = 0 | |
*/ | |
__pyx_t_6 = __pyx_v_self->__pyx_base.N; | |
__pyx_v_N = __pyx_t_6; | |
/* "pandas/_libs/window.pyx":255 | |
* N = self.N | |
* | |
* start[0] = 0 # <<<<<<<<<<<<<< | |
* | |
* # right endpoint is closed | |
*/ | |
__pyx_t_7 = 0; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_start.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_start.diminfo[0].strides) = 0; | |
/* "pandas/_libs/window.pyx":258 | |
* | |
* # right endpoint is closed | |
* if right_closed: # <<<<<<<<<<<<<< | |
* end[0] = 1 | |
* # right endpoint is open | |
*/ | |
__pyx_t_8 = (__pyx_v_right_closed != 0); | |
if (__pyx_t_8) { | |
/* "pandas/_libs/window.pyx":259 | |
* # right endpoint is closed | |
* if right_closed: | |
* end[0] = 1 # <<<<<<<<<<<<<< | |
* # right endpoint is open | |
* else: | |
*/ | |
__pyx_t_9 = 0; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_end.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_end.diminfo[0].strides) = 1; | |
/* "pandas/_libs/window.pyx":258 | |
* | |
* # right endpoint is closed | |
* if right_closed: # <<<<<<<<<<<<<< | |
* end[0] = 1 | |
* # right endpoint is open | |
*/ | |
goto __pyx_L3; | |
} | |
/* "pandas/_libs/window.pyx":262 | |
* # right endpoint is open | |
* else: | |
* end[0] = 0 # <<<<<<<<<<<<<< | |
* | |
* with nogil: | |
*/ | |
/*else*/ { | |
__pyx_t_10 = 0; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_end.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_end.diminfo[0].strides) = 0; | |
} | |
__pyx_L3:; | |
/* "pandas/_libs/window.pyx":264 | |
* end[0] = 0 | |
* | |
* with nogil: # <<<<<<<<<<<<<< | |
* | |
* # start is start of slice interval (including) | |
*/ | |
{ | |
#ifdef WITH_THREAD | |
PyThreadState *_save; | |
Py_UNBLOCK_THREADS | |
__Pyx_FastGIL_Remember(); | |
#endif | |
/*try:*/ { | |
/* "pandas/_libs/window.pyx":268 | |
* # start is start of slice interval (including) | |
* # end is end of slice interval (not including) | |
* for i in range(1, N): # <<<<<<<<<<<<<< | |
* end_bound = index[i] | |
* start_bound = index[i] - win | |
*/ | |
__pyx_t_6 = __pyx_v_N; | |
__pyx_t_11 = __pyx_t_6; | |
for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { | |
__pyx_v_i = __pyx_t_12; | |
/* "pandas/_libs/window.pyx":269 | |
* # end is end of slice interval (not including) | |
* for i in range(1, N): | |
* end_bound = index[i] # <<<<<<<<<<<<<< | |
* start_bound = index[i] - win | |
* | |
*/ | |
__pyx_t_13 = __pyx_v_i; | |
__pyx_v_end_bound = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_index.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":270 | |
* for i in range(1, N): | |
* end_bound = index[i] | |
* start_bound = index[i] - win # <<<<<<<<<<<<<< | |
* | |
* # left endpoint is closed | |
*/ | |
__pyx_t_14 = __pyx_v_i; | |
__pyx_v_start_bound = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_index.diminfo[0].strides)) - __pyx_v_win); | |
/* "pandas/_libs/window.pyx":273 | |
* | |
* # left endpoint is closed | |
* if left_closed: # <<<<<<<<<<<<<< | |
* start_bound -= 1 | |
* | |
*/ | |
__pyx_t_8 = (__pyx_v_left_closed != 0); | |
if (__pyx_t_8) { | |
/* "pandas/_libs/window.pyx":274 | |
* # left endpoint is closed | |
* if left_closed: | |
* start_bound -= 1 # <<<<<<<<<<<<<< | |
* | |
* # advance the start bound until we are | |
*/ | |
__pyx_v_start_bound = (__pyx_v_start_bound - 1); | |
/* "pandas/_libs/window.pyx":273 | |
* | |
* # left endpoint is closed | |
* if left_closed: # <<<<<<<<<<<<<< | |
* start_bound -= 1 | |
* | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":278 | |
* # advance the start bound until we are | |
* # within the constraint | |
* start[i] = i # <<<<<<<<<<<<<< | |
* for j in range(start[i - 1], i): | |
* if index[j] > start_bound: | |
*/ | |
__pyx_t_15 = __pyx_v_i; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_start.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_start.diminfo[0].strides) = __pyx_v_i; | |
/* "pandas/_libs/window.pyx":279 | |
* # within the constraint | |
* start[i] = i | |
* for j in range(start[i - 1], i): # <<<<<<<<<<<<<< | |
* if index[j] > start_bound: | |
* start[i] = j | |
*/ | |
__pyx_t_16 = __pyx_v_i; | |
__pyx_t_17 = (__pyx_v_i - 1); | |
__pyx_t_18 = __pyx_t_16; | |
for (__pyx_t_19 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_start.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_start.diminfo[0].strides)); __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { | |
__pyx_v_j = __pyx_t_19; | |
/* "pandas/_libs/window.pyx":280 | |
* start[i] = i | |
* for j in range(start[i - 1], i): | |
* if index[j] > start_bound: # <<<<<<<<<<<<<< | |
* start[i] = j | |
* break | |
*/ | |
__pyx_t_20 = __pyx_v_j; | |
__pyx_t_8 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_index.diminfo[0].strides)) > __pyx_v_start_bound) != 0); | |
if (__pyx_t_8) { | |
/* "pandas/_libs/window.pyx":281 | |
* for j in range(start[i - 1], i): | |
* if index[j] > start_bound: | |
* start[i] = j # <<<<<<<<<<<<<< | |
* break | |
* | |
*/ | |
__pyx_t_21 = __pyx_v_i; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_start.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_start.diminfo[0].strides) = __pyx_v_j; | |
/* "pandas/_libs/window.pyx":282 | |
* if index[j] > start_bound: | |
* start[i] = j | |
* break # <<<<<<<<<<<<<< | |
* | |
* # end bound is previous end | |
*/ | |
goto __pyx_L11_break; | |
/* "pandas/_libs/window.pyx":280 | |
* start[i] = i | |
* for j in range(start[i - 1], i): | |
* if index[j] > start_bound: # <<<<<<<<<<<<<< | |
* start[i] = j | |
* break | |
*/ | |
} | |
} | |
__pyx_L11_break:; | |
/* "pandas/_libs/window.pyx":286 | |
* # end bound is previous end | |
* # or current index | |
* if index[end[i - 1]] <= end_bound: # <<<<<<<<<<<<<< | |
* end[i] = i + 1 | |
* else: | |
*/ | |
__pyx_t_22 = (__pyx_v_i - 1); | |
__pyx_t_23 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_end.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_end.diminfo[0].strides)); | |
__pyx_t_8 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_index.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_index.diminfo[0].strides)) <= __pyx_v_end_bound) != 0); | |
if (__pyx_t_8) { | |
/* "pandas/_libs/window.pyx":287 | |
* # or current index | |
* if index[end[i - 1]] <= end_bound: | |
* end[i] = i + 1 # <<<<<<<<<<<<<< | |
* else: | |
* end[i] = end[i - 1] | |
*/ | |
__pyx_t_24 = __pyx_v_i; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_end.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_end.diminfo[0].strides) = (__pyx_v_i + 1); | |
/* "pandas/_libs/window.pyx":286 | |
* # end bound is previous end | |
* # or current index | |
* if index[end[i - 1]] <= end_bound: # <<<<<<<<<<<<<< | |
* end[i] = i + 1 | |
* else: | |
*/ | |
goto __pyx_L13; | |
} | |
/* "pandas/_libs/window.pyx":289 | |
* end[i] = i + 1 | |
* else: | |
* end[i] = end[i - 1] # <<<<<<<<<<<<<< | |
* | |
* # right endpoint is open | |
*/ | |
/*else*/ { | |
__pyx_t_25 = (__pyx_v_i - 1); | |
__pyx_t_26 = __pyx_v_i; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_end.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_end.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_end.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_end.diminfo[0].strides)); | |
} | |
__pyx_L13:; | |
/* "pandas/_libs/window.pyx":292 | |
* | |
* # right endpoint is open | |
* if not right_closed: # <<<<<<<<<<<<<< | |
* end[i] -= 1 | |
* | |
*/ | |
__pyx_t_8 = ((!(__pyx_v_right_closed != 0)) != 0); | |
if (__pyx_t_8) { | |
/* "pandas/_libs/window.pyx":293 | |
* # right endpoint is open | |
* if not right_closed: | |
* end[i] -= 1 # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_t_27 = __pyx_v_i; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_end.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_end.diminfo[0].strides) -= 1; | |
/* "pandas/_libs/window.pyx":292 | |
* | |
* # right endpoint is open | |
* if not right_closed: # <<<<<<<<<<<<<< | |
* end[i] -= 1 | |
* | |
*/ | |
} | |
} | |
} | |
/* "pandas/_libs/window.pyx":264 | |
* end[0] = 0 | |
* | |
* with nogil: # <<<<<<<<<<<<<< | |
* | |
* # start is start of slice interval (including) | |
*/ | |
/*finally:*/ { | |
/*normal exit:*/{ | |
#ifdef WITH_THREAD | |
__Pyx_FastGIL_Forget(); | |
Py_BLOCK_THREADS | |
#endif | |
goto __pyx_L6; | |
} | |
__pyx_L6:; | |
} | |
} | |
/* "pandas/_libs/window.pyx":243 | |
* self.win = (self.end - self.start).max() | |
* | |
* def build(self, ndarray[int64_t] index, int64_t win, bint left_closed, # <<<<<<<<<<<<<< | |
* bint right_closed): | |
* | |
*/ | |
/* function exit code */ | |
__pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.VariableWindowIndexer.build", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XDECREF((PyObject *)__pyx_v_start); | |
__Pyx_XDECREF((PyObject *)__pyx_v_end); | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "(tree fragment)":1 | |
* def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
* cdef bint use_setstate | |
* state = (self.N, self.end, self.is_variable, self.minp, self.start, self.win) | |
*/ | |
/* Python wrapper */ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_21VariableWindowIndexer_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_21VariableWindowIndexer_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_21VariableWindowIndexer_4__reduce_cython__(((struct __pyx_obj_6pandas_5_libs_6window_VariableWindowIndexer *)__pyx_v_self)); | |
/* function exit code */ | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_21VariableWindowIndexer_4__reduce_cython__(struct __pyx_obj_6pandas_5_libs_6window_VariableWindowIndexer *__pyx_v_self) { | |
int __pyx_v_use_setstate; | |
PyObject *__pyx_v_state = NULL; | |
PyObject *__pyx_v__dict = NULL; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
PyObject *__pyx_t_2 = NULL; | |
PyObject *__pyx_t_3 = NULL; | |
PyObject *__pyx_t_4 = NULL; | |
PyObject *__pyx_t_5 = NULL; | |
int __pyx_t_6; | |
int __pyx_t_7; | |
int __pyx_t_8; | |
__Pyx_RefNannySetupContext("__reduce_cython__", 0); | |
/* "(tree fragment)":3 | |
* def __reduce_cython__(self): | |
* cdef bint use_setstate | |
* state = (self.N, self.end, self.is_variable, self.minp, self.start, self.win) # <<<<<<<<<<<<<< | |
* _dict = getattr(self, '__dict__', None) | |
* if _dict is not None: | |
*/ | |
__pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.N); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base.is_variable); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_2); | |
__pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.minp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->__pyx_base.win); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_GIVEREF(__pyx_t_1); | |
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); | |
__Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.end)); | |
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.end)); | |
PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_self->__pyx_base.end)); | |
__Pyx_GIVEREF(__pyx_t_2); | |
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2); | |
__Pyx_GIVEREF(__pyx_t_3); | |
PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_3); | |
__Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.start)); | |
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.start)); | |
PyTuple_SET_ITEM(__pyx_t_5, 4, ((PyObject *)__pyx_v_self->__pyx_base.start)); | |
__Pyx_GIVEREF(__pyx_t_4); | |
PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_4); | |
__pyx_t_1 = 0; | |
__pyx_t_2 = 0; | |
__pyx_t_3 = 0; | |
__pyx_t_4 = 0; | |
__pyx_v_state = ((PyObject*)__pyx_t_5); | |
__pyx_t_5 = 0; | |
/* "(tree fragment)":4 | |
* cdef bint use_setstate | |
* state = (self.N, self.end, self.is_variable, self.minp, self.start, self.win) | |
* _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< | |
* if _dict is not None: | |
* state += (_dict,) | |
*/ | |
__pyx_t_5 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 4, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__pyx_v__dict = __pyx_t_5; | |
__pyx_t_5 = 0; | |
/* "(tree fragment)":5 | |
* state = (self.N, self.end, self.is_variable, self.minp, self.start, self.win) | |
* _dict = getattr(self, '__dict__', None) | |
* if _dict is not None: # <<<<<<<<<<<<<< | |
* state += (_dict,) | |
* use_setstate = True | |
*/ | |
__pyx_t_6 = (__pyx_v__dict != Py_None); | |
__pyx_t_7 = (__pyx_t_6 != 0); | |
if (__pyx_t_7) { | |
/* "(tree fragment)":6 | |
* _dict = getattr(self, '__dict__', None) | |
* if _dict is not None: | |
* state += (_dict,) # <<<<<<<<<<<<<< | |
* use_setstate = True | |
* else: | |
*/ | |
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_INCREF(__pyx_v__dict); | |
__Pyx_GIVEREF(__pyx_v__dict); | |
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v__dict); | |
__pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); | |
__pyx_t_4 = 0; | |
/* "(tree fragment)":7 | |
* if _dict is not None: | |
* state += (_dict,) | |
* use_setstate = True # <<<<<<<<<<<<<< | |
* else: | |
* use_setstate = self.end is not None or self.start is not None | |
*/ | |
__pyx_v_use_setstate = 1; | |
/* "(tree fragment)":5 | |
* state = (self.N, self.end, self.is_variable, self.minp, self.start, self.win) | |
* _dict = getattr(self, '__dict__', None) | |
* if _dict is not None: # <<<<<<<<<<<<<< | |
* state += (_dict,) | |
* use_setstate = True | |
*/ | |
goto __pyx_L3; | |
} | |
/* "(tree fragment)":9 | |
* use_setstate = True | |
* else: | |
* use_setstate = self.end is not None or self.start is not None # <<<<<<<<<<<<<< | |
* if use_setstate: | |
* return __pyx_unpickle_VariableWindowIndexer, (type(self), 0x5834fb3, None), state | |
*/ | |
/*else*/ { | |
__pyx_t_6 = (((PyObject *)__pyx_v_self->__pyx_base.end) != Py_None); | |
__pyx_t_8 = (__pyx_t_6 != 0); | |
if (!__pyx_t_8) { | |
} else { | |
__pyx_t_7 = __pyx_t_8; | |
goto __pyx_L4_bool_binop_done; | |
} | |
__pyx_t_8 = (((PyObject *)__pyx_v_self->__pyx_base.start) != Py_None); | |
__pyx_t_6 = (__pyx_t_8 != 0); | |
__pyx_t_7 = __pyx_t_6; | |
__pyx_L4_bool_binop_done:; | |
__pyx_v_use_setstate = __pyx_t_7; | |
} | |
__pyx_L3:; | |
/* "(tree fragment)":10 | |
* else: | |
* use_setstate = self.end is not None or self.start is not None | |
* if use_setstate: # <<<<<<<<<<<<<< | |
* return __pyx_unpickle_VariableWindowIndexer, (type(self), 0x5834fb3, None), state | |
* else: | |
*/ | |
__pyx_t_7 = (__pyx_v_use_setstate != 0); | |
if (__pyx_t_7) { | |
/* "(tree fragment)":11 | |
* use_setstate = self.end is not None or self.start is not None | |
* if use_setstate: | |
* return __pyx_unpickle_VariableWindowIndexer, (type(self), 0x5834fb3, None), state # <<<<<<<<<<<<<< | |
* else: | |
* return __pyx_unpickle_VariableWindowIndexer, (type(self), 0x5834fb3, state) | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_VariableWindowInd); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 11, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 11, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
__Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
__Pyx_INCREF(__pyx_int_92491699); | |
__Pyx_GIVEREF(__pyx_int_92491699); | |
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_92491699); | |
__Pyx_INCREF(Py_None); | |
__Pyx_GIVEREF(Py_None); | |
PyTuple_SET_ITEM(__pyx_t_5, 2, Py_None); | |
__pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 11, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__Pyx_GIVEREF(__pyx_t_4); | |
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); | |
__Pyx_GIVEREF(__pyx_t_5); | |
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); | |
__Pyx_INCREF(__pyx_v_state); | |
__Pyx_GIVEREF(__pyx_v_state); | |
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state); | |
__pyx_t_4 = 0; | |
__pyx_t_5 = 0; | |
__pyx_r = __pyx_t_3; | |
__pyx_t_3 = 0; | |
goto __pyx_L0; | |
/* "(tree fragment)":10 | |
* else: | |
* use_setstate = self.end is not None or self.start is not None | |
* if use_setstate: # <<<<<<<<<<<<<< | |
* return __pyx_unpickle_VariableWindowIndexer, (type(self), 0x5834fb3, None), state | |
* else: | |
*/ | |
} | |
/* "(tree fragment)":13 | |
* return __pyx_unpickle_VariableWindowIndexer, (type(self), 0x5834fb3, None), state | |
* else: | |
* return __pyx_unpickle_VariableWindowIndexer, (type(self), 0x5834fb3, state) # <<<<<<<<<<<<<< | |
* def __setstate_cython__(self, __pyx_state): | |
* __pyx_unpickle_VariableWindowIndexer__set_state(self, __pyx_state) | |
*/ | |
/*else*/ { | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_VariableWindowInd); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
__Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
__Pyx_INCREF(__pyx_int_92491699); | |
__Pyx_GIVEREF(__pyx_int_92491699); | |
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_92491699); | |
__Pyx_INCREF(__pyx_v_state); | |
__Pyx_GIVEREF(__pyx_v_state); | |
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); | |
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__Pyx_GIVEREF(__pyx_t_3); | |
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); | |
__Pyx_GIVEREF(__pyx_t_5); | |
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); | |
__pyx_t_3 = 0; | |
__pyx_t_5 = 0; | |
__pyx_r = __pyx_t_4; | |
__pyx_t_4 = 0; | |
goto __pyx_L0; | |
} | |
/* "(tree fragment)":1 | |
* def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
* cdef bint use_setstate | |
* state = (self.N, self.end, self.is_variable, self.minp, self.start, self.win) | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
__Pyx_XDECREF(__pyx_t_2); | |
__Pyx_XDECREF(__pyx_t_3); | |
__Pyx_XDECREF(__pyx_t_4); | |
__Pyx_XDECREF(__pyx_t_5); | |
__Pyx_AddTraceback("pandas._libs.window.VariableWindowIndexer.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_XDECREF(__pyx_v_state); | |
__Pyx_XDECREF(__pyx_v__dict); | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "(tree fragment)":14 | |
* else: | |
* return __pyx_unpickle_VariableWindowIndexer, (type(self), 0x5834fb3, state) | |
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
* __pyx_unpickle_VariableWindowIndexer__set_state(self, __pyx_state) | |
*/ | |
/* Python wrapper */ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_21VariableWindowIndexer_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_21VariableWindowIndexer_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_21VariableWindowIndexer_6__setstate_cython__(((struct __pyx_obj_6pandas_5_libs_6window_VariableWindowIndexer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); | |
/* function exit code */ | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_21VariableWindowIndexer_6__setstate_cython__(struct __pyx_obj_6pandas_5_libs_6window_VariableWindowIndexer *__pyx_v_self, PyObject *__pyx_v___pyx_state) { | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
__Pyx_RefNannySetupContext("__setstate_cython__", 0); | |
/* "(tree fragment)":15 | |
* return __pyx_unpickle_VariableWindowIndexer, (type(self), 0x5834fb3, state) | |
* def __setstate_cython__(self, __pyx_state): | |
* __pyx_unpickle_VariableWindowIndexer__set_state(self, __pyx_state) # <<<<<<<<<<<<<< | |
*/ | |
if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 15, __pyx_L1_error) | |
__pyx_t_1 = __pyx_f_6pandas_5_libs_6window___pyx_unpickle_VariableWindowIndexer__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
/* "(tree fragment)":14 | |
* else: | |
* return __pyx_unpickle_VariableWindowIndexer, (type(self), 0x5834fb3, state) | |
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
* __pyx_unpickle_VariableWindowIndexer__set_state(self, __pyx_state) | |
*/ | |
/* function exit code */ | |
__pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
__Pyx_AddTraceback("pandas._libs.window.VariableWindowIndexer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "pandas/_libs/window.pyx":296 | |
* | |
* | |
* def get_window_indexer(input, win, minp, index, closed, # <<<<<<<<<<<<<< | |
* floor=None, use_mock=True): | |
* """ | |
*/ | |
/* Python wrapper */ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_3get_window_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static char __pyx_doc_6pandas_5_libs_6window_2get_window_indexer[] = "\n return the correct window indexer for the computation\n\n Parameters\n ----------\n input: 1d ndarray\n win: integer, window size\n minp: integer, minimum periods\n index: 1d ndarray, optional\n index to the input array\n closed: string, default None\n {'right', 'left', 'both', 'neither'}\n window endpoint closedness. Defaults to 'right' in\n VariableWindowIndexer and to 'both' in FixedWindowIndexer\n floor: optional\n unit for flooring the unit\n use_mock: boolean, default True\n if we are a fixed indexer, return a mock indexer\n instead of the FixedWindow Indexer. This is a type\n compat Indexer that allows us to use a standard\n code path with all of the indexers.\n\n\n Returns\n -------\n tuple of 1d int64 ndarrays of the offsets & data about the window\n\n "; | |
static PyMethodDef __pyx_mdef_6pandas_5_libs_6window_3get_window_indexer = {"get_window_indexer", (PyCFunction)__pyx_pw_6pandas_5_libs_6window_3get_window_indexer, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6window_2get_window_indexer}; | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_3get_window_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyObject *__pyx_v_input = 0; | |
PyObject *__pyx_v_win = 0; | |
PyObject *__pyx_v_minp = 0; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_v_floor = 0; | |
PyObject *__pyx_v_use_mock = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("get_window_indexer (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,&__pyx_n_s_floor,&__pyx_n_s_use_mock,0}; | |
PyObject* values[7] = {0,0,0,0,0,0,0}; | |
/* "pandas/_libs/window.pyx":297 | |
* | |
* def get_window_indexer(input, win, minp, index, closed, | |
* floor=None, use_mock=True): # <<<<<<<<<<<<<< | |
* """ | |
* return the correct window indexer for the computation | |
*/ | |
values[5] = ((PyObject *)Py_None); | |
values[6] = ((PyObject *)Py_True); | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); | |
CYTHON_FALLTHROUGH; | |
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); | |
CYTHON_FALLTHROUGH; | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("get_window_indexer", 0, 5, 7, 1); __PYX_ERR(0, 296, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("get_window_indexer", 0, 5, 7, 2); __PYX_ERR(0, 296, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("get_window_indexer", 0, 5, 7, 3); __PYX_ERR(0, 296, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("get_window_indexer", 0, 5, 7, 4); __PYX_ERR(0, 296, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 5: | |
if (kw_args > 0) { | |
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_floor); | |
if (value) { values[5] = value; kw_args--; } | |
} | |
CYTHON_FALLTHROUGH; | |
case 6: | |
if (kw_args > 0) { | |
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_use_mock); | |
if (value) { values[6] = value; kw_args--; } | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_window_indexer") < 0)) __PYX_ERR(0, 296, __pyx_L3_error) | |
} | |
} else { | |
switch (PyTuple_GET_SIZE(__pyx_args)) { | |
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); | |
CYTHON_FALLTHROUGH; | |
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); | |
CYTHON_FALLTHROUGH; | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
} | |
__pyx_v_input = values[0]; | |
__pyx_v_win = values[1]; | |
__pyx_v_minp = values[2]; | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
__pyx_v_floor = values[5]; | |
__pyx_v_use_mock = values[6]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("get_window_indexer", 0, 5, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 296, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.get_window_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_2get_window_indexer(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed, __pyx_v_floor, __pyx_v_use_mock); | |
/* "pandas/_libs/window.pyx":296 | |
* | |
* | |
* def get_window_indexer(input, win, minp, index, closed, # <<<<<<<<<<<<<< | |
* floor=None, use_mock=True): | |
* """ | |
*/ | |
/* function exit code */ | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_2get_window_indexer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input, PyObject *__pyx_v_win, PyObject *__pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed, PyObject *__pyx_v_floor, PyObject *__pyx_v_use_mock) { | |
int __pyx_v_left_closed; | |
int __pyx_v_right_closed; | |
struct __pyx_obj_6pandas_5_libs_6window_WindowIndexer *__pyx_v_indexer = NULL; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
int __pyx_t_1; | |
int __pyx_t_2; | |
int __pyx_t_3; | |
PyObject *__pyx_t_4 = NULL; | |
PyObject *__pyx_t_5 = NULL; | |
PyObject *__pyx_t_6 = NULL; | |
__Pyx_RefNannySetupContext("get_window_indexer", 0); | |
__Pyx_INCREF(__pyx_v_closed); | |
/* "pandas/_libs/window.pyx":328 | |
* | |
* cdef: | |
* bint left_closed = False # <<<<<<<<<<<<<< | |
* bint right_closed = False | |
* | |
*/ | |
__pyx_v_left_closed = 0; | |
/* "pandas/_libs/window.pyx":329 | |
* cdef: | |
* bint left_closed = False | |
* bint right_closed = False # <<<<<<<<<<<<<< | |
* | |
* assert closed is None or closed in ['right', 'left', 'both', 'neither'] | |
*/ | |
__pyx_v_right_closed = 0; | |
/* "pandas/_libs/window.pyx":331 | |
* bint right_closed = False | |
* | |
* assert closed is None or closed in ['right', 'left', 'both', 'neither'] # <<<<<<<<<<<<<< | |
* | |
* # if windows is variable, default is 'right', otherwise default is 'both' | |
*/ | |
#ifndef CYTHON_WITHOUT_ASSERTIONS | |
if (unlikely(!Py_OptimizeFlag)) { | |
__pyx_t_2 = (__pyx_v_closed == Py_None); | |
__pyx_t_3 = (__pyx_t_2 != 0); | |
if (!__pyx_t_3) { | |
} else { | |
__pyx_t_1 = __pyx_t_3; | |
goto __pyx_L3_bool_binop_done; | |
} | |
__Pyx_INCREF(__pyx_v_closed); | |
__pyx_t_4 = __pyx_v_closed; | |
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_right, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 331, __pyx_L1_error) | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L5_bool_binop_done; | |
} | |
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 331, __pyx_L1_error) | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L5_bool_binop_done; | |
} | |
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_both, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 331, __pyx_L1_error) | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L5_bool_binop_done; | |
} | |
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_neither, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 331, __pyx_L1_error) | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L5_bool_binop_done:; | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
__pyx_t_2 = (__pyx_t_3 != 0); | |
__pyx_t_1 = __pyx_t_2; | |
__pyx_L3_bool_binop_done:; | |
if (unlikely(!__pyx_t_1)) { | |
PyErr_SetNone(PyExc_AssertionError); | |
__PYX_ERR(0, 331, __pyx_L1_error) | |
} | |
} | |
#endif | |
/* "pandas/_libs/window.pyx":334 | |
* | |
* # if windows is variable, default is 'right', otherwise default is 'both' | |
* if closed is None: # <<<<<<<<<<<<<< | |
* closed = 'right' if index is not None else 'both' | |
* | |
*/ | |
__pyx_t_1 = (__pyx_v_closed == Py_None); | |
__pyx_t_2 = (__pyx_t_1 != 0); | |
if (__pyx_t_2) { | |
/* "pandas/_libs/window.pyx":335 | |
* # if windows is variable, default is 'right', otherwise default is 'both' | |
* if closed is None: | |
* closed = 'right' if index is not None else 'both' # <<<<<<<<<<<<<< | |
* | |
* if closed in ['right', 'both']: | |
*/ | |
__pyx_t_2 = (__pyx_v_index != Py_None); | |
if ((__pyx_t_2 != 0)) { | |
__Pyx_INCREF(__pyx_n_s_right); | |
__pyx_t_4 = __pyx_n_s_right; | |
} else { | |
__Pyx_INCREF(__pyx_n_s_both); | |
__pyx_t_4 = __pyx_n_s_both; | |
} | |
__Pyx_DECREF_SET(__pyx_v_closed, __pyx_t_4); | |
__pyx_t_4 = 0; | |
/* "pandas/_libs/window.pyx":334 | |
* | |
* # if windows is variable, default is 'right', otherwise default is 'both' | |
* if closed is None: # <<<<<<<<<<<<<< | |
* closed = 'right' if index is not None else 'both' | |
* | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":337 | |
* closed = 'right' if index is not None else 'both' | |
* | |
* if closed in ['right', 'both']: # <<<<<<<<<<<<<< | |
* right_closed = True | |
* | |
*/ | |
__Pyx_INCREF(__pyx_v_closed); | |
__pyx_t_4 = __pyx_v_closed; | |
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_right, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 337, __pyx_L1_error) | |
if (!__pyx_t_1) { | |
} else { | |
__pyx_t_2 = __pyx_t_1; | |
goto __pyx_L11_bool_binop_done; | |
} | |
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_both, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 337, __pyx_L1_error) | |
__pyx_t_2 = __pyx_t_1; | |
__pyx_L11_bool_binop_done:; | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
__pyx_t_1 = (__pyx_t_2 != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":338 | |
* | |
* if closed in ['right', 'both']: | |
* right_closed = True # <<<<<<<<<<<<<< | |
* | |
* if closed in ['left', 'both']: | |
*/ | |
__pyx_v_right_closed = 1; | |
/* "pandas/_libs/window.pyx":337 | |
* closed = 'right' if index is not None else 'both' | |
* | |
* if closed in ['right', 'both']: # <<<<<<<<<<<<<< | |
* right_closed = True | |
* | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":340 | |
* right_closed = True | |
* | |
* if closed in ['left', 'both']: # <<<<<<<<<<<<<< | |
* left_closed = True | |
* | |
*/ | |
__Pyx_INCREF(__pyx_v_closed); | |
__pyx_t_4 = __pyx_v_closed; | |
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 340, __pyx_L1_error) | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_1 = __pyx_t_2; | |
goto __pyx_L14_bool_binop_done; | |
} | |
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_both, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 340, __pyx_L1_error) | |
__pyx_t_1 = __pyx_t_2; | |
__pyx_L14_bool_binop_done:; | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
__pyx_t_2 = (__pyx_t_1 != 0); | |
if (__pyx_t_2) { | |
/* "pandas/_libs/window.pyx":341 | |
* | |
* if closed in ['left', 'both']: | |
* left_closed = True # <<<<<<<<<<<<<< | |
* | |
* if index is not None: | |
*/ | |
__pyx_v_left_closed = 1; | |
/* "pandas/_libs/window.pyx":340 | |
* right_closed = True | |
* | |
* if closed in ['left', 'both']: # <<<<<<<<<<<<<< | |
* left_closed = True | |
* | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":343 | |
* left_closed = True | |
* | |
* if index is not None: # <<<<<<<<<<<<<< | |
* indexer = VariableWindowIndexer(input, win, minp, left_closed, | |
* right_closed, index, floor) | |
*/ | |
__pyx_t_2 = (__pyx_v_index != Py_None); | |
__pyx_t_1 = (__pyx_t_2 != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":344 | |
* | |
* if index is not None: | |
* indexer = VariableWindowIndexer(input, win, minp, left_closed, # <<<<<<<<<<<<<< | |
* right_closed, index, floor) | |
* elif use_mock: | |
*/ | |
__pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_left_closed); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
/* "pandas/_libs/window.pyx":345 | |
* if index is not None: | |
* indexer = VariableWindowIndexer(input, win, minp, left_closed, | |
* right_closed, index, floor) # <<<<<<<<<<<<<< | |
* elif use_mock: | |
* indexer = MockFixedWindowIndexer(input, win, minp, left_closed, | |
*/ | |
__pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_right_closed); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 345, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
/* "pandas/_libs/window.pyx":344 | |
* | |
* if index is not None: | |
* indexer = VariableWindowIndexer(input, win, minp, left_closed, # <<<<<<<<<<<<<< | |
* right_closed, index, floor) | |
* elif use_mock: | |
*/ | |
__pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 344, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_INCREF(__pyx_v_input); | |
__Pyx_GIVEREF(__pyx_v_input); | |
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_input); | |
__Pyx_INCREF(__pyx_v_win); | |
__Pyx_GIVEREF(__pyx_v_win); | |
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_win); | |
__Pyx_INCREF(__pyx_v_minp); | |
__Pyx_GIVEREF(__pyx_v_minp); | |
PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_minp); | |
__Pyx_GIVEREF(__pyx_t_4); | |
PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_4); | |
__Pyx_GIVEREF(__pyx_t_5); | |
PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_5); | |
__Pyx_INCREF(__pyx_v_index); | |
__Pyx_GIVEREF(__pyx_v_index); | |
PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_v_index); | |
__Pyx_INCREF(__pyx_v_floor); | |
__Pyx_GIVEREF(__pyx_v_floor); | |
PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_v_floor); | |
__pyx_t_4 = 0; | |
__pyx_t_5 = 0; | |
__pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6pandas_5_libs_6window_VariableWindowIndexer), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 344, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_v_indexer = ((struct __pyx_obj_6pandas_5_libs_6window_WindowIndexer *)__pyx_t_5); | |
__pyx_t_5 = 0; | |
/* "pandas/_libs/window.pyx":343 | |
* left_closed = True | |
* | |
* if index is not None: # <<<<<<<<<<<<<< | |
* indexer = VariableWindowIndexer(input, win, minp, left_closed, | |
* right_closed, index, floor) | |
*/ | |
goto __pyx_L16; | |
} | |
/* "pandas/_libs/window.pyx":346 | |
* indexer = VariableWindowIndexer(input, win, minp, left_closed, | |
* right_closed, index, floor) | |
* elif use_mock: # <<<<<<<<<<<<<< | |
* indexer = MockFixedWindowIndexer(input, win, minp, left_closed, | |
* right_closed, index, floor) | |
*/ | |
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_use_mock); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 346, __pyx_L1_error) | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":347 | |
* right_closed, index, floor) | |
* elif use_mock: | |
* indexer = MockFixedWindowIndexer(input, win, minp, left_closed, # <<<<<<<<<<<<<< | |
* right_closed, index, floor) | |
* else: | |
*/ | |
__pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_left_closed); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 347, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
/* "pandas/_libs/window.pyx":348 | |
* elif use_mock: | |
* indexer = MockFixedWindowIndexer(input, win, minp, left_closed, | |
* right_closed, index, floor) # <<<<<<<<<<<<<< | |
* else: | |
* indexer = FixedWindowIndexer(input, win, minp, left_closed, | |
*/ | |
__pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_right_closed); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 348, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
/* "pandas/_libs/window.pyx":347 | |
* right_closed, index, floor) | |
* elif use_mock: | |
* indexer = MockFixedWindowIndexer(input, win, minp, left_closed, # <<<<<<<<<<<<<< | |
* right_closed, index, floor) | |
* else: | |
*/ | |
__pyx_t_4 = PyTuple_New(7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 347, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__Pyx_INCREF(__pyx_v_input); | |
__Pyx_GIVEREF(__pyx_v_input); | |
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_input); | |
__Pyx_INCREF(__pyx_v_win); | |
__Pyx_GIVEREF(__pyx_v_win); | |
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_win); | |
__Pyx_INCREF(__pyx_v_minp); | |
__Pyx_GIVEREF(__pyx_v_minp); | |
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_minp); | |
__Pyx_GIVEREF(__pyx_t_5); | |
PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_5); | |
__Pyx_GIVEREF(__pyx_t_6); | |
PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_6); | |
__Pyx_INCREF(__pyx_v_index); | |
__Pyx_GIVEREF(__pyx_v_index); | |
PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_v_index); | |
__Pyx_INCREF(__pyx_v_floor); | |
__Pyx_GIVEREF(__pyx_v_floor); | |
PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_v_floor); | |
__pyx_t_5 = 0; | |
__pyx_t_6 = 0; | |
__pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6pandas_5_libs_6window_MockFixedWindowIndexer), __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 347, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
__pyx_v_indexer = ((struct __pyx_obj_6pandas_5_libs_6window_WindowIndexer *)__pyx_t_6); | |
__pyx_t_6 = 0; | |
/* "pandas/_libs/window.pyx":346 | |
* indexer = VariableWindowIndexer(input, win, minp, left_closed, | |
* right_closed, index, floor) | |
* elif use_mock: # <<<<<<<<<<<<<< | |
* indexer = MockFixedWindowIndexer(input, win, minp, left_closed, | |
* right_closed, index, floor) | |
*/ | |
goto __pyx_L16; | |
} | |
/* "pandas/_libs/window.pyx":350 | |
* right_closed, index, floor) | |
* else: | |
* indexer = FixedWindowIndexer(input, win, minp, left_closed, # <<<<<<<<<<<<<< | |
* right_closed, index, floor) | |
* return indexer.get_data() | |
*/ | |
/*else*/ { | |
__pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_left_closed); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
/* "pandas/_libs/window.pyx":351 | |
* else: | |
* indexer = FixedWindowIndexer(input, win, minp, left_closed, | |
* right_closed, index, floor) # <<<<<<<<<<<<<< | |
* return indexer.get_data() | |
* | |
*/ | |
__pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_right_closed); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
/* "pandas/_libs/window.pyx":350 | |
* right_closed, index, floor) | |
* else: | |
* indexer = FixedWindowIndexer(input, win, minp, left_closed, # <<<<<<<<<<<<<< | |
* right_closed, index, floor) | |
* return indexer.get_data() | |
*/ | |
__pyx_t_5 = PyTuple_New(7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 350, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_INCREF(__pyx_v_input); | |
__Pyx_GIVEREF(__pyx_v_input); | |
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_input); | |
__Pyx_INCREF(__pyx_v_win); | |
__Pyx_GIVEREF(__pyx_v_win); | |
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_win); | |
__Pyx_INCREF(__pyx_v_minp); | |
__Pyx_GIVEREF(__pyx_v_minp); | |
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_minp); | |
__Pyx_GIVEREF(__pyx_t_6); | |
PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_6); | |
__Pyx_GIVEREF(__pyx_t_4); | |
PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_4); | |
__Pyx_INCREF(__pyx_v_index); | |
__Pyx_GIVEREF(__pyx_v_index); | |
PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_v_index); | |
__Pyx_INCREF(__pyx_v_floor); | |
__Pyx_GIVEREF(__pyx_v_floor); | |
PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_v_floor); | |
__pyx_t_6 = 0; | |
__pyx_t_4 = 0; | |
__pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6pandas_5_libs_6window_FixedWindowIndexer), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__pyx_v_indexer = ((struct __pyx_obj_6pandas_5_libs_6window_WindowIndexer *)__pyx_t_4); | |
__pyx_t_4 = 0; | |
} | |
__pyx_L16:; | |
/* "pandas/_libs/window.pyx":352 | |
* indexer = FixedWindowIndexer(input, win, minp, left_closed, | |
* right_closed, index, floor) | |
* return indexer.get_data() # <<<<<<<<<<<<<< | |
* | |
* # ---------------------------------------------------------------------- | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_indexer), __pyx_n_s_get_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 352, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__pyx_t_6 = NULL; | |
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { | |
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); | |
if (likely(__pyx_t_6)) { | |
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); | |
__Pyx_INCREF(__pyx_t_6); | |
__Pyx_INCREF(function); | |
__Pyx_DECREF_SET(__pyx_t_5, function); | |
} | |
} | |
if (__pyx_t_6) { | |
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
} else { | |
__pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error) | |
} | |
__Pyx_GOTREF(__pyx_t_4); | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__pyx_r = __pyx_t_4; | |
__pyx_t_4 = 0; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":296 | |
* | |
* | |
* def get_window_indexer(input, win, minp, index, closed, # <<<<<<<<<<<<<< | |
* floor=None, use_mock=True): | |
* """ | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_4); | |
__Pyx_XDECREF(__pyx_t_5); | |
__Pyx_XDECREF(__pyx_t_6); | |
__Pyx_AddTraceback("pandas._libs.window.get_window_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_XDECREF((PyObject *)__pyx_v_indexer); | |
__Pyx_XDECREF(__pyx_v_closed); | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "pandas/_libs/window.pyx":359 | |
* | |
* | |
* def roll_count(ndarray[double_t] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* cdef: | |
*/ | |
/* Python wrapper */ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_5roll_count(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_mdef_6pandas_5_libs_6window_5roll_count = {"roll_count", (PyCFunction)__pyx_pw_6pandas_5_libs_6window_5roll_count, METH_VARARGS|METH_KEYWORDS, 0}; | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_5roll_count(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_count (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_count", 1, 5, 5, 1); __PYX_ERR(0, 359, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_count", 1, 5, 5, 2); __PYX_ERR(0, 359, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_count", 1, 5, 5, 3); __PYX_ERR(0, 359, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_count", 1, 5, 5, 4); __PYX_ERR(0, 359, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_count") < 0)) __PYX_ERR(0, 359, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 359, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 359, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_count", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 359, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_count", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 359, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_4roll_count(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_4roll_count(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
double __pyx_v_val; | |
double __pyx_v_count_x; | |
__pyx_t_5numpy_int64_t __pyx_v_s; | |
__pyx_t_5numpy_int64_t __pyx_v_e; | |
__pyx_t_5numpy_int64_t __pyx_v_N; | |
Py_ssize_t __pyx_v_i; | |
Py_ssize_t __pyx_v_j; | |
PyArrayObject *__pyx_v_start = 0; | |
PyArrayObject *__pyx_v_end = 0; | |
PyArrayObject *__pyx_v_output = 0; | |
CYTHON_UNUSED PyObject *__pyx_v__ = NULL; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_end; | |
__Pyx_Buffer __pyx_pybuffer_end; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_output; | |
__Pyx_Buffer __pyx_pybuffer_output; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_start; | |
__Pyx_Buffer __pyx_pybuffer_start; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
PyObject *__pyx_t_2 = NULL; | |
PyObject *__pyx_t_3 = NULL; | |
PyObject *__pyx_t_4 = NULL; | |
PyObject *__pyx_t_5 = NULL; | |
int __pyx_t_6; | |
PyObject *__pyx_t_7 = NULL; | |
PyObject *__pyx_t_8 = NULL; | |
PyObject *__pyx_t_9 = NULL; | |
PyObject *(*__pyx_t_10)(PyObject *); | |
__pyx_t_5numpy_int64_t __pyx_t_11; | |
__pyx_t_5numpy_int64_t __pyx_t_12; | |
__pyx_t_5numpy_int64_t __pyx_t_13; | |
PyArrayObject *__pyx_t_14 = NULL; | |
PyObject *__pyx_t_15 = NULL; | |
PyObject *__pyx_t_16 = NULL; | |
PyObject *__pyx_t_17 = NULL; | |
PyArrayObject *__pyx_t_18 = NULL; | |
Py_ssize_t __pyx_t_19; | |
Py_ssize_t __pyx_t_20; | |
Py_ssize_t __pyx_t_21; | |
int __pyx_t_22; | |
__pyx_t_5numpy_int64_t __pyx_t_23; | |
Py_ssize_t __pyx_t_24; | |
Py_ssize_t __pyx_t_25; | |
Py_ssize_t __pyx_t_26; | |
Py_ssize_t __pyx_t_27; | |
Py_ssize_t __pyx_t_28; | |
Py_ssize_t __pyx_t_29; | |
Py_ssize_t __pyx_t_30; | |
Py_ssize_t __pyx_t_31; | |
__Pyx_RefNannySetupContext("roll_count", 0); | |
__pyx_pybuffer_start.pybuffer.buf = NULL; | |
__pyx_pybuffer_start.refcount = 0; | |
__pyx_pybuffernd_start.data = NULL; | |
__pyx_pybuffernd_start.rcbuffer = &__pyx_pybuffer_start; | |
__pyx_pybuffer_end.pybuffer.buf = NULL; | |
__pyx_pybuffer_end.refcount = 0; | |
__pyx_pybuffernd_end.data = NULL; | |
__pyx_pybuffernd_end.rcbuffer = &__pyx_pybuffer_end; | |
__pyx_pybuffer_output.pybuffer.buf = NULL; | |
__pyx_pybuffer_output.refcount = 0; | |
__pyx_pybuffernd_output.data = NULL; | |
__pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":362 | |
* object index, object closed): | |
* cdef: | |
* double val, count_x = 0.0 # <<<<<<<<<<<<<< | |
* int64_t s, e, nobs, N | |
* Py_ssize_t i, j | |
*/ | |
__pyx_v_count_x = 0.0; | |
/* "pandas/_libs/window.pyx":368 | |
* ndarray[double_t] output | |
* | |
* start, end, N, win, minp, _ = get_window_indexer(input, win, # <<<<<<<<<<<<<< | |
* minp, index, closed) | |
* output = np.empty(N, dtype=float) | |
*/ | |
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_window_indexer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_2); | |
__pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_win); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
/* "pandas/_libs/window.pyx":369 | |
* | |
* start, end, N, win, minp, _ = get_window_indexer(input, win, | |
* minp, index, closed) # <<<<<<<<<<<<<< | |
* output = np.empty(N, dtype=float) | |
* | |
*/ | |
__pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_minp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 369, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__pyx_t_5 = NULL; | |
__pyx_t_6 = 0; | |
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { | |
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); | |
if (likely(__pyx_t_5)) { | |
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
__Pyx_INCREF(__pyx_t_5); | |
__Pyx_INCREF(function); | |
__Pyx_DECREF_SET(__pyx_t_2, function); | |
__pyx_t_6 = 1; | |
} | |
} | |
#if CYTHON_FAST_PYCALL | |
if (PyFunction_Check(__pyx_t_2)) { | |
PyObject *__pyx_temp[6] = {__pyx_t_5, ((PyObject *)__pyx_v_input), __pyx_t_3, __pyx_t_4, __pyx_v_index, __pyx_v_closed}; | |
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 5+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error) | |
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
} else | |
#endif | |
#if CYTHON_FAST_PYCCALL | |
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { | |
PyObject *__pyx_temp[6] = {__pyx_t_5, ((PyObject *)__pyx_v_input), __pyx_t_3, __pyx_t_4, __pyx_v_index, __pyx_v_closed}; | |
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 5+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error) | |
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
} else | |
#endif | |
{ | |
__pyx_t_7 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 368, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_7); | |
if (__pyx_t_5) { | |
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; | |
} | |
__Pyx_INCREF(((PyObject *)__pyx_v_input)); | |
__Pyx_GIVEREF(((PyObject *)__pyx_v_input)); | |
PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_input)); | |
__Pyx_GIVEREF(__pyx_t_3); | |
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3); | |
__Pyx_GIVEREF(__pyx_t_4); | |
PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_4); | |
__Pyx_INCREF(__pyx_v_index); | |
__Pyx_GIVEREF(__pyx_v_index); | |
PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_v_index); | |
__Pyx_INCREF(__pyx_v_closed); | |
__Pyx_GIVEREF(__pyx_v_closed); | |
PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_6, __pyx_v_closed); | |
__pyx_t_3 = 0; | |
__pyx_t_4 = 0; | |
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
} | |
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { | |
PyObject* sequence = __pyx_t_1; | |
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); | |
if (unlikely(size != 6)) { | |
if (size > 6) __Pyx_RaiseTooManyValuesError(6); | |
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); | |
__PYX_ERR(0, 368, __pyx_L1_error) | |
} | |
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
if (likely(PyTuple_CheckExact(sequence))) { | |
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); | |
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); | |
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); | |
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 3); | |
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 4); | |
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 5); | |
} else { | |
__pyx_t_2 = PyList_GET_ITEM(sequence, 0); | |
__pyx_t_7 = PyList_GET_ITEM(sequence, 1); | |
__pyx_t_4 = PyList_GET_ITEM(sequence, 2); | |
__pyx_t_3 = PyList_GET_ITEM(sequence, 3); | |
__pyx_t_5 = PyList_GET_ITEM(sequence, 4); | |
__pyx_t_8 = PyList_GET_ITEM(sequence, 5); | |
} | |
__Pyx_INCREF(__pyx_t_2); | |
__Pyx_INCREF(__pyx_t_7); | |
__Pyx_INCREF(__pyx_t_4); | |
__Pyx_INCREF(__pyx_t_3); | |
__Pyx_INCREF(__pyx_t_5); | |
__Pyx_INCREF(__pyx_t_8); | |
#else | |
{ | |
Py_ssize_t i; | |
PyObject** temps[6] = {&__pyx_t_2,&__pyx_t_7,&__pyx_t_4,&__pyx_t_3,&__pyx_t_5,&__pyx_t_8}; | |
for (i=0; i < 6; i++) { | |
PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 368, __pyx_L1_error) | |
__Pyx_GOTREF(item); | |
*(temps[i]) = item; | |
} | |
} | |
#endif | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
} else { | |
Py_ssize_t index = -1; | |
PyObject** temps[6] = {&__pyx_t_2,&__pyx_t_7,&__pyx_t_4,&__pyx_t_3,&__pyx_t_5,&__pyx_t_8}; | |
__pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 368, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_9); | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
__pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; | |
for (index=0; index < 6; index++) { | |
PyObject* item = __pyx_t_10(__pyx_t_9); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; | |
__Pyx_GOTREF(item); | |
*(temps[index]) = item; | |
} | |
if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 6) < 0) __PYX_ERR(0, 368, __pyx_L1_error) | |
__pyx_t_10 = NULL; | |
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
goto __pyx_L4_unpacking_done; | |
__pyx_L3_unpacking_failed:; | |
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
__pyx_t_10 = NULL; | |
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); | |
__PYX_ERR(0, 368, __pyx_L1_error) | |
__pyx_L4_unpacking_done:; | |
} | |
/* "pandas/_libs/window.pyx":368 | |
* ndarray[double_t] output | |
* | |
* start, end, N, win, minp, _ = get_window_indexer(input, win, # <<<<<<<<<<<<<< | |
* minp, index, closed) | |
* output = np.empty(N, dtype=float) | |
*/ | |
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 368, __pyx_L1_error) | |
if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 368, __pyx_L1_error) | |
__pyx_t_11 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_11 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
__pyx_t_12 = __Pyx_PyInt_As_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_12 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
__pyx_t_13 = __Pyx_PyInt_As_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_13 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__pyx_t_14 = ((PyArrayObject *)__pyx_t_2); | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start.rcbuffer->pybuffer); | |
__pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_start.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); | |
if (unlikely(__pyx_t_6 < 0)) { | |
PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_start.rcbuffer->pybuffer, (PyObject*)__pyx_v_start, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { | |
Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); | |
__Pyx_RaiseBufferFallbackError(); | |
} else { | |
PyErr_Restore(__pyx_t_15, __pyx_t_16, __pyx_t_17); | |
} | |
__pyx_t_15 = __pyx_t_16 = __pyx_t_17 = 0; | |
} | |
__pyx_pybuffernd_start.diminfo[0].strides = __pyx_pybuffernd_start.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_start.diminfo[0].shape = __pyx_pybuffernd_start.rcbuffer->pybuffer.shape[0]; | |
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 368, __pyx_L1_error) | |
} | |
__pyx_t_14 = 0; | |
__pyx_v_start = ((PyArrayObject *)__pyx_t_2); | |
__pyx_t_2 = 0; | |
__pyx_t_14 = ((PyArrayObject *)__pyx_t_7); | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end.rcbuffer->pybuffer); | |
__pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_end.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); | |
if (unlikely(__pyx_t_6 < 0)) { | |
PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15); | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_end.rcbuffer->pybuffer, (PyObject*)__pyx_v_end, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { | |
Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15); | |
__Pyx_RaiseBufferFallbackError(); | |
} else { | |
PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15); | |
} | |
__pyx_t_17 = __pyx_t_16 = __pyx_t_15 = 0; | |
} | |
__pyx_pybuffernd_end.diminfo[0].strides = __pyx_pybuffernd_end.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_end.diminfo[0].shape = __pyx_pybuffernd_end.rcbuffer->pybuffer.shape[0]; | |
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 368, __pyx_L1_error) | |
} | |
__pyx_t_14 = 0; | |
__pyx_v_end = ((PyArrayObject *)__pyx_t_7); | |
__pyx_t_7 = 0; | |
__pyx_v_N = __pyx_t_11; | |
__pyx_v_win = __pyx_t_12; | |
__pyx_v_minp = __pyx_t_13; | |
__pyx_v__ = __pyx_t_8; | |
__pyx_t_8 = 0; | |
/* "pandas/_libs/window.pyx":370 | |
* start, end, N, win, minp, _ = get_window_indexer(input, win, | |
* minp, index, closed) | |
* output = np.empty(N, dtype=float) # <<<<<<<<<<<<<< | |
* | |
* with nogil: | |
*/ | |
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 370, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_8); | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
__pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 370, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_GIVEREF(__pyx_t_1); | |
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); | |
__pyx_t_1 = 0; | |
__pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 370, __pyx_L1_error) | |
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 370, __pyx_L1_error) | |
__pyx_t_18 = ((PyArrayObject *)__pyx_t_3); | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); | |
__pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); | |
if (unlikely(__pyx_t_6 < 0)) { | |
PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_v_output, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { | |
Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); | |
__Pyx_RaiseBufferFallbackError(); | |
} else { | |
PyErr_Restore(__pyx_t_15, __pyx_t_16, __pyx_t_17); | |
} | |
__pyx_t_15 = __pyx_t_16 = __pyx_t_17 = 0; | |
} | |
__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; | |
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 370, __pyx_L1_error) | |
} | |
__pyx_t_18 = 0; | |
__pyx_v_output = ((PyArrayObject *)__pyx_t_3); | |
__pyx_t_3 = 0; | |
/* "pandas/_libs/window.pyx":372 | |
* output = np.empty(N, dtype=float) | |
* | |
* with nogil: # <<<<<<<<<<<<<< | |
* | |
* for i in range(0, N): | |
*/ | |
{ | |
#ifdef WITH_THREAD | |
PyThreadState *_save; | |
Py_UNBLOCK_THREADS | |
__Pyx_FastGIL_Remember(); | |
#endif | |
/*try:*/ { | |
/* "pandas/_libs/window.pyx":374 | |
* with nogil: | |
* | |
* for i in range(0, N): # <<<<<<<<<<<<<< | |
* s = start[i] | |
* e = end[i] | |
*/ | |
__pyx_t_13 = __pyx_v_N; | |
__pyx_t_12 = __pyx_t_13; | |
for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_12; __pyx_t_19+=1) { | |
__pyx_v_i = __pyx_t_19; | |
/* "pandas/_libs/window.pyx":375 | |
* | |
* for i in range(0, N): | |
* s = start[i] # <<<<<<<<<<<<<< | |
* e = end[i] | |
* | |
*/ | |
__pyx_t_20 = __pyx_v_i; | |
__pyx_v_s = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_start.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_start.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":376 | |
* for i in range(0, N): | |
* s = start[i] | |
* e = end[i] # <<<<<<<<<<<<<< | |
* | |
* if i == 0: | |
*/ | |
__pyx_t_21 = __pyx_v_i; | |
__pyx_v_e = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_end.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_end.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":378 | |
* e = end[i] | |
* | |
* if i == 0: # <<<<<<<<<<<<<< | |
* | |
* # setup | |
*/ | |
__pyx_t_22 = ((__pyx_v_i == 0) != 0); | |
if (__pyx_t_22) { | |
/* "pandas/_libs/window.pyx":381 | |
* | |
* # setup | |
* count_x = 0.0 # <<<<<<<<<<<<<< | |
* for j in range(s, e): | |
* val = input[j] | |
*/ | |
__pyx_v_count_x = 0.0; | |
/* "pandas/_libs/window.pyx":382 | |
* # setup | |
* count_x = 0.0 | |
* for j in range(s, e): # <<<<<<<<<<<<<< | |
* val = input[j] | |
* if val == val: | |
*/ | |
__pyx_t_11 = __pyx_v_e; | |
__pyx_t_23 = __pyx_t_11; | |
for (__pyx_t_24 = __pyx_v_s; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) { | |
__pyx_v_j = __pyx_t_24; | |
/* "pandas/_libs/window.pyx":383 | |
* count_x = 0.0 | |
* for j in range(s, e): | |
* val = input[j] # <<<<<<<<<<<<<< | |
* if val == val: | |
* count_x += 1.0 | |
*/ | |
__pyx_t_25 = __pyx_v_j; | |
__pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_input.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":384 | |
* for j in range(s, e): | |
* val = input[j] | |
* if val == val: # <<<<<<<<<<<<<< | |
* count_x += 1.0 | |
* | |
*/ | |
__pyx_t_22 = ((__pyx_v_val == __pyx_v_val) != 0); | |
if (__pyx_t_22) { | |
/* "pandas/_libs/window.pyx":385 | |
* val = input[j] | |
* if val == val: | |
* count_x += 1.0 # <<<<<<<<<<<<<< | |
* | |
* else: | |
*/ | |
__pyx_v_count_x = (__pyx_v_count_x + 1.0); | |
/* "pandas/_libs/window.pyx":384 | |
* for j in range(s, e): | |
* val = input[j] | |
* if val == val: # <<<<<<<<<<<<<< | |
* count_x += 1.0 | |
* | |
*/ | |
} | |
} | |
/* "pandas/_libs/window.pyx":378 | |
* e = end[i] | |
* | |
* if i == 0: # <<<<<<<<<<<<<< | |
* | |
* # setup | |
*/ | |
goto __pyx_L10; | |
} | |
/* "pandas/_libs/window.pyx":390 | |
* | |
* # calculate deletes | |
* for j in range(start[i - 1], s): # <<<<<<<<<<<<<< | |
* val = input[j] | |
* if val == val: | |
*/ | |
/*else*/ { | |
__pyx_t_11 = __pyx_v_s; | |
__pyx_t_26 = (__pyx_v_i - 1); | |
__pyx_t_23 = __pyx_t_11; | |
for (__pyx_t_24 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_start.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_start.diminfo[0].strides)); __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) { | |
__pyx_v_j = __pyx_t_24; | |
/* "pandas/_libs/window.pyx":391 | |
* # calculate deletes | |
* for j in range(start[i - 1], s): | |
* val = input[j] # <<<<<<<<<<<<<< | |
* if val == val: | |
* count_x -= 1.0 | |
*/ | |
__pyx_t_27 = __pyx_v_j; | |
__pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_input.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":392 | |
* for j in range(start[i - 1], s): | |
* val = input[j] | |
* if val == val: # <<<<<<<<<<<<<< | |
* count_x -= 1.0 | |
* | |
*/ | |
__pyx_t_22 = ((__pyx_v_val == __pyx_v_val) != 0); | |
if (__pyx_t_22) { | |
/* "pandas/_libs/window.pyx":393 | |
* val = input[j] | |
* if val == val: | |
* count_x -= 1.0 # <<<<<<<<<<<<<< | |
* | |
* # calculate adds | |
*/ | |
__pyx_v_count_x = (__pyx_v_count_x - 1.0); | |
/* "pandas/_libs/window.pyx":392 | |
* for j in range(start[i - 1], s): | |
* val = input[j] | |
* if val == val: # <<<<<<<<<<<<<< | |
* count_x -= 1.0 | |
* | |
*/ | |
} | |
} | |
/* "pandas/_libs/window.pyx":396 | |
* | |
* # calculate adds | |
* for j in range(end[i - 1], e): # <<<<<<<<<<<<<< | |
* val = input[j] | |
* if val == val: | |
*/ | |
__pyx_t_11 = __pyx_v_e; | |
__pyx_t_28 = (__pyx_v_i - 1); | |
__pyx_t_23 = __pyx_t_11; | |
for (__pyx_t_24 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_end.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_end.diminfo[0].strides)); __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) { | |
__pyx_v_j = __pyx_t_24; | |
/* "pandas/_libs/window.pyx":397 | |
* # calculate adds | |
* for j in range(end[i - 1], e): | |
* val = input[j] # <<<<<<<<<<<<<< | |
* if val == val: | |
* count_x += 1.0 | |
*/ | |
__pyx_t_29 = __pyx_v_j; | |
__pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_input.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":398 | |
* for j in range(end[i - 1], e): | |
* val = input[j] | |
* if val == val: # <<<<<<<<<<<<<< | |
* count_x += 1.0 | |
* | |
*/ | |
__pyx_t_22 = ((__pyx_v_val == __pyx_v_val) != 0); | |
if (__pyx_t_22) { | |
/* "pandas/_libs/window.pyx":399 | |
* val = input[j] | |
* if val == val: | |
* count_x += 1.0 # <<<<<<<<<<<<<< | |
* | |
* if count_x >= minp: | |
*/ | |
__pyx_v_count_x = (__pyx_v_count_x + 1.0); | |
/* "pandas/_libs/window.pyx":398 | |
* for j in range(end[i - 1], e): | |
* val = input[j] | |
* if val == val: # <<<<<<<<<<<<<< | |
* count_x += 1.0 | |
* | |
*/ | |
} | |
} | |
} | |
__pyx_L10:; | |
/* "pandas/_libs/window.pyx":401 | |
* count_x += 1.0 | |
* | |
* if count_x >= minp: # <<<<<<<<<<<<<< | |
* output[i] = count_x | |
* else: | |
*/ | |
__pyx_t_22 = ((__pyx_v_count_x >= __pyx_v_minp) != 0); | |
if (__pyx_t_22) { | |
/* "pandas/_libs/window.pyx":402 | |
* | |
* if count_x >= minp: | |
* output[i] = count_x # <<<<<<<<<<<<<< | |
* else: | |
* output[i] = NaN | |
*/ | |
__pyx_t_30 = __pyx_v_i; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_count_x; | |
/* "pandas/_libs/window.pyx":401 | |
* count_x += 1.0 | |
* | |
* if count_x >= minp: # <<<<<<<<<<<<<< | |
* output[i] = count_x | |
* else: | |
*/ | |
goto __pyx_L20; | |
} | |
/* "pandas/_libs/window.pyx":404 | |
* output[i] = count_x | |
* else: | |
* output[i] = NaN # <<<<<<<<<<<<<< | |
* | |
* return output | |
*/ | |
/*else*/ { | |
__pyx_t_31 = __pyx_v_i; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5_libs_6window_NaN; | |
} | |
__pyx_L20:; | |
} | |
} | |
/* "pandas/_libs/window.pyx":372 | |
* output = np.empty(N, dtype=float) | |
* | |
* with nogil: # <<<<<<<<<<<<<< | |
* | |
* for i in range(0, N): | |
*/ | |
/*finally:*/ { | |
/*normal exit:*/{ | |
#ifdef WITH_THREAD | |
__Pyx_FastGIL_Forget(); | |
Py_BLOCK_THREADS | |
#endif | |
goto __pyx_L7; | |
} | |
__pyx_L7:; | |
} | |
} | |
/* "pandas/_libs/window.pyx":406 | |
* output[i] = NaN | |
* | |
* return output # <<<<<<<<<<<<<< | |
* | |
* # ---------------------------------------------------------------------- | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__Pyx_INCREF(((PyObject *)__pyx_v_output)); | |
__pyx_r = ((PyObject *)__pyx_v_output); | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":359 | |
* | |
* | |
* def roll_count(ndarray[double_t] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* cdef: | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
__Pyx_XDECREF(__pyx_t_2); | |
__Pyx_XDECREF(__pyx_t_3); | |
__Pyx_XDECREF(__pyx_t_4); | |
__Pyx_XDECREF(__pyx_t_5); | |
__Pyx_XDECREF(__pyx_t_7); | |
__Pyx_XDECREF(__pyx_t_8); | |
__Pyx_XDECREF(__pyx_t_9); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_count", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XDECREF((PyObject *)__pyx_v_start); | |
__Pyx_XDECREF((PyObject *)__pyx_v_end); | |
__Pyx_XDECREF((PyObject *)__pyx_v_output); | |
__Pyx_XDECREF(__pyx_v__); | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "pandas/_libs/window.pyx":412 | |
* | |
* | |
* cdef inline double calc_sum(int64_t minp, int64_t nobs, double sum_x) nogil: # <<<<<<<<<<<<<< | |
* cdef double result | |
* | |
*/ | |
static CYTHON_INLINE double __pyx_f_6pandas_5_libs_6window_calc_sum(__pyx_t_5numpy_int64_t __pyx_v_minp, __pyx_t_5numpy_int64_t __pyx_v_nobs, double __pyx_v_sum_x) { | |
double __pyx_v_result; | |
double __pyx_r; | |
int __pyx_t_1; | |
/* "pandas/_libs/window.pyx":415 | |
* cdef double result | |
* | |
* if nobs >= minp: # <<<<<<<<<<<<<< | |
* result = sum_x | |
* else: | |
*/ | |
__pyx_t_1 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":416 | |
* | |
* if nobs >= minp: | |
* result = sum_x # <<<<<<<<<<<<<< | |
* else: | |
* result = NaN | |
*/ | |
__pyx_v_result = __pyx_v_sum_x; | |
/* "pandas/_libs/window.pyx":415 | |
* cdef double result | |
* | |
* if nobs >= minp: # <<<<<<<<<<<<<< | |
* result = sum_x | |
* else: | |
*/ | |
goto __pyx_L3; | |
} | |
/* "pandas/_libs/window.pyx":418 | |
* result = sum_x | |
* else: | |
* result = NaN # <<<<<<<<<<<<<< | |
* | |
* return result | |
*/ | |
/*else*/ { | |
__pyx_v_result = __pyx_v_6pandas_5_libs_6window_NaN; | |
} | |
__pyx_L3:; | |
/* "pandas/_libs/window.pyx":420 | |
* result = NaN | |
* | |
* return result # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_r = __pyx_v_result; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":412 | |
* | |
* | |
* cdef inline double calc_sum(int64_t minp, int64_t nobs, double sum_x) nogil: # <<<<<<<<<<<<<< | |
* cdef double result | |
* | |
*/ | |
/* function exit code */ | |
__pyx_L0:; | |
return __pyx_r; | |
} | |
/* "pandas/_libs/window.pyx":423 | |
* | |
* | |
* cdef inline void add_sum(double val, int64_t *nobs, double *sum_x) nogil: # <<<<<<<<<<<<<< | |
* """ add a value from the sum calc """ | |
* | |
*/ | |
static CYTHON_INLINE void __pyx_f_6pandas_5_libs_6window_add_sum(double __pyx_v_val, __pyx_t_5numpy_int64_t *__pyx_v_nobs, double *__pyx_v_sum_x) { | |
int __pyx_t_1; | |
/* "pandas/_libs/window.pyx":427 | |
* | |
* # Not NaN | |
* if val == val: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] + 1 | |
* sum_x[0] = sum_x[0] + val | |
*/ | |
__pyx_t_1 = ((__pyx_v_val == __pyx_v_val) != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":428 | |
* # Not NaN | |
* if val == val: | |
* nobs[0] = nobs[0] + 1 # <<<<<<<<<<<<<< | |
* sum_x[0] = sum_x[0] + val | |
* | |
*/ | |
(__pyx_v_nobs[0]) = ((__pyx_v_nobs[0]) + 1); | |
/* "pandas/_libs/window.pyx":429 | |
* if val == val: | |
* nobs[0] = nobs[0] + 1 | |
* sum_x[0] = sum_x[0] + val # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
(__pyx_v_sum_x[0]) = ((__pyx_v_sum_x[0]) + __pyx_v_val); | |
/* "pandas/_libs/window.pyx":427 | |
* | |
* # Not NaN | |
* if val == val: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] + 1 | |
* sum_x[0] = sum_x[0] + val | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":423 | |
* | |
* | |
* cdef inline void add_sum(double val, int64_t *nobs, double *sum_x) nogil: # <<<<<<<<<<<<<< | |
* """ add a value from the sum calc """ | |
* | |
*/ | |
/* function exit code */ | |
} | |
/* "pandas/_libs/window.pyx":432 | |
* | |
* | |
* cdef inline void remove_sum(double val, int64_t *nobs, double *sum_x) nogil: # <<<<<<<<<<<<<< | |
* """ remove a value from the sum calc """ | |
* | |
*/ | |
static CYTHON_INLINE void __pyx_f_6pandas_5_libs_6window_remove_sum(double __pyx_v_val, __pyx_t_5numpy_int64_t *__pyx_v_nobs, double *__pyx_v_sum_x) { | |
int __pyx_t_1; | |
/* "pandas/_libs/window.pyx":435 | |
* """ remove a value from the sum calc """ | |
* | |
* if val == val: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] - 1 | |
* sum_x[0] = sum_x[0] - val | |
*/ | |
__pyx_t_1 = ((__pyx_v_val == __pyx_v_val) != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":436 | |
* | |
* if val == val: | |
* nobs[0] = nobs[0] - 1 # <<<<<<<<<<<<<< | |
* sum_x[0] = sum_x[0] - val | |
* | |
*/ | |
(__pyx_v_nobs[0]) = ((__pyx_v_nobs[0]) - 1); | |
/* "pandas/_libs/window.pyx":437 | |
* if val == val: | |
* nobs[0] = nobs[0] - 1 | |
* sum_x[0] = sum_x[0] - val # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
(__pyx_v_sum_x[0]) = ((__pyx_v_sum_x[0]) - __pyx_v_val); | |
/* "pandas/_libs/window.pyx":435 | |
* """ remove a value from the sum calc """ | |
* | |
* if val == val: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] - 1 | |
* sum_x[0] = sum_x[0] - val | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":432 | |
* | |
* | |
* cdef inline void remove_sum(double val, int64_t *nobs, double *sum_x) nogil: # <<<<<<<<<<<<<< | |
* """ remove a value from the sum calc """ | |
* | |
*/ | |
/* function exit code */ | |
} | |
/* "pandas/_libs/window.pyx":440 | |
* | |
* | |
* def roll_sum(ndarray[double_t] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* cdef: | |
*/ | |
/* Python wrapper */ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_7roll_sum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_mdef_6pandas_5_libs_6window_7roll_sum = {"roll_sum", (PyCFunction)__pyx_pw_6pandas_5_libs_6window_7roll_sum, METH_VARARGS|METH_KEYWORDS, 0}; | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_7roll_sum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_sum (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_sum", 1, 5, 5, 1); __PYX_ERR(0, 440, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_sum", 1, 5, 5, 2); __PYX_ERR(0, 440, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_sum", 1, 5, 5, 3); __PYX_ERR(0, 440, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_sum", 1, 5, 5, 4); __PYX_ERR(0, 440, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_sum") < 0)) __PYX_ERR(0, 440, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_sum", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 440, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_sum", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 440, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_6roll_sum(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_6roll_sum(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
double __pyx_v_val; | |
double __pyx_v_prev_x; | |
double __pyx_v_sum_x; | |
__pyx_t_5numpy_int64_t __pyx_v_s; | |
__pyx_t_5numpy_int64_t __pyx_v_e; | |
__pyx_t_5numpy_int64_t __pyx_v_range_endpoint; | |
__pyx_t_5numpy_int64_t __pyx_v_nobs; | |
__pyx_t_5numpy_int64_t __pyx_v_i; | |
__pyx_t_5numpy_int64_t __pyx_v_j; | |
__pyx_t_5numpy_int64_t __pyx_v_N; | |
int __pyx_v_is_variable; | |
PyArrayObject *__pyx_v_start = 0; | |
PyArrayObject *__pyx_v_end = 0; | |
PyArrayObject *__pyx_v_output = 0; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_end; | |
__Pyx_Buffer __pyx_pybuffer_end; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_output; | |
__Pyx_Buffer __pyx_pybuffer_output; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_start; | |
__Pyx_Buffer __pyx_pybuffer_start; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
PyObject *__pyx_t_2 = NULL; | |
PyObject *__pyx_t_3 = NULL; | |
PyObject *__pyx_t_4 = NULL; | |
PyObject *__pyx_t_5 = NULL; | |
PyObject *__pyx_t_6 = NULL; | |
PyObject *__pyx_t_7 = NULL; | |
PyObject *__pyx_t_8 = NULL; | |
PyObject *(*__pyx_t_9)(PyObject *); | |
__pyx_t_5numpy_int64_t __pyx_t_10; | |
__pyx_t_5numpy_int64_t __pyx_t_11; | |
__pyx_t_5numpy_int64_t __pyx_t_12; | |
int __pyx_t_13; | |
PyArrayObject *__pyx_t_14 = NULL; | |
int __pyx_t_15; | |
PyObject *__pyx_t_16 = NULL; | |
PyObject *__pyx_t_17 = NULL; | |
PyObject *__pyx_t_18 = NULL; | |
PyArrayObject *__pyx_t_19 = NULL; | |
__pyx_t_5numpy_int64_t __pyx_t_20; | |
__pyx_t_5numpy_int64_t __pyx_t_21; | |
__pyx_t_5numpy_int64_t __pyx_t_22; | |
__pyx_t_5numpy_int64_t __pyx_t_23; | |
__pyx_t_5numpy_int64_t __pyx_t_24; | |
__pyx_t_5numpy_int64_t __pyx_t_25; | |
__pyx_t_5numpy_int64_t __pyx_t_26; | |
__pyx_t_5numpy_int64_t __pyx_t_27; | |
__pyx_t_5numpy_int64_t __pyx_t_28; | |
__pyx_t_5numpy_int64_t __pyx_t_29; | |
__pyx_t_5numpy_int64_t __pyx_t_30; | |
__pyx_t_5numpy_int64_t __pyx_t_31; | |
__pyx_t_5numpy_int64_t __pyx_t_32; | |
__Pyx_RefNannySetupContext("roll_sum", 0); | |
__pyx_pybuffer_start.pybuffer.buf = NULL; | |
__pyx_pybuffer_start.refcount = 0; | |
__pyx_pybuffernd_start.data = NULL; | |
__pyx_pybuffernd_start.rcbuffer = &__pyx_pybuffer_start; | |
__pyx_pybuffer_end.pybuffer.buf = NULL; | |
__pyx_pybuffer_end.refcount = 0; | |
__pyx_pybuffernd_end.data = NULL; | |
__pyx_pybuffernd_end.rcbuffer = &__pyx_pybuffer_end; | |
__pyx_pybuffer_output.pybuffer.buf = NULL; | |
__pyx_pybuffer_output.refcount = 0; | |
__pyx_pybuffernd_output.data = NULL; | |
__pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 440, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":443 | |
* object index, object closed): | |
* cdef: | |
* double val, prev_x, sum_x = 0 # <<<<<<<<<<<<<< | |
* int64_t s, e, range_endpoint | |
* int64_t nobs = 0, i, j, N | |
*/ | |
__pyx_v_sum_x = 0.0; | |
/* "pandas/_libs/window.pyx":445 | |
* double val, prev_x, sum_x = 0 | |
* int64_t s, e, range_endpoint | |
* int64_t nobs = 0, i, j, N # <<<<<<<<<<<<<< | |
* bint is_variable | |
* ndarray[int64_t] start, end | |
*/ | |
__pyx_v_nobs = 0; | |
/* "pandas/_libs/window.pyx":450 | |
* ndarray[double_t] output | |
* | |
* start, end, N, win, minp, is_variable = get_window_indexer(input, win, # <<<<<<<<<<<<<< | |
* minp, index, | |
* closed, | |
*/ | |
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_window_indexer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_win); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_2); | |
/* "pandas/_libs/window.pyx":451 | |
* | |
* start, end, N, win, minp, is_variable = get_window_indexer(input, win, | |
* minp, index, # <<<<<<<<<<<<<< | |
* closed, | |
* floor=0) | |
*/ | |
__pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_minp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
/* "pandas/_libs/window.pyx":450 | |
* ndarray[double_t] output | |
* | |
* start, end, N, win, minp, is_variable = get_window_indexer(input, win, # <<<<<<<<<<<<<< | |
* minp, index, | |
* closed, | |
*/ | |
__pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__Pyx_INCREF(((PyObject *)__pyx_v_input)); | |
__Pyx_GIVEREF(((PyObject *)__pyx_v_input)); | |
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_input)); | |
__Pyx_GIVEREF(__pyx_t_2); | |
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); | |
__Pyx_GIVEREF(__pyx_t_3); | |
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); | |
__Pyx_INCREF(__pyx_v_index); | |
__Pyx_GIVEREF(__pyx_v_index); | |
PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_index); | |
__Pyx_INCREF(__pyx_v_closed); | |
__Pyx_GIVEREF(__pyx_v_closed); | |
PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_closed); | |
__pyx_t_2 = 0; | |
__pyx_t_3 = 0; | |
/* "pandas/_libs/window.pyx":453 | |
* minp, index, | |
* closed, | |
* floor=0) # <<<<<<<<<<<<<< | |
* output = np.empty(N, dtype=float) | |
* | |
*/ | |
__pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_floor, __pyx_int_0) < 0) __PYX_ERR(0, 453, __pyx_L1_error) | |
/* "pandas/_libs/window.pyx":450 | |
* ndarray[double_t] output | |
* | |
* start, end, N, win, minp, is_variable = get_window_indexer(input, win, # <<<<<<<<<<<<<< | |
* minp, index, | |
* closed, | |
*/ | |
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_2); | |
__Pyx_DECREF(__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; | |
if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { | |
PyObject* sequence = __pyx_t_2; | |
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); | |
if (unlikely(size != 6)) { | |
if (size > 6) __Pyx_RaiseTooManyValuesError(6); | |
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); | |
__PYX_ERR(0, 450, __pyx_L1_error) | |
} | |
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
if (likely(PyTuple_CheckExact(sequence))) { | |
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); | |
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); | |
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); | |
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); | |
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 4); | |
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 5); | |
} else { | |
__pyx_t_3 = PyList_GET_ITEM(sequence, 0); | |
__pyx_t_4 = PyList_GET_ITEM(sequence, 1); | |
__pyx_t_1 = PyList_GET_ITEM(sequence, 2); | |
__pyx_t_5 = PyList_GET_ITEM(sequence, 3); | |
__pyx_t_6 = PyList_GET_ITEM(sequence, 4); | |
__pyx_t_7 = PyList_GET_ITEM(sequence, 5); | |
} | |
__Pyx_INCREF(__pyx_t_3); | |
__Pyx_INCREF(__pyx_t_4); | |
__Pyx_INCREF(__pyx_t_1); | |
__Pyx_INCREF(__pyx_t_5); | |
__Pyx_INCREF(__pyx_t_6); | |
__Pyx_INCREF(__pyx_t_7); | |
#else | |
{ | |
Py_ssize_t i; | |
PyObject** temps[6] = {&__pyx_t_3,&__pyx_t_4,&__pyx_t_1,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7}; | |
for (i=0; i < 6; i++) { | |
PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 450, __pyx_L1_error) | |
__Pyx_GOTREF(item); | |
*(temps[i]) = item; | |
} | |
} | |
#endif | |
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
} else { | |
Py_ssize_t index = -1; | |
PyObject** temps[6] = {&__pyx_t_3,&__pyx_t_4,&__pyx_t_1,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7}; | |
__pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 450, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_8); | |
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
__pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; | |
for (index=0; index < 6; index++) { | |
PyObject* item = __pyx_t_9(__pyx_t_8); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; | |
__Pyx_GOTREF(item); | |
*(temps[index]) = item; | |
} | |
if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 6) < 0) __PYX_ERR(0, 450, __pyx_L1_error) | |
__pyx_t_9 = NULL; | |
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
goto __pyx_L4_unpacking_done; | |
__pyx_L3_unpacking_failed:; | |
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
__pyx_t_9 = NULL; | |
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); | |
__PYX_ERR(0, 450, __pyx_L1_error) | |
__pyx_L4_unpacking_done:; | |
} | |
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 450, __pyx_L1_error) | |
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 450, __pyx_L1_error) | |
__pyx_t_10 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_10 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 450, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
__pyx_t_11 = __Pyx_PyInt_As_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_11 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 450, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__pyx_t_12 = __Pyx_PyInt_As_npy_int64(__pyx_t_6); if (unlikely((__pyx_t_12 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 450, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 450, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
__pyx_t_14 = ((PyArrayObject *)__pyx_t_3); | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start.rcbuffer->pybuffer); | |
__pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_start.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); | |
if (unlikely(__pyx_t_15 < 0)) { | |
PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_start.rcbuffer->pybuffer, (PyObject*)__pyx_v_start, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { | |
Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); | |
__Pyx_RaiseBufferFallbackError(); | |
} else { | |
PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); | |
} | |
__pyx_t_16 = __pyx_t_17 = __pyx_t_18 = 0; | |
} | |
__pyx_pybuffernd_start.diminfo[0].strides = __pyx_pybuffernd_start.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_start.diminfo[0].shape = __pyx_pybuffernd_start.rcbuffer->pybuffer.shape[0]; | |
if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 450, __pyx_L1_error) | |
} | |
__pyx_t_14 = 0; | |
__pyx_v_start = ((PyArrayObject *)__pyx_t_3); | |
__pyx_t_3 = 0; | |
__pyx_t_14 = ((PyArrayObject *)__pyx_t_4); | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end.rcbuffer->pybuffer); | |
__pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_end.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); | |
if (unlikely(__pyx_t_15 < 0)) { | |
PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_end.rcbuffer->pybuffer, (PyObject*)__pyx_v_end, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { | |
Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); | |
__Pyx_RaiseBufferFallbackError(); | |
} else { | |
PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); | |
} | |
__pyx_t_18 = __pyx_t_17 = __pyx_t_16 = 0; | |
} | |
__pyx_pybuffernd_end.diminfo[0].strides = __pyx_pybuffernd_end.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_end.diminfo[0].shape = __pyx_pybuffernd_end.rcbuffer->pybuffer.shape[0]; | |
if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 450, __pyx_L1_error) | |
} | |
__pyx_t_14 = 0; | |
__pyx_v_end = ((PyArrayObject *)__pyx_t_4); | |
__pyx_t_4 = 0; | |
__pyx_v_N = __pyx_t_10; | |
__pyx_v_win = __pyx_t_11; | |
__pyx_v_minp = __pyx_t_12; | |
__pyx_v_is_variable = __pyx_t_13; | |
/* "pandas/_libs/window.pyx":454 | |
* closed, | |
* floor=0) | |
* output = np.empty(N, dtype=float) # <<<<<<<<<<<<<< | |
* | |
* # for performance we are going to iterate | |
*/ | |
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_2); | |
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 454, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_7); | |
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
__pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_2); | |
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 454, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_GIVEREF(__pyx_t_2); | |
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); | |
__pyx_t_2 = 0; | |
__pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_2); | |
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 454, __pyx_L1_error) | |
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 454, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 454, __pyx_L1_error) | |
__pyx_t_19 = ((PyArrayObject *)__pyx_t_5); | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); | |
__pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); | |
if (unlikely(__pyx_t_15 < 0)) { | |
PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_v_output, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { | |
Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); | |
__Pyx_RaiseBufferFallbackError(); | |
} else { | |
PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); | |
} | |
__pyx_t_16 = __pyx_t_17 = __pyx_t_18 = 0; | |
} | |
__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; | |
if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 454, __pyx_L1_error) | |
} | |
__pyx_t_19 = 0; | |
__pyx_v_output = ((PyArrayObject *)__pyx_t_5); | |
__pyx_t_5 = 0; | |
/* "pandas/_libs/window.pyx":460 | |
* # but is faster | |
* | |
* if is_variable: # <<<<<<<<<<<<<< | |
* | |
* # variable window | |
*/ | |
__pyx_t_13 = (__pyx_v_is_variable != 0); | |
if (__pyx_t_13) { | |
/* "pandas/_libs/window.pyx":463 | |
* | |
* # variable window | |
* with nogil: # <<<<<<<<<<<<<< | |
* | |
* for i in range(0, N): | |
*/ | |
{ | |
#ifdef WITH_THREAD | |
PyThreadState *_save; | |
Py_UNBLOCK_THREADS | |
__Pyx_FastGIL_Remember(); | |
#endif | |
/*try:*/ { | |
/* "pandas/_libs/window.pyx":465 | |
* with nogil: | |
* | |
* for i in range(0, N): # <<<<<<<<<<<<<< | |
* s = start[i] | |
* e = end[i] | |
*/ | |
__pyx_t_12 = __pyx_v_N; | |
__pyx_t_11 = __pyx_t_12; | |
for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_11; __pyx_t_10+=1) { | |
__pyx_v_i = __pyx_t_10; | |
/* "pandas/_libs/window.pyx":466 | |
* | |
* for i in range(0, N): | |
* s = start[i] # <<<<<<<<<<<<<< | |
* e = end[i] | |
* | |
*/ | |
__pyx_t_20 = __pyx_v_i; | |
__pyx_v_s = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_start.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_start.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":467 | |
* for i in range(0, N): | |
* s = start[i] | |
* e = end[i] # <<<<<<<<<<<<<< | |
* | |
* if i == 0: | |
*/ | |
__pyx_t_21 = __pyx_v_i; | |
__pyx_v_e = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_end.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_end.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":469 | |
* e = end[i] | |
* | |
* if i == 0: # <<<<<<<<<<<<<< | |
* | |
* # setup | |
*/ | |
__pyx_t_13 = ((__pyx_v_i == 0) != 0); | |
if (__pyx_t_13) { | |
/* "pandas/_libs/window.pyx":472 | |
* | |
* # setup | |
* sum_x = 0.0 # <<<<<<<<<<<<<< | |
* nobs = 0 | |
* for j in range(s, e): | |
*/ | |
__pyx_v_sum_x = 0.0; | |
/* "pandas/_libs/window.pyx":473 | |
* # setup | |
* sum_x = 0.0 | |
* nobs = 0 # <<<<<<<<<<<<<< | |
* for j in range(s, e): | |
* add_sum(input[j], &nobs, &sum_x) | |
*/ | |
__pyx_v_nobs = 0; | |
/* "pandas/_libs/window.pyx":474 | |
* sum_x = 0.0 | |
* nobs = 0 | |
* for j in range(s, e): # <<<<<<<<<<<<<< | |
* add_sum(input[j], &nobs, &sum_x) | |
* | |
*/ | |
__pyx_t_22 = __pyx_v_e; | |
__pyx_t_23 = __pyx_t_22; | |
for (__pyx_t_24 = __pyx_v_s; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) { | |
__pyx_v_j = __pyx_t_24; | |
/* "pandas/_libs/window.pyx":475 | |
* nobs = 0 | |
* for j in range(s, e): | |
* add_sum(input[j], &nobs, &sum_x) # <<<<<<<<<<<<<< | |
* | |
* else: | |
*/ | |
__pyx_t_25 = __pyx_v_j; | |
__pyx_f_6pandas_5_libs_6window_add_sum((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_input.diminfo[0].strides)), (&__pyx_v_nobs), (&__pyx_v_sum_x)); | |
} | |
/* "pandas/_libs/window.pyx":469 | |
* e = end[i] | |
* | |
* if i == 0: # <<<<<<<<<<<<<< | |
* | |
* # setup | |
*/ | |
goto __pyx_L11; | |
} | |
/* "pandas/_libs/window.pyx":480 | |
* | |
* # calculate deletes | |
* for j in range(start[i - 1], s): # <<<<<<<<<<<<<< | |
* remove_sum(input[j], &nobs, &sum_x) | |
* | |
*/ | |
/*else*/ { | |
__pyx_t_22 = __pyx_v_s; | |
__pyx_t_23 = (__pyx_v_i - 1); | |
__pyx_t_24 = __pyx_t_22; | |
for (__pyx_t_26 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_start.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_start.diminfo[0].strides)); __pyx_t_26 < __pyx_t_24; __pyx_t_26+=1) { | |
__pyx_v_j = __pyx_t_26; | |
/* "pandas/_libs/window.pyx":481 | |
* # calculate deletes | |
* for j in range(start[i - 1], s): | |
* remove_sum(input[j], &nobs, &sum_x) # <<<<<<<<<<<<<< | |
* | |
* # calculate adds | |
*/ | |
__pyx_t_27 = __pyx_v_j; | |
__pyx_f_6pandas_5_libs_6window_remove_sum((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_input.diminfo[0].strides)), (&__pyx_v_nobs), (&__pyx_v_sum_x)); | |
} | |
/* "pandas/_libs/window.pyx":484 | |
* | |
* # calculate adds | |
* for j in range(end[i - 1], e): # <<<<<<<<<<<<<< | |
* add_sum(input[j], &nobs, &sum_x) | |
* | |
*/ | |
__pyx_t_22 = __pyx_v_e; | |
__pyx_t_24 = (__pyx_v_i - 1); | |
__pyx_t_26 = __pyx_t_22; | |
for (__pyx_t_28 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_end.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_end.diminfo[0].strides)); __pyx_t_28 < __pyx_t_26; __pyx_t_28+=1) { | |
__pyx_v_j = __pyx_t_28; | |
/* "pandas/_libs/window.pyx":485 | |
* # calculate adds | |
* for j in range(end[i - 1], e): | |
* add_sum(input[j], &nobs, &sum_x) # <<<<<<<<<<<<<< | |
* | |
* output[i] = calc_sum(minp, nobs, sum_x) | |
*/ | |
__pyx_t_29 = __pyx_v_j; | |
__pyx_f_6pandas_5_libs_6window_add_sum((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_input.diminfo[0].strides)), (&__pyx_v_nobs), (&__pyx_v_sum_x)); | |
} | |
} | |
__pyx_L11:; | |
/* "pandas/_libs/window.pyx":487 | |
* add_sum(input[j], &nobs, &sum_x) | |
* | |
* output[i] = calc_sum(minp, nobs, sum_x) # <<<<<<<<<<<<<< | |
* | |
* else: | |
*/ | |
__pyx_t_22 = __pyx_v_i; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_f_6pandas_5_libs_6window_calc_sum(__pyx_v_minp, __pyx_v_nobs, __pyx_v_sum_x); | |
} | |
} | |
/* "pandas/_libs/window.pyx":463 | |
* | |
* # variable window | |
* with nogil: # <<<<<<<<<<<<<< | |
* | |
* for i in range(0, N): | |
*/ | |
/*finally:*/ { | |
/*normal exit:*/{ | |
#ifdef WITH_THREAD | |
__Pyx_FastGIL_Forget(); | |
Py_BLOCK_THREADS | |
#endif | |
goto __pyx_L8; | |
} | |
__pyx_L8:; | |
} | |
} | |
/* "pandas/_libs/window.pyx":460 | |
* # but is faster | |
* | |
* if is_variable: # <<<<<<<<<<<<<< | |
* | |
* # variable window | |
*/ | |
goto __pyx_L5; | |
} | |
/* "pandas/_libs/window.pyx":493 | |
* # fixed window | |
* | |
* range_endpoint = int_max(minp, 1) - 1 # <<<<<<<<<<<<<< | |
* | |
* with nogil: | |
*/ | |
/*else*/ { | |
__pyx_v_range_endpoint = (__pyx_f_6pandas_5_libs_6window_int_max(__pyx_v_minp, 1) - 1); | |
/* "pandas/_libs/window.pyx":495 | |
* range_endpoint = int_max(minp, 1) - 1 | |
* | |
* with nogil: # <<<<<<<<<<<<<< | |
* | |
* for i in range(0, range_endpoint): | |
*/ | |
{ | |
#ifdef WITH_THREAD | |
PyThreadState *_save; | |
Py_UNBLOCK_THREADS | |
__Pyx_FastGIL_Remember(); | |
#endif | |
/*try:*/ { | |
/* "pandas/_libs/window.pyx":497 | |
* with nogil: | |
* | |
* for i in range(0, range_endpoint): # <<<<<<<<<<<<<< | |
* add_sum(input[i], &nobs, &sum_x) | |
* output[i] = NaN | |
*/ | |
__pyx_t_12 = __pyx_v_range_endpoint; | |
__pyx_t_11 = __pyx_t_12; | |
for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_11; __pyx_t_10+=1) { | |
__pyx_v_i = __pyx_t_10; | |
/* "pandas/_libs/window.pyx":498 | |
* | |
* for i in range(0, range_endpoint): | |
* add_sum(input[i], &nobs, &sum_x) # <<<<<<<<<<<<<< | |
* output[i] = NaN | |
* | |
*/ | |
__pyx_t_26 = __pyx_v_i; | |
__pyx_f_6pandas_5_libs_6window_add_sum((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_input.diminfo[0].strides)), (&__pyx_v_nobs), (&__pyx_v_sum_x)); | |
/* "pandas/_libs/window.pyx":499 | |
* for i in range(0, range_endpoint): | |
* add_sum(input[i], &nobs, &sum_x) | |
* output[i] = NaN # <<<<<<<<<<<<<< | |
* | |
* for i in range(range_endpoint, N): | |
*/ | |
__pyx_t_28 = __pyx_v_i; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5_libs_6window_NaN; | |
} | |
/* "pandas/_libs/window.pyx":501 | |
* output[i] = NaN | |
* | |
* for i in range(range_endpoint, N): # <<<<<<<<<<<<<< | |
* val = input[i] | |
* add_sum(val, &nobs, &sum_x) | |
*/ | |
__pyx_t_12 = __pyx_v_N; | |
__pyx_t_11 = __pyx_t_12; | |
for (__pyx_t_10 = __pyx_v_range_endpoint; __pyx_t_10 < __pyx_t_11; __pyx_t_10+=1) { | |
__pyx_v_i = __pyx_t_10; | |
/* "pandas/_libs/window.pyx":502 | |
* | |
* for i in range(range_endpoint, N): | |
* val = input[i] # <<<<<<<<<<<<<< | |
* add_sum(val, &nobs, &sum_x) | |
* | |
*/ | |
__pyx_t_30 = __pyx_v_i; | |
__pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_input.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":503 | |
* for i in range(range_endpoint, N): | |
* val = input[i] | |
* add_sum(val, &nobs, &sum_x) # <<<<<<<<<<<<<< | |
* | |
* if i > win - 1: | |
*/ | |
__pyx_f_6pandas_5_libs_6window_add_sum(__pyx_v_val, (&__pyx_v_nobs), (&__pyx_v_sum_x)); | |
/* "pandas/_libs/window.pyx":505 | |
* add_sum(val, &nobs, &sum_x) | |
* | |
* if i > win - 1: # <<<<<<<<<<<<<< | |
* prev_x = input[i - win] | |
* remove_sum(prev_x, &nobs, &sum_x) | |
*/ | |
__pyx_t_13 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0); | |
if (__pyx_t_13) { | |
/* "pandas/_libs/window.pyx":506 | |
* | |
* if i > win - 1: | |
* prev_x = input[i - win] # <<<<<<<<<<<<<< | |
* remove_sum(prev_x, &nobs, &sum_x) | |
* | |
*/ | |
__pyx_t_31 = (__pyx_v_i - __pyx_v_win); | |
__pyx_v_prev_x = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_input.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":507 | |
* if i > win - 1: | |
* prev_x = input[i - win] | |
* remove_sum(prev_x, &nobs, &sum_x) # <<<<<<<<<<<<<< | |
* | |
* output[i] = calc_sum(minp, nobs, sum_x) | |
*/ | |
__pyx_f_6pandas_5_libs_6window_remove_sum(__pyx_v_prev_x, (&__pyx_v_nobs), (&__pyx_v_sum_x)); | |
/* "pandas/_libs/window.pyx":505 | |
* add_sum(val, &nobs, &sum_x) | |
* | |
* if i > win - 1: # <<<<<<<<<<<<<< | |
* prev_x = input[i - win] | |
* remove_sum(prev_x, &nobs, &sum_x) | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":509 | |
* remove_sum(prev_x, &nobs, &sum_x) | |
* | |
* output[i] = calc_sum(minp, nobs, sum_x) # <<<<<<<<<<<<<< | |
* | |
* return output | |
*/ | |
__pyx_t_32 = __pyx_v_i; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_f_6pandas_5_libs_6window_calc_sum(__pyx_v_minp, __pyx_v_nobs, __pyx_v_sum_x); | |
} | |
} | |
/* "pandas/_libs/window.pyx":495 | |
* range_endpoint = int_max(minp, 1) - 1 | |
* | |
* with nogil: # <<<<<<<<<<<<<< | |
* | |
* for i in range(0, range_endpoint): | |
*/ | |
/*finally:*/ { | |
/*normal exit:*/{ | |
#ifdef WITH_THREAD | |
__Pyx_FastGIL_Forget(); | |
Py_BLOCK_THREADS | |
#endif | |
goto __pyx_L20; | |
} | |
__pyx_L20:; | |
} | |
} | |
} | |
__pyx_L5:; | |
/* "pandas/_libs/window.pyx":511 | |
* output[i] = calc_sum(minp, nobs, sum_x) | |
* | |
* return output # <<<<<<<<<<<<<< | |
* | |
* # ---------------------------------------------------------------------- | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__Pyx_INCREF(((PyObject *)__pyx_v_output)); | |
__pyx_r = ((PyObject *)__pyx_v_output); | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":440 | |
* | |
* | |
* def roll_sum(ndarray[double_t] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* cdef: | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
__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); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_sum", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XDECREF((PyObject *)__pyx_v_start); | |
__Pyx_XDECREF((PyObject *)__pyx_v_end); | |
__Pyx_XDECREF((PyObject *)__pyx_v_output); | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "pandas/_libs/window.pyx":517 | |
* | |
* | |
* cdef inline double calc_mean(int64_t minp, Py_ssize_t nobs, # <<<<<<<<<<<<<< | |
* Py_ssize_t neg_ct, double sum_x) nogil: | |
* cdef double result | |
*/ | |
static CYTHON_INLINE double __pyx_f_6pandas_5_libs_6window_calc_mean(__pyx_t_5numpy_int64_t __pyx_v_minp, Py_ssize_t __pyx_v_nobs, Py_ssize_t __pyx_v_neg_ct, double __pyx_v_sum_x) { | |
double __pyx_v_result; | |
double __pyx_r; | |
int __pyx_t_1; | |
int __pyx_t_2; | |
/* "pandas/_libs/window.pyx":521 | |
* cdef double result | |
* | |
* if nobs >= minp: # <<<<<<<<<<<<<< | |
* result = sum_x / <double>nobs | |
* if neg_ct == 0 and result < 0: | |
*/ | |
__pyx_t_1 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":522 | |
* | |
* if nobs >= minp: | |
* result = sum_x / <double>nobs # <<<<<<<<<<<<<< | |
* if neg_ct == 0 and result < 0: | |
* # all positive | |
*/ | |
__pyx_v_result = (__pyx_v_sum_x / ((double)__pyx_v_nobs)); | |
/* "pandas/_libs/window.pyx":523 | |
* if nobs >= minp: | |
* result = sum_x / <double>nobs | |
* if neg_ct == 0 and result < 0: # <<<<<<<<<<<<<< | |
* # all positive | |
* result = 0 | |
*/ | |
__pyx_t_2 = ((__pyx_v_neg_ct == 0) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_1 = __pyx_t_2; | |
goto __pyx_L5_bool_binop_done; | |
} | |
__pyx_t_2 = ((__pyx_v_result < 0.0) != 0); | |
__pyx_t_1 = __pyx_t_2; | |
__pyx_L5_bool_binop_done:; | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":525 | |
* if neg_ct == 0 and result < 0: | |
* # all positive | |
* result = 0 # <<<<<<<<<<<<<< | |
* elif neg_ct == nobs and result > 0: | |
* # all negative | |
*/ | |
__pyx_v_result = 0.0; | |
/* "pandas/_libs/window.pyx":523 | |
* if nobs >= minp: | |
* result = sum_x / <double>nobs | |
* if neg_ct == 0 and result < 0: # <<<<<<<<<<<<<< | |
* # all positive | |
* result = 0 | |
*/ | |
goto __pyx_L4; | |
} | |
/* "pandas/_libs/window.pyx":526 | |
* # all positive | |
* result = 0 | |
* elif neg_ct == nobs and result > 0: # <<<<<<<<<<<<<< | |
* # all negative | |
* result = 0 | |
*/ | |
__pyx_t_2 = ((__pyx_v_neg_ct == __pyx_v_nobs) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_1 = __pyx_t_2; | |
goto __pyx_L7_bool_binop_done; | |
} | |
__pyx_t_2 = ((__pyx_v_result > 0.0) != 0); | |
__pyx_t_1 = __pyx_t_2; | |
__pyx_L7_bool_binop_done:; | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":528 | |
* elif neg_ct == nobs and result > 0: | |
* # all negative | |
* result = 0 # <<<<<<<<<<<<<< | |
* else: | |
* pass | |
*/ | |
__pyx_v_result = 0.0; | |
/* "pandas/_libs/window.pyx":526 | |
* # all positive | |
* result = 0 | |
* elif neg_ct == nobs and result > 0: # <<<<<<<<<<<<<< | |
* # all negative | |
* result = 0 | |
*/ | |
goto __pyx_L4; | |
} | |
/* "pandas/_libs/window.pyx":530 | |
* result = 0 | |
* else: | |
* pass # <<<<<<<<<<<<<< | |
* else: | |
* result = NaN | |
*/ | |
/*else*/ { | |
} | |
__pyx_L4:; | |
/* "pandas/_libs/window.pyx":521 | |
* cdef double result | |
* | |
* if nobs >= minp: # <<<<<<<<<<<<<< | |
* result = sum_x / <double>nobs | |
* if neg_ct == 0 and result < 0: | |
*/ | |
goto __pyx_L3; | |
} | |
/* "pandas/_libs/window.pyx":532 | |
* pass | |
* else: | |
* result = NaN # <<<<<<<<<<<<<< | |
* return result | |
* | |
*/ | |
/*else*/ { | |
__pyx_v_result = __pyx_v_6pandas_5_libs_6window_NaN; | |
} | |
__pyx_L3:; | |
/* "pandas/_libs/window.pyx":533 | |
* else: | |
* result = NaN | |
* return result # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_r = __pyx_v_result; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":517 | |
* | |
* | |
* cdef inline double calc_mean(int64_t minp, Py_ssize_t nobs, # <<<<<<<<<<<<<< | |
* Py_ssize_t neg_ct, double sum_x) nogil: | |
* cdef double result | |
*/ | |
/* function exit code */ | |
__pyx_L0:; | |
return __pyx_r; | |
} | |
/* "pandas/_libs/window.pyx":536 | |
* | |
* | |
* cdef inline void add_mean(double val, Py_ssize_t *nobs, double *sum_x, # <<<<<<<<<<<<<< | |
* Py_ssize_t *neg_ct) nogil: | |
* """ add a value from the mean calc """ | |
*/ | |
static CYTHON_INLINE void __pyx_f_6pandas_5_libs_6window_add_mean(double __pyx_v_val, Py_ssize_t *__pyx_v_nobs, double *__pyx_v_sum_x, Py_ssize_t *__pyx_v_neg_ct) { | |
int __pyx_t_1; | |
/* "pandas/_libs/window.pyx":541 | |
* | |
* # Not NaN | |
* if val == val: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] + 1 | |
* sum_x[0] = sum_x[0] + val | |
*/ | |
__pyx_t_1 = ((__pyx_v_val == __pyx_v_val) != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":542 | |
* # Not NaN | |
* if val == val: | |
* nobs[0] = nobs[0] + 1 # <<<<<<<<<<<<<< | |
* sum_x[0] = sum_x[0] + val | |
* if signbit(val): | |
*/ | |
(__pyx_v_nobs[0]) = ((__pyx_v_nobs[0]) + 1); | |
/* "pandas/_libs/window.pyx":543 | |
* if val == val: | |
* nobs[0] = nobs[0] + 1 | |
* sum_x[0] = sum_x[0] + val # <<<<<<<<<<<<<< | |
* if signbit(val): | |
* neg_ct[0] = neg_ct[0] + 1 | |
*/ | |
(__pyx_v_sum_x[0]) = ((__pyx_v_sum_x[0]) + __pyx_v_val); | |
/* "pandas/_libs/window.pyx":544 | |
* nobs[0] = nobs[0] + 1 | |
* sum_x[0] = sum_x[0] + val | |
* if signbit(val): # <<<<<<<<<<<<<< | |
* neg_ct[0] = neg_ct[0] + 1 | |
* | |
*/ | |
__pyx_t_1 = (std::signbit(__pyx_v_val) != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":545 | |
* sum_x[0] = sum_x[0] + val | |
* if signbit(val): | |
* neg_ct[0] = neg_ct[0] + 1 # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
(__pyx_v_neg_ct[0]) = ((__pyx_v_neg_ct[0]) + 1); | |
/* "pandas/_libs/window.pyx":544 | |
* nobs[0] = nobs[0] + 1 | |
* sum_x[0] = sum_x[0] + val | |
* if signbit(val): # <<<<<<<<<<<<<< | |
* neg_ct[0] = neg_ct[0] + 1 | |
* | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":541 | |
* | |
* # Not NaN | |
* if val == val: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] + 1 | |
* sum_x[0] = sum_x[0] + val | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":536 | |
* | |
* | |
* cdef inline void add_mean(double val, Py_ssize_t *nobs, double *sum_x, # <<<<<<<<<<<<<< | |
* Py_ssize_t *neg_ct) nogil: | |
* """ add a value from the mean calc """ | |
*/ | |
/* function exit code */ | |
} | |
/* "pandas/_libs/window.pyx":548 | |
* | |
* | |
* cdef inline void remove_mean(double val, Py_ssize_t *nobs, double *sum_x, # <<<<<<<<<<<<<< | |
* Py_ssize_t *neg_ct) nogil: | |
* """ remove a value from the mean calc """ | |
*/ | |
static CYTHON_INLINE void __pyx_f_6pandas_5_libs_6window_remove_mean(double __pyx_v_val, Py_ssize_t *__pyx_v_nobs, double *__pyx_v_sum_x, Py_ssize_t *__pyx_v_neg_ct) { | |
int __pyx_t_1; | |
/* "pandas/_libs/window.pyx":552 | |
* """ remove a value from the mean calc """ | |
* | |
* if val == val: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] - 1 | |
* sum_x[0] = sum_x[0] - val | |
*/ | |
__pyx_t_1 = ((__pyx_v_val == __pyx_v_val) != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":553 | |
* | |
* if val == val: | |
* nobs[0] = nobs[0] - 1 # <<<<<<<<<<<<<< | |
* sum_x[0] = sum_x[0] - val | |
* if signbit(val): | |
*/ | |
(__pyx_v_nobs[0]) = ((__pyx_v_nobs[0]) - 1); | |
/* "pandas/_libs/window.pyx":554 | |
* if val == val: | |
* nobs[0] = nobs[0] - 1 | |
* sum_x[0] = sum_x[0] - val # <<<<<<<<<<<<<< | |
* if signbit(val): | |
* neg_ct[0] = neg_ct[0] - 1 | |
*/ | |
(__pyx_v_sum_x[0]) = ((__pyx_v_sum_x[0]) - __pyx_v_val); | |
/* "pandas/_libs/window.pyx":555 | |
* nobs[0] = nobs[0] - 1 | |
* sum_x[0] = sum_x[0] - val | |
* if signbit(val): # <<<<<<<<<<<<<< | |
* neg_ct[0] = neg_ct[0] - 1 | |
* | |
*/ | |
__pyx_t_1 = (std::signbit(__pyx_v_val) != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":556 | |
* sum_x[0] = sum_x[0] - val | |
* if signbit(val): | |
* neg_ct[0] = neg_ct[0] - 1 # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
(__pyx_v_neg_ct[0]) = ((__pyx_v_neg_ct[0]) - 1); | |
/* "pandas/_libs/window.pyx":555 | |
* nobs[0] = nobs[0] - 1 | |
* sum_x[0] = sum_x[0] - val | |
* if signbit(val): # <<<<<<<<<<<<<< | |
* neg_ct[0] = neg_ct[0] - 1 | |
* | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":552 | |
* """ remove a value from the mean calc """ | |
* | |
* if val == val: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] - 1 | |
* sum_x[0] = sum_x[0] - val | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":548 | |
* | |
* | |
* cdef inline void remove_mean(double val, Py_ssize_t *nobs, double *sum_x, # <<<<<<<<<<<<<< | |
* Py_ssize_t *neg_ct) nogil: | |
* """ remove a value from the mean calc """ | |
*/ | |
/* function exit code */ | |
} | |
/* "pandas/_libs/window.pyx":559 | |
* | |
* | |
* def roll_mean(ndarray[double_t] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* cdef: | |
*/ | |
/* Python wrapper */ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_9roll_mean(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_mdef_6pandas_5_libs_6window_9roll_mean = {"roll_mean", (PyCFunction)__pyx_pw_6pandas_5_libs_6window_9roll_mean, METH_VARARGS|METH_KEYWORDS, 0}; | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_9roll_mean(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_mean (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_mean", 1, 5, 5, 1); __PYX_ERR(0, 559, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_mean", 1, 5, 5, 2); __PYX_ERR(0, 559, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_mean", 1, 5, 5, 3); __PYX_ERR(0, 559, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_mean", 1, 5, 5, 4); __PYX_ERR(0, 559, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_mean") < 0)) __PYX_ERR(0, 559, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 559, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 559, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_mean", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 559, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_mean", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 559, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_8roll_mean(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_8roll_mean(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
double __pyx_v_val; | |
double __pyx_v_prev_x; | |
double __pyx_v_sum_x; | |
__pyx_t_5numpy_int64_t __pyx_v_s; | |
__pyx_t_5numpy_int64_t __pyx_v_e; | |
int __pyx_v_is_variable; | |
Py_ssize_t __pyx_v_nobs; | |
Py_ssize_t __pyx_v_i; | |
Py_ssize_t __pyx_v_j; | |
Py_ssize_t __pyx_v_neg_ct; | |
Py_ssize_t __pyx_v_N; | |
PyArrayObject *__pyx_v_start = 0; | |
PyArrayObject *__pyx_v_end = 0; | |
PyArrayObject *__pyx_v_output = 0; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_end; | |
__Pyx_Buffer __pyx_pybuffer_end; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_output; | |
__Pyx_Buffer __pyx_pybuffer_output; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_start; | |
__Pyx_Buffer __pyx_pybuffer_start; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
PyObject *__pyx_t_2 = NULL; | |
PyObject *__pyx_t_3 = NULL; | |
PyObject *__pyx_t_4 = NULL; | |
PyObject *__pyx_t_5 = NULL; | |
int __pyx_t_6; | |
PyObject *__pyx_t_7 = NULL; | |
PyObject *__pyx_t_8 = NULL; | |
PyObject *__pyx_t_9 = NULL; | |
PyObject *(*__pyx_t_10)(PyObject *); | |
Py_ssize_t __pyx_t_11; | |
__pyx_t_5numpy_int64_t __pyx_t_12; | |
__pyx_t_5numpy_int64_t __pyx_t_13; | |
int __pyx_t_14; | |
PyArrayObject *__pyx_t_15 = NULL; | |
PyObject *__pyx_t_16 = NULL; | |
PyObject *__pyx_t_17 = NULL; | |
PyObject *__pyx_t_18 = NULL; | |
PyArrayObject *__pyx_t_19 = NULL; | |
Py_ssize_t __pyx_t_20; | |
Py_ssize_t __pyx_t_21; | |
Py_ssize_t __pyx_t_22; | |
Py_ssize_t __pyx_t_23; | |
Py_ssize_t __pyx_t_24; | |
Py_ssize_t __pyx_t_25; | |
Py_ssize_t __pyx_t_26; | |
Py_ssize_t __pyx_t_27; | |
Py_ssize_t __pyx_t_28; | |
Py_ssize_t __pyx_t_29; | |
Py_ssize_t __pyx_t_30; | |
Py_ssize_t __pyx_t_31; | |
Py_ssize_t __pyx_t_32; | |
Py_ssize_t __pyx_t_33; | |
Py_ssize_t __pyx_t_34; | |
__Pyx_RefNannySetupContext("roll_mean", 0); | |
__pyx_pybuffer_start.pybuffer.buf = NULL; | |
__pyx_pybuffer_start.refcount = 0; | |
__pyx_pybuffernd_start.data = NULL; | |
__pyx_pybuffernd_start.rcbuffer = &__pyx_pybuffer_start; | |
__pyx_pybuffer_end.pybuffer.buf = NULL; | |
__pyx_pybuffer_end.refcount = 0; | |
__pyx_pybuffernd_end.data = NULL; | |
__pyx_pybuffernd_end.rcbuffer = &__pyx_pybuffer_end; | |
__pyx_pybuffer_output.pybuffer.buf = NULL; | |
__pyx_pybuffer_output.refcount = 0; | |
__pyx_pybuffernd_output.data = NULL; | |
__pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 559, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":562 | |
* object index, object closed): | |
* cdef: | |
* double val, prev_x, result, sum_x = 0 # <<<<<<<<<<<<<< | |
* int64_t s, e | |
* bint is_variable | |
*/ | |
__pyx_v_sum_x = 0.0; | |
/* "pandas/_libs/window.pyx":565 | |
* int64_t s, e | |
* bint is_variable | |
* Py_ssize_t nobs = 0, i, j, neg_ct = 0, N # <<<<<<<<<<<<<< | |
* ndarray[int64_t] start, end | |
* ndarray[double_t] output | |
*/ | |
__pyx_v_nobs = 0; | |
__pyx_v_neg_ct = 0; | |
/* "pandas/_libs/window.pyx":569 | |
* ndarray[double_t] output | |
* | |
* start, end, N, win, minp, is_variable = get_window_indexer(input, win, # <<<<<<<<<<<<<< | |
* minp, index, | |
* closed) | |
*/ | |
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_window_indexer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 569, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_2); | |
__pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_win); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 569, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
/* "pandas/_libs/window.pyx":570 | |
* | |
* start, end, N, win, minp, is_variable = get_window_indexer(input, win, | |
* minp, index, # <<<<<<<<<<<<<< | |
* closed) | |
* output = np.empty(N, dtype=float) | |
*/ | |
__pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_minp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
/* "pandas/_libs/window.pyx":571 | |
* start, end, N, win, minp, is_variable = get_window_indexer(input, win, | |
* minp, index, | |
* closed) # <<<<<<<<<<<<<< | |
* output = np.empty(N, dtype=float) | |
* | |
*/ | |
__pyx_t_5 = NULL; | |
__pyx_t_6 = 0; | |
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { | |
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); | |
if (likely(__pyx_t_5)) { | |
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
__Pyx_INCREF(__pyx_t_5); | |
__Pyx_INCREF(function); | |
__Pyx_DECREF_SET(__pyx_t_2, function); | |
__pyx_t_6 = 1; | |
} | |
} | |
#if CYTHON_FAST_PYCALL | |
if (PyFunction_Check(__pyx_t_2)) { | |
PyObject *__pyx_temp[6] = {__pyx_t_5, ((PyObject *)__pyx_v_input), __pyx_t_3, __pyx_t_4, __pyx_v_index, __pyx_v_closed}; | |
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 5+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) | |
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
} else | |
#endif | |
#if CYTHON_FAST_PYCCALL | |
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { | |
PyObject *__pyx_temp[6] = {__pyx_t_5, ((PyObject *)__pyx_v_input), __pyx_t_3, __pyx_t_4, __pyx_v_index, __pyx_v_closed}; | |
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 5+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) | |
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
} else | |
#endif | |
{ | |
__pyx_t_7 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 569, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_7); | |
if (__pyx_t_5) { | |
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; | |
} | |
__Pyx_INCREF(((PyObject *)__pyx_v_input)); | |
__Pyx_GIVEREF(((PyObject *)__pyx_v_input)); | |
PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_input)); | |
__Pyx_GIVEREF(__pyx_t_3); | |
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3); | |
__Pyx_GIVEREF(__pyx_t_4); | |
PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_4); | |
__Pyx_INCREF(__pyx_v_index); | |
__Pyx_GIVEREF(__pyx_v_index); | |
PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_v_index); | |
__Pyx_INCREF(__pyx_v_closed); | |
__Pyx_GIVEREF(__pyx_v_closed); | |
PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_6, __pyx_v_closed); | |
__pyx_t_3 = 0; | |
__pyx_t_4 = 0; | |
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
} | |
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { | |
PyObject* sequence = __pyx_t_1; | |
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); | |
if (unlikely(size != 6)) { | |
if (size > 6) __Pyx_RaiseTooManyValuesError(6); | |
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); | |
__PYX_ERR(0, 569, __pyx_L1_error) | |
} | |
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
if (likely(PyTuple_CheckExact(sequence))) { | |
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); | |
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); | |
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); | |
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 3); | |
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 4); | |
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 5); | |
} else { | |
__pyx_t_2 = PyList_GET_ITEM(sequence, 0); | |
__pyx_t_7 = PyList_GET_ITEM(sequence, 1); | |
__pyx_t_4 = PyList_GET_ITEM(sequence, 2); | |
__pyx_t_3 = PyList_GET_ITEM(sequence, 3); | |
__pyx_t_5 = PyList_GET_ITEM(sequence, 4); | |
__pyx_t_8 = PyList_GET_ITEM(sequence, 5); | |
} | |
__Pyx_INCREF(__pyx_t_2); | |
__Pyx_INCREF(__pyx_t_7); | |
__Pyx_INCREF(__pyx_t_4); | |
__Pyx_INCREF(__pyx_t_3); | |
__Pyx_INCREF(__pyx_t_5); | |
__Pyx_INCREF(__pyx_t_8); | |
#else | |
{ | |
Py_ssize_t i; | |
PyObject** temps[6] = {&__pyx_t_2,&__pyx_t_7,&__pyx_t_4,&__pyx_t_3,&__pyx_t_5,&__pyx_t_8}; | |
for (i=0; i < 6; i++) { | |
PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 569, __pyx_L1_error) | |
__Pyx_GOTREF(item); | |
*(temps[i]) = item; | |
} | |
} | |
#endif | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
} else { | |
Py_ssize_t index = -1; | |
PyObject** temps[6] = {&__pyx_t_2,&__pyx_t_7,&__pyx_t_4,&__pyx_t_3,&__pyx_t_5,&__pyx_t_8}; | |
__pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 569, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_9); | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
__pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; | |
for (index=0; index < 6; index++) { | |
PyObject* item = __pyx_t_10(__pyx_t_9); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; | |
__Pyx_GOTREF(item); | |
*(temps[index]) = item; | |
} | |
if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 6) < 0) __PYX_ERR(0, 569, __pyx_L1_error) | |
__pyx_t_10 = NULL; | |
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
goto __pyx_L4_unpacking_done; | |
__pyx_L3_unpacking_failed:; | |
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
__pyx_t_10 = NULL; | |
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); | |
__PYX_ERR(0, 569, __pyx_L1_error) | |
__pyx_L4_unpacking_done:; | |
} | |
/* "pandas/_libs/window.pyx":569 | |
* ndarray[double_t] output | |
* | |
* start, end, N, win, minp, is_variable = get_window_indexer(input, win, # <<<<<<<<<<<<<< | |
* minp, index, | |
* closed) | |
*/ | |
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 569, __pyx_L1_error) | |
if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 569, __pyx_L1_error) | |
__pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 569, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
__pyx_t_12 = __Pyx_PyInt_As_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_12 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 569, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
__pyx_t_13 = __Pyx_PyInt_As_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_13 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 569, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 569, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
__pyx_t_15 = ((PyArrayObject *)__pyx_t_2); | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start.rcbuffer->pybuffer); | |
__pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_start.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); | |
if (unlikely(__pyx_t_6 < 0)) { | |
PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_start.rcbuffer->pybuffer, (PyObject*)__pyx_v_start, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { | |
Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); | |
__Pyx_RaiseBufferFallbackError(); | |
} else { | |
PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); | |
} | |
__pyx_t_16 = __pyx_t_17 = __pyx_t_18 = 0; | |
} | |
__pyx_pybuffernd_start.diminfo[0].strides = __pyx_pybuffernd_start.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_start.diminfo[0].shape = __pyx_pybuffernd_start.rcbuffer->pybuffer.shape[0]; | |
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 569, __pyx_L1_error) | |
} | |
__pyx_t_15 = 0; | |
__pyx_v_start = ((PyArrayObject *)__pyx_t_2); | |
__pyx_t_2 = 0; | |
__pyx_t_15 = ((PyArrayObject *)__pyx_t_7); | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end.rcbuffer->pybuffer); | |
__pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_end.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); | |
if (unlikely(__pyx_t_6 < 0)) { | |
PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_end.rcbuffer->pybuffer, (PyObject*)__pyx_v_end, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { | |
Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); | |
__Pyx_RaiseBufferFallbackError(); | |
} else { | |
PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); | |
} | |
__pyx_t_18 = __pyx_t_17 = __pyx_t_16 = 0; | |
} | |
__pyx_pybuffernd_end.diminfo[0].strides = __pyx_pybuffernd_end.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_end.diminfo[0].shape = __pyx_pybuffernd_end.rcbuffer->pybuffer.shape[0]; | |
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 569, __pyx_L1_error) | |
} | |
__pyx_t_15 = 0; | |
__pyx_v_end = ((PyArrayObject *)__pyx_t_7); | |
__pyx_t_7 = 0; | |
__pyx_v_N = __pyx_t_11; | |
__pyx_v_win = __pyx_t_12; | |
__pyx_v_minp = __pyx_t_13; | |
__pyx_v_is_variable = __pyx_t_14; | |
/* "pandas/_libs/window.pyx":572 | |
* minp, index, | |
* closed) | |
* output = np.empty(N, dtype=float) # <<<<<<<<<<<<<< | |
* | |
* # for performance we are going to iterate | |
*/ | |
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 572, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_8); | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
__pyx_t_1 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 572, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_GIVEREF(__pyx_t_1); | |
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); | |
__pyx_t_1 = 0; | |
__pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 572, __pyx_L1_error) | |
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 572, __pyx_L1_error) | |
__pyx_t_19 = ((PyArrayObject *)__pyx_t_3); | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); | |
__pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); | |
if (unlikely(__pyx_t_6 < 0)) { | |
PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_v_output, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { | |
Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); | |
__Pyx_RaiseBufferFallbackError(); | |
} else { | |
PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); | |
} | |
__pyx_t_16 = __pyx_t_17 = __pyx_t_18 = 0; | |
} | |
__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; | |
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 572, __pyx_L1_error) | |
} | |
__pyx_t_19 = 0; | |
__pyx_v_output = ((PyArrayObject *)__pyx_t_3); | |
__pyx_t_3 = 0; | |
/* "pandas/_libs/window.pyx":578 | |
* # but is faster | |
* | |
* if is_variable: # <<<<<<<<<<<<<< | |
* | |
* with nogil: | |
*/ | |
__pyx_t_14 = (__pyx_v_is_variable != 0); | |
if (__pyx_t_14) { | |
/* "pandas/_libs/window.pyx":580 | |
* if is_variable: | |
* | |
* with nogil: # <<<<<<<<<<<<<< | |
* | |
* for i in range(0, N): | |
*/ | |
{ | |
#ifdef WITH_THREAD | |
PyThreadState *_save; | |
Py_UNBLOCK_THREADS | |
__Pyx_FastGIL_Remember(); | |
#endif | |
/*try:*/ { | |
/* "pandas/_libs/window.pyx":582 | |
* with nogil: | |
* | |
* for i in range(0, N): # <<<<<<<<<<<<<< | |
* s = start[i] | |
* e = end[i] | |
*/ | |
__pyx_t_11 = __pyx_v_N; | |
__pyx_t_20 = __pyx_t_11; | |
for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { | |
__pyx_v_i = __pyx_t_21; | |
/* "pandas/_libs/window.pyx":583 | |
* | |
* for i in range(0, N): | |
* s = start[i] # <<<<<<<<<<<<<< | |
* e = end[i] | |
* | |
*/ | |
__pyx_t_22 = __pyx_v_i; | |
__pyx_v_s = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_start.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_start.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":584 | |
* for i in range(0, N): | |
* s = start[i] | |
* e = end[i] # <<<<<<<<<<<<<< | |
* | |
* if i == 0: | |
*/ | |
__pyx_t_23 = __pyx_v_i; | |
__pyx_v_e = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_end.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_end.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":586 | |
* e = end[i] | |
* | |
* if i == 0: # <<<<<<<<<<<<<< | |
* | |
* # setup | |
*/ | |
__pyx_t_14 = ((__pyx_v_i == 0) != 0); | |
if (__pyx_t_14) { | |
/* "pandas/_libs/window.pyx":589 | |
* | |
* # setup | |
* sum_x = 0.0 # <<<<<<<<<<<<<< | |
* nobs = 0 | |
* for j in range(s, e): | |
*/ | |
__pyx_v_sum_x = 0.0; | |
/* "pandas/_libs/window.pyx":590 | |
* # setup | |
* sum_x = 0.0 | |
* nobs = 0 # <<<<<<<<<<<<<< | |
* for j in range(s, e): | |
* val = input[j] | |
*/ | |
__pyx_v_nobs = 0; | |
/* "pandas/_libs/window.pyx":591 | |
* sum_x = 0.0 | |
* nobs = 0 | |
* for j in range(s, e): # <<<<<<<<<<<<<< | |
* val = input[j] | |
* add_mean(val, &nobs, &sum_x, &neg_ct) | |
*/ | |
__pyx_t_13 = __pyx_v_e; | |
__pyx_t_12 = __pyx_t_13; | |
for (__pyx_t_24 = __pyx_v_s; __pyx_t_24 < __pyx_t_12; __pyx_t_24+=1) { | |
__pyx_v_j = __pyx_t_24; | |
/* "pandas/_libs/window.pyx":592 | |
* nobs = 0 | |
* for j in range(s, e): | |
* val = input[j] # <<<<<<<<<<<<<< | |
* add_mean(val, &nobs, &sum_x, &neg_ct) | |
* | |
*/ | |
__pyx_t_25 = __pyx_v_j; | |
__pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_input.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":593 | |
* for j in range(s, e): | |
* val = input[j] | |
* add_mean(val, &nobs, &sum_x, &neg_ct) # <<<<<<<<<<<<<< | |
* | |
* else: | |
*/ | |
__pyx_f_6pandas_5_libs_6window_add_mean(__pyx_v_val, (&__pyx_v_nobs), (&__pyx_v_sum_x), (&__pyx_v_neg_ct)); | |
} | |
/* "pandas/_libs/window.pyx":586 | |
* e = end[i] | |
* | |
* if i == 0: # <<<<<<<<<<<<<< | |
* | |
* # setup | |
*/ | |
goto __pyx_L11; | |
} | |
/* "pandas/_libs/window.pyx":598 | |
* | |
* # calculate deletes | |
* for j in range(start[i - 1], s): # <<<<<<<<<<<<<< | |
* val = input[j] | |
* remove_mean(val, &nobs, &sum_x, &neg_ct) | |
*/ | |
/*else*/ { | |
__pyx_t_13 = __pyx_v_s; | |
__pyx_t_26 = (__pyx_v_i - 1); | |
__pyx_t_12 = __pyx_t_13; | |
for (__pyx_t_24 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_start.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_start.diminfo[0].strides)); __pyx_t_24 < __pyx_t_12; __pyx_t_24+=1) { | |
__pyx_v_j = __pyx_t_24; | |
/* "pandas/_libs/window.pyx":599 | |
* # calculate deletes | |
* for j in range(start[i - 1], s): | |
* val = input[j] # <<<<<<<<<<<<<< | |
* remove_mean(val, &nobs, &sum_x, &neg_ct) | |
* | |
*/ | |
__pyx_t_27 = __pyx_v_j; | |
__pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_input.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":600 | |
* for j in range(start[i - 1], s): | |
* val = input[j] | |
* remove_mean(val, &nobs, &sum_x, &neg_ct) # <<<<<<<<<<<<<< | |
* | |
* # calculate adds | |
*/ | |
__pyx_f_6pandas_5_libs_6window_remove_mean(__pyx_v_val, (&__pyx_v_nobs), (&__pyx_v_sum_x), (&__pyx_v_neg_ct)); | |
} | |
/* "pandas/_libs/window.pyx":603 | |
* | |
* # calculate adds | |
* for j in range(end[i - 1], e): # <<<<<<<<<<<<<< | |
* val = input[j] | |
* add_mean(val, &nobs, &sum_x, &neg_ct) | |
*/ | |
__pyx_t_13 = __pyx_v_e; | |
__pyx_t_28 = (__pyx_v_i - 1); | |
__pyx_t_12 = __pyx_t_13; | |
for (__pyx_t_24 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_end.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_end.diminfo[0].strides)); __pyx_t_24 < __pyx_t_12; __pyx_t_24+=1) { | |
__pyx_v_j = __pyx_t_24; | |
/* "pandas/_libs/window.pyx":604 | |
* # calculate adds | |
* for j in range(end[i - 1], e): | |
* val = input[j] # <<<<<<<<<<<<<< | |
* add_mean(val, &nobs, &sum_x, &neg_ct) | |
* | |
*/ | |
__pyx_t_29 = __pyx_v_j; | |
__pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_input.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":605 | |
* for j in range(end[i - 1], e): | |
* val = input[j] | |
* add_mean(val, &nobs, &sum_x, &neg_ct) # <<<<<<<<<<<<<< | |
* | |
* output[i] = calc_mean(minp, nobs, neg_ct, sum_x) | |
*/ | |
__pyx_f_6pandas_5_libs_6window_add_mean(__pyx_v_val, (&__pyx_v_nobs), (&__pyx_v_sum_x), (&__pyx_v_neg_ct)); | |
} | |
} | |
__pyx_L11:; | |
/* "pandas/_libs/window.pyx":607 | |
* add_mean(val, &nobs, &sum_x, &neg_ct) | |
* | |
* output[i] = calc_mean(minp, nobs, neg_ct, sum_x) # <<<<<<<<<<<<<< | |
* | |
* else: | |
*/ | |
__pyx_t_30 = __pyx_v_i; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_f_6pandas_5_libs_6window_calc_mean(__pyx_v_minp, __pyx_v_nobs, __pyx_v_neg_ct, __pyx_v_sum_x); | |
} | |
} | |
/* "pandas/_libs/window.pyx":580 | |
* if is_variable: | |
* | |
* with nogil: # <<<<<<<<<<<<<< | |
* | |
* for i in range(0, N): | |
*/ | |
/*finally:*/ { | |
/*normal exit:*/{ | |
#ifdef WITH_THREAD | |
__Pyx_FastGIL_Forget(); | |
Py_BLOCK_THREADS | |
#endif | |
goto __pyx_L8; | |
} | |
__pyx_L8:; | |
} | |
} | |
/* "pandas/_libs/window.pyx":578 | |
* # but is faster | |
* | |
* if is_variable: # <<<<<<<<<<<<<< | |
* | |
* with nogil: | |
*/ | |
goto __pyx_L5; | |
} | |
/* "pandas/_libs/window.pyx":611 | |
* else: | |
* | |
* with nogil: # <<<<<<<<<<<<<< | |
* for i from 0 <= i < minp - 1: | |
* val = input[i] | |
*/ | |
/*else*/ { | |
{ | |
#ifdef WITH_THREAD | |
PyThreadState *_save; | |
Py_UNBLOCK_THREADS | |
__Pyx_FastGIL_Remember(); | |
#endif | |
/*try:*/ { | |
/* "pandas/_libs/window.pyx":612 | |
* | |
* with nogil: | |
* for i from 0 <= i < minp - 1: # <<<<<<<<<<<<<< | |
* val = input[i] | |
* add_mean(val, &nobs, &sum_x, &neg_ct) | |
*/ | |
__pyx_t_13 = (__pyx_v_minp - 1); | |
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_13; __pyx_v_i++) { | |
/* "pandas/_libs/window.pyx":613 | |
* with nogil: | |
* for i from 0 <= i < minp - 1: | |
* val = input[i] # <<<<<<<<<<<<<< | |
* add_mean(val, &nobs, &sum_x, &neg_ct) | |
* output[i] = NaN | |
*/ | |
__pyx_t_31 = __pyx_v_i; | |
__pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_input.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":614 | |
* for i from 0 <= i < minp - 1: | |
* val = input[i] | |
* add_mean(val, &nobs, &sum_x, &neg_ct) # <<<<<<<<<<<<<< | |
* output[i] = NaN | |
* | |
*/ | |
__pyx_f_6pandas_5_libs_6window_add_mean(__pyx_v_val, (&__pyx_v_nobs), (&__pyx_v_sum_x), (&__pyx_v_neg_ct)); | |
/* "pandas/_libs/window.pyx":615 | |
* val = input[i] | |
* add_mean(val, &nobs, &sum_x, &neg_ct) | |
* output[i] = NaN # <<<<<<<<<<<<<< | |
* | |
* for i from minp - 1 <= i < N: | |
*/ | |
__pyx_t_32 = __pyx_v_i; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5_libs_6window_NaN; | |
} | |
/* "pandas/_libs/window.pyx":617 | |
* output[i] = NaN | |
* | |
* for i from minp - 1 <= i < N: # <<<<<<<<<<<<<< | |
* val = input[i] | |
* add_mean(val, &nobs, &sum_x, &neg_ct) | |
*/ | |
__pyx_t_11 = __pyx_v_N; | |
for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_11; __pyx_v_i++) { | |
/* "pandas/_libs/window.pyx":618 | |
* | |
* for i from minp - 1 <= i < N: | |
* val = input[i] # <<<<<<<<<<<<<< | |
* add_mean(val, &nobs, &sum_x, &neg_ct) | |
* | |
*/ | |
__pyx_t_33 = __pyx_v_i; | |
__pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_input.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":619 | |
* for i from minp - 1 <= i < N: | |
* val = input[i] | |
* add_mean(val, &nobs, &sum_x, &neg_ct) # <<<<<<<<<<<<<< | |
* | |
* if i > win - 1: | |
*/ | |
__pyx_f_6pandas_5_libs_6window_add_mean(__pyx_v_val, (&__pyx_v_nobs), (&__pyx_v_sum_x), (&__pyx_v_neg_ct)); | |
/* "pandas/_libs/window.pyx":621 | |
* add_mean(val, &nobs, &sum_x, &neg_ct) | |
* | |
* if i > win - 1: # <<<<<<<<<<<<<< | |
* prev_x = input[i - win] | |
* remove_mean(prev_x, &nobs, &sum_x, &neg_ct) | |
*/ | |
__pyx_t_14 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0); | |
if (__pyx_t_14) { | |
/* "pandas/_libs/window.pyx":622 | |
* | |
* if i > win - 1: | |
* prev_x = input[i - win] # <<<<<<<<<<<<<< | |
* remove_mean(prev_x, &nobs, &sum_x, &neg_ct) | |
* | |
*/ | |
__pyx_t_13 = (__pyx_v_i - __pyx_v_win); | |
__pyx_v_prev_x = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_input.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":623 | |
* if i > win - 1: | |
* prev_x = input[i - win] | |
* remove_mean(prev_x, &nobs, &sum_x, &neg_ct) # <<<<<<<<<<<<<< | |
* | |
* output[i] = calc_mean(minp, nobs, neg_ct, sum_x) | |
*/ | |
__pyx_f_6pandas_5_libs_6window_remove_mean(__pyx_v_prev_x, (&__pyx_v_nobs), (&__pyx_v_sum_x), (&__pyx_v_neg_ct)); | |
/* "pandas/_libs/window.pyx":621 | |
* add_mean(val, &nobs, &sum_x, &neg_ct) | |
* | |
* if i > win - 1: # <<<<<<<<<<<<<< | |
* prev_x = input[i - win] | |
* remove_mean(prev_x, &nobs, &sum_x, &neg_ct) | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":625 | |
* remove_mean(prev_x, &nobs, &sum_x, &neg_ct) | |
* | |
* output[i] = calc_mean(minp, nobs, neg_ct, sum_x) # <<<<<<<<<<<<<< | |
* | |
* return output | |
*/ | |
__pyx_t_34 = __pyx_v_i; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_f_6pandas_5_libs_6window_calc_mean(__pyx_v_minp, __pyx_v_nobs, __pyx_v_neg_ct, __pyx_v_sum_x); | |
} | |
} | |
/* "pandas/_libs/window.pyx":611 | |
* else: | |
* | |
* with nogil: # <<<<<<<<<<<<<< | |
* for i from 0 <= i < minp - 1: | |
* val = input[i] | |
*/ | |
/*finally:*/ { | |
/*normal exit:*/{ | |
#ifdef WITH_THREAD | |
__Pyx_FastGIL_Forget(); | |
Py_BLOCK_THREADS | |
#endif | |
goto __pyx_L20; | |
} | |
__pyx_L20:; | |
} | |
} | |
} | |
__pyx_L5:; | |
/* "pandas/_libs/window.pyx":627 | |
* output[i] = calc_mean(minp, nobs, neg_ct, sum_x) | |
* | |
* return output # <<<<<<<<<<<<<< | |
* | |
* # ---------------------------------------------------------------------- | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__Pyx_INCREF(((PyObject *)__pyx_v_output)); | |
__pyx_r = ((PyObject *)__pyx_v_output); | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":559 | |
* | |
* | |
* def roll_mean(ndarray[double_t] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* cdef: | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
__Pyx_XDECREF(__pyx_t_2); | |
__Pyx_XDECREF(__pyx_t_3); | |
__Pyx_XDECREF(__pyx_t_4); | |
__Pyx_XDECREF(__pyx_t_5); | |
__Pyx_XDECREF(__pyx_t_7); | |
__Pyx_XDECREF(__pyx_t_8); | |
__Pyx_XDECREF(__pyx_t_9); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_mean", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XDECREF((PyObject *)__pyx_v_start); | |
__Pyx_XDECREF((PyObject *)__pyx_v_end); | |
__Pyx_XDECREF((PyObject *)__pyx_v_output); | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "pandas/_libs/window.pyx":633 | |
* | |
* | |
* cdef inline double calc_var(int64_t minp, int ddof, double nobs, # <<<<<<<<<<<<<< | |
* double ssqdm_x) nogil: | |
* cdef double result | |
*/ | |
static CYTHON_INLINE double __pyx_f_6pandas_5_libs_6window_calc_var(__pyx_t_5numpy_int64_t __pyx_v_minp, int __pyx_v_ddof, double __pyx_v_nobs, double __pyx_v_ssqdm_x) { | |
double __pyx_v_result; | |
double __pyx_r; | |
int __pyx_t_1; | |
int __pyx_t_2; | |
/* "pandas/_libs/window.pyx":638 | |
* | |
* # Variance is unchanged if no observation is added or removed | |
* if (nobs >= minp) and (nobs > ddof): # <<<<<<<<<<<<<< | |
* | |
* # pathological case | |
*/ | |
__pyx_t_2 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_1 = __pyx_t_2; | |
goto __pyx_L4_bool_binop_done; | |
} | |
__pyx_t_2 = ((__pyx_v_nobs > __pyx_v_ddof) != 0); | |
__pyx_t_1 = __pyx_t_2; | |
__pyx_L4_bool_binop_done:; | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":641 | |
* | |
* # pathological case | |
* if nobs == 1: # <<<<<<<<<<<<<< | |
* result = 0 | |
* else: | |
*/ | |
__pyx_t_1 = ((__pyx_v_nobs == 1.0) != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":642 | |
* # pathological case | |
* if nobs == 1: | |
* result = 0 # <<<<<<<<<<<<<< | |
* else: | |
* result = ssqdm_x / (nobs - <double>ddof) | |
*/ | |
__pyx_v_result = 0.0; | |
/* "pandas/_libs/window.pyx":641 | |
* | |
* # pathological case | |
* if nobs == 1: # <<<<<<<<<<<<<< | |
* result = 0 | |
* else: | |
*/ | |
goto __pyx_L6; | |
} | |
/* "pandas/_libs/window.pyx":644 | |
* result = 0 | |
* else: | |
* result = ssqdm_x / (nobs - <double>ddof) # <<<<<<<<<<<<<< | |
* if result < 0: | |
* result = 0 | |
*/ | |
/*else*/ { | |
__pyx_v_result = (__pyx_v_ssqdm_x / (__pyx_v_nobs - ((double)__pyx_v_ddof))); | |
/* "pandas/_libs/window.pyx":645 | |
* else: | |
* result = ssqdm_x / (nobs - <double>ddof) | |
* if result < 0: # <<<<<<<<<<<<<< | |
* result = 0 | |
* else: | |
*/ | |
__pyx_t_1 = ((__pyx_v_result < 0.0) != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":646 | |
* result = ssqdm_x / (nobs - <double>ddof) | |
* if result < 0: | |
* result = 0 # <<<<<<<<<<<<<< | |
* else: | |
* result = NaN | |
*/ | |
__pyx_v_result = 0.0; | |
/* "pandas/_libs/window.pyx":645 | |
* else: | |
* result = ssqdm_x / (nobs - <double>ddof) | |
* if result < 0: # <<<<<<<<<<<<<< | |
* result = 0 | |
* else: | |
*/ | |
} | |
} | |
__pyx_L6:; | |
/* "pandas/_libs/window.pyx":638 | |
* | |
* # Variance is unchanged if no observation is added or removed | |
* if (nobs >= minp) and (nobs > ddof): # <<<<<<<<<<<<<< | |
* | |
* # pathological case | |
*/ | |
goto __pyx_L3; | |
} | |
/* "pandas/_libs/window.pyx":648 | |
* result = 0 | |
* else: | |
* result = NaN # <<<<<<<<<<<<<< | |
* | |
* return result | |
*/ | |
/*else*/ { | |
__pyx_v_result = __pyx_v_6pandas_5_libs_6window_NaN; | |
} | |
__pyx_L3:; | |
/* "pandas/_libs/window.pyx":650 | |
* result = NaN | |
* | |
* return result # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_r = __pyx_v_result; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":633 | |
* | |
* | |
* cdef inline double calc_var(int64_t minp, int ddof, double nobs, # <<<<<<<<<<<<<< | |
* double ssqdm_x) nogil: | |
* cdef double result | |
*/ | |
/* function exit code */ | |
__pyx_L0:; | |
return __pyx_r; | |
} | |
/* "pandas/_libs/window.pyx":653 | |
* | |
* | |
* cdef inline void add_var(double val, double *nobs, double *mean_x, # <<<<<<<<<<<<<< | |
* double *ssqdm_x) nogil: | |
* """ add a value from the var calc """ | |
*/ | |
static CYTHON_INLINE void __pyx_f_6pandas_5_libs_6window_add_var(double __pyx_v_val, double *__pyx_v_nobs, double *__pyx_v_mean_x, double *__pyx_v_ssqdm_x) { | |
double __pyx_v_delta; | |
int __pyx_t_1; | |
/* "pandas/_libs/window.pyx":658 | |
* cdef double delta | |
* # Not NaN | |
* if val == val: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] + 1 | |
* # a part of Welford's method for the online variance-calculation | |
*/ | |
__pyx_t_1 = ((__pyx_v_val == __pyx_v_val) != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":659 | |
* # Not NaN | |
* if val == val: | |
* nobs[0] = nobs[0] + 1 # <<<<<<<<<<<<<< | |
* # a part of Welford's method for the online variance-calculation | |
* # https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance | |
*/ | |
(__pyx_v_nobs[0]) = ((__pyx_v_nobs[0]) + 1.0); | |
/* "pandas/_libs/window.pyx":662 | |
* # a part of Welford's method for the online variance-calculation | |
* # https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance | |
* delta = val - mean_x[0] # <<<<<<<<<<<<<< | |
* mean_x[0] = mean_x[0] + delta / nobs[0] | |
* ssqdm_x[0] = ssqdm_x[0] + ((nobs[0] - 1) * delta ** 2) / nobs[0] | |
*/ | |
__pyx_v_delta = (__pyx_v_val - (__pyx_v_mean_x[0])); | |
/* "pandas/_libs/window.pyx":663 | |
* # https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance | |
* delta = val - mean_x[0] | |
* mean_x[0] = mean_x[0] + delta / nobs[0] # <<<<<<<<<<<<<< | |
* ssqdm_x[0] = ssqdm_x[0] + ((nobs[0] - 1) * delta ** 2) / nobs[0] | |
* | |
*/ | |
(__pyx_v_mean_x[0]) = ((__pyx_v_mean_x[0]) + (__pyx_v_delta / (__pyx_v_nobs[0]))); | |
/* "pandas/_libs/window.pyx":664 | |
* delta = val - mean_x[0] | |
* mean_x[0] = mean_x[0] + delta / nobs[0] | |
* ssqdm_x[0] = ssqdm_x[0] + ((nobs[0] - 1) * delta ** 2) / nobs[0] # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
(__pyx_v_ssqdm_x[0]) = ((__pyx_v_ssqdm_x[0]) + ((((__pyx_v_nobs[0]) - 1.0) * pow(__pyx_v_delta, 2.0)) / (__pyx_v_nobs[0]))); | |
/* "pandas/_libs/window.pyx":658 | |
* cdef double delta | |
* # Not NaN | |
* if val == val: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] + 1 | |
* # a part of Welford's method for the online variance-calculation | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":653 | |
* | |
* | |
* cdef inline void add_var(double val, double *nobs, double *mean_x, # <<<<<<<<<<<<<< | |
* double *ssqdm_x) nogil: | |
* """ add a value from the var calc """ | |
*/ | |
/* function exit code */ | |
} | |
/* "pandas/_libs/window.pyx":667 | |
* | |
* | |
* cdef inline void remove_var(double val, double *nobs, double *mean_x, # <<<<<<<<<<<<<< | |
* double *ssqdm_x) nogil: | |
* """ remove a value from the var calc """ | |
*/ | |
static CYTHON_INLINE void __pyx_f_6pandas_5_libs_6window_remove_var(double __pyx_v_val, double *__pyx_v_nobs, double *__pyx_v_mean_x, double *__pyx_v_ssqdm_x) { | |
double __pyx_v_delta; | |
int __pyx_t_1; | |
/* "pandas/_libs/window.pyx":673 | |
* | |
* # Not NaN | |
* if val == val: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] - 1 | |
* if nobs[0]: | |
*/ | |
__pyx_t_1 = ((__pyx_v_val == __pyx_v_val) != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":674 | |
* # Not NaN | |
* if val == val: | |
* nobs[0] = nobs[0] - 1 # <<<<<<<<<<<<<< | |
* if nobs[0]: | |
* # a part of Welford's method for the online variance-calculation | |
*/ | |
(__pyx_v_nobs[0]) = ((__pyx_v_nobs[0]) - 1.0); | |
/* "pandas/_libs/window.pyx":675 | |
* if val == val: | |
* nobs[0] = nobs[0] - 1 | |
* if nobs[0]: # <<<<<<<<<<<<<< | |
* # a part of Welford's method for the online variance-calculation | |
* # https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance | |
*/ | |
__pyx_t_1 = ((__pyx_v_nobs[0]) != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":678 | |
* # a part of Welford's method for the online variance-calculation | |
* # https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance | |
* delta = val - mean_x[0] # <<<<<<<<<<<<<< | |
* mean_x[0] = mean_x[0] - delta / nobs[0] | |
* ssqdm_x[0] = ssqdm_x[0] - ((nobs[0] + 1) * delta ** 2) / nobs[0] | |
*/ | |
__pyx_v_delta = (__pyx_v_val - (__pyx_v_mean_x[0])); | |
/* "pandas/_libs/window.pyx":679 | |
* # https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance | |
* delta = val - mean_x[0] | |
* mean_x[0] = mean_x[0] - delta / nobs[0] # <<<<<<<<<<<<<< | |
* ssqdm_x[0] = ssqdm_x[0] - ((nobs[0] + 1) * delta ** 2) / nobs[0] | |
* else: | |
*/ | |
(__pyx_v_mean_x[0]) = ((__pyx_v_mean_x[0]) - (__pyx_v_delta / (__pyx_v_nobs[0]))); | |
/* "pandas/_libs/window.pyx":680 | |
* delta = val - mean_x[0] | |
* mean_x[0] = mean_x[0] - delta / nobs[0] | |
* ssqdm_x[0] = ssqdm_x[0] - ((nobs[0] + 1) * delta ** 2) / nobs[0] # <<<<<<<<<<<<<< | |
* else: | |
* mean_x[0] = 0 | |
*/ | |
(__pyx_v_ssqdm_x[0]) = ((__pyx_v_ssqdm_x[0]) - ((((__pyx_v_nobs[0]) + 1.0) * pow(__pyx_v_delta, 2.0)) / (__pyx_v_nobs[0]))); | |
/* "pandas/_libs/window.pyx":675 | |
* if val == val: | |
* nobs[0] = nobs[0] - 1 | |
* if nobs[0]: # <<<<<<<<<<<<<< | |
* # a part of Welford's method for the online variance-calculation | |
* # https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance | |
*/ | |
goto __pyx_L4; | |
} | |
/* "pandas/_libs/window.pyx":682 | |
* ssqdm_x[0] = ssqdm_x[0] - ((nobs[0] + 1) * delta ** 2) / nobs[0] | |
* else: | |
* mean_x[0] = 0 # <<<<<<<<<<<<<< | |
* ssqdm_x[0] = 0 | |
* | |
*/ | |
/*else*/ { | |
(__pyx_v_mean_x[0]) = 0.0; | |
/* "pandas/_libs/window.pyx":683 | |
* else: | |
* mean_x[0] = 0 | |
* ssqdm_x[0] = 0 # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
(__pyx_v_ssqdm_x[0]) = 0.0; | |
} | |
__pyx_L4:; | |
/* "pandas/_libs/window.pyx":673 | |
* | |
* # Not NaN | |
* if val == val: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] - 1 | |
* if nobs[0]: | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":667 | |
* | |
* | |
* cdef inline void remove_var(double val, double *nobs, double *mean_x, # <<<<<<<<<<<<<< | |
* double *ssqdm_x) nogil: | |
* """ remove a value from the var calc """ | |
*/ | |
/* function exit code */ | |
} | |
/* "pandas/_libs/window.pyx":686 | |
* | |
* | |
* def roll_var(ndarray[double_t] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed, int ddof=1): | |
* """ | |
*/ | |
/* Python wrapper */ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_11roll_var(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static char __pyx_doc_6pandas_5_libs_6window_10roll_var[] = "\n Numerically stable implementation using Welford's method.\n "; | |
static PyMethodDef __pyx_mdef_6pandas_5_libs_6window_11roll_var = {"roll_var", (PyCFunction)__pyx_pw_6pandas_5_libs_6window_11roll_var, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6window_10roll_var}; | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_11roll_var(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
int __pyx_v_ddof; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_var (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,&__pyx_n_s_ddof,0}; | |
PyObject* values[6] = {0,0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); | |
CYTHON_FALLTHROUGH; | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_var", 0, 5, 6, 1); __PYX_ERR(0, 686, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_var", 0, 5, 6, 2); __PYX_ERR(0, 686, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_var", 0, 5, 6, 3); __PYX_ERR(0, 686, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_var", 0, 5, 6, 4); __PYX_ERR(0, 686, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 5: | |
if (kw_args > 0) { | |
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ddof); | |
if (value) { values[5] = value; kw_args--; } | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_var") < 0)) __PYX_ERR(0, 686, __pyx_L3_error) | |
} | |
} else { | |
switch (PyTuple_GET_SIZE(__pyx_args)) { | |
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); | |
CYTHON_FALLTHROUGH; | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
if (values[5]) { | |
__pyx_v_ddof = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_ddof == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 687, __pyx_L3_error) | |
} else { | |
__pyx_v_ddof = ((int)1); | |
} | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_var", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 686, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_var", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 686, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_10roll_var(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed, __pyx_v_ddof); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_10roll_var(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed, int __pyx_v_ddof) { | |
double __pyx_v_val; | |
double __pyx_v_prev; | |
double __pyx_v_mean_x; | |
double __pyx_v_ssqdm_x; | |
double __pyx_v_nobs; | |
double __pyx_v_delta; | |
double __pyx_v_mean_x_old; | |
__pyx_t_5numpy_int64_t __pyx_v_s; | |
__pyx_t_5numpy_int64_t __pyx_v_e; | |
int __pyx_v_is_variable; | |
Py_ssize_t __pyx_v_i; | |
Py_ssize_t __pyx_v_j; | |
Py_ssize_t __pyx_v_N; | |
PyArrayObject *__pyx_v_start = 0; | |
PyArrayObject *__pyx_v_end = 0; | |
PyArrayObject *__pyx_v_output = 0; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_end; | |
__Pyx_Buffer __pyx_pybuffer_end; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_output; | |
__Pyx_Buffer __pyx_pybuffer_output; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_start; | |
__Pyx_Buffer __pyx_pybuffer_start; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
PyObject *__pyx_t_2 = NULL; | |
PyObject *__pyx_t_3 = NULL; | |
PyObject *__pyx_t_4 = NULL; | |
PyObject *__pyx_t_5 = NULL; | |
int __pyx_t_6; | |
PyObject *__pyx_t_7 = NULL; | |
PyObject *__pyx_t_8 = NULL; | |
PyObject *__pyx_t_9 = NULL; | |
PyObject *(*__pyx_t_10)(PyObject *); | |
Py_ssize_t __pyx_t_11; | |
__pyx_t_5numpy_int64_t __pyx_t_12; | |
__pyx_t_5numpy_int64_t __pyx_t_13; | |
int __pyx_t_14; | |
PyArrayObject *__pyx_t_15 = NULL; | |
PyObject *__pyx_t_16 = NULL; | |
PyObject *__pyx_t_17 = NULL; | |
PyObject *__pyx_t_18 = NULL; | |
PyArrayObject *__pyx_t_19 = NULL; | |
Py_ssize_t __pyx_t_20; | |
Py_ssize_t __pyx_t_21; | |
Py_ssize_t __pyx_t_22; | |
Py_ssize_t __pyx_t_23; | |
Py_ssize_t __pyx_t_24; | |
Py_ssize_t __pyx_t_25; | |
Py_ssize_t __pyx_t_26; | |
Py_ssize_t __pyx_t_27; | |
Py_ssize_t __pyx_t_28; | |
Py_ssize_t __pyx_t_29; | |
Py_ssize_t __pyx_t_30; | |
Py_ssize_t __pyx_t_31; | |
Py_ssize_t __pyx_t_32; | |
Py_ssize_t __pyx_t_33; | |
Py_ssize_t __pyx_t_34; | |
__Pyx_RefNannySetupContext("roll_var", 0); | |
__pyx_pybuffer_start.pybuffer.buf = NULL; | |
__pyx_pybuffer_start.refcount = 0; | |
__pyx_pybuffernd_start.data = NULL; | |
__pyx_pybuffernd_start.rcbuffer = &__pyx_pybuffer_start; | |
__pyx_pybuffer_end.pybuffer.buf = NULL; | |
__pyx_pybuffer_end.refcount = 0; | |
__pyx_pybuffernd_end.data = NULL; | |
__pyx_pybuffernd_end.rcbuffer = &__pyx_pybuffer_end; | |
__pyx_pybuffer_output.pybuffer.buf = NULL; | |
__pyx_pybuffer_output.refcount = 0; | |
__pyx_pybuffernd_output.data = NULL; | |
__pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 686, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":692 | |
* """ | |
* cdef: | |
* double val, prev, mean_x = 0, ssqdm_x = 0, nobs = 0, delta, mean_x_old # <<<<<<<<<<<<<< | |
* int64_t s, e | |
* bint is_variable | |
*/ | |
__pyx_v_mean_x = 0.0; | |
__pyx_v_ssqdm_x = 0.0; | |
__pyx_v_nobs = 0.0; | |
/* "pandas/_libs/window.pyx":699 | |
* ndarray[double_t] output | |
* | |
* start, end, N, win, minp, is_variable = get_window_indexer(input, win, # <<<<<<<<<<<<<< | |
* minp, index, | |
* closed) | |
*/ | |
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_window_indexer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_2); | |
__pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_win); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 699, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
/* "pandas/_libs/window.pyx":700 | |
* | |
* start, end, N, win, minp, is_variable = get_window_indexer(input, win, | |
* minp, index, # <<<<<<<<<<<<<< | |
* closed) | |
* output = np.empty(N, dtype=float) | |
*/ | |
__pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_minp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 700, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
/* "pandas/_libs/window.pyx":701 | |
* start, end, N, win, minp, is_variable = get_window_indexer(input, win, | |
* minp, index, | |
* closed) # <<<<<<<<<<<<<< | |
* output = np.empty(N, dtype=float) | |
* | |
*/ | |
__pyx_t_5 = NULL; | |
__pyx_t_6 = 0; | |
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { | |
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); | |
if (likely(__pyx_t_5)) { | |
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
__Pyx_INCREF(__pyx_t_5); | |
__Pyx_INCREF(function); | |
__Pyx_DECREF_SET(__pyx_t_2, function); | |
__pyx_t_6 = 1; | |
} | |
} | |
#if CYTHON_FAST_PYCALL | |
if (PyFunction_Check(__pyx_t_2)) { | |
PyObject *__pyx_temp[6] = {__pyx_t_5, ((PyObject *)__pyx_v_input), __pyx_t_3, __pyx_t_4, __pyx_v_index, __pyx_v_closed}; | |
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 5+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error) | |
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
} else | |
#endif | |
#if CYTHON_FAST_PYCCALL | |
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { | |
PyObject *__pyx_temp[6] = {__pyx_t_5, ((PyObject *)__pyx_v_input), __pyx_t_3, __pyx_t_4, __pyx_v_index, __pyx_v_closed}; | |
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 5+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error) | |
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
} else | |
#endif | |
{ | |
__pyx_t_7 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 699, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_7); | |
if (__pyx_t_5) { | |
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; | |
} | |
__Pyx_INCREF(((PyObject *)__pyx_v_input)); | |
__Pyx_GIVEREF(((PyObject *)__pyx_v_input)); | |
PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_input)); | |
__Pyx_GIVEREF(__pyx_t_3); | |
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3); | |
__Pyx_GIVEREF(__pyx_t_4); | |
PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_4); | |
__Pyx_INCREF(__pyx_v_index); | |
__Pyx_GIVEREF(__pyx_v_index); | |
PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_v_index); | |
__Pyx_INCREF(__pyx_v_closed); | |
__Pyx_GIVEREF(__pyx_v_closed); | |
PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_6, __pyx_v_closed); | |
__pyx_t_3 = 0; | |
__pyx_t_4 = 0; | |
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
} | |
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { | |
PyObject* sequence = __pyx_t_1; | |
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); | |
if (unlikely(size != 6)) { | |
if (size > 6) __Pyx_RaiseTooManyValuesError(6); | |
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); | |
__PYX_ERR(0, 699, __pyx_L1_error) | |
} | |
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
if (likely(PyTuple_CheckExact(sequence))) { | |
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); | |
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); | |
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); | |
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 3); | |
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 4); | |
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 5); | |
} else { | |
__pyx_t_2 = PyList_GET_ITEM(sequence, 0); | |
__pyx_t_7 = PyList_GET_ITEM(sequence, 1); | |
__pyx_t_4 = PyList_GET_ITEM(sequence, 2); | |
__pyx_t_3 = PyList_GET_ITEM(sequence, 3); | |
__pyx_t_5 = PyList_GET_ITEM(sequence, 4); | |
__pyx_t_8 = PyList_GET_ITEM(sequence, 5); | |
} | |
__Pyx_INCREF(__pyx_t_2); | |
__Pyx_INCREF(__pyx_t_7); | |
__Pyx_INCREF(__pyx_t_4); | |
__Pyx_INCREF(__pyx_t_3); | |
__Pyx_INCREF(__pyx_t_5); | |
__Pyx_INCREF(__pyx_t_8); | |
#else | |
{ | |
Py_ssize_t i; | |
PyObject** temps[6] = {&__pyx_t_2,&__pyx_t_7,&__pyx_t_4,&__pyx_t_3,&__pyx_t_5,&__pyx_t_8}; | |
for (i=0; i < 6; i++) { | |
PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 699, __pyx_L1_error) | |
__Pyx_GOTREF(item); | |
*(temps[i]) = item; | |
} | |
} | |
#endif | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
} else { | |
Py_ssize_t index = -1; | |
PyObject** temps[6] = {&__pyx_t_2,&__pyx_t_7,&__pyx_t_4,&__pyx_t_3,&__pyx_t_5,&__pyx_t_8}; | |
__pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 699, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_9); | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
__pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; | |
for (index=0; index < 6; index++) { | |
PyObject* item = __pyx_t_10(__pyx_t_9); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; | |
__Pyx_GOTREF(item); | |
*(temps[index]) = item; | |
} | |
if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 6) < 0) __PYX_ERR(0, 699, __pyx_L1_error) | |
__pyx_t_10 = NULL; | |
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
goto __pyx_L4_unpacking_done; | |
__pyx_L3_unpacking_failed:; | |
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
__pyx_t_10 = NULL; | |
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); | |
__PYX_ERR(0, 699, __pyx_L1_error) | |
__pyx_L4_unpacking_done:; | |
} | |
/* "pandas/_libs/window.pyx":699 | |
* ndarray[double_t] output | |
* | |
* start, end, N, win, minp, is_variable = get_window_indexer(input, win, # <<<<<<<<<<<<<< | |
* minp, index, | |
* closed) | |
*/ | |
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 699, __pyx_L1_error) | |
if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 699, __pyx_L1_error) | |
__pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 699, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
__pyx_t_12 = __Pyx_PyInt_As_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_12 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 699, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
__pyx_t_13 = __Pyx_PyInt_As_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_13 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 699, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 699, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
__pyx_t_15 = ((PyArrayObject *)__pyx_t_2); | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start.rcbuffer->pybuffer); | |
__pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_start.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); | |
if (unlikely(__pyx_t_6 < 0)) { | |
PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_start.rcbuffer->pybuffer, (PyObject*)__pyx_v_start, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { | |
Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); | |
__Pyx_RaiseBufferFallbackError(); | |
} else { | |
PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); | |
} | |
__pyx_t_16 = __pyx_t_17 = __pyx_t_18 = 0; | |
} | |
__pyx_pybuffernd_start.diminfo[0].strides = __pyx_pybuffernd_start.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_start.diminfo[0].shape = __pyx_pybuffernd_start.rcbuffer->pybuffer.shape[0]; | |
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 699, __pyx_L1_error) | |
} | |
__pyx_t_15 = 0; | |
__pyx_v_start = ((PyArrayObject *)__pyx_t_2); | |
__pyx_t_2 = 0; | |
__pyx_t_15 = ((PyArrayObject *)__pyx_t_7); | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end.rcbuffer->pybuffer); | |
__pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_end.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); | |
if (unlikely(__pyx_t_6 < 0)) { | |
PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_end.rcbuffer->pybuffer, (PyObject*)__pyx_v_end, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { | |
Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); | |
__Pyx_RaiseBufferFallbackError(); | |
} else { | |
PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); | |
} | |
__pyx_t_18 = __pyx_t_17 = __pyx_t_16 = 0; | |
} | |
__pyx_pybuffernd_end.diminfo[0].strides = __pyx_pybuffernd_end.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_end.diminfo[0].shape = __pyx_pybuffernd_end.rcbuffer->pybuffer.shape[0]; | |
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 699, __pyx_L1_error) | |
} | |
__pyx_t_15 = 0; | |
__pyx_v_end = ((PyArrayObject *)__pyx_t_7); | |
__pyx_t_7 = 0; | |
__pyx_v_N = __pyx_t_11; | |
__pyx_v_win = __pyx_t_12; | |
__pyx_v_minp = __pyx_t_13; | |
__pyx_v_is_variable = __pyx_t_14; | |
/* "pandas/_libs/window.pyx":702 | |
* minp, index, | |
* closed) | |
* output = np.empty(N, dtype=float) # <<<<<<<<<<<<<< | |
* | |
* # Check for windows larger than array, addresses #7297 | |
*/ | |
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 702, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_8); | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
__pyx_t_1 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_GIVEREF(__pyx_t_1); | |
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); | |
__pyx_t_1 = 0; | |
__pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 702, __pyx_L1_error) | |
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 702, __pyx_L1_error) | |
__pyx_t_19 = ((PyArrayObject *)__pyx_t_3); | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); | |
__pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); | |
if (unlikely(__pyx_t_6 < 0)) { | |
PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_v_output, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { | |
Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); | |
__Pyx_RaiseBufferFallbackError(); | |
} else { | |
PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); | |
} | |
__pyx_t_16 = __pyx_t_17 = __pyx_t_18 = 0; | |
} | |
__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; | |
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 702, __pyx_L1_error) | |
} | |
__pyx_t_19 = 0; | |
__pyx_v_output = ((PyArrayObject *)__pyx_t_3); | |
__pyx_t_3 = 0; | |
/* "pandas/_libs/window.pyx":705 | |
* | |
* # Check for windows larger than array, addresses #7297 | |
* win = min(win, N) # <<<<<<<<<<<<<< | |
* | |
* # for performance we are going to iterate | |
*/ | |
__pyx_t_11 = __pyx_v_N; | |
__pyx_t_13 = __pyx_v_win; | |
if (((__pyx_t_11 < __pyx_t_13) != 0)) { | |
__pyx_t_12 = __pyx_t_11; | |
} else { | |
__pyx_t_12 = __pyx_t_13; | |
} | |
__pyx_v_win = __pyx_t_12; | |
/* "pandas/_libs/window.pyx":711 | |
* # have 2 paths but is faster | |
* | |
* if is_variable: # <<<<<<<<<<<<<< | |
* | |
* with nogil: | |
*/ | |
__pyx_t_14 = (__pyx_v_is_variable != 0); | |
if (__pyx_t_14) { | |
/* "pandas/_libs/window.pyx":713 | |
* if is_variable: | |
* | |
* with nogil: # <<<<<<<<<<<<<< | |
* | |
* for i in range(0, N): | |
*/ | |
{ | |
#ifdef WITH_THREAD | |
PyThreadState *_save; | |
Py_UNBLOCK_THREADS | |
__Pyx_FastGIL_Remember(); | |
#endif | |
/*try:*/ { | |
/* "pandas/_libs/window.pyx":715 | |
* with nogil: | |
* | |
* for i in range(0, N): # <<<<<<<<<<<<<< | |
* | |
* s = start[i] | |
*/ | |
__pyx_t_11 = __pyx_v_N; | |
__pyx_t_20 = __pyx_t_11; | |
for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { | |
__pyx_v_i = __pyx_t_21; | |
/* "pandas/_libs/window.pyx":717 | |
* for i in range(0, N): | |
* | |
* s = start[i] # <<<<<<<<<<<<<< | |
* e = end[i] | |
* | |
*/ | |
__pyx_t_22 = __pyx_v_i; | |
__pyx_v_s = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_start.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_start.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":718 | |
* | |
* s = start[i] | |
* e = end[i] # <<<<<<<<<<<<<< | |
* | |
* # Over the first window, observations can only be added | |
*/ | |
__pyx_t_23 = __pyx_v_i; | |
__pyx_v_e = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_end.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_end.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":722 | |
* # Over the first window, observations can only be added | |
* # never removed | |
* if i == 0: # <<<<<<<<<<<<<< | |
* | |
* for j in range(s, e): | |
*/ | |
__pyx_t_14 = ((__pyx_v_i == 0) != 0); | |
if (__pyx_t_14) { | |
/* "pandas/_libs/window.pyx":724 | |
* if i == 0: | |
* | |
* for j in range(s, e): # <<<<<<<<<<<<<< | |
* add_var(input[j], &nobs, &mean_x, &ssqdm_x) | |
* | |
*/ | |
__pyx_t_12 = __pyx_v_e; | |
__pyx_t_13 = __pyx_t_12; | |
for (__pyx_t_24 = __pyx_v_s; __pyx_t_24 < __pyx_t_13; __pyx_t_24+=1) { | |
__pyx_v_j = __pyx_t_24; | |
/* "pandas/_libs/window.pyx":725 | |
* | |
* for j in range(s, e): | |
* add_var(input[j], &nobs, &mean_x, &ssqdm_x) # <<<<<<<<<<<<<< | |
* | |
* else: | |
*/ | |
__pyx_t_25 = __pyx_v_j; | |
__pyx_f_6pandas_5_libs_6window_add_var((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_input.diminfo[0].strides)), (&__pyx_v_nobs), (&__pyx_v_mean_x), (&__pyx_v_ssqdm_x)); | |
} | |
/* "pandas/_libs/window.pyx":722 | |
* # Over the first window, observations can only be added | |
* # never removed | |
* if i == 0: # <<<<<<<<<<<<<< | |
* | |
* for j in range(s, e): | |
*/ | |
goto __pyx_L11; | |
} | |
/* "pandas/_libs/window.pyx":733 | |
* | |
* # calculate adds | |
* for j in range(end[i - 1], e): # <<<<<<<<<<<<<< | |
* add_var(input[j], &nobs, &mean_x, &ssqdm_x) | |
* | |
*/ | |
/*else*/ { | |
__pyx_t_12 = __pyx_v_e; | |
__pyx_t_26 = (__pyx_v_i - 1); | |
__pyx_t_13 = __pyx_t_12; | |
for (__pyx_t_24 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_end.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_end.diminfo[0].strides)); __pyx_t_24 < __pyx_t_13; __pyx_t_24+=1) { | |
__pyx_v_j = __pyx_t_24; | |
/* "pandas/_libs/window.pyx":734 | |
* # calculate adds | |
* for j in range(end[i - 1], e): | |
* add_var(input[j], &nobs, &mean_x, &ssqdm_x) # <<<<<<<<<<<<<< | |
* | |
* # calculate deletes | |
*/ | |
__pyx_t_27 = __pyx_v_j; | |
__pyx_f_6pandas_5_libs_6window_add_var((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_input.diminfo[0].strides)), (&__pyx_v_nobs), (&__pyx_v_mean_x), (&__pyx_v_ssqdm_x)); | |
} | |
/* "pandas/_libs/window.pyx":737 | |
* | |
* # calculate deletes | |
* for j in range(start[i - 1], s): # <<<<<<<<<<<<<< | |
* remove_var(input[j], &nobs, &mean_x, &ssqdm_x) | |
* | |
*/ | |
__pyx_t_12 = __pyx_v_s; | |
__pyx_t_28 = (__pyx_v_i - 1); | |
__pyx_t_13 = __pyx_t_12; | |
for (__pyx_t_24 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_start.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_start.diminfo[0].strides)); __pyx_t_24 < __pyx_t_13; __pyx_t_24+=1) { | |
__pyx_v_j = __pyx_t_24; | |
/* "pandas/_libs/window.pyx":738 | |
* # calculate deletes | |
* for j in range(start[i - 1], s): | |
* remove_var(input[j], &nobs, &mean_x, &ssqdm_x) # <<<<<<<<<<<<<< | |
* | |
* output[i] = calc_var(minp, ddof, nobs, ssqdm_x) | |
*/ | |
__pyx_t_29 = __pyx_v_j; | |
__pyx_f_6pandas_5_libs_6window_remove_var((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_input.diminfo[0].strides)), (&__pyx_v_nobs), (&__pyx_v_mean_x), (&__pyx_v_ssqdm_x)); | |
} | |
} | |
__pyx_L11:; | |
/* "pandas/_libs/window.pyx":740 | |
* remove_var(input[j], &nobs, &mean_x, &ssqdm_x) | |
* | |
* output[i] = calc_var(minp, ddof, nobs, ssqdm_x) # <<<<<<<<<<<<<< | |
* | |
* else: | |
*/ | |
__pyx_t_30 = __pyx_v_i; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_f_6pandas_5_libs_6window_calc_var(__pyx_v_minp, __pyx_v_ddof, __pyx_v_nobs, __pyx_v_ssqdm_x); | |
} | |
} | |
/* "pandas/_libs/window.pyx":713 | |
* if is_variable: | |
* | |
* with nogil: # <<<<<<<<<<<<<< | |
* | |
* for i in range(0, N): | |
*/ | |
/*finally:*/ { | |
/*normal exit:*/{ | |
#ifdef WITH_THREAD | |
__Pyx_FastGIL_Forget(); | |
Py_BLOCK_THREADS | |
#endif | |
goto __pyx_L8; | |
} | |
__pyx_L8:; | |
} | |
} | |
/* "pandas/_libs/window.pyx":711 | |
* # have 2 paths but is faster | |
* | |
* if is_variable: # <<<<<<<<<<<<<< | |
* | |
* with nogil: | |
*/ | |
goto __pyx_L5; | |
} | |
/* "pandas/_libs/window.pyx":744 | |
* else: | |
* | |
* with nogil: # <<<<<<<<<<<<<< | |
* | |
* # Over the first window, observations can only be added, never | |
*/ | |
/*else*/ { | |
{ | |
#ifdef WITH_THREAD | |
PyThreadState *_save; | |
Py_UNBLOCK_THREADS | |
__Pyx_FastGIL_Remember(); | |
#endif | |
/*try:*/ { | |
/* "pandas/_libs/window.pyx":748 | |
* # Over the first window, observations can only be added, never | |
* # removed | |
* for i from 0 <= i < win: # <<<<<<<<<<<<<< | |
* add_var(input[i], &nobs, &mean_x, &ssqdm_x) | |
* output[i] = calc_var(minp, ddof, nobs, ssqdm_x) | |
*/ | |
__pyx_t_12 = __pyx_v_win; | |
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_12; __pyx_v_i++) { | |
/* "pandas/_libs/window.pyx":749 | |
* # removed | |
* for i from 0 <= i < win: | |
* add_var(input[i], &nobs, &mean_x, &ssqdm_x) # <<<<<<<<<<<<<< | |
* output[i] = calc_var(minp, ddof, nobs, ssqdm_x) | |
* | |
*/ | |
__pyx_t_31 = __pyx_v_i; | |
__pyx_f_6pandas_5_libs_6window_add_var((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_input.diminfo[0].strides)), (&__pyx_v_nobs), (&__pyx_v_mean_x), (&__pyx_v_ssqdm_x)); | |
/* "pandas/_libs/window.pyx":750 | |
* for i from 0 <= i < win: | |
* add_var(input[i], &nobs, &mean_x, &ssqdm_x) | |
* output[i] = calc_var(minp, ddof, nobs, ssqdm_x) # <<<<<<<<<<<<<< | |
* | |
* # a part of Welford's method for the online variance-calculation | |
*/ | |
__pyx_t_32 = __pyx_v_i; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_f_6pandas_5_libs_6window_calc_var(__pyx_v_minp, __pyx_v_ddof, __pyx_v_nobs, __pyx_v_ssqdm_x); | |
} | |
/* "pandas/_libs/window.pyx":757 | |
* # After the first window, observations can both be added and | |
* # removed | |
* for i from win <= i < N: # <<<<<<<<<<<<<< | |
* val = input[i] | |
* prev = input[i - win] | |
*/ | |
__pyx_t_11 = __pyx_v_N; | |
for (__pyx_v_i = __pyx_v_win; __pyx_v_i < __pyx_t_11; __pyx_v_i++) { | |
/* "pandas/_libs/window.pyx":758 | |
* # removed | |
* for i from win <= i < N: | |
* val = input[i] # <<<<<<<<<<<<<< | |
* prev = input[i - win] | |
* | |
*/ | |
__pyx_t_33 = __pyx_v_i; | |
__pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_input.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":759 | |
* for i from win <= i < N: | |
* val = input[i] | |
* prev = input[i - win] # <<<<<<<<<<<<<< | |
* | |
* if val == val: | |
*/ | |
__pyx_t_12 = (__pyx_v_i - __pyx_v_win); | |
__pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_input.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":761 | |
* prev = input[i - win] | |
* | |
* if val == val: # <<<<<<<<<<<<<< | |
* if prev == prev: | |
* | |
*/ | |
__pyx_t_14 = ((__pyx_v_val == __pyx_v_val) != 0); | |
if (__pyx_t_14) { | |
/* "pandas/_libs/window.pyx":762 | |
* | |
* if val == val: | |
* if prev == prev: # <<<<<<<<<<<<<< | |
* | |
* # Adding one observation and removing another one | |
*/ | |
__pyx_t_14 = ((__pyx_v_prev == __pyx_v_prev) != 0); | |
if (__pyx_t_14) { | |
/* "pandas/_libs/window.pyx":765 | |
* | |
* # Adding one observation and removing another one | |
* delta = val - prev # <<<<<<<<<<<<<< | |
* mean_x_old = mean_x | |
* | |
*/ | |
__pyx_v_delta = (__pyx_v_val - __pyx_v_prev); | |
/* "pandas/_libs/window.pyx":766 | |
* # Adding one observation and removing another one | |
* delta = val - prev | |
* mean_x_old = mean_x # <<<<<<<<<<<<<< | |
* | |
* mean_x += delta / nobs | |
*/ | |
__pyx_v_mean_x_old = __pyx_v_mean_x; | |
/* "pandas/_libs/window.pyx":768 | |
* mean_x_old = mean_x | |
* | |
* mean_x += delta / nobs # <<<<<<<<<<<<<< | |
* ssqdm_x += ((nobs - 1) * val | |
* + (nobs + 1) * prev | |
*/ | |
__pyx_v_mean_x = (__pyx_v_mean_x + (__pyx_v_delta / __pyx_v_nobs)); | |
/* "pandas/_libs/window.pyx":769 | |
* | |
* mean_x += delta / nobs | |
* ssqdm_x += ((nobs - 1) * val # <<<<<<<<<<<<<< | |
* + (nobs + 1) * prev | |
* - 2 * nobs * mean_x_old) * delta / nobs | |
*/ | |
__pyx_v_ssqdm_x = (__pyx_v_ssqdm_x + ((((((__pyx_v_nobs - 1.0) * __pyx_v_val) + ((__pyx_v_nobs + 1.0) * __pyx_v_prev)) - ((2.0 * __pyx_v_nobs) * __pyx_v_mean_x_old)) * __pyx_v_delta) / __pyx_v_nobs)); | |
/* "pandas/_libs/window.pyx":762 | |
* | |
* if val == val: | |
* if prev == prev: # <<<<<<<<<<<<<< | |
* | |
* # Adding one observation and removing another one | |
*/ | |
goto __pyx_L26; | |
} | |
/* "pandas/_libs/window.pyx":774 | |
* | |
* else: | |
* add_var(val, &nobs, &mean_x, &ssqdm_x) # <<<<<<<<<<<<<< | |
* elif prev == prev: | |
* remove_var(prev, &nobs, &mean_x, &ssqdm_x) | |
*/ | |
/*else*/ { | |
__pyx_f_6pandas_5_libs_6window_add_var(__pyx_v_val, (&__pyx_v_nobs), (&__pyx_v_mean_x), (&__pyx_v_ssqdm_x)); | |
} | |
__pyx_L26:; | |
/* "pandas/_libs/window.pyx":761 | |
* prev = input[i - win] | |
* | |
* if val == val: # <<<<<<<<<<<<<< | |
* if prev == prev: | |
* | |
*/ | |
goto __pyx_L25; | |
} | |
/* "pandas/_libs/window.pyx":775 | |
* else: | |
* add_var(val, &nobs, &mean_x, &ssqdm_x) | |
* elif prev == prev: # <<<<<<<<<<<<<< | |
* remove_var(prev, &nobs, &mean_x, &ssqdm_x) | |
* | |
*/ | |
__pyx_t_14 = ((__pyx_v_prev == __pyx_v_prev) != 0); | |
if (__pyx_t_14) { | |
/* "pandas/_libs/window.pyx":776 | |
* add_var(val, &nobs, &mean_x, &ssqdm_x) | |
* elif prev == prev: | |
* remove_var(prev, &nobs, &mean_x, &ssqdm_x) # <<<<<<<<<<<<<< | |
* | |
* output[i] = calc_var(minp, ddof, nobs, ssqdm_x) | |
*/ | |
__pyx_f_6pandas_5_libs_6window_remove_var(__pyx_v_prev, (&__pyx_v_nobs), (&__pyx_v_mean_x), (&__pyx_v_ssqdm_x)); | |
/* "pandas/_libs/window.pyx":775 | |
* else: | |
* add_var(val, &nobs, &mean_x, &ssqdm_x) | |
* elif prev == prev: # <<<<<<<<<<<<<< | |
* remove_var(prev, &nobs, &mean_x, &ssqdm_x) | |
* | |
*/ | |
} | |
__pyx_L25:; | |
/* "pandas/_libs/window.pyx":778 | |
* remove_var(prev, &nobs, &mean_x, &ssqdm_x) | |
* | |
* output[i] = calc_var(minp, ddof, nobs, ssqdm_x) # <<<<<<<<<<<<<< | |
* | |
* return output | |
*/ | |
__pyx_t_34 = __pyx_v_i; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_f_6pandas_5_libs_6window_calc_var(__pyx_v_minp, __pyx_v_ddof, __pyx_v_nobs, __pyx_v_ssqdm_x); | |
} | |
} | |
/* "pandas/_libs/window.pyx":744 | |
* else: | |
* | |
* with nogil: # <<<<<<<<<<<<<< | |
* | |
* # Over the first window, observations can only be added, never | |
*/ | |
/*finally:*/ { | |
/*normal exit:*/{ | |
#ifdef WITH_THREAD | |
__Pyx_FastGIL_Forget(); | |
Py_BLOCK_THREADS | |
#endif | |
goto __pyx_L20; | |
} | |
__pyx_L20:; | |
} | |
} | |
} | |
__pyx_L5:; | |
/* "pandas/_libs/window.pyx":780 | |
* output[i] = calc_var(minp, ddof, nobs, ssqdm_x) | |
* | |
* return output # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__Pyx_INCREF(((PyObject *)__pyx_v_output)); | |
__pyx_r = ((PyObject *)__pyx_v_output); | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":686 | |
* | |
* | |
* def roll_var(ndarray[double_t] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed, int ddof=1): | |
* """ | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
__Pyx_XDECREF(__pyx_t_2); | |
__Pyx_XDECREF(__pyx_t_3); | |
__Pyx_XDECREF(__pyx_t_4); | |
__Pyx_XDECREF(__pyx_t_5); | |
__Pyx_XDECREF(__pyx_t_7); | |
__Pyx_XDECREF(__pyx_t_8); | |
__Pyx_XDECREF(__pyx_t_9); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_var", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XDECREF((PyObject *)__pyx_v_start); | |
__Pyx_XDECREF((PyObject *)__pyx_v_end); | |
__Pyx_XDECREF((PyObject *)__pyx_v_output); | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "pandas/_libs/window.pyx":786 | |
* # Rolling skewness | |
* | |
* cdef inline double calc_skew(int64_t minp, int64_t nobs, double x, double xx, # <<<<<<<<<<<<<< | |
* double xxx) nogil: | |
* cdef double result, dnobs | |
*/ | |
static CYTHON_INLINE double __pyx_f_6pandas_5_libs_6window_calc_skew(__pyx_t_5numpy_int64_t __pyx_v_minp, __pyx_t_5numpy_int64_t __pyx_v_nobs, double __pyx_v_x, double __pyx_v_xx, double __pyx_v_xxx) { | |
double __pyx_v_result; | |
double __pyx_v_dnobs; | |
double __pyx_v_A; | |
double __pyx_v_B; | |
double __pyx_v_C; | |
double __pyx_v_R; | |
double __pyx_r; | |
int __pyx_t_1; | |
int __pyx_t_2; | |
/* "pandas/_libs/window.pyx":791 | |
* cdef double A, B, C, R | |
* | |
* if nobs >= minp: # <<<<<<<<<<<<<< | |
* dnobs = <double>nobs | |
* A = x / dnobs | |
*/ | |
__pyx_t_1 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":792 | |
* | |
* if nobs >= minp: | |
* dnobs = <double>nobs # <<<<<<<<<<<<<< | |
* A = x / dnobs | |
* B = xx / dnobs - A * A | |
*/ | |
__pyx_v_dnobs = ((double)__pyx_v_nobs); | |
/* "pandas/_libs/window.pyx":793 | |
* if nobs >= minp: | |
* dnobs = <double>nobs | |
* A = x / dnobs # <<<<<<<<<<<<<< | |
* B = xx / dnobs - A * A | |
* C = xxx / dnobs - A * A * A - 3 * A * B | |
*/ | |
__pyx_v_A = (__pyx_v_x / __pyx_v_dnobs); | |
/* "pandas/_libs/window.pyx":794 | |
* dnobs = <double>nobs | |
* A = x / dnobs | |
* B = xx / dnobs - A * A # <<<<<<<<<<<<<< | |
* C = xxx / dnobs - A * A * A - 3 * A * B | |
* | |
*/ | |
__pyx_v_B = ((__pyx_v_xx / __pyx_v_dnobs) - (__pyx_v_A * __pyx_v_A)); | |
/* "pandas/_libs/window.pyx":795 | |
* A = x / dnobs | |
* B = xx / dnobs - A * A | |
* C = xxx / dnobs - A * A * A - 3 * A * B # <<<<<<<<<<<<<< | |
* | |
* # #18044: with uniform distribution, floating issue will | |
*/ | |
__pyx_v_C = (((__pyx_v_xxx / __pyx_v_dnobs) - ((__pyx_v_A * __pyx_v_A) * __pyx_v_A)) - ((3.0 * __pyx_v_A) * __pyx_v_B)); | |
/* "pandas/_libs/window.pyx":806 | |
* # treat as zero, here we follow the original | |
* # skew/kurt behaviour to check B <= 1e-14 | |
* if B <= 1e-14 or nobs < 3: # <<<<<<<<<<<<<< | |
* result = NaN | |
* else: | |
*/ | |
__pyx_t_2 = ((__pyx_v_B <= 1e-14) != 0); | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_1 = __pyx_t_2; | |
goto __pyx_L5_bool_binop_done; | |
} | |
__pyx_t_2 = ((__pyx_v_nobs < 3) != 0); | |
__pyx_t_1 = __pyx_t_2; | |
__pyx_L5_bool_binop_done:; | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":807 | |
* # skew/kurt behaviour to check B <= 1e-14 | |
* if B <= 1e-14 or nobs < 3: | |
* result = NaN # <<<<<<<<<<<<<< | |
* else: | |
* R = sqrt(B) | |
*/ | |
__pyx_v_result = __pyx_v_6pandas_5_libs_6window_NaN; | |
/* "pandas/_libs/window.pyx":806 | |
* # treat as zero, here we follow the original | |
* # skew/kurt behaviour to check B <= 1e-14 | |
* if B <= 1e-14 or nobs < 3: # <<<<<<<<<<<<<< | |
* result = NaN | |
* else: | |
*/ | |
goto __pyx_L4; | |
} | |
/* "pandas/_libs/window.pyx":809 | |
* result = NaN | |
* else: | |
* R = sqrt(B) # <<<<<<<<<<<<<< | |
* result = ((sqrt(dnobs * (dnobs - 1.)) * C) / | |
* ((dnobs - 2) * R * R * R)) | |
*/ | |
/*else*/ { | |
__pyx_v_R = std::sqrt(__pyx_v_B); | |
/* "pandas/_libs/window.pyx":810 | |
* else: | |
* R = sqrt(B) | |
* result = ((sqrt(dnobs * (dnobs - 1.)) * C) / # <<<<<<<<<<<<<< | |
* ((dnobs - 2) * R * R * R)) | |
* else: | |
*/ | |
__pyx_v_result = ((std::sqrt((__pyx_v_dnobs * (__pyx_v_dnobs - 1.))) * __pyx_v_C) / ((((__pyx_v_dnobs - 2.0) * __pyx_v_R) * __pyx_v_R) * __pyx_v_R)); | |
} | |
__pyx_L4:; | |
/* "pandas/_libs/window.pyx":791 | |
* cdef double A, B, C, R | |
* | |
* if nobs >= minp: # <<<<<<<<<<<<<< | |
* dnobs = <double>nobs | |
* A = x / dnobs | |
*/ | |
goto __pyx_L3; | |
} | |
/* "pandas/_libs/window.pyx":813 | |
* ((dnobs - 2) * R * R * R)) | |
* else: | |
* result = NaN # <<<<<<<<<<<<<< | |
* | |
* return result | |
*/ | |
/*else*/ { | |
__pyx_v_result = __pyx_v_6pandas_5_libs_6window_NaN; | |
} | |
__pyx_L3:; | |
/* "pandas/_libs/window.pyx":815 | |
* result = NaN | |
* | |
* return result # <<<<<<<<<<<<<< | |
* | |
* cdef inline void add_skew(double val, int64_t *nobs, double *x, double *xx, | |
*/ | |
__pyx_r = __pyx_v_result; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":786 | |
* # Rolling skewness | |
* | |
* cdef inline double calc_skew(int64_t minp, int64_t nobs, double x, double xx, # <<<<<<<<<<<<<< | |
* double xxx) nogil: | |
* cdef double result, dnobs | |
*/ | |
/* function exit code */ | |
__pyx_L0:; | |
return __pyx_r; | |
} | |
/* "pandas/_libs/window.pyx":817 | |
* return result | |
* | |
* cdef inline void add_skew(double val, int64_t *nobs, double *x, double *xx, # <<<<<<<<<<<<<< | |
* double *xxx) nogil: | |
* """ add a value from the skew calc """ | |
*/ | |
static CYTHON_INLINE void __pyx_f_6pandas_5_libs_6window_add_skew(double __pyx_v_val, __pyx_t_5numpy_int64_t *__pyx_v_nobs, double *__pyx_v_x, double *__pyx_v_xx, double *__pyx_v_xxx) { | |
int __pyx_t_1; | |
/* "pandas/_libs/window.pyx":822 | |
* | |
* # Not NaN | |
* if val == val: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] + 1 | |
* | |
*/ | |
__pyx_t_1 = ((__pyx_v_val == __pyx_v_val) != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":823 | |
* # Not NaN | |
* if val == val: | |
* nobs[0] = nobs[0] + 1 # <<<<<<<<<<<<<< | |
* | |
* # seriously don't ask me why this is faster | |
*/ | |
(__pyx_v_nobs[0]) = ((__pyx_v_nobs[0]) + 1); | |
/* "pandas/_libs/window.pyx":826 | |
* | |
* # seriously don't ask me why this is faster | |
* x[0] = x[0] + val # <<<<<<<<<<<<<< | |
* xx[0] = xx[0] + val * val | |
* xxx[0] = xxx[0] + val * val * val | |
*/ | |
(__pyx_v_x[0]) = ((__pyx_v_x[0]) + __pyx_v_val); | |
/* "pandas/_libs/window.pyx":827 | |
* # seriously don't ask me why this is faster | |
* x[0] = x[0] + val | |
* xx[0] = xx[0] + val * val # <<<<<<<<<<<<<< | |
* xxx[0] = xxx[0] + val * val * val | |
* | |
*/ | |
(__pyx_v_xx[0]) = ((__pyx_v_xx[0]) + (__pyx_v_val * __pyx_v_val)); | |
/* "pandas/_libs/window.pyx":828 | |
* x[0] = x[0] + val | |
* xx[0] = xx[0] + val * val | |
* xxx[0] = xxx[0] + val * val * val # <<<<<<<<<<<<<< | |
* | |
* cdef inline void remove_skew(double val, int64_t *nobs, double *x, double *xx, | |
*/ | |
(__pyx_v_xxx[0]) = ((__pyx_v_xxx[0]) + ((__pyx_v_val * __pyx_v_val) * __pyx_v_val)); | |
/* "pandas/_libs/window.pyx":822 | |
* | |
* # Not NaN | |
* if val == val: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] + 1 | |
* | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":817 | |
* return result | |
* | |
* cdef inline void add_skew(double val, int64_t *nobs, double *x, double *xx, # <<<<<<<<<<<<<< | |
* double *xxx) nogil: | |
* """ add a value from the skew calc """ | |
*/ | |
/* function exit code */ | |
} | |
/* "pandas/_libs/window.pyx":830 | |
* xxx[0] = xxx[0] + val * val * val | |
* | |
* cdef inline void remove_skew(double val, int64_t *nobs, double *x, double *xx, # <<<<<<<<<<<<<< | |
* double *xxx) nogil: | |
* """ remove a value from the skew calc """ | |
*/ | |
static CYTHON_INLINE void __pyx_f_6pandas_5_libs_6window_remove_skew(double __pyx_v_val, __pyx_t_5numpy_int64_t *__pyx_v_nobs, double *__pyx_v_x, double *__pyx_v_xx, double *__pyx_v_xxx) { | |
int __pyx_t_1; | |
/* "pandas/_libs/window.pyx":835 | |
* | |
* # Not NaN | |
* if val == val: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] - 1 | |
* | |
*/ | |
__pyx_t_1 = ((__pyx_v_val == __pyx_v_val) != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":836 | |
* # Not NaN | |
* if val == val: | |
* nobs[0] = nobs[0] - 1 # <<<<<<<<<<<<<< | |
* | |
* # seriously don't ask me why this is faster | |
*/ | |
(__pyx_v_nobs[0]) = ((__pyx_v_nobs[0]) - 1); | |
/* "pandas/_libs/window.pyx":839 | |
* | |
* # seriously don't ask me why this is faster | |
* x[0] = x[0] - val # <<<<<<<<<<<<<< | |
* xx[0] = xx[0] - val * val | |
* xxx[0] = xxx[0] - val * val * val | |
*/ | |
(__pyx_v_x[0]) = ((__pyx_v_x[0]) - __pyx_v_val); | |
/* "pandas/_libs/window.pyx":840 | |
* # seriously don't ask me why this is faster | |
* x[0] = x[0] - val | |
* xx[0] = xx[0] - val * val # <<<<<<<<<<<<<< | |
* xxx[0] = xxx[0] - val * val * val | |
* | |
*/ | |
(__pyx_v_xx[0]) = ((__pyx_v_xx[0]) - (__pyx_v_val * __pyx_v_val)); | |
/* "pandas/_libs/window.pyx":841 | |
* x[0] = x[0] - val | |
* xx[0] = xx[0] - val * val | |
* xxx[0] = xxx[0] - val * val * val # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
(__pyx_v_xxx[0]) = ((__pyx_v_xxx[0]) - ((__pyx_v_val * __pyx_v_val) * __pyx_v_val)); | |
/* "pandas/_libs/window.pyx":835 | |
* | |
* # Not NaN | |
* if val == val: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] - 1 | |
* | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":830 | |
* xxx[0] = xxx[0] + val * val * val | |
* | |
* cdef inline void remove_skew(double val, int64_t *nobs, double *x, double *xx, # <<<<<<<<<<<<<< | |
* double *xxx) nogil: | |
* """ remove a value from the skew calc """ | |
*/ | |
/* function exit code */ | |
} | |
/* "pandas/_libs/window.pyx":844 | |
* | |
* | |
* def roll_skew(ndarray[double_t] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* cdef: | |
*/ | |
/* Python wrapper */ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_13roll_skew(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_mdef_6pandas_5_libs_6window_13roll_skew = {"roll_skew", (PyCFunction)__pyx_pw_6pandas_5_libs_6window_13roll_skew, METH_VARARGS|METH_KEYWORDS, 0}; | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_13roll_skew(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_skew (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_skew", 1, 5, 5, 1); __PYX_ERR(0, 844, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_skew", 1, 5, 5, 2); __PYX_ERR(0, 844, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_skew", 1, 5, 5, 3); __PYX_ERR(0, 844, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_skew", 1, 5, 5, 4); __PYX_ERR(0, 844, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_skew") < 0)) __PYX_ERR(0, 844, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 844, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 844, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_skew", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 844, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_skew", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 844, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_12roll_skew(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_12roll_skew(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
double __pyx_v_val; | |
double __pyx_v_prev; | |
double __pyx_v_x; | |
double __pyx_v_xx; | |
double __pyx_v_xxx; | |
__pyx_t_5numpy_int64_t __pyx_v_nobs; | |
__pyx_t_5numpy_int64_t __pyx_v_i; | |
__pyx_t_5numpy_int64_t __pyx_v_j; | |
__pyx_t_5numpy_int64_t __pyx_v_N; | |
__pyx_t_5numpy_int64_t __pyx_v_s; | |
__pyx_t_5numpy_int64_t __pyx_v_e; | |
int __pyx_v_is_variable; | |
PyArrayObject *__pyx_v_start = 0; | |
PyArrayObject *__pyx_v_end = 0; | |
PyArrayObject *__pyx_v_output = 0; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_end; | |
__Pyx_Buffer __pyx_pybuffer_end; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_output; | |
__Pyx_Buffer __pyx_pybuffer_output; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_start; | |
__Pyx_Buffer __pyx_pybuffer_start; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
PyObject *__pyx_t_2 = NULL; | |
PyObject *__pyx_t_3 = NULL; | |
PyObject *__pyx_t_4 = NULL; | |
PyObject *__pyx_t_5 = NULL; | |
int __pyx_t_6; | |
PyObject *__pyx_t_7 = NULL; | |
PyObject *__pyx_t_8 = NULL; | |
PyObject *__pyx_t_9 = NULL; | |
PyObject *(*__pyx_t_10)(PyObject *); | |
__pyx_t_5numpy_int64_t __pyx_t_11; | |
__pyx_t_5numpy_int64_t __pyx_t_12; | |
__pyx_t_5numpy_int64_t __pyx_t_13; | |
int __pyx_t_14; | |
PyArrayObject *__pyx_t_15 = NULL; | |
PyObject *__pyx_t_16 = NULL; | |
PyObject *__pyx_t_17 = NULL; | |
PyObject *__pyx_t_18 = NULL; | |
PyArrayObject *__pyx_t_19 = NULL; | |
__pyx_t_5numpy_int64_t __pyx_t_20; | |
__pyx_t_5numpy_int64_t __pyx_t_21; | |
__pyx_t_5numpy_int64_t __pyx_t_22; | |
__pyx_t_5numpy_int64_t __pyx_t_23; | |
__pyx_t_5numpy_int64_t __pyx_t_24; | |
__pyx_t_5numpy_int64_t __pyx_t_25; | |
__pyx_t_5numpy_int64_t __pyx_t_26; | |
__pyx_t_5numpy_int64_t __pyx_t_27; | |
__pyx_t_5numpy_int64_t __pyx_t_28; | |
__pyx_t_5numpy_int64_t __pyx_t_29; | |
__pyx_t_5numpy_int64_t __pyx_t_30; | |
__Pyx_RefNannySetupContext("roll_skew", 0); | |
__pyx_pybuffer_start.pybuffer.buf = NULL; | |
__pyx_pybuffer_start.refcount = 0; | |
__pyx_pybuffernd_start.data = NULL; | |
__pyx_pybuffernd_start.rcbuffer = &__pyx_pybuffer_start; | |
__pyx_pybuffer_end.pybuffer.buf = NULL; | |
__pyx_pybuffer_end.refcount = 0; | |
__pyx_pybuffernd_end.data = NULL; | |
__pyx_pybuffernd_end.rcbuffer = &__pyx_pybuffer_end; | |
__pyx_pybuffer_output.pybuffer.buf = NULL; | |
__pyx_pybuffer_output.refcount = 0; | |
__pyx_pybuffernd_output.data = NULL; | |
__pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 844, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":848 | |
* cdef: | |
* double val, prev | |
* double x = 0, xx = 0, xxx = 0 # <<<<<<<<<<<<<< | |
* int64_t nobs = 0, i, j, N | |
* int64_t s, e | |
*/ | |
__pyx_v_x = 0.0; | |
__pyx_v_xx = 0.0; | |
__pyx_v_xxx = 0.0; | |
/* "pandas/_libs/window.pyx":849 | |
* double val, prev | |
* double x = 0, xx = 0, xxx = 0 | |
* int64_t nobs = 0, i, j, N # <<<<<<<<<<<<<< | |
* int64_t s, e | |
* bint is_variable | |
*/ | |
__pyx_v_nobs = 0; | |
/* "pandas/_libs/window.pyx":855 | |
* ndarray[double_t] output | |
* | |
* start, end, N, win, minp, is_variable = get_window_indexer(input, win, # <<<<<<<<<<<<<< | |
* minp, index, | |
* closed) | |
*/ | |
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_window_indexer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_2); | |
__pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_win); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
/* "pandas/_libs/window.pyx":856 | |
* | |
* start, end, N, win, minp, is_variable = get_window_indexer(input, win, | |
* minp, index, # <<<<<<<<<<<<<< | |
* closed) | |
* output = np.empty(N, dtype=float) | |
*/ | |
__pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_minp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
/* "pandas/_libs/window.pyx":857 | |
* start, end, N, win, minp, is_variable = get_window_indexer(input, win, | |
* minp, index, | |
* closed) # <<<<<<<<<<<<<< | |
* output = np.empty(N, dtype=float) | |
* | |
*/ | |
__pyx_t_5 = NULL; | |
__pyx_t_6 = 0; | |
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { | |
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); | |
if (likely(__pyx_t_5)) { | |
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
__Pyx_INCREF(__pyx_t_5); | |
__Pyx_INCREF(function); | |
__Pyx_DECREF_SET(__pyx_t_2, function); | |
__pyx_t_6 = 1; | |
} | |
} | |
#if CYTHON_FAST_PYCALL | |
if (PyFunction_Check(__pyx_t_2)) { | |
PyObject *__pyx_temp[6] = {__pyx_t_5, ((PyObject *)__pyx_v_input), __pyx_t_3, __pyx_t_4, __pyx_v_index, __pyx_v_closed}; | |
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 5+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) | |
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
} else | |
#endif | |
#if CYTHON_FAST_PYCCALL | |
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { | |
PyObject *__pyx_temp[6] = {__pyx_t_5, ((PyObject *)__pyx_v_input), __pyx_t_3, __pyx_t_4, __pyx_v_index, __pyx_v_closed}; | |
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 5+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) | |
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
} else | |
#endif | |
{ | |
__pyx_t_7 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 855, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_7); | |
if (__pyx_t_5) { | |
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; | |
} | |
__Pyx_INCREF(((PyObject *)__pyx_v_input)); | |
__Pyx_GIVEREF(((PyObject *)__pyx_v_input)); | |
PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_input)); | |
__Pyx_GIVEREF(__pyx_t_3); | |
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3); | |
__Pyx_GIVEREF(__pyx_t_4); | |
PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_4); | |
__Pyx_INCREF(__pyx_v_index); | |
__Pyx_GIVEREF(__pyx_v_index); | |
PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_v_index); | |
__Pyx_INCREF(__pyx_v_closed); | |
__Pyx_GIVEREF(__pyx_v_closed); | |
PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_6, __pyx_v_closed); | |
__pyx_t_3 = 0; | |
__pyx_t_4 = 0; | |
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
} | |
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { | |
PyObject* sequence = __pyx_t_1; | |
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); | |
if (unlikely(size != 6)) { | |
if (size > 6) __Pyx_RaiseTooManyValuesError(6); | |
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); | |
__PYX_ERR(0, 855, __pyx_L1_error) | |
} | |
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
if (likely(PyTuple_CheckExact(sequence))) { | |
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); | |
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); | |
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); | |
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 3); | |
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 4); | |
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 5); | |
} else { | |
__pyx_t_2 = PyList_GET_ITEM(sequence, 0); | |
__pyx_t_7 = PyList_GET_ITEM(sequence, 1); | |
__pyx_t_4 = PyList_GET_ITEM(sequence, 2); | |
__pyx_t_3 = PyList_GET_ITEM(sequence, 3); | |
__pyx_t_5 = PyList_GET_ITEM(sequence, 4); | |
__pyx_t_8 = PyList_GET_ITEM(sequence, 5); | |
} | |
__Pyx_INCREF(__pyx_t_2); | |
__Pyx_INCREF(__pyx_t_7); | |
__Pyx_INCREF(__pyx_t_4); | |
__Pyx_INCREF(__pyx_t_3); | |
__Pyx_INCREF(__pyx_t_5); | |
__Pyx_INCREF(__pyx_t_8); | |
#else | |
{ | |
Py_ssize_t i; | |
PyObject** temps[6] = {&__pyx_t_2,&__pyx_t_7,&__pyx_t_4,&__pyx_t_3,&__pyx_t_5,&__pyx_t_8}; | |
for (i=0; i < 6; i++) { | |
PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 855, __pyx_L1_error) | |
__Pyx_GOTREF(item); | |
*(temps[i]) = item; | |
} | |
} | |
#endif | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
} else { | |
Py_ssize_t index = -1; | |
PyObject** temps[6] = {&__pyx_t_2,&__pyx_t_7,&__pyx_t_4,&__pyx_t_3,&__pyx_t_5,&__pyx_t_8}; | |
__pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 855, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_9); | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
__pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; | |
for (index=0; index < 6; index++) { | |
PyObject* item = __pyx_t_10(__pyx_t_9); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; | |
__Pyx_GOTREF(item); | |
*(temps[index]) = item; | |
} | |
if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 6) < 0) __PYX_ERR(0, 855, __pyx_L1_error) | |
__pyx_t_10 = NULL; | |
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
goto __pyx_L4_unpacking_done; | |
__pyx_L3_unpacking_failed:; | |
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
__pyx_t_10 = NULL; | |
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); | |
__PYX_ERR(0, 855, __pyx_L1_error) | |
__pyx_L4_unpacking_done:; | |
} | |
/* "pandas/_libs/window.pyx":855 | |
* ndarray[double_t] output | |
* | |
* start, end, N, win, minp, is_variable = get_window_indexer(input, win, # <<<<<<<<<<<<<< | |
* minp, index, | |
* closed) | |
*/ | |
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 855, __pyx_L1_error) | |
if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 855, __pyx_L1_error) | |
__pyx_t_11 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_11 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 855, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
__pyx_t_12 = __Pyx_PyInt_As_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_12 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 855, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
__pyx_t_13 = __Pyx_PyInt_As_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_13 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 855, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 855, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
__pyx_t_15 = ((PyArrayObject *)__pyx_t_2); | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start.rcbuffer->pybuffer); | |
__pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_start.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); | |
if (unlikely(__pyx_t_6 < 0)) { | |
PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_start.rcbuffer->pybuffer, (PyObject*)__pyx_v_start, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { | |
Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); | |
__Pyx_RaiseBufferFallbackError(); | |
} else { | |
PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); | |
} | |
__pyx_t_16 = __pyx_t_17 = __pyx_t_18 = 0; | |
} | |
__pyx_pybuffernd_start.diminfo[0].strides = __pyx_pybuffernd_start.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_start.diminfo[0].shape = __pyx_pybuffernd_start.rcbuffer->pybuffer.shape[0]; | |
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 855, __pyx_L1_error) | |
} | |
__pyx_t_15 = 0; | |
__pyx_v_start = ((PyArrayObject *)__pyx_t_2); | |
__pyx_t_2 = 0; | |
__pyx_t_15 = ((PyArrayObject *)__pyx_t_7); | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end.rcbuffer->pybuffer); | |
__pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_end.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); | |
if (unlikely(__pyx_t_6 < 0)) { | |
PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_end.rcbuffer->pybuffer, (PyObject*)__pyx_v_end, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { | |
Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); | |
__Pyx_RaiseBufferFallbackError(); | |
} else { | |
PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); | |
} | |
__pyx_t_18 = __pyx_t_17 = __pyx_t_16 = 0; | |
} | |
__pyx_pybuffernd_end.diminfo[0].strides = __pyx_pybuffernd_end.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_end.diminfo[0].shape = __pyx_pybuffernd_end.rcbuffer->pybuffer.shape[0]; | |
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 855, __pyx_L1_error) | |
} | |
__pyx_t_15 = 0; | |
__pyx_v_end = ((PyArrayObject *)__pyx_t_7); | |
__pyx_t_7 = 0; | |
__pyx_v_N = __pyx_t_11; | |
__pyx_v_win = __pyx_t_12; | |
__pyx_v_minp = __pyx_t_13; | |
__pyx_v_is_variable = __pyx_t_14; | |
/* "pandas/_libs/window.pyx":858 | |
* minp, index, | |
* closed) | |
* output = np.empty(N, dtype=float) # <<<<<<<<<<<<<< | |
* | |
* if is_variable: | |
*/ | |
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 858, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_8); | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
__pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 858, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_GIVEREF(__pyx_t_1); | |
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); | |
__pyx_t_1 = 0; | |
__pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 858, __pyx_L1_error) | |
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 858, __pyx_L1_error) | |
__pyx_t_19 = ((PyArrayObject *)__pyx_t_3); | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); | |
__pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); | |
if (unlikely(__pyx_t_6 < 0)) { | |
PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_v_output, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { | |
Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); | |
__Pyx_RaiseBufferFallbackError(); | |
} else { | |
PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); | |
} | |
__pyx_t_16 = __pyx_t_17 = __pyx_t_18 = 0; | |
} | |
__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; | |
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 858, __pyx_L1_error) | |
} | |
__pyx_t_19 = 0; | |
__pyx_v_output = ((PyArrayObject *)__pyx_t_3); | |
__pyx_t_3 = 0; | |
/* "pandas/_libs/window.pyx":860 | |
* output = np.empty(N, dtype=float) | |
* | |
* if is_variable: # <<<<<<<<<<<<<< | |
* | |
* with nogil: | |
*/ | |
__pyx_t_14 = (__pyx_v_is_variable != 0); | |
if (__pyx_t_14) { | |
/* "pandas/_libs/window.pyx":862 | |
* if is_variable: | |
* | |
* with nogil: # <<<<<<<<<<<<<< | |
* | |
* for i in range(0, N): | |
*/ | |
{ | |
#ifdef WITH_THREAD | |
PyThreadState *_save; | |
Py_UNBLOCK_THREADS | |
__Pyx_FastGIL_Remember(); | |
#endif | |
/*try:*/ { | |
/* "pandas/_libs/window.pyx":864 | |
* with nogil: | |
* | |
* for i in range(0, N): # <<<<<<<<<<<<<< | |
* | |
* s = start[i] | |
*/ | |
__pyx_t_13 = __pyx_v_N; | |
__pyx_t_12 = __pyx_t_13; | |
for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11+=1) { | |
__pyx_v_i = __pyx_t_11; | |
/* "pandas/_libs/window.pyx":866 | |
* for i in range(0, N): | |
* | |
* s = start[i] # <<<<<<<<<<<<<< | |
* e = end[i] | |
* | |
*/ | |
__pyx_t_20 = __pyx_v_i; | |
__pyx_v_s = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_start.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_start.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":867 | |
* | |
* s = start[i] | |
* e = end[i] # <<<<<<<<<<<<<< | |
* | |
* # Over the first window, observations can only be added | |
*/ | |
__pyx_t_21 = __pyx_v_i; | |
__pyx_v_e = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_end.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_end.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":871 | |
* # Over the first window, observations can only be added | |
* # never removed | |
* if i == 0: # <<<<<<<<<<<<<< | |
* | |
* for j in range(s, e): | |
*/ | |
__pyx_t_14 = ((__pyx_v_i == 0) != 0); | |
if (__pyx_t_14) { | |
/* "pandas/_libs/window.pyx":873 | |
* if i == 0: | |
* | |
* for j in range(s, e): # <<<<<<<<<<<<<< | |
* val = input[j] | |
* add_skew(val, &nobs, &x, &xx, &xxx) | |
*/ | |
__pyx_t_22 = __pyx_v_e; | |
__pyx_t_23 = __pyx_t_22; | |
for (__pyx_t_24 = __pyx_v_s; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) { | |
__pyx_v_j = __pyx_t_24; | |
/* "pandas/_libs/window.pyx":874 | |
* | |
* for j in range(s, e): | |
* val = input[j] # <<<<<<<<<<<<<< | |
* add_skew(val, &nobs, &x, &xx, &xxx) | |
* | |
*/ | |
__pyx_t_25 = __pyx_v_j; | |
__pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_input.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":875 | |
* for j in range(s, e): | |
* val = input[j] | |
* add_skew(val, &nobs, &x, &xx, &xxx) # <<<<<<<<<<<<<< | |
* | |
* else: | |
*/ | |
__pyx_f_6pandas_5_libs_6window_add_skew(__pyx_v_val, (&__pyx_v_nobs), (&__pyx_v_x), (&__pyx_v_xx), (&__pyx_v_xxx)); | |
} | |
/* "pandas/_libs/window.pyx":871 | |
* # Over the first window, observations can only be added | |
* # never removed | |
* if i == 0: # <<<<<<<<<<<<<< | |
* | |
* for j in range(s, e): | |
*/ | |
goto __pyx_L11; | |
} | |
/* "pandas/_libs/window.pyx":883 | |
* | |
* # calculate adds | |
* for j in range(end[i - 1], e): # <<<<<<<<<<<<<< | |
* val = input[j] | |
* add_skew(val, &nobs, &x, &xx, &xxx) | |
*/ | |
/*else*/ { | |
__pyx_t_22 = __pyx_v_e; | |
__pyx_t_23 = (__pyx_v_i - 1); | |
__pyx_t_24 = __pyx_t_22; | |
for (__pyx_t_26 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_end.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_end.diminfo[0].strides)); __pyx_t_26 < __pyx_t_24; __pyx_t_26+=1) { | |
__pyx_v_j = __pyx_t_26; | |
/* "pandas/_libs/window.pyx":884 | |
* # calculate adds | |
* for j in range(end[i - 1], e): | |
* val = input[j] # <<<<<<<<<<<<<< | |
* add_skew(val, &nobs, &x, &xx, &xxx) | |
* | |
*/ | |
__pyx_t_27 = __pyx_v_j; | |
__pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_input.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":885 | |
* for j in range(end[i - 1], e): | |
* val = input[j] | |
* add_skew(val, &nobs, &x, &xx, &xxx) # <<<<<<<<<<<<<< | |
* | |
* # calculate deletes | |
*/ | |
__pyx_f_6pandas_5_libs_6window_add_skew(__pyx_v_val, (&__pyx_v_nobs), (&__pyx_v_x), (&__pyx_v_xx), (&__pyx_v_xxx)); | |
} | |
/* "pandas/_libs/window.pyx":888 | |
* | |
* # calculate deletes | |
* for j in range(start[i - 1], s): # <<<<<<<<<<<<<< | |
* val = input[j] | |
* remove_skew(val, &nobs, &x, &xx, &xxx) | |
*/ | |
__pyx_t_22 = __pyx_v_s; | |
__pyx_t_24 = (__pyx_v_i - 1); | |
__pyx_t_26 = __pyx_t_22; | |
for (__pyx_t_28 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_start.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_start.diminfo[0].strides)); __pyx_t_28 < __pyx_t_26; __pyx_t_28+=1) { | |
__pyx_v_j = __pyx_t_28; | |
/* "pandas/_libs/window.pyx":889 | |
* # calculate deletes | |
* for j in range(start[i - 1], s): | |
* val = input[j] # <<<<<<<<<<<<<< | |
* remove_skew(val, &nobs, &x, &xx, &xxx) | |
* | |
*/ | |
__pyx_t_29 = __pyx_v_j; | |
__pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_input.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":890 | |
* for j in range(start[i - 1], s): | |
* val = input[j] | |
* remove_skew(val, &nobs, &x, &xx, &xxx) # <<<<<<<<<<<<<< | |
* | |
* output[i] = calc_skew(minp, nobs, x, xx, xxx) | |
*/ | |
__pyx_f_6pandas_5_libs_6window_remove_skew(__pyx_v_val, (&__pyx_v_nobs), (&__pyx_v_x), (&__pyx_v_xx), (&__pyx_v_xxx)); | |
} | |
} | |
__pyx_L11:; | |
/* "pandas/_libs/window.pyx":892 | |
* remove_skew(val, &nobs, &x, &xx, &xxx) | |
* | |
* output[i] = calc_skew(minp, nobs, x, xx, xxx) # <<<<<<<<<<<<<< | |
* | |
* else: | |
*/ | |
__pyx_t_22 = __pyx_v_i; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_f_6pandas_5_libs_6window_calc_skew(__pyx_v_minp, __pyx_v_nobs, __pyx_v_x, __pyx_v_xx, __pyx_v_xxx); | |
} | |
} | |
/* "pandas/_libs/window.pyx":862 | |
* if is_variable: | |
* | |
* with nogil: # <<<<<<<<<<<<<< | |
* | |
* for i in range(0, N): | |
*/ | |
/*finally:*/ { | |
/*normal exit:*/{ | |
#ifdef WITH_THREAD | |
__Pyx_FastGIL_Forget(); | |
Py_BLOCK_THREADS | |
#endif | |
goto __pyx_L8; | |
} | |
__pyx_L8:; | |
} | |
} | |
/* "pandas/_libs/window.pyx":860 | |
* output = np.empty(N, dtype=float) | |
* | |
* if is_variable: # <<<<<<<<<<<<<< | |
* | |
* with nogil: | |
*/ | |
goto __pyx_L5; | |
} | |
/* "pandas/_libs/window.pyx":896 | |
* else: | |
* | |
* with nogil: # <<<<<<<<<<<<<< | |
* for i from 0 <= i < minp - 1: | |
* val = input[i] | |
*/ | |
/*else*/ { | |
{ | |
#ifdef WITH_THREAD | |
PyThreadState *_save; | |
Py_UNBLOCK_THREADS | |
__Pyx_FastGIL_Remember(); | |
#endif | |
/*try:*/ { | |
/* "pandas/_libs/window.pyx":897 | |
* | |
* with nogil: | |
* for i from 0 <= i < minp - 1: # <<<<<<<<<<<<<< | |
* val = input[i] | |
* add_skew(val, &nobs, &x, &xx, &xxx) | |
*/ | |
__pyx_t_13 = (__pyx_v_minp - 1); | |
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_13; __pyx_v_i++) { | |
/* "pandas/_libs/window.pyx":898 | |
* with nogil: | |
* for i from 0 <= i < minp - 1: | |
* val = input[i] # <<<<<<<<<<<<<< | |
* add_skew(val, &nobs, &x, &xx, &xxx) | |
* output[i] = NaN | |
*/ | |
__pyx_t_12 = __pyx_v_i; | |
__pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_input.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":899 | |
* for i from 0 <= i < minp - 1: | |
* val = input[i] | |
* add_skew(val, &nobs, &x, &xx, &xxx) # <<<<<<<<<<<<<< | |
* output[i] = NaN | |
* | |
*/ | |
__pyx_f_6pandas_5_libs_6window_add_skew(__pyx_v_val, (&__pyx_v_nobs), (&__pyx_v_x), (&__pyx_v_xx), (&__pyx_v_xxx)); | |
/* "pandas/_libs/window.pyx":900 | |
* val = input[i] | |
* add_skew(val, &nobs, &x, &xx, &xxx) | |
* output[i] = NaN # <<<<<<<<<<<<<< | |
* | |
* for i from minp - 1 <= i < N: | |
*/ | |
__pyx_t_11 = __pyx_v_i; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5_libs_6window_NaN; | |
} | |
/* "pandas/_libs/window.pyx":902 | |
* output[i] = NaN | |
* | |
* for i from minp - 1 <= i < N: # <<<<<<<<<<<<<< | |
* val = input[i] | |
* add_skew(val, &nobs, &x, &xx, &xxx) | |
*/ | |
__pyx_t_13 = __pyx_v_N; | |
for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_13; __pyx_v_i++) { | |
/* "pandas/_libs/window.pyx":903 | |
* | |
* for i from minp - 1 <= i < N: | |
* val = input[i] # <<<<<<<<<<<<<< | |
* add_skew(val, &nobs, &x, &xx, &xxx) | |
* | |
*/ | |
__pyx_t_26 = __pyx_v_i; | |
__pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_input.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":904 | |
* for i from minp - 1 <= i < N: | |
* val = input[i] | |
* add_skew(val, &nobs, &x, &xx, &xxx) # <<<<<<<<<<<<<< | |
* | |
* if i > win - 1: | |
*/ | |
__pyx_f_6pandas_5_libs_6window_add_skew(__pyx_v_val, (&__pyx_v_nobs), (&__pyx_v_x), (&__pyx_v_xx), (&__pyx_v_xxx)); | |
/* "pandas/_libs/window.pyx":906 | |
* add_skew(val, &nobs, &x, &xx, &xxx) | |
* | |
* if i > win - 1: # <<<<<<<<<<<<<< | |
* prev = input[i - win] | |
* remove_skew(prev, &nobs, &x, &xx, &xxx) | |
*/ | |
__pyx_t_14 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0); | |
if (__pyx_t_14) { | |
/* "pandas/_libs/window.pyx":907 | |
* | |
* if i > win - 1: | |
* prev = input[i - win] # <<<<<<<<<<<<<< | |
* remove_skew(prev, &nobs, &x, &xx, &xxx) | |
* | |
*/ | |
__pyx_t_28 = (__pyx_v_i - __pyx_v_win); | |
__pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_input.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":908 | |
* if i > win - 1: | |
* prev = input[i - win] | |
* remove_skew(prev, &nobs, &x, &xx, &xxx) # <<<<<<<<<<<<<< | |
* | |
* output[i] = calc_skew(minp, nobs, x, xx, xxx) | |
*/ | |
__pyx_f_6pandas_5_libs_6window_remove_skew(__pyx_v_prev, (&__pyx_v_nobs), (&__pyx_v_x), (&__pyx_v_xx), (&__pyx_v_xxx)); | |
/* "pandas/_libs/window.pyx":906 | |
* add_skew(val, &nobs, &x, &xx, &xxx) | |
* | |
* if i > win - 1: # <<<<<<<<<<<<<< | |
* prev = input[i - win] | |
* remove_skew(prev, &nobs, &x, &xx, &xxx) | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":910 | |
* remove_skew(prev, &nobs, &x, &xx, &xxx) | |
* | |
* output[i] = calc_skew(minp, nobs, x, xx, xxx) # <<<<<<<<<<<<<< | |
* | |
* return output | |
*/ | |
__pyx_t_30 = __pyx_v_i; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_f_6pandas_5_libs_6window_calc_skew(__pyx_v_minp, __pyx_v_nobs, __pyx_v_x, __pyx_v_xx, __pyx_v_xxx); | |
} | |
} | |
/* "pandas/_libs/window.pyx":896 | |
* else: | |
* | |
* with nogil: # <<<<<<<<<<<<<< | |
* for i from 0 <= i < minp - 1: | |
* val = input[i] | |
*/ | |
/*finally:*/ { | |
/*normal exit:*/{ | |
#ifdef WITH_THREAD | |
__Pyx_FastGIL_Forget(); | |
Py_BLOCK_THREADS | |
#endif | |
goto __pyx_L20; | |
} | |
__pyx_L20:; | |
} | |
} | |
} | |
__pyx_L5:; | |
/* "pandas/_libs/window.pyx":912 | |
* output[i] = calc_skew(minp, nobs, x, xx, xxx) | |
* | |
* return output # <<<<<<<<<<<<<< | |
* | |
* # ---------------------------------------------------------------------- | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__Pyx_INCREF(((PyObject *)__pyx_v_output)); | |
__pyx_r = ((PyObject *)__pyx_v_output); | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":844 | |
* | |
* | |
* def roll_skew(ndarray[double_t] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* cdef: | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
__Pyx_XDECREF(__pyx_t_2); | |
__Pyx_XDECREF(__pyx_t_3); | |
__Pyx_XDECREF(__pyx_t_4); | |
__Pyx_XDECREF(__pyx_t_5); | |
__Pyx_XDECREF(__pyx_t_7); | |
__Pyx_XDECREF(__pyx_t_8); | |
__Pyx_XDECREF(__pyx_t_9); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_skew", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XDECREF((PyObject *)__pyx_v_start); | |
__Pyx_XDECREF((PyObject *)__pyx_v_end); | |
__Pyx_XDECREF((PyObject *)__pyx_v_output); | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "pandas/_libs/window.pyx":918 | |
* | |
* | |
* cdef inline double calc_kurt(int64_t minp, int64_t nobs, double x, double xx, # <<<<<<<<<<<<<< | |
* double xxx, double xxxx) nogil: | |
* cdef double result, dnobs | |
*/ | |
static CYTHON_INLINE double __pyx_f_6pandas_5_libs_6window_calc_kurt(__pyx_t_5numpy_int64_t __pyx_v_minp, __pyx_t_5numpy_int64_t __pyx_v_nobs, double __pyx_v_x, double __pyx_v_xx, double __pyx_v_xxx, double __pyx_v_xxxx) { | |
double __pyx_v_result; | |
double __pyx_v_dnobs; | |
double __pyx_v_A; | |
double __pyx_v_B; | |
double __pyx_v_C; | |
double __pyx_v_D; | |
double __pyx_v_R; | |
double __pyx_v_K; | |
double __pyx_r; | |
int __pyx_t_1; | |
int __pyx_t_2; | |
/* "pandas/_libs/window.pyx":923 | |
* cdef double A, B, C, D, R, K | |
* | |
* if nobs >= minp: # <<<<<<<<<<<<<< | |
* dnobs = <double>nobs | |
* A = x / dnobs | |
*/ | |
__pyx_t_1 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":924 | |
* | |
* if nobs >= minp: | |
* dnobs = <double>nobs # <<<<<<<<<<<<<< | |
* A = x / dnobs | |
* R = A * A | |
*/ | |
__pyx_v_dnobs = ((double)__pyx_v_nobs); | |
/* "pandas/_libs/window.pyx":925 | |
* if nobs >= minp: | |
* dnobs = <double>nobs | |
* A = x / dnobs # <<<<<<<<<<<<<< | |
* R = A * A | |
* B = xx / dnobs - R | |
*/ | |
__pyx_v_A = (__pyx_v_x / __pyx_v_dnobs); | |
/* "pandas/_libs/window.pyx":926 | |
* dnobs = <double>nobs | |
* A = x / dnobs | |
* R = A * A # <<<<<<<<<<<<<< | |
* B = xx / dnobs - R | |
* R = R * A | |
*/ | |
__pyx_v_R = (__pyx_v_A * __pyx_v_A); | |
/* "pandas/_libs/window.pyx":927 | |
* A = x / dnobs | |
* R = A * A | |
* B = xx / dnobs - R # <<<<<<<<<<<<<< | |
* R = R * A | |
* C = xxx / dnobs - R - 3 * A * B | |
*/ | |
__pyx_v_B = ((__pyx_v_xx / __pyx_v_dnobs) - __pyx_v_R); | |
/* "pandas/_libs/window.pyx":928 | |
* R = A * A | |
* B = xx / dnobs - R | |
* R = R * A # <<<<<<<<<<<<<< | |
* C = xxx / dnobs - R - 3 * A * B | |
* R = R * A | |
*/ | |
__pyx_v_R = (__pyx_v_R * __pyx_v_A); | |
/* "pandas/_libs/window.pyx":929 | |
* B = xx / dnobs - R | |
* R = R * A | |
* C = xxx / dnobs - R - 3 * A * B # <<<<<<<<<<<<<< | |
* R = R * A | |
* D = xxxx / dnobs - R - 6 * B * A * A - 4 * C * A | |
*/ | |
__pyx_v_C = (((__pyx_v_xxx / __pyx_v_dnobs) - __pyx_v_R) - ((3.0 * __pyx_v_A) * __pyx_v_B)); | |
/* "pandas/_libs/window.pyx":930 | |
* R = R * A | |
* C = xxx / dnobs - R - 3 * A * B | |
* R = R * A # <<<<<<<<<<<<<< | |
* D = xxxx / dnobs - R - 6 * B * A * A - 4 * C * A | |
* | |
*/ | |
__pyx_v_R = (__pyx_v_R * __pyx_v_A); | |
/* "pandas/_libs/window.pyx":931 | |
* C = xxx / dnobs - R - 3 * A * B | |
* R = R * A | |
* D = xxxx / dnobs - R - 6 * B * A * A - 4 * C * A # <<<<<<<<<<<<<< | |
* | |
* # #18044: with uniform distribution, floating issue will | |
*/ | |
__pyx_v_D = ((((__pyx_v_xxxx / __pyx_v_dnobs) - __pyx_v_R) - (((6.0 * __pyx_v_B) * __pyx_v_A) * __pyx_v_A)) - ((4.0 * __pyx_v_C) * __pyx_v_A)); | |
/* "pandas/_libs/window.pyx":942 | |
* # treat as zero, here we follow the original | |
* # skew/kurt behaviour to check B <= 1e-14 | |
* if B <= 1e-14 or nobs < 4: # <<<<<<<<<<<<<< | |
* result = NaN | |
* else: | |
*/ | |
__pyx_t_2 = ((__pyx_v_B <= 1e-14) != 0); | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_1 = __pyx_t_2; | |
goto __pyx_L5_bool_binop_done; | |
} | |
__pyx_t_2 = ((__pyx_v_nobs < 4) != 0); | |
__pyx_t_1 = __pyx_t_2; | |
__pyx_L5_bool_binop_done:; | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":943 | |
* # skew/kurt behaviour to check B <= 1e-14 | |
* if B <= 1e-14 or nobs < 4: | |
* result = NaN # <<<<<<<<<<<<<< | |
* else: | |
* K = (dnobs * dnobs - 1.) * D / (B * B) - 3 * ((dnobs - 1.) ** 2) | |
*/ | |
__pyx_v_result = __pyx_v_6pandas_5_libs_6window_NaN; | |
/* "pandas/_libs/window.pyx":942 | |
* # treat as zero, here we follow the original | |
* # skew/kurt behaviour to check B <= 1e-14 | |
* if B <= 1e-14 or nobs < 4: # <<<<<<<<<<<<<< | |
* result = NaN | |
* else: | |
*/ | |
goto __pyx_L4; | |
} | |
/* "pandas/_libs/window.pyx":945 | |
* result = NaN | |
* else: | |
* K = (dnobs * dnobs - 1.) * D / (B * B) - 3 * ((dnobs - 1.) ** 2) # <<<<<<<<<<<<<< | |
* result = K / ((dnobs - 2.) * (dnobs - 3.)) | |
* else: | |
*/ | |
/*else*/ { | |
__pyx_v_K = (((((__pyx_v_dnobs * __pyx_v_dnobs) - 1.) * __pyx_v_D) / (__pyx_v_B * __pyx_v_B)) - (3.0 * pow((__pyx_v_dnobs - 1.), 2.0))); | |
/* "pandas/_libs/window.pyx":946 | |
* else: | |
* K = (dnobs * dnobs - 1.) * D / (B * B) - 3 * ((dnobs - 1.) ** 2) | |
* result = K / ((dnobs - 2.) * (dnobs - 3.)) # <<<<<<<<<<<<<< | |
* else: | |
* result = NaN | |
*/ | |
__pyx_v_result = (__pyx_v_K / ((__pyx_v_dnobs - 2.) * (__pyx_v_dnobs - 3.))); | |
} | |
__pyx_L4:; | |
/* "pandas/_libs/window.pyx":923 | |
* cdef double A, B, C, D, R, K | |
* | |
* if nobs >= minp: # <<<<<<<<<<<<<< | |
* dnobs = <double>nobs | |
* A = x / dnobs | |
*/ | |
goto __pyx_L3; | |
} | |
/* "pandas/_libs/window.pyx":948 | |
* result = K / ((dnobs - 2.) * (dnobs - 3.)) | |
* else: | |
* result = NaN # <<<<<<<<<<<<<< | |
* | |
* return result | |
*/ | |
/*else*/ { | |
__pyx_v_result = __pyx_v_6pandas_5_libs_6window_NaN; | |
} | |
__pyx_L3:; | |
/* "pandas/_libs/window.pyx":950 | |
* result = NaN | |
* | |
* return result # <<<<<<<<<<<<<< | |
* | |
* cdef inline void add_kurt(double val, int64_t *nobs, double *x, double *xx, | |
*/ | |
__pyx_r = __pyx_v_result; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":918 | |
* | |
* | |
* cdef inline double calc_kurt(int64_t minp, int64_t nobs, double x, double xx, # <<<<<<<<<<<<<< | |
* double xxx, double xxxx) nogil: | |
* cdef double result, dnobs | |
*/ | |
/* function exit code */ | |
__pyx_L0:; | |
return __pyx_r; | |
} | |
/* "pandas/_libs/window.pyx":952 | |
* return result | |
* | |
* cdef inline void add_kurt(double val, int64_t *nobs, double *x, double *xx, # <<<<<<<<<<<<<< | |
* double *xxx, double *xxxx) nogil: | |
* """ add a value from the kurotic calc """ | |
*/ | |
static CYTHON_INLINE void __pyx_f_6pandas_5_libs_6window_add_kurt(double __pyx_v_val, __pyx_t_5numpy_int64_t *__pyx_v_nobs, double *__pyx_v_x, double *__pyx_v_xx, double *__pyx_v_xxx, double *__pyx_v_xxxx) { | |
int __pyx_t_1; | |
/* "pandas/_libs/window.pyx":957 | |
* | |
* # Not NaN | |
* if val == val: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] + 1 | |
* | |
*/ | |
__pyx_t_1 = ((__pyx_v_val == __pyx_v_val) != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":958 | |
* # Not NaN | |
* if val == val: | |
* nobs[0] = nobs[0] + 1 # <<<<<<<<<<<<<< | |
* | |
* # seriously don't ask me why this is faster | |
*/ | |
(__pyx_v_nobs[0]) = ((__pyx_v_nobs[0]) + 1); | |
/* "pandas/_libs/window.pyx":961 | |
* | |
* # seriously don't ask me why this is faster | |
* x[0] = x[0] + val # <<<<<<<<<<<<<< | |
* xx[0] = xx[0] + val * val | |
* xxx[0] = xxx[0] + val * val * val | |
*/ | |
(__pyx_v_x[0]) = ((__pyx_v_x[0]) + __pyx_v_val); | |
/* "pandas/_libs/window.pyx":962 | |
* # seriously don't ask me why this is faster | |
* x[0] = x[0] + val | |
* xx[0] = xx[0] + val * val # <<<<<<<<<<<<<< | |
* xxx[0] = xxx[0] + val * val * val | |
* xxxx[0] = xxxx[0] + val * val * val * val | |
*/ | |
(__pyx_v_xx[0]) = ((__pyx_v_xx[0]) + (__pyx_v_val * __pyx_v_val)); | |
/* "pandas/_libs/window.pyx":963 | |
* x[0] = x[0] + val | |
* xx[0] = xx[0] + val * val | |
* xxx[0] = xxx[0] + val * val * val # <<<<<<<<<<<<<< | |
* xxxx[0] = xxxx[0] + val * val * val * val | |
* | |
*/ | |
(__pyx_v_xxx[0]) = ((__pyx_v_xxx[0]) + ((__pyx_v_val * __pyx_v_val) * __pyx_v_val)); | |
/* "pandas/_libs/window.pyx":964 | |
* xx[0] = xx[0] + val * val | |
* xxx[0] = xxx[0] + val * val * val | |
* xxxx[0] = xxxx[0] + val * val * val * val # <<<<<<<<<<<<<< | |
* | |
* cdef inline void remove_kurt(double val, int64_t *nobs, double *x, double *xx, | |
*/ | |
(__pyx_v_xxxx[0]) = ((__pyx_v_xxxx[0]) + (((__pyx_v_val * __pyx_v_val) * __pyx_v_val) * __pyx_v_val)); | |
/* "pandas/_libs/window.pyx":957 | |
* | |
* # Not NaN | |
* if val == val: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] + 1 | |
* | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":952 | |
* return result | |
* | |
* cdef inline void add_kurt(double val, int64_t *nobs, double *x, double *xx, # <<<<<<<<<<<<<< | |
* double *xxx, double *xxxx) nogil: | |
* """ add a value from the kurotic calc """ | |
*/ | |
/* function exit code */ | |
} | |
/* "pandas/_libs/window.pyx":966 | |
* xxxx[0] = xxxx[0] + val * val * val * val | |
* | |
* cdef inline void remove_kurt(double val, int64_t *nobs, double *x, double *xx, # <<<<<<<<<<<<<< | |
* double *xxx, double *xxxx) nogil: | |
* """ remove a value from the kurotic calc """ | |
*/ | |
static CYTHON_INLINE void __pyx_f_6pandas_5_libs_6window_remove_kurt(double __pyx_v_val, __pyx_t_5numpy_int64_t *__pyx_v_nobs, double *__pyx_v_x, double *__pyx_v_xx, double *__pyx_v_xxx, double *__pyx_v_xxxx) { | |
int __pyx_t_1; | |
/* "pandas/_libs/window.pyx":971 | |
* | |
* # Not NaN | |
* if val == val: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] - 1 | |
* | |
*/ | |
__pyx_t_1 = ((__pyx_v_val == __pyx_v_val) != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":972 | |
* # Not NaN | |
* if val == val: | |
* nobs[0] = nobs[0] - 1 # <<<<<<<<<<<<<< | |
* | |
* # seriously don't ask me why this is faster | |
*/ | |
(__pyx_v_nobs[0]) = ((__pyx_v_nobs[0]) - 1); | |
/* "pandas/_libs/window.pyx":975 | |
* | |
* # seriously don't ask me why this is faster | |
* x[0] = x[0] - val # <<<<<<<<<<<<<< | |
* xx[0] = xx[0] - val * val | |
* xxx[0] = xxx[0] - val * val * val | |
*/ | |
(__pyx_v_x[0]) = ((__pyx_v_x[0]) - __pyx_v_val); | |
/* "pandas/_libs/window.pyx":976 | |
* # seriously don't ask me why this is faster | |
* x[0] = x[0] - val | |
* xx[0] = xx[0] - val * val # <<<<<<<<<<<<<< | |
* xxx[0] = xxx[0] - val * val * val | |
* xxxx[0] = xxxx[0] - val * val * val * val | |
*/ | |
(__pyx_v_xx[0]) = ((__pyx_v_xx[0]) - (__pyx_v_val * __pyx_v_val)); | |
/* "pandas/_libs/window.pyx":977 | |
* x[0] = x[0] - val | |
* xx[0] = xx[0] - val * val | |
* xxx[0] = xxx[0] - val * val * val # <<<<<<<<<<<<<< | |
* xxxx[0] = xxxx[0] - val * val * val * val | |
* | |
*/ | |
(__pyx_v_xxx[0]) = ((__pyx_v_xxx[0]) - ((__pyx_v_val * __pyx_v_val) * __pyx_v_val)); | |
/* "pandas/_libs/window.pyx":978 | |
* xx[0] = xx[0] - val * val | |
* xxx[0] = xxx[0] - val * val * val | |
* xxxx[0] = xxxx[0] - val * val * val * val # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
(__pyx_v_xxxx[0]) = ((__pyx_v_xxxx[0]) - (((__pyx_v_val * __pyx_v_val) * __pyx_v_val) * __pyx_v_val)); | |
/* "pandas/_libs/window.pyx":971 | |
* | |
* # Not NaN | |
* if val == val: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] - 1 | |
* | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":966 | |
* xxxx[0] = xxxx[0] + val * val * val * val | |
* | |
* cdef inline void remove_kurt(double val, int64_t *nobs, double *x, double *xx, # <<<<<<<<<<<<<< | |
* double *xxx, double *xxxx) nogil: | |
* """ remove a value from the kurotic calc """ | |
*/ | |
/* function exit code */ | |
} | |
/* "pandas/_libs/window.pyx":981 | |
* | |
* | |
* def roll_kurt(ndarray[double_t] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* cdef: | |
*/ | |
/* Python wrapper */ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_15roll_kurt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_mdef_6pandas_5_libs_6window_15roll_kurt = {"roll_kurt", (PyCFunction)__pyx_pw_6pandas_5_libs_6window_15roll_kurt, METH_VARARGS|METH_KEYWORDS, 0}; | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_15roll_kurt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_kurt (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_kurt", 1, 5, 5, 1); __PYX_ERR(0, 981, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_kurt", 1, 5, 5, 2); __PYX_ERR(0, 981, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_kurt", 1, 5, 5, 3); __PYX_ERR(0, 981, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_kurt", 1, 5, 5, 4); __PYX_ERR(0, 981, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_kurt") < 0)) __PYX_ERR(0, 981, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 981, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 981, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_kurt", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 981, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_kurt", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 981, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_14roll_kurt(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_14roll_kurt(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
double __pyx_v_prev; | |
double __pyx_v_x; | |
double __pyx_v_xx; | |
double __pyx_v_xxx; | |
double __pyx_v_xxxx; | |
__pyx_t_5numpy_int64_t __pyx_v_nobs; | |
__pyx_t_5numpy_int64_t __pyx_v_i; | |
__pyx_t_5numpy_int64_t __pyx_v_j; | |
__pyx_t_5numpy_int64_t __pyx_v_N; | |
__pyx_t_5numpy_int64_t __pyx_v_s; | |
__pyx_t_5numpy_int64_t __pyx_v_e; | |
int __pyx_v_is_variable; | |
PyArrayObject *__pyx_v_start = 0; | |
PyArrayObject *__pyx_v_end = 0; | |
PyArrayObject *__pyx_v_output = 0; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_end; | |
__Pyx_Buffer __pyx_pybuffer_end; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_output; | |
__Pyx_Buffer __pyx_pybuffer_output; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_start; | |
__Pyx_Buffer __pyx_pybuffer_start; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
PyObject *__pyx_t_2 = NULL; | |
PyObject *__pyx_t_3 = NULL; | |
PyObject *__pyx_t_4 = NULL; | |
PyObject *__pyx_t_5 = NULL; | |
int __pyx_t_6; | |
PyObject *__pyx_t_7 = NULL; | |
PyObject *__pyx_t_8 = NULL; | |
PyObject *__pyx_t_9 = NULL; | |
PyObject *(*__pyx_t_10)(PyObject *); | |
__pyx_t_5numpy_int64_t __pyx_t_11; | |
__pyx_t_5numpy_int64_t __pyx_t_12; | |
__pyx_t_5numpy_int64_t __pyx_t_13; | |
int __pyx_t_14; | |
PyArrayObject *__pyx_t_15 = NULL; | |
PyObject *__pyx_t_16 = NULL; | |
PyObject *__pyx_t_17 = NULL; | |
PyObject *__pyx_t_18 = NULL; | |
PyArrayObject *__pyx_t_19 = NULL; | |
__pyx_t_5numpy_int64_t __pyx_t_20; | |
__pyx_t_5numpy_int64_t __pyx_t_21; | |
__pyx_t_5numpy_int64_t __pyx_t_22; | |
__pyx_t_5numpy_int64_t __pyx_t_23; | |
__pyx_t_5numpy_int64_t __pyx_t_24; | |
__pyx_t_5numpy_int64_t __pyx_t_25; | |
__pyx_t_5numpy_int64_t __pyx_t_26; | |
__pyx_t_5numpy_int64_t __pyx_t_27; | |
__pyx_t_5numpy_int64_t __pyx_t_28; | |
__pyx_t_5numpy_int64_t __pyx_t_29; | |
__pyx_t_5numpy_int64_t __pyx_t_30; | |
__Pyx_RefNannySetupContext("roll_kurt", 0); | |
__pyx_pybuffer_start.pybuffer.buf = NULL; | |
__pyx_pybuffer_start.refcount = 0; | |
__pyx_pybuffernd_start.data = NULL; | |
__pyx_pybuffernd_start.rcbuffer = &__pyx_pybuffer_start; | |
__pyx_pybuffer_end.pybuffer.buf = NULL; | |
__pyx_pybuffer_end.refcount = 0; | |
__pyx_pybuffernd_end.data = NULL; | |
__pyx_pybuffernd_end.rcbuffer = &__pyx_pybuffer_end; | |
__pyx_pybuffer_output.pybuffer.buf = NULL; | |
__pyx_pybuffer_output.refcount = 0; | |
__pyx_pybuffernd_output.data = NULL; | |
__pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 981, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":985 | |
* cdef: | |
* double val, prev | |
* double x = 0, xx = 0, xxx = 0, xxxx = 0 # <<<<<<<<<<<<<< | |
* int64_t nobs = 0, i, j, N | |
* int64_t s, e | |
*/ | |
__pyx_v_x = 0.0; | |
__pyx_v_xx = 0.0; | |
__pyx_v_xxx = 0.0; | |
__pyx_v_xxxx = 0.0; | |
/* "pandas/_libs/window.pyx":986 | |
* double val, prev | |
* double x = 0, xx = 0, xxx = 0, xxxx = 0 | |
* int64_t nobs = 0, i, j, N # <<<<<<<<<<<<<< | |
* int64_t s, e | |
* bint is_variable | |
*/ | |
__pyx_v_nobs = 0; | |
/* "pandas/_libs/window.pyx":992 | |
* ndarray[double_t] output | |
* | |
* start, end, N, win, minp, is_variable = get_window_indexer(input, win, # <<<<<<<<<<<<<< | |
* minp, index, | |
* closed) | |
*/ | |
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_window_indexer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 992, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_2); | |
__pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_win); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 992, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
/* "pandas/_libs/window.pyx":993 | |
* | |
* start, end, N, win, minp, is_variable = get_window_indexer(input, win, | |
* minp, index, # <<<<<<<<<<<<<< | |
* closed) | |
* output = np.empty(N, dtype=float) | |
*/ | |
__pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_minp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 993, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
/* "pandas/_libs/window.pyx":994 | |
* start, end, N, win, minp, is_variable = get_window_indexer(input, win, | |
* minp, index, | |
* closed) # <<<<<<<<<<<<<< | |
* output = np.empty(N, dtype=float) | |
* | |
*/ | |
__pyx_t_5 = NULL; | |
__pyx_t_6 = 0; | |
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { | |
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); | |
if (likely(__pyx_t_5)) { | |
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
__Pyx_INCREF(__pyx_t_5); | |
__Pyx_INCREF(function); | |
__Pyx_DECREF_SET(__pyx_t_2, function); | |
__pyx_t_6 = 1; | |
} | |
} | |
#if CYTHON_FAST_PYCALL | |
if (PyFunction_Check(__pyx_t_2)) { | |
PyObject *__pyx_temp[6] = {__pyx_t_5, ((PyObject *)__pyx_v_input), __pyx_t_3, __pyx_t_4, __pyx_v_index, __pyx_v_closed}; | |
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 5+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error) | |
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
} else | |
#endif | |
#if CYTHON_FAST_PYCCALL | |
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { | |
PyObject *__pyx_temp[6] = {__pyx_t_5, ((PyObject *)__pyx_v_input), __pyx_t_3, __pyx_t_4, __pyx_v_index, __pyx_v_closed}; | |
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 5+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error) | |
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
} else | |
#endif | |
{ | |
__pyx_t_7 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 992, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_7); | |
if (__pyx_t_5) { | |
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; | |
} | |
__Pyx_INCREF(((PyObject *)__pyx_v_input)); | |
__Pyx_GIVEREF(((PyObject *)__pyx_v_input)); | |
PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_input)); | |
__Pyx_GIVEREF(__pyx_t_3); | |
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3); | |
__Pyx_GIVEREF(__pyx_t_4); | |
PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_4); | |
__Pyx_INCREF(__pyx_v_index); | |
__Pyx_GIVEREF(__pyx_v_index); | |
PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_v_index); | |
__Pyx_INCREF(__pyx_v_closed); | |
__Pyx_GIVEREF(__pyx_v_closed); | |
PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_6, __pyx_v_closed); | |
__pyx_t_3 = 0; | |
__pyx_t_4 = 0; | |
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
} | |
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { | |
PyObject* sequence = __pyx_t_1; | |
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); | |
if (unlikely(size != 6)) { | |
if (size > 6) __Pyx_RaiseTooManyValuesError(6); | |
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); | |
__PYX_ERR(0, 992, __pyx_L1_error) | |
} | |
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
if (likely(PyTuple_CheckExact(sequence))) { | |
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); | |
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); | |
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); | |
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 3); | |
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 4); | |
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 5); | |
} else { | |
__pyx_t_2 = PyList_GET_ITEM(sequence, 0); | |
__pyx_t_7 = PyList_GET_ITEM(sequence, 1); | |
__pyx_t_4 = PyList_GET_ITEM(sequence, 2); | |
__pyx_t_3 = PyList_GET_ITEM(sequence, 3); | |
__pyx_t_5 = PyList_GET_ITEM(sequence, 4); | |
__pyx_t_8 = PyList_GET_ITEM(sequence, 5); | |
} | |
__Pyx_INCREF(__pyx_t_2); | |
__Pyx_INCREF(__pyx_t_7); | |
__Pyx_INCREF(__pyx_t_4); | |
__Pyx_INCREF(__pyx_t_3); | |
__Pyx_INCREF(__pyx_t_5); | |
__Pyx_INCREF(__pyx_t_8); | |
#else | |
{ | |
Py_ssize_t i; | |
PyObject** temps[6] = {&__pyx_t_2,&__pyx_t_7,&__pyx_t_4,&__pyx_t_3,&__pyx_t_5,&__pyx_t_8}; | |
for (i=0; i < 6; i++) { | |
PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 992, __pyx_L1_error) | |
__Pyx_GOTREF(item); | |
*(temps[i]) = item; | |
} | |
} | |
#endif | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
} else { | |
Py_ssize_t index = -1; | |
PyObject** temps[6] = {&__pyx_t_2,&__pyx_t_7,&__pyx_t_4,&__pyx_t_3,&__pyx_t_5,&__pyx_t_8}; | |
__pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 992, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_9); | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
__pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; | |
for (index=0; index < 6; index++) { | |
PyObject* item = __pyx_t_10(__pyx_t_9); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; | |
__Pyx_GOTREF(item); | |
*(temps[index]) = item; | |
} | |
if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 6) < 0) __PYX_ERR(0, 992, __pyx_L1_error) | |
__pyx_t_10 = NULL; | |
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
goto __pyx_L4_unpacking_done; | |
__pyx_L3_unpacking_failed:; | |
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
__pyx_t_10 = NULL; | |
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); | |
__PYX_ERR(0, 992, __pyx_L1_error) | |
__pyx_L4_unpacking_done:; | |
} | |
/* "pandas/_libs/window.pyx":992 | |
* ndarray[double_t] output | |
* | |
* start, end, N, win, minp, is_variable = get_window_indexer(input, win, # <<<<<<<<<<<<<< | |
* minp, index, | |
* closed) | |
*/ | |
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 992, __pyx_L1_error) | |
if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 992, __pyx_L1_error) | |
__pyx_t_11 = __Pyx_PyInt_As_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_11 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 992, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
__pyx_t_12 = __Pyx_PyInt_As_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_12 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 992, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
__pyx_t_13 = __Pyx_PyInt_As_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_13 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 992, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 992, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
__pyx_t_15 = ((PyArrayObject *)__pyx_t_2); | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start.rcbuffer->pybuffer); | |
__pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_start.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); | |
if (unlikely(__pyx_t_6 < 0)) { | |
PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_start.rcbuffer->pybuffer, (PyObject*)__pyx_v_start, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { | |
Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); | |
__Pyx_RaiseBufferFallbackError(); | |
} else { | |
PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); | |
} | |
__pyx_t_16 = __pyx_t_17 = __pyx_t_18 = 0; | |
} | |
__pyx_pybuffernd_start.diminfo[0].strides = __pyx_pybuffernd_start.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_start.diminfo[0].shape = __pyx_pybuffernd_start.rcbuffer->pybuffer.shape[0]; | |
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 992, __pyx_L1_error) | |
} | |
__pyx_t_15 = 0; | |
__pyx_v_start = ((PyArrayObject *)__pyx_t_2); | |
__pyx_t_2 = 0; | |
__pyx_t_15 = ((PyArrayObject *)__pyx_t_7); | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end.rcbuffer->pybuffer); | |
__pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_end.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); | |
if (unlikely(__pyx_t_6 < 0)) { | |
PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_end.rcbuffer->pybuffer, (PyObject*)__pyx_v_end, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { | |
Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); | |
__Pyx_RaiseBufferFallbackError(); | |
} else { | |
PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); | |
} | |
__pyx_t_18 = __pyx_t_17 = __pyx_t_16 = 0; | |
} | |
__pyx_pybuffernd_end.diminfo[0].strides = __pyx_pybuffernd_end.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_end.diminfo[0].shape = __pyx_pybuffernd_end.rcbuffer->pybuffer.shape[0]; | |
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 992, __pyx_L1_error) | |
} | |
__pyx_t_15 = 0; | |
__pyx_v_end = ((PyArrayObject *)__pyx_t_7); | |
__pyx_t_7 = 0; | |
__pyx_v_N = __pyx_t_11; | |
__pyx_v_win = __pyx_t_12; | |
__pyx_v_minp = __pyx_t_13; | |
__pyx_v_is_variable = __pyx_t_14; | |
/* "pandas/_libs/window.pyx":995 | |
* minp, index, | |
* closed) | |
* output = np.empty(N, dtype=float) # <<<<<<<<<<<<<< | |
* | |
* if is_variable: | |
*/ | |
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 995, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_8); | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
__pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 995, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_GIVEREF(__pyx_t_1); | |
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); | |
__pyx_t_1 = 0; | |
__pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 995, __pyx_L1_error) | |
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 995, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 995, __pyx_L1_error) | |
__pyx_t_19 = ((PyArrayObject *)__pyx_t_3); | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); | |
__pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); | |
if (unlikely(__pyx_t_6 < 0)) { | |
PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_v_output, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { | |
Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); | |
__Pyx_RaiseBufferFallbackError(); | |
} else { | |
PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); | |
} | |
__pyx_t_16 = __pyx_t_17 = __pyx_t_18 = 0; | |
} | |
__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; | |
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 995, __pyx_L1_error) | |
} | |
__pyx_t_19 = 0; | |
__pyx_v_output = ((PyArrayObject *)__pyx_t_3); | |
__pyx_t_3 = 0; | |
/* "pandas/_libs/window.pyx":997 | |
* output = np.empty(N, dtype=float) | |
* | |
* if is_variable: # <<<<<<<<<<<<<< | |
* | |
* with nogil: | |
*/ | |
__pyx_t_14 = (__pyx_v_is_variable != 0); | |
if (__pyx_t_14) { | |
/* "pandas/_libs/window.pyx":999 | |
* if is_variable: | |
* | |
* with nogil: # <<<<<<<<<<<<<< | |
* | |
* for i in range(0, N): | |
*/ | |
{ | |
#ifdef WITH_THREAD | |
PyThreadState *_save; | |
Py_UNBLOCK_THREADS | |
__Pyx_FastGIL_Remember(); | |
#endif | |
/*try:*/ { | |
/* "pandas/_libs/window.pyx":1001 | |
* with nogil: | |
* | |
* for i in range(0, N): # <<<<<<<<<<<<<< | |
* | |
* s = start[i] | |
*/ | |
__pyx_t_13 = __pyx_v_N; | |
__pyx_t_12 = __pyx_t_13; | |
for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11+=1) { | |
__pyx_v_i = __pyx_t_11; | |
/* "pandas/_libs/window.pyx":1003 | |
* for i in range(0, N): | |
* | |
* s = start[i] # <<<<<<<<<<<<<< | |
* e = end[i] | |
* | |
*/ | |
__pyx_t_20 = __pyx_v_i; | |
__pyx_v_s = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_start.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_start.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":1004 | |
* | |
* s = start[i] | |
* e = end[i] # <<<<<<<<<<<<<< | |
* | |
* # Over the first window, observations can only be added | |
*/ | |
__pyx_t_21 = __pyx_v_i; | |
__pyx_v_e = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_end.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_end.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":1008 | |
* # Over the first window, observations can only be added | |
* # never removed | |
* if i == 0: # <<<<<<<<<<<<<< | |
* | |
* for j in range(s, e): | |
*/ | |
__pyx_t_14 = ((__pyx_v_i == 0) != 0); | |
if (__pyx_t_14) { | |
/* "pandas/_libs/window.pyx":1010 | |
* if i == 0: | |
* | |
* for j in range(s, e): # <<<<<<<<<<<<<< | |
* add_kurt(input[j], &nobs, &x, &xx, &xxx, &xxxx) | |
* | |
*/ | |
__pyx_t_22 = __pyx_v_e; | |
__pyx_t_23 = __pyx_t_22; | |
for (__pyx_t_24 = __pyx_v_s; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) { | |
__pyx_v_j = __pyx_t_24; | |
/* "pandas/_libs/window.pyx":1011 | |
* | |
* for j in range(s, e): | |
* add_kurt(input[j], &nobs, &x, &xx, &xxx, &xxxx) # <<<<<<<<<<<<<< | |
* | |
* else: | |
*/ | |
__pyx_t_25 = __pyx_v_j; | |
__pyx_f_6pandas_5_libs_6window_add_kurt((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_input.diminfo[0].strides)), (&__pyx_v_nobs), (&__pyx_v_x), (&__pyx_v_xx), (&__pyx_v_xxx), (&__pyx_v_xxxx)); | |
} | |
/* "pandas/_libs/window.pyx":1008 | |
* # Over the first window, observations can only be added | |
* # never removed | |
* if i == 0: # <<<<<<<<<<<<<< | |
* | |
* for j in range(s, e): | |
*/ | |
goto __pyx_L11; | |
} | |
/* "pandas/_libs/window.pyx":1019 | |
* | |
* # calculate adds | |
* for j in range(end[i - 1], e): # <<<<<<<<<<<<<< | |
* add_kurt(input[j], &nobs, &x, &xx, &xxx, &xxxx) | |
* | |
*/ | |
/*else*/ { | |
__pyx_t_22 = __pyx_v_e; | |
__pyx_t_23 = (__pyx_v_i - 1); | |
__pyx_t_24 = __pyx_t_22; | |
for (__pyx_t_26 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_end.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_end.diminfo[0].strides)); __pyx_t_26 < __pyx_t_24; __pyx_t_26+=1) { | |
__pyx_v_j = __pyx_t_26; | |
/* "pandas/_libs/window.pyx":1020 | |
* # calculate adds | |
* for j in range(end[i - 1], e): | |
* add_kurt(input[j], &nobs, &x, &xx, &xxx, &xxxx) # <<<<<<<<<<<<<< | |
* | |
* # calculate deletes | |
*/ | |
__pyx_t_27 = __pyx_v_j; | |
__pyx_f_6pandas_5_libs_6window_add_kurt((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_input.diminfo[0].strides)), (&__pyx_v_nobs), (&__pyx_v_x), (&__pyx_v_xx), (&__pyx_v_xxx), (&__pyx_v_xxxx)); | |
} | |
/* "pandas/_libs/window.pyx":1023 | |
* | |
* # calculate deletes | |
* for j in range(start[i - 1], s): # <<<<<<<<<<<<<< | |
* remove_kurt(input[j], &nobs, &x, &xx, &xxx, &xxxx) | |
* | |
*/ | |
__pyx_t_22 = __pyx_v_s; | |
__pyx_t_24 = (__pyx_v_i - 1); | |
__pyx_t_26 = __pyx_t_22; | |
for (__pyx_t_28 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_start.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_start.diminfo[0].strides)); __pyx_t_28 < __pyx_t_26; __pyx_t_28+=1) { | |
__pyx_v_j = __pyx_t_28; | |
/* "pandas/_libs/window.pyx":1024 | |
* # calculate deletes | |
* for j in range(start[i - 1], s): | |
* remove_kurt(input[j], &nobs, &x, &xx, &xxx, &xxxx) # <<<<<<<<<<<<<< | |
* | |
* output[i] = calc_kurt(minp, nobs, x, xx, xxx, xxxx) | |
*/ | |
__pyx_t_29 = __pyx_v_j; | |
__pyx_f_6pandas_5_libs_6window_remove_kurt((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_input.diminfo[0].strides)), (&__pyx_v_nobs), (&__pyx_v_x), (&__pyx_v_xx), (&__pyx_v_xxx), (&__pyx_v_xxxx)); | |
} | |
} | |
__pyx_L11:; | |
/* "pandas/_libs/window.pyx":1026 | |
* remove_kurt(input[j], &nobs, &x, &xx, &xxx, &xxxx) | |
* | |
* output[i] = calc_kurt(minp, nobs, x, xx, xxx, xxxx) # <<<<<<<<<<<<<< | |
* | |
* else: | |
*/ | |
__pyx_t_22 = __pyx_v_i; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_f_6pandas_5_libs_6window_calc_kurt(__pyx_v_minp, __pyx_v_nobs, __pyx_v_x, __pyx_v_xx, __pyx_v_xxx, __pyx_v_xxxx); | |
} | |
} | |
/* "pandas/_libs/window.pyx":999 | |
* if is_variable: | |
* | |
* with nogil: # <<<<<<<<<<<<<< | |
* | |
* for i in range(0, N): | |
*/ | |
/*finally:*/ { | |
/*normal exit:*/{ | |
#ifdef WITH_THREAD | |
__Pyx_FastGIL_Forget(); | |
Py_BLOCK_THREADS | |
#endif | |
goto __pyx_L8; | |
} | |
__pyx_L8:; | |
} | |
} | |
/* "pandas/_libs/window.pyx":997 | |
* output = np.empty(N, dtype=float) | |
* | |
* if is_variable: # <<<<<<<<<<<<<< | |
* | |
* with nogil: | |
*/ | |
goto __pyx_L5; | |
} | |
/* "pandas/_libs/window.pyx":1030 | |
* else: | |
* | |
* with nogil: # <<<<<<<<<<<<<< | |
* | |
* for i from 0 <= i < minp - 1: | |
*/ | |
/*else*/ { | |
{ | |
#ifdef WITH_THREAD | |
PyThreadState *_save; | |
Py_UNBLOCK_THREADS | |
__Pyx_FastGIL_Remember(); | |
#endif | |
/*try:*/ { | |
/* "pandas/_libs/window.pyx":1032 | |
* with nogil: | |
* | |
* for i from 0 <= i < minp - 1: # <<<<<<<<<<<<<< | |
* add_kurt(input[i], &nobs, &x, &xx, &xxx, &xxxx) | |
* output[i] = NaN | |
*/ | |
__pyx_t_13 = (__pyx_v_minp - 1); | |
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_13; __pyx_v_i++) { | |
/* "pandas/_libs/window.pyx":1033 | |
* | |
* for i from 0 <= i < minp - 1: | |
* add_kurt(input[i], &nobs, &x, &xx, &xxx, &xxxx) # <<<<<<<<<<<<<< | |
* output[i] = NaN | |
* | |
*/ | |
__pyx_t_12 = __pyx_v_i; | |
__pyx_f_6pandas_5_libs_6window_add_kurt((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_input.diminfo[0].strides)), (&__pyx_v_nobs), (&__pyx_v_x), (&__pyx_v_xx), (&__pyx_v_xxx), (&__pyx_v_xxxx)); | |
/* "pandas/_libs/window.pyx":1034 | |
* for i from 0 <= i < minp - 1: | |
* add_kurt(input[i], &nobs, &x, &xx, &xxx, &xxxx) | |
* output[i] = NaN # <<<<<<<<<<<<<< | |
* | |
* for i from minp - 1 <= i < N: | |
*/ | |
__pyx_t_11 = __pyx_v_i; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_6pandas_5_libs_6window_NaN; | |
} | |
/* "pandas/_libs/window.pyx":1036 | |
* output[i] = NaN | |
* | |
* for i from minp - 1 <= i < N: # <<<<<<<<<<<<<< | |
* add_kurt(input[i], &nobs, &x, &xx, &xxx, &xxxx) | |
* | |
*/ | |
__pyx_t_13 = __pyx_v_N; | |
for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_13; __pyx_v_i++) { | |
/* "pandas/_libs/window.pyx":1037 | |
* | |
* for i from minp - 1 <= i < N: | |
* add_kurt(input[i], &nobs, &x, &xx, &xxx, &xxxx) # <<<<<<<<<<<<<< | |
* | |
* if i > win - 1: | |
*/ | |
__pyx_t_26 = __pyx_v_i; | |
__pyx_f_6pandas_5_libs_6window_add_kurt((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_input.diminfo[0].strides)), (&__pyx_v_nobs), (&__pyx_v_x), (&__pyx_v_xx), (&__pyx_v_xxx), (&__pyx_v_xxxx)); | |
/* "pandas/_libs/window.pyx":1039 | |
* add_kurt(input[i], &nobs, &x, &xx, &xxx, &xxxx) | |
* | |
* if i > win - 1: # <<<<<<<<<<<<<< | |
* prev = input[i - win] | |
* remove_kurt(prev, &nobs, &x, &xx, &xxx, &xxxx) | |
*/ | |
__pyx_t_14 = ((__pyx_v_i > (__pyx_v_win - 1)) != 0); | |
if (__pyx_t_14) { | |
/* "pandas/_libs/window.pyx":1040 | |
* | |
* if i > win - 1: | |
* prev = input[i - win] # <<<<<<<<<<<<<< | |
* remove_kurt(prev, &nobs, &x, &xx, &xxx, &xxxx) | |
* | |
*/ | |
__pyx_t_28 = (__pyx_v_i - __pyx_v_win); | |
__pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_input.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":1041 | |
* if i > win - 1: | |
* prev = input[i - win] | |
* remove_kurt(prev, &nobs, &x, &xx, &xxx, &xxxx) # <<<<<<<<<<<<<< | |
* | |
* output[i] = calc_kurt(minp, nobs, x, xx, xxx, xxxx) | |
*/ | |
__pyx_f_6pandas_5_libs_6window_remove_kurt(__pyx_v_prev, (&__pyx_v_nobs), (&__pyx_v_x), (&__pyx_v_xx), (&__pyx_v_xxx), (&__pyx_v_xxxx)); | |
/* "pandas/_libs/window.pyx":1039 | |
* add_kurt(input[i], &nobs, &x, &xx, &xxx, &xxxx) | |
* | |
* if i > win - 1: # <<<<<<<<<<<<<< | |
* prev = input[i - win] | |
* remove_kurt(prev, &nobs, &x, &xx, &xxx, &xxxx) | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":1043 | |
* remove_kurt(prev, &nobs, &x, &xx, &xxx, &xxxx) | |
* | |
* output[i] = calc_kurt(minp, nobs, x, xx, xxx, xxxx) # <<<<<<<<<<<<<< | |
* | |
* return output | |
*/ | |
__pyx_t_30 = __pyx_v_i; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_f_6pandas_5_libs_6window_calc_kurt(__pyx_v_minp, __pyx_v_nobs, __pyx_v_x, __pyx_v_xx, __pyx_v_xxx, __pyx_v_xxxx); | |
} | |
} | |
/* "pandas/_libs/window.pyx":1030 | |
* else: | |
* | |
* with nogil: # <<<<<<<<<<<<<< | |
* | |
* for i from 0 <= i < minp - 1: | |
*/ | |
/*finally:*/ { | |
/*normal exit:*/{ | |
#ifdef WITH_THREAD | |
__Pyx_FastGIL_Forget(); | |
Py_BLOCK_THREADS | |
#endif | |
goto __pyx_L20; | |
} | |
__pyx_L20:; | |
} | |
} | |
} | |
__pyx_L5:; | |
/* "pandas/_libs/window.pyx":1045 | |
* output[i] = calc_kurt(minp, nobs, x, xx, xxx, xxxx) | |
* | |
* return output # <<<<<<<<<<<<<< | |
* | |
* # ---------------------------------------------------------------------- | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__Pyx_INCREF(((PyObject *)__pyx_v_output)); | |
__pyx_r = ((PyObject *)__pyx_v_output); | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":981 | |
* | |
* | |
* def roll_kurt(ndarray[double_t] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* cdef: | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
__Pyx_XDECREF(__pyx_t_2); | |
__Pyx_XDECREF(__pyx_t_3); | |
__Pyx_XDECREF(__pyx_t_4); | |
__Pyx_XDECREF(__pyx_t_5); | |
__Pyx_XDECREF(__pyx_t_7); | |
__Pyx_XDECREF(__pyx_t_8); | |
__Pyx_XDECREF(__pyx_t_9); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_kurt", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XDECREF((PyObject *)__pyx_v_start); | |
__Pyx_XDECREF((PyObject *)__pyx_v_end); | |
__Pyx_XDECREF((PyObject *)__pyx_v_output); | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "pandas/_libs/window.pyx":1051 | |
* | |
* | |
* def roll_median_c(ndarray[float64_t] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* cdef: | |
*/ | |
/* Python wrapper */ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_17roll_median_c(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_mdef_6pandas_5_libs_6window_17roll_median_c = {"roll_median_c", (PyCFunction)__pyx_pw_6pandas_5_libs_6window_17roll_median_c, METH_VARARGS|METH_KEYWORDS, 0}; | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_17roll_median_c(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_median_c (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_median_c", 1, 5, 5, 1); __PYX_ERR(0, 1051, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_median_c", 1, 5, 5, 2); __PYX_ERR(0, 1051, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_median_c", 1, 5, 5, 3); __PYX_ERR(0, 1051, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_median_c", 1, 5, 5, 4); __PYX_ERR(0, 1051, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_median_c") < 0)) __PYX_ERR(0, 1051, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1051, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1051, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_median_c", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1051, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_median_c", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 1051, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_16roll_median_c(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_16roll_median_c(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
double __pyx_v_val; | |
double __pyx_v_res; | |
int __pyx_v_err; | |
CYTHON_UNUSED int __pyx_v_is_variable; | |
int __pyx_v_ret; | |
skiplist_t *__pyx_v_sl; | |
Py_ssize_t __pyx_v_i; | |
Py_ssize_t __pyx_v_j; | |
__pyx_t_5numpy_int64_t __pyx_v_nobs; | |
__pyx_t_5numpy_int64_t __pyx_v_N; | |
__pyx_t_5numpy_int64_t __pyx_v_s; | |
__pyx_t_5numpy_int64_t __pyx_v_e; | |
int __pyx_v_midpoint; | |
PyArrayObject *__pyx_v_start = 0; | |
PyArrayObject *__pyx_v_end = 0; | |
PyArrayObject *__pyx_v_output = 0; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_end; | |
__Pyx_Buffer __pyx_pybuffer_end; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_output; | |
__Pyx_Buffer __pyx_pybuffer_output; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_start; | |
__Pyx_Buffer __pyx_pybuffer_start; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
PyObject *__pyx_t_2 = NULL; | |
PyObject *__pyx_t_3 = NULL; | |
PyObject *__pyx_t_4 = NULL; | |
PyObject *__pyx_t_5 = NULL; | |
PyObject *__pyx_t_6 = NULL; | |
PyObject *__pyx_t_7 = NULL; | |
PyObject *__pyx_t_8 = NULL; | |
PyObject *(*__pyx_t_9)(PyObject *); | |
__pyx_t_5numpy_int64_t __pyx_t_10; | |
__pyx_t_5numpy_int64_t __pyx_t_11; | |
__pyx_t_5numpy_int64_t __pyx_t_12; | |
int __pyx_t_13; | |
PyArrayObject *__pyx_t_14 = NULL; | |
int __pyx_t_15; | |
PyObject *__pyx_t_16 = NULL; | |
PyObject *__pyx_t_17 = NULL; | |
PyObject *__pyx_t_18 = NULL; | |
PyArrayObject *__pyx_t_19 = NULL; | |
Py_ssize_t __pyx_t_20; | |
Py_ssize_t __pyx_t_21; | |
Py_ssize_t __pyx_t_22; | |
Py_ssize_t __pyx_t_23; | |
Py_ssize_t __pyx_t_24; | |
__pyx_t_5numpy_int64_t __pyx_t_25; | |
Py_ssize_t __pyx_t_26; | |
Py_ssize_t __pyx_t_27; | |
Py_ssize_t __pyx_t_28; | |
Py_ssize_t __pyx_t_29; | |
Py_ssize_t __pyx_t_30; | |
__Pyx_RefNannySetupContext("roll_median_c", 0); | |
__pyx_pybuffer_start.pybuffer.buf = NULL; | |
__pyx_pybuffer_start.refcount = 0; | |
__pyx_pybuffernd_start.data = NULL; | |
__pyx_pybuffernd_start.rcbuffer = &__pyx_pybuffer_start; | |
__pyx_pybuffer_end.pybuffer.buf = NULL; | |
__pyx_pybuffer_end.refcount = 0; | |
__pyx_pybuffernd_end.data = NULL; | |
__pyx_pybuffernd_end.rcbuffer = &__pyx_pybuffer_end; | |
__pyx_pybuffer_output.pybuffer.buf = NULL; | |
__pyx_pybuffer_output.refcount = 0; | |
__pyx_pybuffernd_output.data = NULL; | |
__pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output; | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1051, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":1055 | |
* cdef: | |
* double val, res, prev | |
* bint err = 0, is_variable # <<<<<<<<<<<<<< | |
* int ret = 0 | |
* skiplist_t *sl | |
*/ | |
__pyx_v_err = 0; | |
/* "pandas/_libs/window.pyx":1056 | |
* double val, res, prev | |
* bint err = 0, is_variable | |
* int ret = 0 # <<<<<<<<<<<<<< | |
* skiplist_t *sl | |
* Py_ssize_t i, j | |
*/ | |
__pyx_v_ret = 0; | |
/* "pandas/_libs/window.pyx":1059 | |
* skiplist_t *sl | |
* Py_ssize_t i, j | |
* int64_t nobs = 0, N, s, e # <<<<<<<<<<<<<< | |
* int midpoint | |
* ndarray[int64_t] start, end | |
*/ | |
__pyx_v_nobs = 0; | |
/* "pandas/_libs/window.pyx":1066 | |
* # we use the Fixed/Variable Indexer here as the | |
* # actual skiplist ops outweigh any window computation costs | |
* start, end, N, win, minp, is_variable = get_window_indexer( # <<<<<<<<<<<<<< | |
* input, win, | |
* minp, index, closed, | |
*/ | |
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_window_indexer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1066, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
/* "pandas/_libs/window.pyx":1067 | |
* # actual skiplist ops outweigh any window computation costs | |
* start, end, N, win, minp, is_variable = get_window_indexer( | |
* input, win, # <<<<<<<<<<<<<< | |
* minp, index, closed, | |
* use_mock=False) | |
*/ | |
__pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_win); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1067, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_2); | |
/* "pandas/_libs/window.pyx":1068 | |
* start, end, N, win, minp, is_variable = get_window_indexer( | |
* input, win, | |
* minp, index, closed, # <<<<<<<<<<<<<< | |
* use_mock=False) | |
* output = np.empty(N, dtype=float) | |
*/ | |
__pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_minp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
/* "pandas/_libs/window.pyx":1066 | |
* # we use the Fixed/Variable Indexer here as the | |
* # actual skiplist ops outweigh any window computation costs | |
* start, end, N, win, minp, is_variable = get_window_indexer( # <<<<<<<<<<<<<< | |
* input, win, | |
* minp, index, closed, | |
*/ | |
__pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1066, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_4); | |
__Pyx_INCREF(((PyObject *)__pyx_v_input)); | |
__Pyx_GIVEREF(((PyObject *)__pyx_v_input)); | |
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_input)); | |
__Pyx_GIVEREF(__pyx_t_2); | |
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); | |
__Pyx_GIVEREF(__pyx_t_3); | |
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); | |
__Pyx_INCREF(__pyx_v_index); | |
__Pyx_GIVEREF(__pyx_v_index); | |
PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_index); | |
__Pyx_INCREF(__pyx_v_closed); | |
__Pyx_GIVEREF(__pyx_v_closed); | |
PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_closed); | |
__pyx_t_2 = 0; | |
__pyx_t_3 = 0; | |
/* "pandas/_libs/window.pyx":1069 | |
* input, win, | |
* minp, index, closed, | |
* use_mock=False) # <<<<<<<<<<<<<< | |
* output = np.empty(N, dtype=float) | |
* | |
*/ | |
__pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1069, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_3); | |
if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_use_mock, Py_False) < 0) __PYX_ERR(0, 1069, __pyx_L1_error) | |
/* "pandas/_libs/window.pyx":1066 | |
* # we use the Fixed/Variable Indexer here as the | |
* # actual skiplist ops outweigh any window computation costs | |
* start, end, N, win, minp, is_variable = get_window_indexer( # <<<<<<<<<<<<<< | |
* input, win, | |
* minp, index, closed, | |
*/ | |
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1066, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_2); | |
__Pyx_DECREF(__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; | |
if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { | |
PyObject* sequence = __pyx_t_2; | |
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); | |
if (unlikely(size != 6)) { | |
if (size > 6) __Pyx_RaiseTooManyValuesError(6); | |
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); | |
__PYX_ERR(0, 1066, __pyx_L1_error) | |
} | |
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
if (likely(PyTuple_CheckExact(sequence))) { | |
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); | |
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); | |
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); | |
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); | |
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 4); | |
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 5); | |
} else { | |
__pyx_t_3 = PyList_GET_ITEM(sequence, 0); | |
__pyx_t_4 = PyList_GET_ITEM(sequence, 1); | |
__pyx_t_1 = PyList_GET_ITEM(sequence, 2); | |
__pyx_t_5 = PyList_GET_ITEM(sequence, 3); | |
__pyx_t_6 = PyList_GET_ITEM(sequence, 4); | |
__pyx_t_7 = PyList_GET_ITEM(sequence, 5); | |
} | |
__Pyx_INCREF(__pyx_t_3); | |
__Pyx_INCREF(__pyx_t_4); | |
__Pyx_INCREF(__pyx_t_1); | |
__Pyx_INCREF(__pyx_t_5); | |
__Pyx_INCREF(__pyx_t_6); | |
__Pyx_INCREF(__pyx_t_7); | |
#else | |
{ | |
Py_ssize_t i; | |
PyObject** temps[6] = {&__pyx_t_3,&__pyx_t_4,&__pyx_t_1,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7}; | |
for (i=0; i < 6; i++) { | |
PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 1066, __pyx_L1_error) | |
__Pyx_GOTREF(item); | |
*(temps[i]) = item; | |
} | |
} | |
#endif | |
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
} else { | |
Py_ssize_t index = -1; | |
PyObject** temps[6] = {&__pyx_t_3,&__pyx_t_4,&__pyx_t_1,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7}; | |
__pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1066, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_8); | |
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
__pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; | |
for (index=0; index < 6; index++) { | |
PyObject* item = __pyx_t_9(__pyx_t_8); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; | |
__Pyx_GOTREF(item); | |
*(temps[index]) = item; | |
} | |
if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 6) < 0) __PYX_ERR(0, 1066, __pyx_L1_error) | |
__pyx_t_9 = NULL; | |
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
goto __pyx_L4_unpacking_done; | |
__pyx_L3_unpacking_failed:; | |
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
__pyx_t_9 = NULL; | |
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); | |
__PYX_ERR(0, 1066, __pyx_L1_error) | |
__pyx_L4_unpacking_done:; | |
} | |
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1066, __pyx_L1_error) | |
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1066, __pyx_L1_error) | |
__pyx_t_10 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_10 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1066, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
__pyx_t_11 = __Pyx_PyInt_As_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_11 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1066, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__pyx_t_12 = __Pyx_PyInt_As_npy_int64(__pyx_t_6); if (unlikely((__pyx_t_12 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1066, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1066, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
__pyx_t_14 = ((PyArrayObject *)__pyx_t_3); | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start.rcbuffer->pybuffer); | |
__pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_start.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); | |
if (unlikely(__pyx_t_15 < 0)) { | |
PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_start.rcbuffer->pybuffer, (PyObject*)__pyx_v_start, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { | |
Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); | |
__Pyx_RaiseBufferFallbackError(); | |
} else { | |
PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); | |
} | |
__pyx_t_16 = __pyx_t_17 = __pyx_t_18 = 0; | |
} | |
__pyx_pybuffernd_start.diminfo[0].strides = __pyx_pybuffernd_start.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_start.diminfo[0].shape = __pyx_pybuffernd_start.rcbuffer->pybuffer.shape[0]; | |
if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 1066, __pyx_L1_error) | |
} | |
__pyx_t_14 = 0; | |
__pyx_v_start = ((PyArrayObject *)__pyx_t_3); | |
__pyx_t_3 = 0; | |
__pyx_t_14 = ((PyArrayObject *)__pyx_t_4); | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end.rcbuffer->pybuffer); | |
__pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_end.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); | |
if (unlikely(__pyx_t_15 < 0)) { | |
PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_end.rcbuffer->pybuffer, (PyObject*)__pyx_v_end, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { | |
Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); | |
__Pyx_RaiseBufferFallbackError(); | |
} else { | |
PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16); | |
} | |
__pyx_t_18 = __pyx_t_17 = __pyx_t_16 = 0; | |
} | |
__pyx_pybuffernd_end.diminfo[0].strides = __pyx_pybuffernd_end.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_end.diminfo[0].shape = __pyx_pybuffernd_end.rcbuffer->pybuffer.shape[0]; | |
if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 1066, __pyx_L1_error) | |
} | |
__pyx_t_14 = 0; | |
__pyx_v_end = ((PyArrayObject *)__pyx_t_4); | |
__pyx_t_4 = 0; | |
__pyx_v_N = __pyx_t_10; | |
__pyx_v_win = __pyx_t_11; | |
__pyx_v_minp = __pyx_t_12; | |
__pyx_v_is_variable = __pyx_t_13; | |
/* "pandas/_libs/window.pyx":1070 | |
* minp, index, closed, | |
* use_mock=False) | |
* output = np.empty(N, dtype=float) # <<<<<<<<<<<<<< | |
* | |
* sl = skiplist_init(<int>win) | |
*/ | |
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1070, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_2); | |
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1070, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_7); | |
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
__pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1070, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_2); | |
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1070, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_GIVEREF(__pyx_t_2); | |
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); | |
__pyx_t_2 = 0; | |
__pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1070, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_2); | |
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 1070, __pyx_L1_error) | |
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1070, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1070, __pyx_L1_error) | |
__pyx_t_19 = ((PyArrayObject *)__pyx_t_5); | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); | |
__pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); | |
if (unlikely(__pyx_t_15 < 0)) { | |
PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_v_output, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { | |
Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18); | |
__Pyx_RaiseBufferFallbackError(); | |
} else { | |
PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18); | |
} | |
__pyx_t_16 = __pyx_t_17 = __pyx_t_18 = 0; | |
} | |
__pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; | |
if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 1070, __pyx_L1_error) | |
} | |
__pyx_t_19 = 0; | |
__pyx_v_output = ((PyArrayObject *)__pyx_t_5); | |
__pyx_t_5 = 0; | |
/* "pandas/_libs/window.pyx":1072 | |
* output = np.empty(N, dtype=float) | |
* | |
* sl = skiplist_init(<int>win) # <<<<<<<<<<<<<< | |
* if sl == NULL: | |
* raise MemoryError("skiplist_init failed") | |
*/ | |
__pyx_v_sl = skiplist_init(((int)__pyx_v_win)); | |
/* "pandas/_libs/window.pyx":1073 | |
* | |
* sl = skiplist_init(<int>win) | |
* if sl == NULL: # <<<<<<<<<<<<<< | |
* raise MemoryError("skiplist_init failed") | |
* | |
*/ | |
__pyx_t_13 = ((__pyx_v_sl == NULL) != 0); | |
if (unlikely(__pyx_t_13)) { | |
/* "pandas/_libs/window.pyx":1074 | |
* sl = skiplist_init(<int>win) | |
* if sl == NULL: | |
* raise MemoryError("skiplist_init failed") # <<<<<<<<<<<<<< | |
* | |
* with nogil: | |
*/ | |
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1074, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_Raise(__pyx_t_5, 0, 0, 0); | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__PYX_ERR(0, 1074, __pyx_L1_error) | |
/* "pandas/_libs/window.pyx":1073 | |
* | |
* sl = skiplist_init(<int>win) | |
* if sl == NULL: # <<<<<<<<<<<<<< | |
* raise MemoryError("skiplist_init failed") | |
* | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":1076 | |
* raise MemoryError("skiplist_init failed") | |
* | |
* with nogil: # <<<<<<<<<<<<<< | |
* | |
* for i in range(0, N): | |
*/ | |
{ | |
#ifdef WITH_THREAD | |
PyThreadState *_save; | |
Py_UNBLOCK_THREADS | |
__Pyx_FastGIL_Remember(); | |
#endif | |
/*try:*/ { | |
/* "pandas/_libs/window.pyx":1078 | |
* with nogil: | |
* | |
* for i in range(0, N): # <<<<<<<<<<<<<< | |
* s = start[i] | |
* e = end[i] | |
*/ | |
__pyx_t_12 = __pyx_v_N; | |
__pyx_t_11 = __pyx_t_12; | |
for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_11; __pyx_t_20+=1) { | |
__pyx_v_i = __pyx_t_20; | |
/* "pandas/_libs/window.pyx":1079 | |
* | |
* for i in range(0, N): | |
* s = start[i] # <<<<<<<<<<<<<< | |
* e = end[i] | |
* | |
*/ | |
__pyx_t_21 = __pyx_v_i; | |
__pyx_v_s = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_start.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_start.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":1080 | |
* for i in range(0, N): | |
* s = start[i] | |
* e = end[i] # <<<<<<<<<<<<<< | |
* | |
* if i == 0: | |
*/ | |
__pyx_t_22 = __pyx_v_i; | |
__pyx_v_e = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_end.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_end.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":1082 | |
* e = end[i] | |
* | |
* if i == 0: # <<<<<<<<<<<<<< | |
* | |
* # setup | |
*/ | |
__pyx_t_13 = ((__pyx_v_i == 0) != 0); | |
if (__pyx_t_13) { | |
/* "pandas/_libs/window.pyx":1085 | |
* | |
* # setup | |
* val = input[i] # <<<<<<<<<<<<<< | |
* if val == val: | |
* nobs += 1 | |
*/ | |
__pyx_t_23 = __pyx_v_i; | |
__pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_input.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":1086 | |
* # setup | |
* val = input[i] | |
* if val == val: # <<<<<<<<<<<<<< | |
* nobs += 1 | |
* err = skiplist_insert(sl, val) != 1 | |
*/ | |
__pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0); | |
if (__pyx_t_13) { | |
/* "pandas/_libs/window.pyx":1087 | |
* val = input[i] | |
* if val == val: | |
* nobs += 1 # <<<<<<<<<<<<<< | |
* err = skiplist_insert(sl, val) != 1 | |
* if err: | |
*/ | |
__pyx_v_nobs = (__pyx_v_nobs + 1); | |
/* "pandas/_libs/window.pyx":1088 | |
* if val == val: | |
* nobs += 1 | |
* err = skiplist_insert(sl, val) != 1 # <<<<<<<<<<<<<< | |
* if err: | |
* break | |
*/ | |
__pyx_v_err = (skiplist_insert(__pyx_v_sl, __pyx_v_val) != 1); | |
/* "pandas/_libs/window.pyx":1089 | |
* nobs += 1 | |
* err = skiplist_insert(sl, val) != 1 | |
* if err: # <<<<<<<<<<<<<< | |
* break | |
* | |
*/ | |
__pyx_t_13 = (__pyx_v_err != 0); | |
if (__pyx_t_13) { | |
/* "pandas/_libs/window.pyx":1090 | |
* err = skiplist_insert(sl, val) != 1 | |
* if err: | |
* break # <<<<<<<<<<<<<< | |
* | |
* else: | |
*/ | |
goto __pyx_L10_break; | |
/* "pandas/_libs/window.pyx":1089 | |
* nobs += 1 | |
* err = skiplist_insert(sl, val) != 1 | |
* if err: # <<<<<<<<<<<<<< | |
* break | |
* | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":1086 | |
* # setup | |
* val = input[i] | |
* if val == val: # <<<<<<<<<<<<<< | |
* nobs += 1 | |
* err = skiplist_insert(sl, val) != 1 | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":1082 | |
* e = end[i] | |
* | |
* if i == 0: # <<<<<<<<<<<<<< | |
* | |
* # setup | |
*/ | |
goto __pyx_L11; | |
} | |
/* "pandas/_libs/window.pyx":1095 | |
* | |
* # calculate deletes | |
* for j in range(start[i - 1], s): # <<<<<<<<<<<<<< | |
* val = input[j] | |
* if val == val: | |
*/ | |
/*else*/ { | |
__pyx_t_10 = __pyx_v_s; | |
__pyx_t_24 = (__pyx_v_i - 1); | |
__pyx_t_25 = __pyx_t_10; | |
for (__pyx_t_26 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_start.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_start.diminfo[0].strides)); __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) { | |
__pyx_v_j = __pyx_t_26; | |
/* "pandas/_libs/window.pyx":1096 | |
* # calculate deletes | |
* for j in range(start[i - 1], s): | |
* val = input[j] # <<<<<<<<<<<<<< | |
* if val == val: | |
* skiplist_remove(sl, val) | |
*/ | |
__pyx_t_27 = __pyx_v_j; | |
__pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_input.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":1097 | |
* for j in range(start[i - 1], s): | |
* val = input[j] | |
* if val == val: # <<<<<<<<<<<<<< | |
* skiplist_remove(sl, val) | |
* nobs -= 1 | |
*/ | |
__pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0); | |
if (__pyx_t_13) { | |
/* "pandas/_libs/window.pyx":1098 | |
* val = input[j] | |
* if val == val: | |
* skiplist_remove(sl, val) # <<<<<<<<<<<<<< | |
* nobs -= 1 | |
* | |
*/ | |
(void)(skiplist_remove(__pyx_v_sl, __pyx_v_val)); | |
/* "pandas/_libs/window.pyx":1099 | |
* if val == val: | |
* skiplist_remove(sl, val) | |
* nobs -= 1 # <<<<<<<<<<<<<< | |
* | |
* # calculate adds | |
*/ | |
__pyx_v_nobs = (__pyx_v_nobs - 1); | |
/* "pandas/_libs/window.pyx":1097 | |
* for j in range(start[i - 1], s): | |
* val = input[j] | |
* if val == val: # <<<<<<<<<<<<<< | |
* skiplist_remove(sl, val) | |
* nobs -= 1 | |
*/ | |
} | |
} | |
/* "pandas/_libs/window.pyx":1102 | |
* | |
* # calculate adds | |
* for j in range(end[i - 1], e): # <<<<<<<<<<<<<< | |
* val = input[j] | |
* if val == val: | |
*/ | |
__pyx_t_10 = __pyx_v_e; | |
__pyx_t_28 = (__pyx_v_i - 1); | |
__pyx_t_25 = __pyx_t_10; | |
for (__pyx_t_26 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_end.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_end.diminfo[0].strides)); __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) { | |
__pyx_v_j = __pyx_t_26; | |
/* "pandas/_libs/window.pyx":1103 | |
* # calculate adds | |
* for j in range(end[i - 1], e): | |
* val = input[j] # <<<<<<<<<<<<<< | |
* if val == val: | |
* nobs += 1 | |
*/ | |
__pyx_t_29 = __pyx_v_j; | |
__pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_input.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_input.diminfo[0].strides)); | |
/* "pandas/_libs/window.pyx":1104 | |
* for j in range(end[i - 1], e): | |
* val = input[j] | |
* if val == val: # <<<<<<<<<<<<<< | |
* nobs += 1 | |
* err = skiplist_insert(sl, val) != 1 | |
*/ | |
__pyx_t_13 = ((__pyx_v_val == __pyx_v_val) != 0); | |
if (__pyx_t_13) { | |
/* "pandas/_libs/window.pyx":1105 | |
* val = input[j] | |
* if val == val: | |
* nobs += 1 # <<<<<<<<<<<<<< | |
* err = skiplist_insert(sl, val) != 1 | |
* if err: | |
*/ | |
__pyx_v_nobs = (__pyx_v_nobs + 1); | |
/* "pandas/_libs/window.pyx":1106 | |
* if val == val: | |
* nobs += 1 | |
* err = skiplist_insert(sl, val) != 1 # <<<<<<<<<<<<<< | |
* if err: | |
* break | |
*/ | |
__pyx_v_err = (skiplist_insert(__pyx_v_sl, __pyx_v_val) != 1); | |
/* "pandas/_libs/window.pyx":1107 | |
* nobs += 1 | |
* err = skiplist_insert(sl, val) != 1 | |
* if err: # <<<<<<<<<<<<<< | |
* break | |
* | |
*/ | |
__pyx_t_13 = (__pyx_v_err != 0); | |
if (__pyx_t_13) { | |
/* "pandas/_libs/window.pyx":1108 | |
* err = skiplist_insert(sl, val) != 1 | |
* if err: | |
* break # <<<<<<<<<<<<<< | |
* | |
* if nobs >= minp: | |
*/ | |
goto __pyx_L18_break; | |
/* "pandas/_libs/window.pyx":1107 | |
* nobs += 1 | |
* err = skiplist_insert(sl, val) != 1 | |
* if err: # <<<<<<<<<<<<<< | |
* break | |
* | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":1104 | |
* for j in range(end[i - 1], e): | |
* val = input[j] | |
* if val == val: # <<<<<<<<<<<<<< | |
* nobs += 1 | |
* err = skiplist_insert(sl, val) != 1 | |
*/ | |
} | |
} | |
__pyx_L18_break:; | |
} | |
__pyx_L11:; | |
/* "pandas/_libs/window.pyx":1110 | |
* break | |
* | |
* if nobs >= minp: # <<<<<<<<<<<<<< | |
* midpoint = <int>(nobs / 2) | |
* if nobs % 2: | |
*/ | |
__pyx_t_13 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); | |
if (__pyx_t_13) { | |
/* "pandas/_libs/window.pyx":1111 | |
* | |
* if nobs >= minp: | |
* midpoint = <int>(nobs / 2) # <<<<<<<<<<<<<< | |
* if nobs % 2: | |
* res = skiplist_get(sl, midpoint, &ret) | |
*/ | |
__pyx_v_midpoint = ((int)(__pyx_v_nobs / 2)); | |
/* "pandas/_libs/window.pyx":1112 | |
* if nobs >= minp: | |
* midpoint = <int>(nobs / 2) | |
* if nobs % 2: # <<<<<<<<<<<<<< | |
* res = skiplist_get(sl, midpoint, &ret) | |
* else: | |
*/ | |
__pyx_t_13 = ((__pyx_v_nobs % 2) != 0); | |
if (__pyx_t_13) { | |
/* "pandas/_libs/window.pyx":1113 | |
* midpoint = <int>(nobs / 2) | |
* if nobs % 2: | |
* res = skiplist_get(sl, midpoint, &ret) # <<<<<<<<<<<<<< | |
* else: | |
* res = (skiplist_get(sl, midpoint, &ret) + | |
*/ | |
__pyx_v_res = skiplist_get(__pyx_v_sl, __pyx_v_midpoint, (&__pyx_v_ret)); | |
/* "pandas/_libs/window.pyx":1112 | |
* if nobs >= minp: | |
* midpoint = <int>(nobs / 2) | |
* if nobs % 2: # <<<<<<<<<<<<<< | |
* res = skiplist_get(sl, midpoint, &ret) | |
* else: | |
*/ | |
goto __pyx_L22; | |
} | |
/* "pandas/_libs/window.pyx":1116 | |
* else: | |
* res = (skiplist_get(sl, midpoint, &ret) + | |
* skiplist_get(sl, (midpoint - 1), &ret)) / 2 # <<<<<<<<<<<<<< | |
* else: | |
* res = NaN | |
*/ | |
/*else*/ { | |
/* "pandas/_libs/window.pyx":1115 | |
* res = skiplist_get(sl, midpoint, &ret) | |
* else: | |
* res = (skiplist_get(sl, midpoint, &ret) + # <<<<<<<<<<<<<< | |
* skiplist_get(sl, (midpoint - 1), &ret)) / 2 | |
* else: | |
*/ | |
__pyx_v_res = ((skiplist_get(__pyx_v_sl, __pyx_v_midpoint, (&__pyx_v_ret)) + skiplist_get(__pyx_v_sl, (__pyx_v_midpoint - 1), (&__pyx_v_ret))) / 2.0); | |
} | |
__pyx_L22:; | |
/* "pandas/_libs/window.pyx":1110 | |
* break | |
* | |
* if nobs >= minp: # <<<<<<<<<<<<<< | |
* midpoint = <int>(nobs / 2) | |
* if nobs % 2: | |
*/ | |
goto __pyx_L21; | |
} | |
/* "pandas/_libs/window.pyx":1118 | |
* skiplist_get(sl, (midpoint - 1), &ret)) / 2 | |
* else: | |
* res = NaN # <<<<<<<<<<<<<< | |
* | |
* output[i] = res | |
*/ | |
/*else*/ { | |
__pyx_v_res = __pyx_v_6pandas_5_libs_6window_NaN; | |
} | |
__pyx_L21:; | |
/* "pandas/_libs/window.pyx":1120 | |
* res = NaN | |
* | |
* output[i] = res # <<<<<<<<<<<<<< | |
* | |
* skiplist_destroy(sl) | |
*/ | |
__pyx_t_30 = __pyx_v_i; | |
*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_output.diminfo[0].strides) = __pyx_v_res; | |
} | |
__pyx_L10_break:; | |
} | |
/* "pandas/_libs/window.pyx":1076 | |
* raise MemoryError("skiplist_init failed") | |
* | |
* with nogil: # <<<<<<<<<<<<<< | |
* | |
* for i in range(0, N): | |
*/ | |
/*finally:*/ { | |
/*normal exit:*/{ | |
#ifdef WITH_THREAD | |
__Pyx_FastGIL_Forget(); | |
Py_BLOCK_THREADS | |
#endif | |
goto __pyx_L8; | |
} | |
__pyx_L8:; | |
} | |
} | |
/* "pandas/_libs/window.pyx":1122 | |
* output[i] = res | |
* | |
* skiplist_destroy(sl) # <<<<<<<<<<<<<< | |
* if err: | |
* raise MemoryError("skiplist_insert failed") | |
*/ | |
skiplist_destroy(__pyx_v_sl); | |
/* "pandas/_libs/window.pyx":1123 | |
* | |
* skiplist_destroy(sl) | |
* if err: # <<<<<<<<<<<<<< | |
* raise MemoryError("skiplist_insert failed") | |
* return output | |
*/ | |
__pyx_t_13 = (__pyx_v_err != 0); | |
if (unlikely(__pyx_t_13)) { | |
/* "pandas/_libs/window.pyx":1124 | |
* skiplist_destroy(sl) | |
* if err: | |
* raise MemoryError("skiplist_insert failed") # <<<<<<<<<<<<<< | |
* return output | |
* | |
*/ | |
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1124, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_5); | |
__Pyx_Raise(__pyx_t_5, 0, 0, 0); | |
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
__PYX_ERR(0, 1124, __pyx_L1_error) | |
/* "pandas/_libs/window.pyx":1123 | |
* | |
* skiplist_destroy(sl) | |
* if err: # <<<<<<<<<<<<<< | |
* raise MemoryError("skiplist_insert failed") | |
* return output | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":1125 | |
* if err: | |
* raise MemoryError("skiplist_insert failed") | |
* return output # <<<<<<<<<<<<<< | |
* | |
* # ---------------------------------------------------------------------- | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__Pyx_INCREF(((PyObject *)__pyx_v_output)); | |
__pyx_r = ((PyObject *)__pyx_v_output); | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1051 | |
* | |
* | |
* def roll_median_c(ndarray[float64_t] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* cdef: | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
__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); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_median_c", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_end.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_start.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XDECREF((PyObject *)__pyx_v_start); | |
__Pyx_XDECREF((PyObject *)__pyx_v_end); | |
__Pyx_XDECREF((PyObject *)__pyx_v_output); | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "pandas/_libs/window.pyx":1134 | |
* | |
* | |
* cdef inline numeric init_mm(numeric ai, Py_ssize_t *nobs, bint is_max) nogil: # <<<<<<<<<<<<<< | |
* | |
* if numeric in cython.floating: | |
*/ | |
static CYTHON_INLINE __pyx_t_5numpy_int8_t __pyx_fuse_0__pyx_f_6pandas_5_libs_6window_init_mm(__pyx_t_5numpy_int8_t __pyx_v_ai, Py_ssize_t *__pyx_v_nobs, CYTHON_UNUSED int __pyx_v_is_max) { | |
__pyx_t_5numpy_int8_t __pyx_r; | |
/* "pandas/_libs/window.pyx":1151 | |
* | |
* else: | |
* nobs[0] = nobs[0] + 1 # <<<<<<<<<<<<<< | |
* | |
* return ai | |
*/ | |
(__pyx_v_nobs[0]) = ((__pyx_v_nobs[0]) + 1); | |
/* "pandas/_libs/window.pyx":1153 | |
* nobs[0] = nobs[0] + 1 | |
* | |
* return ai # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_r = __pyx_v_ai; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1134 | |
* | |
* | |
* cdef inline numeric init_mm(numeric ai, Py_ssize_t *nobs, bint is_max) nogil: # <<<<<<<<<<<<<< | |
* | |
* if numeric in cython.floating: | |
*/ | |
/* function exit code */ | |
__pyx_L0:; | |
return __pyx_r; | |
} | |
static CYTHON_INLINE __pyx_t_5numpy_int16_t __pyx_fuse_1__pyx_f_6pandas_5_libs_6window_init_mm(__pyx_t_5numpy_int16_t __pyx_v_ai, Py_ssize_t *__pyx_v_nobs, CYTHON_UNUSED int __pyx_v_is_max) { | |
__pyx_t_5numpy_int16_t __pyx_r; | |
/* "pandas/_libs/window.pyx":1151 | |
* | |
* else: | |
* nobs[0] = nobs[0] + 1 # <<<<<<<<<<<<<< | |
* | |
* return ai | |
*/ | |
(__pyx_v_nobs[0]) = ((__pyx_v_nobs[0]) + 1); | |
/* "pandas/_libs/window.pyx":1153 | |
* nobs[0] = nobs[0] + 1 | |
* | |
* return ai # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_r = __pyx_v_ai; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1134 | |
* | |
* | |
* cdef inline numeric init_mm(numeric ai, Py_ssize_t *nobs, bint is_max) nogil: # <<<<<<<<<<<<<< | |
* | |
* if numeric in cython.floating: | |
*/ | |
/* function exit code */ | |
__pyx_L0:; | |
return __pyx_r; | |
} | |
static CYTHON_INLINE __pyx_t_5numpy_int32_t __pyx_fuse_2__pyx_f_6pandas_5_libs_6window_init_mm(__pyx_t_5numpy_int32_t __pyx_v_ai, Py_ssize_t *__pyx_v_nobs, CYTHON_UNUSED int __pyx_v_is_max) { | |
__pyx_t_5numpy_int32_t __pyx_r; | |
/* "pandas/_libs/window.pyx":1151 | |
* | |
* else: | |
* nobs[0] = nobs[0] + 1 # <<<<<<<<<<<<<< | |
* | |
* return ai | |
*/ | |
(__pyx_v_nobs[0]) = ((__pyx_v_nobs[0]) + 1); | |
/* "pandas/_libs/window.pyx":1153 | |
* nobs[0] = nobs[0] + 1 | |
* | |
* return ai # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_r = __pyx_v_ai; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1134 | |
* | |
* | |
* cdef inline numeric init_mm(numeric ai, Py_ssize_t *nobs, bint is_max) nogil: # <<<<<<<<<<<<<< | |
* | |
* if numeric in cython.floating: | |
*/ | |
/* function exit code */ | |
__pyx_L0:; | |
return __pyx_r; | |
} | |
static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_fuse_3__pyx_f_6pandas_5_libs_6window_init_mm(__pyx_t_5numpy_int64_t __pyx_v_ai, Py_ssize_t *__pyx_v_nobs, CYTHON_UNUSED int __pyx_v_is_max) { | |
__pyx_t_5numpy_int64_t __pyx_r; | |
/* "pandas/_libs/window.pyx":1151 | |
* | |
* else: | |
* nobs[0] = nobs[0] + 1 # <<<<<<<<<<<<<< | |
* | |
* return ai | |
*/ | |
(__pyx_v_nobs[0]) = ((__pyx_v_nobs[0]) + 1); | |
/* "pandas/_libs/window.pyx":1153 | |
* nobs[0] = nobs[0] + 1 | |
* | |
* return ai # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_r = __pyx_v_ai; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1134 | |
* | |
* | |
* cdef inline numeric init_mm(numeric ai, Py_ssize_t *nobs, bint is_max) nogil: # <<<<<<<<<<<<<< | |
* | |
* if numeric in cython.floating: | |
*/ | |
/* function exit code */ | |
__pyx_L0:; | |
return __pyx_r; | |
} | |
static CYTHON_INLINE __pyx_t_5numpy_uint8_t __pyx_fuse_4__pyx_f_6pandas_5_libs_6window_init_mm(__pyx_t_5numpy_uint8_t __pyx_v_ai, Py_ssize_t *__pyx_v_nobs, CYTHON_UNUSED int __pyx_v_is_max) { | |
__pyx_t_5numpy_uint8_t __pyx_r; | |
/* "pandas/_libs/window.pyx":1151 | |
* | |
* else: | |
* nobs[0] = nobs[0] + 1 # <<<<<<<<<<<<<< | |
* | |
* return ai | |
*/ | |
(__pyx_v_nobs[0]) = ((__pyx_v_nobs[0]) + 1); | |
/* "pandas/_libs/window.pyx":1153 | |
* nobs[0] = nobs[0] + 1 | |
* | |
* return ai # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_r = __pyx_v_ai; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1134 | |
* | |
* | |
* cdef inline numeric init_mm(numeric ai, Py_ssize_t *nobs, bint is_max) nogil: # <<<<<<<<<<<<<< | |
* | |
* if numeric in cython.floating: | |
*/ | |
/* function exit code */ | |
__pyx_L0:; | |
return __pyx_r; | |
} | |
static CYTHON_INLINE __pyx_t_5numpy_uint16_t __pyx_fuse_5__pyx_f_6pandas_5_libs_6window_init_mm(__pyx_t_5numpy_uint16_t __pyx_v_ai, Py_ssize_t *__pyx_v_nobs, CYTHON_UNUSED int __pyx_v_is_max) { | |
__pyx_t_5numpy_uint16_t __pyx_r; | |
/* "pandas/_libs/window.pyx":1151 | |
* | |
* else: | |
* nobs[0] = nobs[0] + 1 # <<<<<<<<<<<<<< | |
* | |
* return ai | |
*/ | |
(__pyx_v_nobs[0]) = ((__pyx_v_nobs[0]) + 1); | |
/* "pandas/_libs/window.pyx":1153 | |
* nobs[0] = nobs[0] + 1 | |
* | |
* return ai # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_r = __pyx_v_ai; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1134 | |
* | |
* | |
* cdef inline numeric init_mm(numeric ai, Py_ssize_t *nobs, bint is_max) nogil: # <<<<<<<<<<<<<< | |
* | |
* if numeric in cython.floating: | |
*/ | |
/* function exit code */ | |
__pyx_L0:; | |
return __pyx_r; | |
} | |
static CYTHON_INLINE __pyx_t_5numpy_uint32_t __pyx_fuse_6__pyx_f_6pandas_5_libs_6window_init_mm(__pyx_t_5numpy_uint32_t __pyx_v_ai, Py_ssize_t *__pyx_v_nobs, CYTHON_UNUSED int __pyx_v_is_max) { | |
__pyx_t_5numpy_uint32_t __pyx_r; | |
/* "pandas/_libs/window.pyx":1151 | |
* | |
* else: | |
* nobs[0] = nobs[0] + 1 # <<<<<<<<<<<<<< | |
* | |
* return ai | |
*/ | |
(__pyx_v_nobs[0]) = ((__pyx_v_nobs[0]) + 1); | |
/* "pandas/_libs/window.pyx":1153 | |
* nobs[0] = nobs[0] + 1 | |
* | |
* return ai # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_r = __pyx_v_ai; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1134 | |
* | |
* | |
* cdef inline numeric init_mm(numeric ai, Py_ssize_t *nobs, bint is_max) nogil: # <<<<<<<<<<<<<< | |
* | |
* if numeric in cython.floating: | |
*/ | |
/* function exit code */ | |
__pyx_L0:; | |
return __pyx_r; | |
} | |
static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_fuse_7__pyx_f_6pandas_5_libs_6window_init_mm(__pyx_t_5numpy_uint64_t __pyx_v_ai, Py_ssize_t *__pyx_v_nobs, CYTHON_UNUSED int __pyx_v_is_max) { | |
__pyx_t_5numpy_uint64_t __pyx_r; | |
/* "pandas/_libs/window.pyx":1151 | |
* | |
* else: | |
* nobs[0] = nobs[0] + 1 # <<<<<<<<<<<<<< | |
* | |
* return ai | |
*/ | |
(__pyx_v_nobs[0]) = ((__pyx_v_nobs[0]) + 1); | |
/* "pandas/_libs/window.pyx":1153 | |
* nobs[0] = nobs[0] + 1 | |
* | |
* return ai # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_r = __pyx_v_ai; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1134 | |
* | |
* | |
* cdef inline numeric init_mm(numeric ai, Py_ssize_t *nobs, bint is_max) nogil: # <<<<<<<<<<<<<< | |
* | |
* if numeric in cython.floating: | |
*/ | |
/* function exit code */ | |
__pyx_L0:; | |
return __pyx_r; | |
} | |
static CYTHON_INLINE __pyx_t_5numpy_float32_t __pyx_fuse_8__pyx_f_6pandas_5_libs_6window_init_mm(__pyx_t_5numpy_float32_t __pyx_v_ai, Py_ssize_t *__pyx_v_nobs, int __pyx_v_is_max) { | |
__pyx_t_5numpy_float32_t __pyx_r; | |
int __pyx_t_1; | |
/* "pandas/_libs/window.pyx":1137 | |
* | |
* if numeric in cython.floating: | |
* if ai == ai: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] + 1 | |
* elif is_max: | |
*/ | |
__pyx_t_1 = ((__pyx_v_ai == __pyx_v_ai) != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":1138 | |
* if numeric in cython.floating: | |
* if ai == ai: | |
* nobs[0] = nobs[0] + 1 # <<<<<<<<<<<<<< | |
* elif is_max: | |
* if numeric == cython.float: | |
*/ | |
(__pyx_v_nobs[0]) = ((__pyx_v_nobs[0]) + 1); | |
/* "pandas/_libs/window.pyx":1137 | |
* | |
* if numeric in cython.floating: | |
* if ai == ai: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] + 1 | |
* elif is_max: | |
*/ | |
goto __pyx_L3; | |
} | |
/* "pandas/_libs/window.pyx":1139 | |
* if ai == ai: | |
* nobs[0] = nobs[0] + 1 | |
* elif is_max: # <<<<<<<<<<<<<< | |
* if numeric == cython.float: | |
* ai = MINfloat32 | |
*/ | |
__pyx_t_1 = (__pyx_v_is_max != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":1141 | |
* elif is_max: | |
* if numeric == cython.float: | |
* ai = MINfloat32 # <<<<<<<<<<<<<< | |
* else: | |
* ai = MINfloat64 | |
*/ | |
__pyx_v_ai = __pyx_v_6pandas_5_libs_6window_MINfloat32; | |
/* "pandas/_libs/window.pyx":1139 | |
* if ai == ai: | |
* nobs[0] = nobs[0] + 1 | |
* elif is_max: # <<<<<<<<<<<<<< | |
* if numeric == cython.float: | |
* ai = MINfloat32 | |
*/ | |
goto __pyx_L3; | |
} | |
/* "pandas/_libs/window.pyx":1145 | |
* ai = MINfloat64 | |
* else: | |
* if numeric == cython.float: # <<<<<<<<<<<<<< | |
* ai = MAXfloat32 | |
* else: | |
*/ | |
/*else*/ { | |
/* "pandas/_libs/window.pyx":1146 | |
* else: | |
* if numeric == cython.float: | |
* ai = MAXfloat32 # <<<<<<<<<<<<<< | |
* else: | |
* ai = MAXfloat64 | |
*/ | |
__pyx_v_ai = __pyx_v_6pandas_5_libs_6window_MAXfloat32; | |
} | |
__pyx_L3:; | |
/* "pandas/_libs/window.pyx":1153 | |
* nobs[0] = nobs[0] + 1 | |
* | |
* return ai # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_r = __pyx_v_ai; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1134 | |
* | |
* | |
* cdef inline numeric init_mm(numeric ai, Py_ssize_t *nobs, bint is_max) nogil: # <<<<<<<<<<<<<< | |
* | |
* if numeric in cython.floating: | |
*/ | |
/* function exit code */ | |
__pyx_L0:; | |
return __pyx_r; | |
} | |
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_fuse_9__pyx_f_6pandas_5_libs_6window_init_mm(__pyx_t_5numpy_float64_t __pyx_v_ai, Py_ssize_t *__pyx_v_nobs, int __pyx_v_is_max) { | |
__pyx_t_5numpy_float64_t __pyx_r; | |
int __pyx_t_1; | |
/* "pandas/_libs/window.pyx":1137 | |
* | |
* if numeric in cython.floating: | |
* if ai == ai: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] + 1 | |
* elif is_max: | |
*/ | |
__pyx_t_1 = ((__pyx_v_ai == __pyx_v_ai) != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":1138 | |
* if numeric in cython.floating: | |
* if ai == ai: | |
* nobs[0] = nobs[0] + 1 # <<<<<<<<<<<<<< | |
* elif is_max: | |
* if numeric == cython.float: | |
*/ | |
(__pyx_v_nobs[0]) = ((__pyx_v_nobs[0]) + 1); | |
/* "pandas/_libs/window.pyx":1137 | |
* | |
* if numeric in cython.floating: | |
* if ai == ai: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] + 1 | |
* elif is_max: | |
*/ | |
goto __pyx_L3; | |
} | |
/* "pandas/_libs/window.pyx":1139 | |
* if ai == ai: | |
* nobs[0] = nobs[0] + 1 | |
* elif is_max: # <<<<<<<<<<<<<< | |
* if numeric == cython.float: | |
* ai = MINfloat32 | |
*/ | |
__pyx_t_1 = (__pyx_v_is_max != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":1143 | |
* ai = MINfloat32 | |
* else: | |
* ai = MINfloat64 # <<<<<<<<<<<<<< | |
* else: | |
* if numeric == cython.float: | |
*/ | |
__pyx_v_ai = __pyx_v_6pandas_5_libs_6window_MINfloat64; | |
/* "pandas/_libs/window.pyx":1139 | |
* if ai == ai: | |
* nobs[0] = nobs[0] + 1 | |
* elif is_max: # <<<<<<<<<<<<<< | |
* if numeric == cython.float: | |
* ai = MINfloat32 | |
*/ | |
goto __pyx_L3; | |
} | |
/* "pandas/_libs/window.pyx":1145 | |
* ai = MINfloat64 | |
* else: | |
* if numeric == cython.float: # <<<<<<<<<<<<<< | |
* ai = MAXfloat32 | |
* else: | |
*/ | |
/*else*/ { | |
/* "pandas/_libs/window.pyx":1148 | |
* ai = MAXfloat32 | |
* else: | |
* ai = MAXfloat64 # <<<<<<<<<<<<<< | |
* | |
* else: | |
*/ | |
__pyx_v_ai = __pyx_v_6pandas_5_libs_6window_MAXfloat64; | |
} | |
__pyx_L3:; | |
/* "pandas/_libs/window.pyx":1153 | |
* nobs[0] = nobs[0] + 1 | |
* | |
* return ai # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_r = __pyx_v_ai; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1134 | |
* | |
* | |
* cdef inline numeric init_mm(numeric ai, Py_ssize_t *nobs, bint is_max) nogil: # <<<<<<<<<<<<<< | |
* | |
* if numeric in cython.floating: | |
*/ | |
/* function exit code */ | |
__pyx_L0:; | |
return __pyx_r; | |
} | |
/* "pandas/_libs/window.pyx":1156 | |
* | |
* | |
* cdef inline void remove_mm(numeric aold, Py_ssize_t *nobs) nogil: # <<<<<<<<<<<<<< | |
* """ remove a value from the mm calc """ | |
* if numeric in cython.floating and aold == aold: | |
*/ | |
static CYTHON_INLINE void __pyx_fuse_0__pyx_f_6pandas_5_libs_6window_remove_mm(CYTHON_UNUSED __pyx_t_5numpy_int8_t __pyx_v_aold, CYTHON_UNUSED Py_ssize_t *__pyx_v_nobs) { | |
/* "pandas/_libs/window.pyx":1158 | |
* cdef inline void remove_mm(numeric aold, Py_ssize_t *nobs) nogil: | |
* """ remove a value from the mm calc """ | |
* if numeric in cython.floating and aold == aold: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] - 1 | |
* | |
*/ | |
/* function exit code */ | |
} | |
/* "pandas/_libs/window.pyx":1156 | |
* | |
* | |
* cdef inline void remove_mm(numeric aold, Py_ssize_t *nobs) nogil: # <<<<<<<<<<<<<< | |
* """ remove a value from the mm calc """ | |
* if numeric in cython.floating and aold == aold: | |
*/ | |
static CYTHON_INLINE void __pyx_fuse_1__pyx_f_6pandas_5_libs_6window_remove_mm(CYTHON_UNUSED __pyx_t_5numpy_int16_t __pyx_v_aold, CYTHON_UNUSED Py_ssize_t *__pyx_v_nobs) { | |
/* "pandas/_libs/window.pyx":1158 | |
* cdef inline void remove_mm(numeric aold, Py_ssize_t *nobs) nogil: | |
* """ remove a value from the mm calc """ | |
* if numeric in cython.floating and aold == aold: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] - 1 | |
* | |
*/ | |
/* function exit code */ | |
} | |
/* "pandas/_libs/window.pyx":1156 | |
* | |
* | |
* cdef inline void remove_mm(numeric aold, Py_ssize_t *nobs) nogil: # <<<<<<<<<<<<<< | |
* """ remove a value from the mm calc """ | |
* if numeric in cython.floating and aold == aold: | |
*/ | |
static CYTHON_INLINE void __pyx_fuse_2__pyx_f_6pandas_5_libs_6window_remove_mm(CYTHON_UNUSED __pyx_t_5numpy_int32_t __pyx_v_aold, CYTHON_UNUSED Py_ssize_t *__pyx_v_nobs) { | |
/* "pandas/_libs/window.pyx":1158 | |
* cdef inline void remove_mm(numeric aold, Py_ssize_t *nobs) nogil: | |
* """ remove a value from the mm calc """ | |
* if numeric in cython.floating and aold == aold: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] - 1 | |
* | |
*/ | |
/* function exit code */ | |
} | |
/* "pandas/_libs/window.pyx":1156 | |
* | |
* | |
* cdef inline void remove_mm(numeric aold, Py_ssize_t *nobs) nogil: # <<<<<<<<<<<<<< | |
* """ remove a value from the mm calc """ | |
* if numeric in cython.floating and aold == aold: | |
*/ | |
static CYTHON_INLINE void __pyx_fuse_3__pyx_f_6pandas_5_libs_6window_remove_mm(CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_aold, CYTHON_UNUSED Py_ssize_t *__pyx_v_nobs) { | |
/* "pandas/_libs/window.pyx":1158 | |
* cdef inline void remove_mm(numeric aold, Py_ssize_t *nobs) nogil: | |
* """ remove a value from the mm calc """ | |
* if numeric in cython.floating and aold == aold: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] - 1 | |
* | |
*/ | |
/* function exit code */ | |
} | |
/* "pandas/_libs/window.pyx":1156 | |
* | |
* | |
* cdef inline void remove_mm(numeric aold, Py_ssize_t *nobs) nogil: # <<<<<<<<<<<<<< | |
* """ remove a value from the mm calc """ | |
* if numeric in cython.floating and aold == aold: | |
*/ | |
static CYTHON_INLINE void __pyx_fuse_4__pyx_f_6pandas_5_libs_6window_remove_mm(CYTHON_UNUSED __pyx_t_5numpy_uint8_t __pyx_v_aold, CYTHON_UNUSED Py_ssize_t *__pyx_v_nobs) { | |
/* "pandas/_libs/window.pyx":1158 | |
* cdef inline void remove_mm(numeric aold, Py_ssize_t *nobs) nogil: | |
* """ remove a value from the mm calc """ | |
* if numeric in cython.floating and aold == aold: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] - 1 | |
* | |
*/ | |
/* function exit code */ | |
} | |
/* "pandas/_libs/window.pyx":1156 | |
* | |
* | |
* cdef inline void remove_mm(numeric aold, Py_ssize_t *nobs) nogil: # <<<<<<<<<<<<<< | |
* """ remove a value from the mm calc """ | |
* if numeric in cython.floating and aold == aold: | |
*/ | |
static CYTHON_INLINE void __pyx_fuse_5__pyx_f_6pandas_5_libs_6window_remove_mm(CYTHON_UNUSED __pyx_t_5numpy_uint16_t __pyx_v_aold, CYTHON_UNUSED Py_ssize_t *__pyx_v_nobs) { | |
/* "pandas/_libs/window.pyx":1158 | |
* cdef inline void remove_mm(numeric aold, Py_ssize_t *nobs) nogil: | |
* """ remove a value from the mm calc """ | |
* if numeric in cython.floating and aold == aold: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] - 1 | |
* | |
*/ | |
/* function exit code */ | |
} | |
/* "pandas/_libs/window.pyx":1156 | |
* | |
* | |
* cdef inline void remove_mm(numeric aold, Py_ssize_t *nobs) nogil: # <<<<<<<<<<<<<< | |
* """ remove a value from the mm calc """ | |
* if numeric in cython.floating and aold == aold: | |
*/ | |
static CYTHON_INLINE void __pyx_fuse_6__pyx_f_6pandas_5_libs_6window_remove_mm(CYTHON_UNUSED __pyx_t_5numpy_uint32_t __pyx_v_aold, CYTHON_UNUSED Py_ssize_t *__pyx_v_nobs) { | |
/* "pandas/_libs/window.pyx":1158 | |
* cdef inline void remove_mm(numeric aold, Py_ssize_t *nobs) nogil: | |
* """ remove a value from the mm calc """ | |
* if numeric in cython.floating and aold == aold: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] - 1 | |
* | |
*/ | |
/* function exit code */ | |
} | |
/* "pandas/_libs/window.pyx":1156 | |
* | |
* | |
* cdef inline void remove_mm(numeric aold, Py_ssize_t *nobs) nogil: # <<<<<<<<<<<<<< | |
* """ remove a value from the mm calc """ | |
* if numeric in cython.floating and aold == aold: | |
*/ | |
static CYTHON_INLINE void __pyx_fuse_7__pyx_f_6pandas_5_libs_6window_remove_mm(CYTHON_UNUSED __pyx_t_5numpy_uint64_t __pyx_v_aold, CYTHON_UNUSED Py_ssize_t *__pyx_v_nobs) { | |
/* "pandas/_libs/window.pyx":1158 | |
* cdef inline void remove_mm(numeric aold, Py_ssize_t *nobs) nogil: | |
* """ remove a value from the mm calc """ | |
* if numeric in cython.floating and aold == aold: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] - 1 | |
* | |
*/ | |
/* function exit code */ | |
} | |
/* "pandas/_libs/window.pyx":1156 | |
* | |
* | |
* cdef inline void remove_mm(numeric aold, Py_ssize_t *nobs) nogil: # <<<<<<<<<<<<<< | |
* """ remove a value from the mm calc """ | |
* if numeric in cython.floating and aold == aold: | |
*/ | |
static CYTHON_INLINE void __pyx_fuse_8__pyx_f_6pandas_5_libs_6window_remove_mm(__pyx_t_5numpy_float32_t __pyx_v_aold, Py_ssize_t *__pyx_v_nobs) { | |
int __pyx_t_1; | |
/* "pandas/_libs/window.pyx":1158 | |
* cdef inline void remove_mm(numeric aold, Py_ssize_t *nobs) nogil: | |
* """ remove a value from the mm calc """ | |
* if numeric in cython.floating and aold == aold: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] - 1 | |
* | |
*/ | |
__pyx_t_1 = ((__pyx_v_aold == __pyx_v_aold) != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":1159 | |
* """ remove a value from the mm calc """ | |
* if numeric in cython.floating and aold == aold: | |
* nobs[0] = nobs[0] - 1 # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
(__pyx_v_nobs[0]) = ((__pyx_v_nobs[0]) - 1); | |
/* "pandas/_libs/window.pyx":1158 | |
* cdef inline void remove_mm(numeric aold, Py_ssize_t *nobs) nogil: | |
* """ remove a value from the mm calc """ | |
* if numeric in cython.floating and aold == aold: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] - 1 | |
* | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":1156 | |
* | |
* | |
* cdef inline void remove_mm(numeric aold, Py_ssize_t *nobs) nogil: # <<<<<<<<<<<<<< | |
* """ remove a value from the mm calc """ | |
* if numeric in cython.floating and aold == aold: | |
*/ | |
/* function exit code */ | |
} | |
static CYTHON_INLINE void __pyx_fuse_9__pyx_f_6pandas_5_libs_6window_remove_mm(__pyx_t_5numpy_float64_t __pyx_v_aold, Py_ssize_t *__pyx_v_nobs) { | |
int __pyx_t_1; | |
/* "pandas/_libs/window.pyx":1158 | |
* cdef inline void remove_mm(numeric aold, Py_ssize_t *nobs) nogil: | |
* """ remove a value from the mm calc """ | |
* if numeric in cython.floating and aold == aold: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] - 1 | |
* | |
*/ | |
__pyx_t_1 = ((__pyx_v_aold == __pyx_v_aold) != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":1159 | |
* """ remove a value from the mm calc """ | |
* if numeric in cython.floating and aold == aold: | |
* nobs[0] = nobs[0] - 1 # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
(__pyx_v_nobs[0]) = ((__pyx_v_nobs[0]) - 1); | |
/* "pandas/_libs/window.pyx":1158 | |
* cdef inline void remove_mm(numeric aold, Py_ssize_t *nobs) nogil: | |
* """ remove a value from the mm calc """ | |
* if numeric in cython.floating and aold == aold: # <<<<<<<<<<<<<< | |
* nobs[0] = nobs[0] - 1 | |
* | |
*/ | |
} | |
/* "pandas/_libs/window.pyx":1156 | |
* | |
* | |
* cdef inline void remove_mm(numeric aold, Py_ssize_t *nobs) nogil: # <<<<<<<<<<<<<< | |
* """ remove a value from the mm calc """ | |
* if numeric in cython.floating and aold == aold: | |
*/ | |
/* function exit code */ | |
} | |
/* "pandas/_libs/window.pyx":1162 | |
* | |
* | |
* cdef inline numeric calc_mm(int64_t minp, Py_ssize_t nobs, # <<<<<<<<<<<<<< | |
* numeric value) nogil: | |
* cdef numeric result | |
*/ | |
static CYTHON_INLINE __pyx_t_5numpy_int8_t __pyx_fuse_0__pyx_f_6pandas_5_libs_6window_calc_mm(CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_minp, CYTHON_UNUSED Py_ssize_t __pyx_v_nobs, __pyx_t_5numpy_int8_t __pyx_v_value) { | |
__pyx_t_5numpy_int8_t __pyx_v_result; | |
__pyx_t_5numpy_int8_t __pyx_r; | |
/* "pandas/_libs/window.pyx":1172 | |
* result = NaN | |
* else: | |
* result = value # <<<<<<<<<<<<<< | |
* | |
* return result | |
*/ | |
__pyx_v_result = __pyx_v_value; | |
/* "pandas/_libs/window.pyx":1174 | |
* result = value | |
* | |
* return result # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_r = __pyx_v_result; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1162 | |
* | |
* | |
* cdef inline numeric calc_mm(int64_t minp, Py_ssize_t nobs, # <<<<<<<<<<<<<< | |
* numeric value) nogil: | |
* cdef numeric result | |
*/ | |
/* function exit code */ | |
__pyx_L0:; | |
return __pyx_r; | |
} | |
static CYTHON_INLINE __pyx_t_5numpy_int16_t __pyx_fuse_1__pyx_f_6pandas_5_libs_6window_calc_mm(CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_minp, CYTHON_UNUSED Py_ssize_t __pyx_v_nobs, __pyx_t_5numpy_int16_t __pyx_v_value) { | |
__pyx_t_5numpy_int16_t __pyx_v_result; | |
__pyx_t_5numpy_int16_t __pyx_r; | |
/* "pandas/_libs/window.pyx":1172 | |
* result = NaN | |
* else: | |
* result = value # <<<<<<<<<<<<<< | |
* | |
* return result | |
*/ | |
__pyx_v_result = __pyx_v_value; | |
/* "pandas/_libs/window.pyx":1174 | |
* result = value | |
* | |
* return result # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_r = __pyx_v_result; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1162 | |
* | |
* | |
* cdef inline numeric calc_mm(int64_t minp, Py_ssize_t nobs, # <<<<<<<<<<<<<< | |
* numeric value) nogil: | |
* cdef numeric result | |
*/ | |
/* function exit code */ | |
__pyx_L0:; | |
return __pyx_r; | |
} | |
static CYTHON_INLINE __pyx_t_5numpy_int32_t __pyx_fuse_2__pyx_f_6pandas_5_libs_6window_calc_mm(CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_minp, CYTHON_UNUSED Py_ssize_t __pyx_v_nobs, __pyx_t_5numpy_int32_t __pyx_v_value) { | |
__pyx_t_5numpy_int32_t __pyx_v_result; | |
__pyx_t_5numpy_int32_t __pyx_r; | |
/* "pandas/_libs/window.pyx":1172 | |
* result = NaN | |
* else: | |
* result = value # <<<<<<<<<<<<<< | |
* | |
* return result | |
*/ | |
__pyx_v_result = __pyx_v_value; | |
/* "pandas/_libs/window.pyx":1174 | |
* result = value | |
* | |
* return result # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_r = __pyx_v_result; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1162 | |
* | |
* | |
* cdef inline numeric calc_mm(int64_t minp, Py_ssize_t nobs, # <<<<<<<<<<<<<< | |
* numeric value) nogil: | |
* cdef numeric result | |
*/ | |
/* function exit code */ | |
__pyx_L0:; | |
return __pyx_r; | |
} | |
static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_fuse_3__pyx_f_6pandas_5_libs_6window_calc_mm(CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_minp, CYTHON_UNUSED Py_ssize_t __pyx_v_nobs, __pyx_t_5numpy_int64_t __pyx_v_value) { | |
__pyx_t_5numpy_int64_t __pyx_v_result; | |
__pyx_t_5numpy_int64_t __pyx_r; | |
/* "pandas/_libs/window.pyx":1172 | |
* result = NaN | |
* else: | |
* result = value # <<<<<<<<<<<<<< | |
* | |
* return result | |
*/ | |
__pyx_v_result = __pyx_v_value; | |
/* "pandas/_libs/window.pyx":1174 | |
* result = value | |
* | |
* return result # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_r = __pyx_v_result; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1162 | |
* | |
* | |
* cdef inline numeric calc_mm(int64_t minp, Py_ssize_t nobs, # <<<<<<<<<<<<<< | |
* numeric value) nogil: | |
* cdef numeric result | |
*/ | |
/* function exit code */ | |
__pyx_L0:; | |
return __pyx_r; | |
} | |
static CYTHON_INLINE __pyx_t_5numpy_uint8_t __pyx_fuse_4__pyx_f_6pandas_5_libs_6window_calc_mm(CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_minp, CYTHON_UNUSED Py_ssize_t __pyx_v_nobs, __pyx_t_5numpy_uint8_t __pyx_v_value) { | |
__pyx_t_5numpy_uint8_t __pyx_v_result; | |
__pyx_t_5numpy_uint8_t __pyx_r; | |
/* "pandas/_libs/window.pyx":1172 | |
* result = NaN | |
* else: | |
* result = value # <<<<<<<<<<<<<< | |
* | |
* return result | |
*/ | |
__pyx_v_result = __pyx_v_value; | |
/* "pandas/_libs/window.pyx":1174 | |
* result = value | |
* | |
* return result # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_r = __pyx_v_result; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1162 | |
* | |
* | |
* cdef inline numeric calc_mm(int64_t minp, Py_ssize_t nobs, # <<<<<<<<<<<<<< | |
* numeric value) nogil: | |
* cdef numeric result | |
*/ | |
/* function exit code */ | |
__pyx_L0:; | |
return __pyx_r; | |
} | |
static CYTHON_INLINE __pyx_t_5numpy_uint16_t __pyx_fuse_5__pyx_f_6pandas_5_libs_6window_calc_mm(CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_minp, CYTHON_UNUSED Py_ssize_t __pyx_v_nobs, __pyx_t_5numpy_uint16_t __pyx_v_value) { | |
__pyx_t_5numpy_uint16_t __pyx_v_result; | |
__pyx_t_5numpy_uint16_t __pyx_r; | |
/* "pandas/_libs/window.pyx":1172 | |
* result = NaN | |
* else: | |
* result = value # <<<<<<<<<<<<<< | |
* | |
* return result | |
*/ | |
__pyx_v_result = __pyx_v_value; | |
/* "pandas/_libs/window.pyx":1174 | |
* result = value | |
* | |
* return result # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_r = __pyx_v_result; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1162 | |
* | |
* | |
* cdef inline numeric calc_mm(int64_t minp, Py_ssize_t nobs, # <<<<<<<<<<<<<< | |
* numeric value) nogil: | |
* cdef numeric result | |
*/ | |
/* function exit code */ | |
__pyx_L0:; | |
return __pyx_r; | |
} | |
static CYTHON_INLINE __pyx_t_5numpy_uint32_t __pyx_fuse_6__pyx_f_6pandas_5_libs_6window_calc_mm(CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_minp, CYTHON_UNUSED Py_ssize_t __pyx_v_nobs, __pyx_t_5numpy_uint32_t __pyx_v_value) { | |
__pyx_t_5numpy_uint32_t __pyx_v_result; | |
__pyx_t_5numpy_uint32_t __pyx_r; | |
/* "pandas/_libs/window.pyx":1172 | |
* result = NaN | |
* else: | |
* result = value # <<<<<<<<<<<<<< | |
* | |
* return result | |
*/ | |
__pyx_v_result = __pyx_v_value; | |
/* "pandas/_libs/window.pyx":1174 | |
* result = value | |
* | |
* return result # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_r = __pyx_v_result; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1162 | |
* | |
* | |
* cdef inline numeric calc_mm(int64_t minp, Py_ssize_t nobs, # <<<<<<<<<<<<<< | |
* numeric value) nogil: | |
* cdef numeric result | |
*/ | |
/* function exit code */ | |
__pyx_L0:; | |
return __pyx_r; | |
} | |
static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_fuse_7__pyx_f_6pandas_5_libs_6window_calc_mm(CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_minp, CYTHON_UNUSED Py_ssize_t __pyx_v_nobs, __pyx_t_5numpy_uint64_t __pyx_v_value) { | |
__pyx_t_5numpy_uint64_t __pyx_v_result; | |
__pyx_t_5numpy_uint64_t __pyx_r; | |
/* "pandas/_libs/window.pyx":1172 | |
* result = NaN | |
* else: | |
* result = value # <<<<<<<<<<<<<< | |
* | |
* return result | |
*/ | |
__pyx_v_result = __pyx_v_value; | |
/* "pandas/_libs/window.pyx":1174 | |
* result = value | |
* | |
* return result # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_r = __pyx_v_result; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1162 | |
* | |
* | |
* cdef inline numeric calc_mm(int64_t minp, Py_ssize_t nobs, # <<<<<<<<<<<<<< | |
* numeric value) nogil: | |
* cdef numeric result | |
*/ | |
/* function exit code */ | |
__pyx_L0:; | |
return __pyx_r; | |
} | |
static CYTHON_INLINE __pyx_t_5numpy_float32_t __pyx_fuse_8__pyx_f_6pandas_5_libs_6window_calc_mm(__pyx_t_5numpy_int64_t __pyx_v_minp, Py_ssize_t __pyx_v_nobs, __pyx_t_5numpy_float32_t __pyx_v_value) { | |
__pyx_t_5numpy_float32_t __pyx_v_result; | |
__pyx_t_5numpy_float32_t __pyx_r; | |
int __pyx_t_1; | |
/* "pandas/_libs/window.pyx":1167 | |
* | |
* if numeric in cython.floating: | |
* if nobs >= minp: # <<<<<<<<<<<<<< | |
* result = value | |
* else: | |
*/ | |
__pyx_t_1 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":1168 | |
* if numeric in cython.floating: | |
* if nobs >= minp: | |
* result = value # <<<<<<<<<<<<<< | |
* else: | |
* result = NaN | |
*/ | |
__pyx_v_result = __pyx_v_value; | |
/* "pandas/_libs/window.pyx":1167 | |
* | |
* if numeric in cython.floating: | |
* if nobs >= minp: # <<<<<<<<<<<<<< | |
* result = value | |
* else: | |
*/ | |
goto __pyx_L3; | |
} | |
/* "pandas/_libs/window.pyx":1170 | |
* result = value | |
* else: | |
* result = NaN # <<<<<<<<<<<<<< | |
* else: | |
* result = value | |
*/ | |
/*else*/ { | |
__pyx_v_result = __pyx_v_6pandas_5_libs_6window_NaN; | |
} | |
__pyx_L3:; | |
/* "pandas/_libs/window.pyx":1174 | |
* result = value | |
* | |
* return result # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_r = __pyx_v_result; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1162 | |
* | |
* | |
* cdef inline numeric calc_mm(int64_t minp, Py_ssize_t nobs, # <<<<<<<<<<<<<< | |
* numeric value) nogil: | |
* cdef numeric result | |
*/ | |
/* function exit code */ | |
__pyx_L0:; | |
return __pyx_r; | |
} | |
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_fuse_9__pyx_f_6pandas_5_libs_6window_calc_mm(__pyx_t_5numpy_int64_t __pyx_v_minp, Py_ssize_t __pyx_v_nobs, __pyx_t_5numpy_float64_t __pyx_v_value) { | |
__pyx_t_5numpy_float64_t __pyx_v_result; | |
__pyx_t_5numpy_float64_t __pyx_r; | |
int __pyx_t_1; | |
/* "pandas/_libs/window.pyx":1167 | |
* | |
* if numeric in cython.floating: | |
* if nobs >= minp: # <<<<<<<<<<<<<< | |
* result = value | |
* else: | |
*/ | |
__pyx_t_1 = ((__pyx_v_nobs >= __pyx_v_minp) != 0); | |
if (__pyx_t_1) { | |
/* "pandas/_libs/window.pyx":1168 | |
* if numeric in cython.floating: | |
* if nobs >= minp: | |
* result = value # <<<<<<<<<<<<<< | |
* else: | |
* result = NaN | |
*/ | |
__pyx_v_result = __pyx_v_value; | |
/* "pandas/_libs/window.pyx":1167 | |
* | |
* if numeric in cython.floating: | |
* if nobs >= minp: # <<<<<<<<<<<<<< | |
* result = value | |
* else: | |
*/ | |
goto __pyx_L3; | |
} | |
/* "pandas/_libs/window.pyx":1170 | |
* result = value | |
* else: | |
* result = NaN # <<<<<<<<<<<<<< | |
* else: | |
* result = value | |
*/ | |
/*else*/ { | |
__pyx_v_result = __pyx_v_6pandas_5_libs_6window_NaN; | |
} | |
__pyx_L3:; | |
/* "pandas/_libs/window.pyx":1174 | |
* result = value | |
* | |
* return result # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__pyx_r = __pyx_v_result; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1162 | |
* | |
* | |
* cdef inline numeric calc_mm(int64_t minp, Py_ssize_t nobs, # <<<<<<<<<<<<<< | |
* numeric value) nogil: | |
* cdef numeric result | |
*/ | |
/* function exit code */ | |
__pyx_L0:; | |
return __pyx_r; | |
} | |
/* "pandas/_libs/window.pyx":1177 | |
* | |
* | |
* def roll_max(ndarray[numeric] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* """ | |
*/ | |
/* Python wrapper */ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_19roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static char __pyx_doc_6pandas_5_libs_6window_18roll_max[] = "\n Moving max of 1d array of any numeric type along axis=0 ignoring NaNs.\n\n Parameters\n ----------\n input: numpy array\n window: int, size of rolling window\n minp: if number of observations in window\n is below this, output a NaN\n index: ndarray, optional\n index for window computation\n closed: 'right', 'left', 'both', 'neither'\n make the interval closed on the right, left,\n both or neither endpoints\n "; | |
static PyMethodDef __pyx_mdef_6pandas_5_libs_6window_19roll_max = {"roll_max", (PyCFunction)__pyx_pw_6pandas_5_libs_6window_19roll_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6window_18roll_max}; | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_19roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyObject *__pyx_v_signatures = 0; | |
PyObject *__pyx_v_args = 0; | |
PyObject *__pyx_v_kwargs = 0; | |
CYTHON_UNUSED PyObject *__pyx_v_defaults = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0}; | |
PyObject* values[4] = {0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 4) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
} | |
__pyx_v_signatures = values[0]; | |
__pyx_v_args = values[1]; | |
__pyx_v_kwargs = values[2]; | |
__pyx_v_defaults = values[3]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_18roll_max(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults); | |
/* function exit code */ | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_18roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) { | |
PyObject *__pyx_v_dest_sig = NULL; | |
Py_ssize_t __pyx_v_i; | |
PyTypeObject *__pyx_v_ndarray = 0; | |
__Pyx_memviewslice __pyx_v_memslice; | |
Py_ssize_t __pyx_v_itemsize; | |
int __pyx_v_dtype_signed; | |
char __pyx_v_kind; | |
int __pyx_v____pyx_int8_t_is_signed; | |
int __pyx_v____pyx_int16_t_is_signed; | |
int __pyx_v____pyx_int32_t_is_signed; | |
int __pyx_v____pyx_int64_t_is_signed; | |
int __pyx_v____pyx_uint8_t_is_signed; | |
int __pyx_v____pyx_uint16_t_is_signed; | |
int __pyx_v____pyx_uint32_t_is_signed; | |
int __pyx_v____pyx_uint64_t_is_signed; | |
PyObject *__pyx_v_arg = NULL; | |
PyObject *__pyx_v_dtype = NULL; | |
PyObject *__pyx_v_arg_base = NULL; | |
PyObject *__pyx_v_candidates = NULL; | |
PyObject *__pyx_v_sig = NULL; | |
int __pyx_v_match_found; | |
PyObject *__pyx_v_src_sig = NULL; | |
PyObject *__pyx_v_dst_type = NULL; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
int __pyx_t_2; | |
int __pyx_t_3; | |
int __pyx_t_4; | |
Py_ssize_t __pyx_t_5; | |
PyObject *__pyx_t_6 = NULL; | |
long __pyx_t_7; | |
__Pyx_memviewslice __pyx_t_8; | |
Py_ssize_t __pyx_t_9; | |
int __pyx_t_10; | |
int __pyx_t_11; | |
PyObject *__pyx_t_12 = NULL; | |
Py_ssize_t __pyx_t_13; | |
Py_ssize_t __pyx_t_14; | |
Py_ssize_t __pyx_t_15; | |
int __pyx_t_16; | |
__Pyx_RefNannySetupContext("roll_max", 0); | |
__Pyx_INCREF(__pyx_v_kwargs); | |
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_INCREF(Py_None); | |
__Pyx_GIVEREF(Py_None); | |
PyList_SET_ITEM(__pyx_t_1, 0, Py_None); | |
__pyx_v_dest_sig = ((PyObject*)__pyx_t_1); | |
__pyx_t_1 = 0; | |
__pyx_t_3 = (__pyx_v_kwargs != Py_None); | |
__pyx_t_4 = (__pyx_t_3 != 0); | |
if (__pyx_t_4) { | |
} else { | |
__pyx_t_2 = __pyx_t_4; | |
goto __pyx_L4_bool_binop_done; | |
} | |
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__pyx_t_3 = ((!__pyx_t_4) != 0); | |
__pyx_t_2 = __pyx_t_3; | |
__pyx_L4_bool_binop_done:; | |
if (__pyx_t_2) { | |
__Pyx_INCREF(Py_None); | |
__Pyx_DECREF_SET(__pyx_v_kwargs, Py_None); | |
} | |
__pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); | |
__pyx_t_1 = 0; | |
__pyx_v_itemsize = -1L; | |
__pyx_v____pyx_int8_t_is_signed = (!((((__pyx_t_5numpy_int8_t)-1L) > 0) != 0)); | |
__pyx_v____pyx_int16_t_is_signed = (!((((__pyx_t_5numpy_int16_t)-1L) > 0) != 0)); | |
__pyx_v____pyx_int32_t_is_signed = (!((((__pyx_t_5numpy_int32_t)-1L) > 0) != 0)); | |
__pyx_v____pyx_int64_t_is_signed = (!((((__pyx_t_5numpy_int64_t)-1L) > 0) != 0)); | |
__pyx_v____pyx_uint8_t_is_signed = (!((((__pyx_t_5numpy_uint8_t)-1L) > 0) != 0)); | |
__pyx_v____pyx_uint16_t_is_signed = (!((((__pyx_t_5numpy_uint16_t)-1L) > 0) != 0)); | |
__pyx_v____pyx_uint32_t_is_signed = (!((((__pyx_t_5numpy_uint32_t)-1L) > 0) != 0)); | |
__pyx_v____pyx_uint64_t_is_signed = (!((((__pyx_t_5numpy_uint64_t)-1L) > 0) != 0)); | |
if (unlikely(__pyx_v_args == Py_None)) { | |
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); | |
__PYX_ERR(0, 1177, __pyx_L1_error) | |
} | |
__pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__pyx_t_2 = ((0 < __pyx_t_5) != 0); | |
if (__pyx_t_2) { | |
if (unlikely(__pyx_v_args == Py_None)) { | |
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
__PYX_ERR(0, 1177, __pyx_L1_error) | |
} | |
__pyx_t_1 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0); | |
__Pyx_INCREF(__pyx_t_1); | |
__pyx_v_arg = __pyx_t_1; | |
__pyx_t_1 = 0; | |
goto __pyx_L6; | |
} | |
__pyx_t_3 = (__pyx_v_kwargs != Py_None); | |
__pyx_t_4 = (__pyx_t_3 != 0); | |
if (__pyx_t_4) { | |
} else { | |
__pyx_t_2 = __pyx_t_4; | |
goto __pyx_L7_bool_binop_done; | |
} | |
if (unlikely(__pyx_v_kwargs == Py_None)) { | |
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); | |
__PYX_ERR(0, 1177, __pyx_L1_error) | |
} | |
__pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_input, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__pyx_t_3 = (__pyx_t_4 != 0); | |
__pyx_t_2 = __pyx_t_3; | |
__pyx_L7_bool_binop_done:; | |
if (__pyx_t_2) { | |
if (unlikely(__pyx_v_kwargs == Py_None)) { | |
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
__PYX_ERR(0, 1177, __pyx_L1_error) | |
} | |
__pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_input); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_v_arg = __pyx_t_1; | |
__pyx_t_1 = 0; | |
goto __pyx_L6; | |
} | |
/*else*/ { | |
if (unlikely(__pyx_v_args == Py_None)) { | |
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); | |
__PYX_ERR(0, 1177, __pyx_L1_error) | |
} | |
__pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_INCREF(__pyx_int_5); | |
__Pyx_GIVEREF(__pyx_int_5); | |
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_5); | |
__Pyx_INCREF(__pyx_n_s_s); | |
__Pyx_GIVEREF(__pyx_n_s_s); | |
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_s); | |
__Pyx_GIVEREF(__pyx_t_1); | |
PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); | |
__pyx_t_1 = 0; | |
__pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
__Pyx_Raise(__pyx_t_6, 0, 0, 0); | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__PYX_ERR(0, 1177, __pyx_L1_error) | |
} | |
__pyx_L6:; | |
while (1) { | |
__pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)Py_None)); | |
__pyx_t_3 = (__pyx_t_2 != 0); | |
if (__pyx_t_3) { | |
__pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); | |
__pyx_t_2 = (__pyx_t_3 != 0); | |
if (__pyx_t_2) { | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_v_dtype = __pyx_t_6; | |
__pyx_t_6 = 0; | |
goto __pyx_L12; | |
} | |
__pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); | |
__pyx_t_3 = (__pyx_t_2 != 0); | |
if (__pyx_t_3) { | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_v_arg_base = __pyx_t_6; | |
__pyx_t_6 = 0; | |
__pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); | |
__pyx_t_2 = (__pyx_t_3 != 0); | |
if (__pyx_t_2) { | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_v_dtype = __pyx_t_6; | |
__pyx_t_6 = 0; | |
goto __pyx_L13; | |
} | |
/*else*/ { | |
__Pyx_INCREF(Py_None); | |
__pyx_v_dtype = Py_None; | |
} | |
__pyx_L13:; | |
goto __pyx_L12; | |
} | |
/*else*/ { | |
__Pyx_INCREF(Py_None); | |
__pyx_v_dtype = Py_None; | |
} | |
__pyx_L12:; | |
__pyx_v_itemsize = -1L; | |
__pyx_t_2 = (__pyx_v_dtype != Py_None); | |
__pyx_t_3 = (__pyx_t_2 != 0); | |
if (__pyx_t_3) { | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_v_itemsize = __pyx_t_5; | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_v_kind = __pyx_t_7; | |
__pyx_v_dtype_signed = (__pyx_v_kind == 'i'); | |
switch (__pyx_v_kind) { | |
case 'i': | |
case 'u': | |
__pyx_t_2 = (((sizeof(__pyx_t_5numpy_int8_t)) == __pyx_v_itemsize) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L16_bool_binop_done; | |
} | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L16_bool_binop_done; | |
} | |
__pyx_t_2 = ((!((__pyx_v____pyx_int8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L16_bool_binop_done:; | |
if (__pyx_t_3) { | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
__pyx_t_2 = (((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L20_bool_binop_done; | |
} | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L20_bool_binop_done; | |
} | |
__pyx_t_2 = ((!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L20_bool_binop_done:; | |
if (__pyx_t_3) { | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
__pyx_t_2 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L24_bool_binop_done; | |
} | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L24_bool_binop_done; | |
} | |
__pyx_t_2 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L24_bool_binop_done:; | |
if (__pyx_t_3) { | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
__pyx_t_2 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L28_bool_binop_done; | |
} | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L28_bool_binop_done; | |
} | |
__pyx_t_2 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L28_bool_binop_done:; | |
if (__pyx_t_3) { | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
__pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint8_t)) == __pyx_v_itemsize) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L32_bool_binop_done; | |
} | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L32_bool_binop_done; | |
} | |
__pyx_t_2 = ((!((__pyx_v____pyx_uint8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L32_bool_binop_done:; | |
if (__pyx_t_3) { | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
__pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint16_t)) == __pyx_v_itemsize) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L36_bool_binop_done; | |
} | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L36_bool_binop_done; | |
} | |
__pyx_t_2 = ((!((__pyx_v____pyx_uint16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L36_bool_binop_done:; | |
if (__pyx_t_3) { | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
__pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint32_t)) == __pyx_v_itemsize) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L40_bool_binop_done; | |
} | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L40_bool_binop_done; | |
} | |
__pyx_t_2 = ((!((__pyx_v____pyx_uint32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L40_bool_binop_done:; | |
if (__pyx_t_3) { | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
__pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint64_t)) == __pyx_v_itemsize) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L44_bool_binop_done; | |
} | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L44_bool_binop_done; | |
} | |
__pyx_t_2 = ((!((__pyx_v____pyx_uint64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L44_bool_binop_done:; | |
if (__pyx_t_3) { | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
break; | |
case 'f': | |
__pyx_t_2 = (((sizeof(__pyx_t_5numpy_float32_t)) == __pyx_v_itemsize) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L48_bool_binop_done; | |
} | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L48_bool_binop_done:; | |
if (__pyx_t_3) { | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
__pyx_t_2 = (((sizeof(__pyx_t_5numpy_float64_t)) == __pyx_v_itemsize) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L51_bool_binop_done; | |
} | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L51_bool_binop_done:; | |
if (__pyx_t_3) { | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
break; | |
case 'c': | |
break; | |
case 'O': | |
break; | |
default: break; | |
} | |
} | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L54_bool_binop_done; | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int8_t))) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L54_bool_binop_done:; | |
if (__pyx_t_3) { | |
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(__pyx_v_arg, 0); | |
__pyx_v_memslice = __pyx_t_8; | |
__pyx_t_3 = (__pyx_v_memslice.memview != 0); | |
if (__pyx_t_3) { | |
__PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
/*else*/ { | |
PyErr_Clear(); | |
} | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L58_bool_binop_done; | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L58_bool_binop_done:; | |
if (__pyx_t_3) { | |
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg, 0); | |
__pyx_v_memslice = __pyx_t_8; | |
__pyx_t_3 = (__pyx_v_memslice.memview != 0); | |
if (__pyx_t_3) { | |
__PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
/*else*/ { | |
PyErr_Clear(); | |
} | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L62_bool_binop_done; | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L62_bool_binop_done:; | |
if (__pyx_t_3) { | |
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg, 0); | |
__pyx_v_memslice = __pyx_t_8; | |
__pyx_t_3 = (__pyx_v_memslice.memview != 0); | |
if (__pyx_t_3) { | |
__PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
/*else*/ { | |
PyErr_Clear(); | |
} | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L66_bool_binop_done; | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L66_bool_binop_done:; | |
if (__pyx_t_3) { | |
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg, 0); | |
__pyx_v_memslice = __pyx_t_8; | |
__pyx_t_3 = (__pyx_v_memslice.memview != 0); | |
if (__pyx_t_3) { | |
__PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
/*else*/ { | |
PyErr_Clear(); | |
} | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L70_bool_binop_done; | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint8_t))) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L70_bool_binop_done:; | |
if (__pyx_t_3) { | |
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_v_arg, 0); | |
__pyx_v_memslice = __pyx_t_8; | |
__pyx_t_3 = (__pyx_v_memslice.memview != 0); | |
if (__pyx_t_3) { | |
__PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
/*else*/ { | |
PyErr_Clear(); | |
} | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L74_bool_binop_done; | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint16_t))) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L74_bool_binop_done:; | |
if (__pyx_t_3) { | |
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(__pyx_v_arg, 0); | |
__pyx_v_memslice = __pyx_t_8; | |
__pyx_t_3 = (__pyx_v_memslice.memview != 0); | |
if (__pyx_t_3) { | |
__PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
/*else*/ { | |
PyErr_Clear(); | |
} | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L78_bool_binop_done; | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint32_t))) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L78_bool_binop_done:; | |
if (__pyx_t_3) { | |
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_arg, 0); | |
__pyx_v_memslice = __pyx_t_8; | |
__pyx_t_3 = (__pyx_v_memslice.memview != 0); | |
if (__pyx_t_3) { | |
__PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
/*else*/ { | |
PyErr_Clear(); | |
} | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L82_bool_binop_done; | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint64_t))) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L82_bool_binop_done:; | |
if (__pyx_t_3) { | |
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(__pyx_v_arg, 0); | |
__pyx_v_memslice = __pyx_t_8; | |
__pyx_t_3 = (__pyx_v_memslice.memview != 0); | |
if (__pyx_t_3) { | |
__PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
/*else*/ { | |
PyErr_Clear(); | |
} | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L86_bool_binop_done; | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float32_t))) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L86_bool_binop_done:; | |
if (__pyx_t_3) { | |
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(__pyx_v_arg, 0); | |
__pyx_v_memslice = __pyx_t_8; | |
__pyx_t_3 = (__pyx_v_memslice.memview != 0); | |
if (__pyx_t_3) { | |
__PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
/*else*/ { | |
PyErr_Clear(); | |
} | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L90_bool_binop_done; | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float64_t))) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L90_bool_binop_done:; | |
if (__pyx_t_3) { | |
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_arg, 0); | |
__pyx_v_memslice = __pyx_t_8; | |
__pyx_t_3 = (__pyx_v_memslice.memview != 0); | |
if (__pyx_t_3) { | |
__PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
/*else*/ { | |
PyErr_Clear(); | |
} | |
} | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
__pyx_L10_break:; | |
__pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_v_candidates = ((PyObject*)__pyx_t_6); | |
__pyx_t_6 = 0; | |
__pyx_t_5 = 0; | |
if (unlikely(__pyx_v_signatures == Py_None)) { | |
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); | |
__PYX_ERR(0, 1177, __pyx_L1_error) | |
} | |
__pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_XDECREF(__pyx_t_6); | |
__pyx_t_6 = __pyx_t_1; | |
__pyx_t_1 = 0; | |
while (1) { | |
__pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_9, &__pyx_t_5, &__pyx_t_1, NULL, NULL, __pyx_t_10); | |
if (unlikely(__pyx_t_11 == 0)) break; | |
if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_1); | |
__pyx_t_1 = 0; | |
__pyx_v_match_found = 0; | |
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_12); | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
__pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_12); | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
__Pyx_XDECREF_SET(__pyx_v_src_sig, __pyx_t_12); | |
__pyx_t_12 = 0; | |
__pyx_t_13 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__pyx_t_14 = __pyx_t_13; | |
for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { | |
__pyx_v_i = __pyx_t_15; | |
__pyx_t_12 = PyList_GET_ITEM(__pyx_v_dest_sig, __pyx_v_i); | |
__Pyx_INCREF(__pyx_t_12); | |
__Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_12); | |
__pyx_t_12 = 0; | |
__pyx_t_3 = (__pyx_v_dst_type != Py_None); | |
__pyx_t_2 = (__pyx_t_3 != 0); | |
if (__pyx_t_2) { | |
__pyx_t_12 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_12); | |
__pyx_t_1 = PyObject_RichCompare(__pyx_t_12, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
if (__pyx_t_2) { | |
__pyx_v_match_found = 1; | |
goto __pyx_L98; | |
} | |
/*else*/ { | |
__pyx_v_match_found = 0; | |
goto __pyx_L96_break; | |
} | |
__pyx_L98:; | |
} | |
} | |
__pyx_L96_break:; | |
__pyx_t_2 = (__pyx_v_match_found != 0); | |
if (__pyx_t_2) { | |
__pyx_t_16 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 1177, __pyx_L1_error) | |
} | |
} | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_2 = (PyList_GET_SIZE(__pyx_v_candidates) != 0); | |
__pyx_t_3 = ((!__pyx_t_2) != 0); | |
if (__pyx_t_3) { | |
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_Raise(__pyx_t_6, 0, 0, 0); | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__PYX_ERR(0, 1177, __pyx_L1_error) | |
} | |
__pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__pyx_t_3 = ((__pyx_t_9 > 1) != 0); | |
if (__pyx_t_3) { | |
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_Raise(__pyx_t_6, 0, 0, 0); | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__PYX_ERR(0, 1177, __pyx_L1_error) | |
} | |
/*else*/ { | |
__Pyx_XDECREF(__pyx_r); | |
if (unlikely(__pyx_v_signatures == Py_None)) { | |
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
__PYX_ERR(0, 1177, __pyx_L1_error) | |
} | |
__pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_r = __pyx_t_6; | |
__pyx_t_6 = 0; | |
goto __pyx_L0; | |
} | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
__Pyx_XDECREF(__pyx_t_6); | |
__Pyx_XDECREF(__pyx_t_12); | |
__Pyx_AddTraceback("pandas._libs.window.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_XDECREF(__pyx_v_dest_sig); | |
__Pyx_XDECREF(__pyx_v_ndarray); | |
__Pyx_XDECREF(__pyx_v_arg); | |
__Pyx_XDECREF(__pyx_v_dtype); | |
__Pyx_XDECREF(__pyx_v_arg_base); | |
__Pyx_XDECREF(__pyx_v_candidates); | |
__Pyx_XDECREF(__pyx_v_sig); | |
__Pyx_XDECREF(__pyx_v_src_sig); | |
__Pyx_XDECREF(__pyx_v_dst_type); | |
__Pyx_XDECREF(__pyx_v_kwargs); | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* Python wrapper */ | |
static PyObject *__pyx_fuse_0__pyx_pw_6pandas_5_libs_6window_41roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_fuse_0__pyx_mdef_6pandas_5_libs_6window_41roll_max = {"__pyx_fuse_0roll_max", (PyCFunction)__pyx_fuse_0__pyx_pw_6pandas_5_libs_6window_41roll_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6window_18roll_max}; | |
static PyObject *__pyx_fuse_0__pyx_pw_6pandas_5_libs_6window_41roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_max (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 1); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 2); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 3); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 4); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_max") < 0)) __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_40roll_max(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_40roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
__Pyx_RefNannySetupContext("__pyx_fuse_0roll_max", 0); | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":1194 | |
* both or neither endpoints | |
* """ | |
* return _roll_min_max(input, win, minp, index, closed=closed, is_max=1) # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_1 = __pyx_fuse_0__pyx_f_6pandas_5_libs_6window__roll_min_max(((PyArrayObject *)__pyx_v_input), __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_r = __pyx_t_1; | |
__pyx_t_1 = 0; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1177 | |
* | |
* | |
* def roll_max(ndarray[numeric] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* """ | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* Python wrapper */ | |
static PyObject *__pyx_fuse_1__pyx_pw_6pandas_5_libs_6window_43roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_fuse_1__pyx_mdef_6pandas_5_libs_6window_43roll_max = {"__pyx_fuse_1roll_max", (PyCFunction)__pyx_fuse_1__pyx_pw_6pandas_5_libs_6window_43roll_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6window_18roll_max}; | |
static PyObject *__pyx_fuse_1__pyx_pw_6pandas_5_libs_6window_43roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_max (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 1); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 2); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 3); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 4); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_max") < 0)) __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_42roll_max(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_42roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
__Pyx_RefNannySetupContext("__pyx_fuse_1roll_max", 0); | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":1194 | |
* both or neither endpoints | |
* """ | |
* return _roll_min_max(input, win, minp, index, closed=closed, is_max=1) # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_1 = __pyx_fuse_1__pyx_f_6pandas_5_libs_6window__roll_min_max(((PyArrayObject *)__pyx_v_input), __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_r = __pyx_t_1; | |
__pyx_t_1 = 0; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1177 | |
* | |
* | |
* def roll_max(ndarray[numeric] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* """ | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* Python wrapper */ | |
static PyObject *__pyx_fuse_2__pyx_pw_6pandas_5_libs_6window_45roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_fuse_2__pyx_mdef_6pandas_5_libs_6window_45roll_max = {"__pyx_fuse_2roll_max", (PyCFunction)__pyx_fuse_2__pyx_pw_6pandas_5_libs_6window_45roll_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6window_18roll_max}; | |
static PyObject *__pyx_fuse_2__pyx_pw_6pandas_5_libs_6window_45roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_max (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 1); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 2); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 3); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 4); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_max") < 0)) __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_44roll_max(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_44roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
__Pyx_RefNannySetupContext("__pyx_fuse_2roll_max", 0); | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":1194 | |
* both or neither endpoints | |
* """ | |
* return _roll_min_max(input, win, minp, index, closed=closed, is_max=1) # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_1 = __pyx_fuse_2__pyx_f_6pandas_5_libs_6window__roll_min_max(((PyArrayObject *)__pyx_v_input), __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_r = __pyx_t_1; | |
__pyx_t_1 = 0; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1177 | |
* | |
* | |
* def roll_max(ndarray[numeric] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* """ | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* Python wrapper */ | |
static PyObject *__pyx_fuse_3__pyx_pw_6pandas_5_libs_6window_47roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_fuse_3__pyx_mdef_6pandas_5_libs_6window_47roll_max = {"__pyx_fuse_3roll_max", (PyCFunction)__pyx_fuse_3__pyx_pw_6pandas_5_libs_6window_47roll_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6window_18roll_max}; | |
static PyObject *__pyx_fuse_3__pyx_pw_6pandas_5_libs_6window_47roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_max (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 1); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 2); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 3); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 4); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_max") < 0)) __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_46roll_max(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_46roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
__Pyx_RefNannySetupContext("__pyx_fuse_3roll_max", 0); | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":1194 | |
* both or neither endpoints | |
* """ | |
* return _roll_min_max(input, win, minp, index, closed=closed, is_max=1) # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_1 = __pyx_fuse_3__pyx_f_6pandas_5_libs_6window__roll_min_max(((PyArrayObject *)__pyx_v_input), __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_r = __pyx_t_1; | |
__pyx_t_1 = 0; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1177 | |
* | |
* | |
* def roll_max(ndarray[numeric] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* """ | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* Python wrapper */ | |
static PyObject *__pyx_fuse_4__pyx_pw_6pandas_5_libs_6window_49roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_fuse_4__pyx_mdef_6pandas_5_libs_6window_49roll_max = {"__pyx_fuse_4roll_max", (PyCFunction)__pyx_fuse_4__pyx_pw_6pandas_5_libs_6window_49roll_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6window_18roll_max}; | |
static PyObject *__pyx_fuse_4__pyx_pw_6pandas_5_libs_6window_49roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_max (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 1); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 2); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 3); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 4); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_max") < 0)) __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_48roll_max(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_48roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
__Pyx_RefNannySetupContext("__pyx_fuse_4roll_max", 0); | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":1194 | |
* both or neither endpoints | |
* """ | |
* return _roll_min_max(input, win, minp, index, closed=closed, is_max=1) # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_1 = __pyx_fuse_4__pyx_f_6pandas_5_libs_6window__roll_min_max(((PyArrayObject *)__pyx_v_input), __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_r = __pyx_t_1; | |
__pyx_t_1 = 0; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1177 | |
* | |
* | |
* def roll_max(ndarray[numeric] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* """ | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* Python wrapper */ | |
static PyObject *__pyx_fuse_5__pyx_pw_6pandas_5_libs_6window_51roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_fuse_5__pyx_mdef_6pandas_5_libs_6window_51roll_max = {"__pyx_fuse_5roll_max", (PyCFunction)__pyx_fuse_5__pyx_pw_6pandas_5_libs_6window_51roll_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6window_18roll_max}; | |
static PyObject *__pyx_fuse_5__pyx_pw_6pandas_5_libs_6window_51roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_max (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 1); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 2); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 3); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 4); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_max") < 0)) __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_50roll_max(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_50roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
__Pyx_RefNannySetupContext("__pyx_fuse_5roll_max", 0); | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":1194 | |
* both or neither endpoints | |
* """ | |
* return _roll_min_max(input, win, minp, index, closed=closed, is_max=1) # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_1 = __pyx_fuse_5__pyx_f_6pandas_5_libs_6window__roll_min_max(((PyArrayObject *)__pyx_v_input), __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_r = __pyx_t_1; | |
__pyx_t_1 = 0; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1177 | |
* | |
* | |
* def roll_max(ndarray[numeric] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* """ | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* Python wrapper */ | |
static PyObject *__pyx_fuse_6__pyx_pw_6pandas_5_libs_6window_53roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_fuse_6__pyx_mdef_6pandas_5_libs_6window_53roll_max = {"__pyx_fuse_6roll_max", (PyCFunction)__pyx_fuse_6__pyx_pw_6pandas_5_libs_6window_53roll_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6window_18roll_max}; | |
static PyObject *__pyx_fuse_6__pyx_pw_6pandas_5_libs_6window_53roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_max (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 1); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 2); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 3); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 4); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_max") < 0)) __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_52roll_max(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_52roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
__Pyx_RefNannySetupContext("__pyx_fuse_6roll_max", 0); | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":1194 | |
* both or neither endpoints | |
* """ | |
* return _roll_min_max(input, win, minp, index, closed=closed, is_max=1) # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_1 = __pyx_fuse_6__pyx_f_6pandas_5_libs_6window__roll_min_max(((PyArrayObject *)__pyx_v_input), __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_r = __pyx_t_1; | |
__pyx_t_1 = 0; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1177 | |
* | |
* | |
* def roll_max(ndarray[numeric] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* """ | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* Python wrapper */ | |
static PyObject *__pyx_fuse_7__pyx_pw_6pandas_5_libs_6window_55roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_fuse_7__pyx_mdef_6pandas_5_libs_6window_55roll_max = {"__pyx_fuse_7roll_max", (PyCFunction)__pyx_fuse_7__pyx_pw_6pandas_5_libs_6window_55roll_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6window_18roll_max}; | |
static PyObject *__pyx_fuse_7__pyx_pw_6pandas_5_libs_6window_55roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_max (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 1); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 2); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 3); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 4); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_max") < 0)) __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_54roll_max(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_54roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
__Pyx_RefNannySetupContext("__pyx_fuse_7roll_max", 0); | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":1194 | |
* both or neither endpoints | |
* """ | |
* return _roll_min_max(input, win, minp, index, closed=closed, is_max=1) # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_1 = __pyx_fuse_7__pyx_f_6pandas_5_libs_6window__roll_min_max(((PyArrayObject *)__pyx_v_input), __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_r = __pyx_t_1; | |
__pyx_t_1 = 0; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1177 | |
* | |
* | |
* def roll_max(ndarray[numeric] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* """ | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* Python wrapper */ | |
static PyObject *__pyx_fuse_8__pyx_pw_6pandas_5_libs_6window_57roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_fuse_8__pyx_mdef_6pandas_5_libs_6window_57roll_max = {"__pyx_fuse_8roll_max", (PyCFunction)__pyx_fuse_8__pyx_pw_6pandas_5_libs_6window_57roll_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6window_18roll_max}; | |
static PyObject *__pyx_fuse_8__pyx_pw_6pandas_5_libs_6window_57roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_max (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 1); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 2); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 3); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 4); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_max") < 0)) __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_56roll_max(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_56roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
__Pyx_RefNannySetupContext("__pyx_fuse_8roll_max", 0); | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":1194 | |
* both or neither endpoints | |
* """ | |
* return _roll_min_max(input, win, minp, index, closed=closed, is_max=1) # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_1 = __pyx_fuse_8__pyx_f_6pandas_5_libs_6window__roll_min_max(((PyArrayObject *)__pyx_v_input), __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_r = __pyx_t_1; | |
__pyx_t_1 = 0; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1177 | |
* | |
* | |
* def roll_max(ndarray[numeric] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* """ | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* Python wrapper */ | |
static PyObject *__pyx_fuse_9__pyx_pw_6pandas_5_libs_6window_59roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_fuse_9__pyx_mdef_6pandas_5_libs_6window_59roll_max = {"__pyx_fuse_9roll_max", (PyCFunction)__pyx_fuse_9__pyx_pw_6pandas_5_libs_6window_59roll_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6window_18roll_max}; | |
static PyObject *__pyx_fuse_9__pyx_pw_6pandas_5_libs_6window_59roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_max (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 1); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 2); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 3); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, 4); __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_max") < 0)) __PYX_ERR(0, 1177, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_max", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1177, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 1177, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_58roll_max(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_58roll_max(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
__Pyx_RefNannySetupContext("__pyx_fuse_9roll_max", 0); | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1177, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":1194 | |
* both or neither endpoints | |
* """ | |
* return _roll_min_max(input, win, minp, index, closed=closed, is_max=1) # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_1 = __pyx_fuse_9__pyx_f_6pandas_5_libs_6window__roll_min_max(((PyArrayObject *)__pyx_v_input), __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_r = __pyx_t_1; | |
__pyx_t_1 = 0; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1177 | |
* | |
* | |
* def roll_max(ndarray[numeric] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* """ | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "pandas/_libs/window.pyx":1197 | |
* | |
* | |
* def roll_min(ndarray[numeric] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* """ | |
*/ | |
/* Python wrapper */ | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_21roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static char __pyx_doc_6pandas_5_libs_6window_20roll_min[] = "\n Moving max of 1d array of any numeric type along axis=0 ignoring NaNs.\n\n Parameters\n ----------\n input: numpy array\n window: int, size of rolling window\n minp: if number of observations in window\n is below this, output a NaN\n index: ndarray, optional\n index for window computation\n "; | |
static PyMethodDef __pyx_mdef_6pandas_5_libs_6window_21roll_min = {"roll_min", (PyCFunction)__pyx_pw_6pandas_5_libs_6window_21roll_min, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6window_20roll_min}; | |
static PyObject *__pyx_pw_6pandas_5_libs_6window_21roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyObject *__pyx_v_signatures = 0; | |
PyObject *__pyx_v_args = 0; | |
PyObject *__pyx_v_kwargs = 0; | |
CYTHON_UNUSED PyObject *__pyx_v_defaults = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0}; | |
PyObject* values[4] = {0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 4) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
} | |
__pyx_v_signatures = values[0]; | |
__pyx_v_args = values[1]; | |
__pyx_v_kwargs = values[2]; | |
__pyx_v_defaults = values[3]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_20roll_min(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults); | |
/* function exit code */ | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_20roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) { | |
PyObject *__pyx_v_dest_sig = NULL; | |
Py_ssize_t __pyx_v_i; | |
PyTypeObject *__pyx_v_ndarray = 0; | |
__Pyx_memviewslice __pyx_v_memslice; | |
Py_ssize_t __pyx_v_itemsize; | |
int __pyx_v_dtype_signed; | |
char __pyx_v_kind; | |
int __pyx_v____pyx_int8_t_is_signed; | |
int __pyx_v____pyx_int16_t_is_signed; | |
int __pyx_v____pyx_int32_t_is_signed; | |
int __pyx_v____pyx_int64_t_is_signed; | |
int __pyx_v____pyx_uint8_t_is_signed; | |
int __pyx_v____pyx_uint16_t_is_signed; | |
int __pyx_v____pyx_uint32_t_is_signed; | |
int __pyx_v____pyx_uint64_t_is_signed; | |
PyObject *__pyx_v_arg = NULL; | |
PyObject *__pyx_v_dtype = NULL; | |
PyObject *__pyx_v_arg_base = NULL; | |
PyObject *__pyx_v_candidates = NULL; | |
PyObject *__pyx_v_sig = NULL; | |
int __pyx_v_match_found; | |
PyObject *__pyx_v_src_sig = NULL; | |
PyObject *__pyx_v_dst_type = NULL; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
int __pyx_t_2; | |
int __pyx_t_3; | |
int __pyx_t_4; | |
Py_ssize_t __pyx_t_5; | |
PyObject *__pyx_t_6 = NULL; | |
long __pyx_t_7; | |
__Pyx_memviewslice __pyx_t_8; | |
Py_ssize_t __pyx_t_9; | |
int __pyx_t_10; | |
int __pyx_t_11; | |
PyObject *__pyx_t_12 = NULL; | |
Py_ssize_t __pyx_t_13; | |
Py_ssize_t __pyx_t_14; | |
Py_ssize_t __pyx_t_15; | |
int __pyx_t_16; | |
__Pyx_RefNannySetupContext("roll_min", 0); | |
__Pyx_INCREF(__pyx_v_kwargs); | |
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_INCREF(Py_None); | |
__Pyx_GIVEREF(Py_None); | |
PyList_SET_ITEM(__pyx_t_1, 0, Py_None); | |
__pyx_v_dest_sig = ((PyObject*)__pyx_t_1); | |
__pyx_t_1 = 0; | |
__pyx_t_3 = (__pyx_v_kwargs != Py_None); | |
__pyx_t_4 = (__pyx_t_3 != 0); | |
if (__pyx_t_4) { | |
} else { | |
__pyx_t_2 = __pyx_t_4; | |
goto __pyx_L4_bool_binop_done; | |
} | |
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__pyx_t_3 = ((!__pyx_t_4) != 0); | |
__pyx_t_2 = __pyx_t_3; | |
__pyx_L4_bool_binop_done:; | |
if (__pyx_t_2) { | |
__Pyx_INCREF(Py_None); | |
__Pyx_DECREF_SET(__pyx_v_kwargs, Py_None); | |
} | |
__pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1); | |
__pyx_t_1 = 0; | |
__pyx_v_itemsize = -1L; | |
__pyx_v____pyx_int8_t_is_signed = (!((((__pyx_t_5numpy_int8_t)-1L) > 0) != 0)); | |
__pyx_v____pyx_int16_t_is_signed = (!((((__pyx_t_5numpy_int16_t)-1L) > 0) != 0)); | |
__pyx_v____pyx_int32_t_is_signed = (!((((__pyx_t_5numpy_int32_t)-1L) > 0) != 0)); | |
__pyx_v____pyx_int64_t_is_signed = (!((((__pyx_t_5numpy_int64_t)-1L) > 0) != 0)); | |
__pyx_v____pyx_uint8_t_is_signed = (!((((__pyx_t_5numpy_uint8_t)-1L) > 0) != 0)); | |
__pyx_v____pyx_uint16_t_is_signed = (!((((__pyx_t_5numpy_uint16_t)-1L) > 0) != 0)); | |
__pyx_v____pyx_uint32_t_is_signed = (!((((__pyx_t_5numpy_uint32_t)-1L) > 0) != 0)); | |
__pyx_v____pyx_uint64_t_is_signed = (!((((__pyx_t_5numpy_uint64_t)-1L) > 0) != 0)); | |
if (unlikely(__pyx_v_args == Py_None)) { | |
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); | |
__PYX_ERR(0, 1197, __pyx_L1_error) | |
} | |
__pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__pyx_t_2 = ((0 < __pyx_t_5) != 0); | |
if (__pyx_t_2) { | |
if (unlikely(__pyx_v_args == Py_None)) { | |
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
__PYX_ERR(0, 1197, __pyx_L1_error) | |
} | |
__pyx_t_1 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0); | |
__Pyx_INCREF(__pyx_t_1); | |
__pyx_v_arg = __pyx_t_1; | |
__pyx_t_1 = 0; | |
goto __pyx_L6; | |
} | |
__pyx_t_3 = (__pyx_v_kwargs != Py_None); | |
__pyx_t_4 = (__pyx_t_3 != 0); | |
if (__pyx_t_4) { | |
} else { | |
__pyx_t_2 = __pyx_t_4; | |
goto __pyx_L7_bool_binop_done; | |
} | |
if (unlikely(__pyx_v_kwargs == Py_None)) { | |
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); | |
__PYX_ERR(0, 1197, __pyx_L1_error) | |
} | |
__pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_input, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__pyx_t_3 = (__pyx_t_4 != 0); | |
__pyx_t_2 = __pyx_t_3; | |
__pyx_L7_bool_binop_done:; | |
if (__pyx_t_2) { | |
if (unlikely(__pyx_v_kwargs == Py_None)) { | |
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
__PYX_ERR(0, 1197, __pyx_L1_error) | |
} | |
__pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_input); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_v_arg = __pyx_t_1; | |
__pyx_t_1 = 0; | |
goto __pyx_L6; | |
} | |
/*else*/ { | |
if (unlikely(__pyx_v_args == Py_None)) { | |
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); | |
__PYX_ERR(0, 1197, __pyx_L1_error) | |
} | |
__pyx_t_5 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_INCREF(__pyx_int_5); | |
__Pyx_GIVEREF(__pyx_int_5); | |
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_5); | |
__Pyx_INCREF(__pyx_n_s_s); | |
__Pyx_GIVEREF(__pyx_n_s_s); | |
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_s); | |
__Pyx_GIVEREF(__pyx_t_1); | |
PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); | |
__pyx_t_1 = 0; | |
__pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
__Pyx_Raise(__pyx_t_6, 0, 0, 0); | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__PYX_ERR(0, 1197, __pyx_L1_error) | |
} | |
__pyx_L6:; | |
while (1) { | |
__pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)Py_None)); | |
__pyx_t_3 = (__pyx_t_2 != 0); | |
if (__pyx_t_3) { | |
__pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); | |
__pyx_t_2 = (__pyx_t_3 != 0); | |
if (__pyx_t_2) { | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_v_dtype = __pyx_t_6; | |
__pyx_t_6 = 0; | |
goto __pyx_L12; | |
} | |
__pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); | |
__pyx_t_3 = (__pyx_t_2 != 0); | |
if (__pyx_t_3) { | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_v_arg_base = __pyx_t_6; | |
__pyx_t_6 = 0; | |
__pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); | |
__pyx_t_2 = (__pyx_t_3 != 0); | |
if (__pyx_t_2) { | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_v_dtype = __pyx_t_6; | |
__pyx_t_6 = 0; | |
goto __pyx_L13; | |
} | |
/*else*/ { | |
__Pyx_INCREF(Py_None); | |
__pyx_v_dtype = Py_None; | |
} | |
__pyx_L13:; | |
goto __pyx_L12; | |
} | |
/*else*/ { | |
__Pyx_INCREF(Py_None); | |
__pyx_v_dtype = Py_None; | |
} | |
__pyx_L12:; | |
__pyx_v_itemsize = -1L; | |
__pyx_t_2 = (__pyx_v_dtype != Py_None); | |
__pyx_t_3 = (__pyx_t_2 != 0); | |
if (__pyx_t_3) { | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_v_itemsize = __pyx_t_5; | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_v_kind = __pyx_t_7; | |
__pyx_v_dtype_signed = (__pyx_v_kind == 'i'); | |
switch (__pyx_v_kind) { | |
case 'i': | |
case 'u': | |
__pyx_t_2 = (((sizeof(__pyx_t_5numpy_int8_t)) == __pyx_v_itemsize) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L16_bool_binop_done; | |
} | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L16_bool_binop_done; | |
} | |
__pyx_t_2 = ((!((__pyx_v____pyx_int8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L16_bool_binop_done:; | |
if (__pyx_t_3) { | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
__pyx_t_2 = (((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L20_bool_binop_done; | |
} | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L20_bool_binop_done; | |
} | |
__pyx_t_2 = ((!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L20_bool_binop_done:; | |
if (__pyx_t_3) { | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
__pyx_t_2 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L24_bool_binop_done; | |
} | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L24_bool_binop_done; | |
} | |
__pyx_t_2 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L24_bool_binop_done:; | |
if (__pyx_t_3) { | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
__pyx_t_2 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L28_bool_binop_done; | |
} | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L28_bool_binop_done; | |
} | |
__pyx_t_2 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L28_bool_binop_done:; | |
if (__pyx_t_3) { | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
__pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint8_t)) == __pyx_v_itemsize) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L32_bool_binop_done; | |
} | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L32_bool_binop_done; | |
} | |
__pyx_t_2 = ((!((__pyx_v____pyx_uint8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L32_bool_binop_done:; | |
if (__pyx_t_3) { | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
__pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint16_t)) == __pyx_v_itemsize) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L36_bool_binop_done; | |
} | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L36_bool_binop_done; | |
} | |
__pyx_t_2 = ((!((__pyx_v____pyx_uint16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L36_bool_binop_done:; | |
if (__pyx_t_3) { | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
__pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint32_t)) == __pyx_v_itemsize) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L40_bool_binop_done; | |
} | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L40_bool_binop_done; | |
} | |
__pyx_t_2 = ((!((__pyx_v____pyx_uint32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L40_bool_binop_done:; | |
if (__pyx_t_3) { | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
__pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint64_t)) == __pyx_v_itemsize) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L44_bool_binop_done; | |
} | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L44_bool_binop_done; | |
} | |
__pyx_t_2 = ((!((__pyx_v____pyx_uint64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L44_bool_binop_done:; | |
if (__pyx_t_3) { | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
break; | |
case 'f': | |
__pyx_t_2 = (((sizeof(__pyx_t_5numpy_float32_t)) == __pyx_v_itemsize) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L48_bool_binop_done; | |
} | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L48_bool_binop_done:; | |
if (__pyx_t_3) { | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
__pyx_t_2 = (((sizeof(__pyx_t_5numpy_float64_t)) == __pyx_v_itemsize) != 0); | |
if (__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L51_bool_binop_done; | |
} | |
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_2 = ((((Py_ssize_t)__pyx_t_5) == 1) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L51_bool_binop_done:; | |
if (__pyx_t_3) { | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
break; | |
case 'c': | |
break; | |
case 'O': | |
break; | |
default: break; | |
} | |
} | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L54_bool_binop_done; | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int8_t))) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L54_bool_binop_done:; | |
if (__pyx_t_3) { | |
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(__pyx_v_arg, 0); | |
__pyx_v_memslice = __pyx_t_8; | |
__pyx_t_3 = (__pyx_v_memslice.memview != 0); | |
if (__pyx_t_3) { | |
__PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
/*else*/ { | |
PyErr_Clear(); | |
} | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L58_bool_binop_done; | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L58_bool_binop_done:; | |
if (__pyx_t_3) { | |
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg, 0); | |
__pyx_v_memslice = __pyx_t_8; | |
__pyx_t_3 = (__pyx_v_memslice.memview != 0); | |
if (__pyx_t_3) { | |
__PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
/*else*/ { | |
PyErr_Clear(); | |
} | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L62_bool_binop_done; | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L62_bool_binop_done:; | |
if (__pyx_t_3) { | |
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg, 0); | |
__pyx_v_memslice = __pyx_t_8; | |
__pyx_t_3 = (__pyx_v_memslice.memview != 0); | |
if (__pyx_t_3) { | |
__PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
/*else*/ { | |
PyErr_Clear(); | |
} | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L66_bool_binop_done; | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L66_bool_binop_done:; | |
if (__pyx_t_3) { | |
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg, 0); | |
__pyx_v_memslice = __pyx_t_8; | |
__pyx_t_3 = (__pyx_v_memslice.memview != 0); | |
if (__pyx_t_3) { | |
__PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
/*else*/ { | |
PyErr_Clear(); | |
} | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L70_bool_binop_done; | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint8_t))) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L70_bool_binop_done:; | |
if (__pyx_t_3) { | |
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_v_arg, 0); | |
__pyx_v_memslice = __pyx_t_8; | |
__pyx_t_3 = (__pyx_v_memslice.memview != 0); | |
if (__pyx_t_3) { | |
__PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
/*else*/ { | |
PyErr_Clear(); | |
} | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L74_bool_binop_done; | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint16_t))) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L74_bool_binop_done:; | |
if (__pyx_t_3) { | |
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(__pyx_v_arg, 0); | |
__pyx_v_memslice = __pyx_t_8; | |
__pyx_t_3 = (__pyx_v_memslice.memview != 0); | |
if (__pyx_t_3) { | |
__PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
/*else*/ { | |
PyErr_Clear(); | |
} | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L78_bool_binop_done; | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint32_t))) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L78_bool_binop_done:; | |
if (__pyx_t_3) { | |
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_arg, 0); | |
__pyx_v_memslice = __pyx_t_8; | |
__pyx_t_3 = (__pyx_v_memslice.memview != 0); | |
if (__pyx_t_3) { | |
__PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
/*else*/ { | |
PyErr_Clear(); | |
} | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L82_bool_binop_done; | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint64_t))) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L82_bool_binop_done:; | |
if (__pyx_t_3) { | |
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(__pyx_v_arg, 0); | |
__pyx_v_memslice = __pyx_t_8; | |
__pyx_t_3 = (__pyx_v_memslice.memview != 0); | |
if (__pyx_t_3) { | |
__PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
/*else*/ { | |
PyErr_Clear(); | |
} | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L86_bool_binop_done; | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float32_t))) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L86_bool_binop_done:; | |
if (__pyx_t_3) { | |
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(__pyx_v_arg, 0); | |
__pyx_v_memslice = __pyx_t_8; | |
__pyx_t_3 = (__pyx_v_memslice.memview != 0); | |
if (__pyx_t_3) { | |
__PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
/*else*/ { | |
PyErr_Clear(); | |
} | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); | |
if (!__pyx_t_2) { | |
} else { | |
__pyx_t_3 = __pyx_t_2; | |
goto __pyx_L90_bool_binop_done; | |
} | |
__pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float64_t))) != 0); | |
__pyx_t_3 = __pyx_t_2; | |
__pyx_L90_bool_binop_done:; | |
if (__pyx_t_3) { | |
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_arg, 0); | |
__pyx_v_memslice = __pyx_t_8; | |
__pyx_t_3 = (__pyx_v_memslice.memview != 0); | |
if (__pyx_t_3) { | |
__PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
/*else*/ { | |
PyErr_Clear(); | |
} | |
} | |
if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
goto __pyx_L10_break; | |
} | |
__pyx_L10_break:; | |
__pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_v_candidates = ((PyObject*)__pyx_t_6); | |
__pyx_t_6 = 0; | |
__pyx_t_5 = 0; | |
if (unlikely(__pyx_v_signatures == Py_None)) { | |
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); | |
__PYX_ERR(0, 1197, __pyx_L1_error) | |
} | |
__pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_XDECREF(__pyx_t_6); | |
__pyx_t_6 = __pyx_t_1; | |
__pyx_t_1 = 0; | |
while (1) { | |
__pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_9, &__pyx_t_5, &__pyx_t_1, NULL, NULL, __pyx_t_10); | |
if (unlikely(__pyx_t_11 == 0)) break; | |
if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_1); | |
__pyx_t_1 = 0; | |
__pyx_v_match_found = 0; | |
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_12); | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
__pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_12); | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
__Pyx_XDECREF_SET(__pyx_v_src_sig, __pyx_t_12); | |
__pyx_t_12 = 0; | |
__pyx_t_13 = PyList_GET_SIZE(__pyx_v_dest_sig); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__pyx_t_14 = __pyx_t_13; | |
for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { | |
__pyx_v_i = __pyx_t_15; | |
__pyx_t_12 = PyList_GET_ITEM(__pyx_v_dest_sig, __pyx_v_i); | |
__Pyx_INCREF(__pyx_t_12); | |
__Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_12); | |
__pyx_t_12 = 0; | |
__pyx_t_3 = (__pyx_v_dst_type != Py_None); | |
__pyx_t_2 = (__pyx_t_3 != 0); | |
if (__pyx_t_2) { | |
__pyx_t_12 = __Pyx_GetItemInt(__pyx_v_src_sig, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_12); | |
__pyx_t_1 = PyObject_RichCompare(__pyx_t_12, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; | |
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
if (__pyx_t_2) { | |
__pyx_v_match_found = 1; | |
goto __pyx_L98; | |
} | |
/*else*/ { | |
__pyx_v_match_found = 0; | |
goto __pyx_L96_break; | |
} | |
__pyx_L98:; | |
} | |
} | |
__pyx_L96_break:; | |
__pyx_t_2 = (__pyx_v_match_found != 0); | |
if (__pyx_t_2) { | |
__pyx_t_16 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 1197, __pyx_L1_error) | |
} | |
} | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__pyx_t_2 = (PyList_GET_SIZE(__pyx_v_candidates) != 0); | |
__pyx_t_3 = ((!__pyx_t_2) != 0); | |
if (__pyx_t_3) { | |
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_Raise(__pyx_t_6, 0, 0, 0); | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__PYX_ERR(0, 1197, __pyx_L1_error) | |
} | |
__pyx_t_9 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__pyx_t_3 = ((__pyx_t_9 > 1) != 0); | |
if (__pyx_t_3) { | |
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__Pyx_Raise(__pyx_t_6, 0, 0, 0); | |
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
__PYX_ERR(0, 1197, __pyx_L1_error) | |
} | |
/*else*/ { | |
__Pyx_XDECREF(__pyx_r); | |
if (unlikely(__pyx_v_signatures == Py_None)) { | |
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
__PYX_ERR(0, 1197, __pyx_L1_error) | |
} | |
__pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_6); | |
__pyx_r = __pyx_t_6; | |
__pyx_t_6 = 0; | |
goto __pyx_L0; | |
} | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
__Pyx_XDECREF(__pyx_t_6); | |
__Pyx_XDECREF(__pyx_t_12); | |
__Pyx_AddTraceback("pandas._libs.window.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_XDECREF(__pyx_v_dest_sig); | |
__Pyx_XDECREF(__pyx_v_ndarray); | |
__Pyx_XDECREF(__pyx_v_arg); | |
__Pyx_XDECREF(__pyx_v_dtype); | |
__Pyx_XDECREF(__pyx_v_arg_base); | |
__Pyx_XDECREF(__pyx_v_candidates); | |
__Pyx_XDECREF(__pyx_v_sig); | |
__Pyx_XDECREF(__pyx_v_src_sig); | |
__Pyx_XDECREF(__pyx_v_dst_type); | |
__Pyx_XDECREF(__pyx_v_kwargs); | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* Python wrapper */ | |
static PyObject *__pyx_fuse_0__pyx_pw_6pandas_5_libs_6window_63roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_fuse_0__pyx_mdef_6pandas_5_libs_6window_63roll_min = {"__pyx_fuse_0roll_min", (PyCFunction)__pyx_fuse_0__pyx_pw_6pandas_5_libs_6window_63roll_min, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6window_20roll_min}; | |
static PyObject *__pyx_fuse_0__pyx_pw_6pandas_5_libs_6window_63roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_min (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 1); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 2); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 3); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 4); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_min") < 0)) __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_62roll_min(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_62roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
__Pyx_RefNannySetupContext("__pyx_fuse_0roll_min", 0); | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":1211 | |
* index for window computation | |
* """ | |
* return _roll_min_max(input, win, minp, index, is_max=0, closed=closed) # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_1 = __pyx_fuse_0__pyx_f_6pandas_5_libs_6window__roll_min_max(((PyArrayObject *)__pyx_v_input), __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_r = __pyx_t_1; | |
__pyx_t_1 = 0; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1197 | |
* | |
* | |
* def roll_min(ndarray[numeric] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* """ | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* Python wrapper */ | |
static PyObject *__pyx_fuse_1__pyx_pw_6pandas_5_libs_6window_65roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_fuse_1__pyx_mdef_6pandas_5_libs_6window_65roll_min = {"__pyx_fuse_1roll_min", (PyCFunction)__pyx_fuse_1__pyx_pw_6pandas_5_libs_6window_65roll_min, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6window_20roll_min}; | |
static PyObject *__pyx_fuse_1__pyx_pw_6pandas_5_libs_6window_65roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_min (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 1); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 2); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 3); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 4); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_min") < 0)) __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_64roll_min(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_64roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
__Pyx_RefNannySetupContext("__pyx_fuse_1roll_min", 0); | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":1211 | |
* index for window computation | |
* """ | |
* return _roll_min_max(input, win, minp, index, is_max=0, closed=closed) # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_1 = __pyx_fuse_1__pyx_f_6pandas_5_libs_6window__roll_min_max(((PyArrayObject *)__pyx_v_input), __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_r = __pyx_t_1; | |
__pyx_t_1 = 0; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1197 | |
* | |
* | |
* def roll_min(ndarray[numeric] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* """ | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* Python wrapper */ | |
static PyObject *__pyx_fuse_2__pyx_pw_6pandas_5_libs_6window_67roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_fuse_2__pyx_mdef_6pandas_5_libs_6window_67roll_min = {"__pyx_fuse_2roll_min", (PyCFunction)__pyx_fuse_2__pyx_pw_6pandas_5_libs_6window_67roll_min, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6window_20roll_min}; | |
static PyObject *__pyx_fuse_2__pyx_pw_6pandas_5_libs_6window_67roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_min (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 1); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 2); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 3); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 4); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_min") < 0)) __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_66roll_min(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_66roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
__Pyx_RefNannySetupContext("__pyx_fuse_2roll_min", 0); | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":1211 | |
* index for window computation | |
* """ | |
* return _roll_min_max(input, win, minp, index, is_max=0, closed=closed) # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_1 = __pyx_fuse_2__pyx_f_6pandas_5_libs_6window__roll_min_max(((PyArrayObject *)__pyx_v_input), __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_r = __pyx_t_1; | |
__pyx_t_1 = 0; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1197 | |
* | |
* | |
* def roll_min(ndarray[numeric] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* """ | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* Python wrapper */ | |
static PyObject *__pyx_fuse_3__pyx_pw_6pandas_5_libs_6window_69roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_fuse_3__pyx_mdef_6pandas_5_libs_6window_69roll_min = {"__pyx_fuse_3roll_min", (PyCFunction)__pyx_fuse_3__pyx_pw_6pandas_5_libs_6window_69roll_min, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6window_20roll_min}; | |
static PyObject *__pyx_fuse_3__pyx_pw_6pandas_5_libs_6window_69roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_min (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 1); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 2); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 3); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 4); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_min") < 0)) __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_68roll_min(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_68roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
__Pyx_RefNannySetupContext("__pyx_fuse_3roll_min", 0); | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":1211 | |
* index for window computation | |
* """ | |
* return _roll_min_max(input, win, minp, index, is_max=0, closed=closed) # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_1 = __pyx_fuse_3__pyx_f_6pandas_5_libs_6window__roll_min_max(((PyArrayObject *)__pyx_v_input), __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_r = __pyx_t_1; | |
__pyx_t_1 = 0; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1197 | |
* | |
* | |
* def roll_min(ndarray[numeric] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* """ | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* Python wrapper */ | |
static PyObject *__pyx_fuse_4__pyx_pw_6pandas_5_libs_6window_71roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_fuse_4__pyx_mdef_6pandas_5_libs_6window_71roll_min = {"__pyx_fuse_4roll_min", (PyCFunction)__pyx_fuse_4__pyx_pw_6pandas_5_libs_6window_71roll_min, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6window_20roll_min}; | |
static PyObject *__pyx_fuse_4__pyx_pw_6pandas_5_libs_6window_71roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_min (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 1); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 2); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 3); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 4); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_min") < 0)) __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_70roll_min(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_70roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
__Pyx_RefNannySetupContext("__pyx_fuse_4roll_min", 0); | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":1211 | |
* index for window computation | |
* """ | |
* return _roll_min_max(input, win, minp, index, is_max=0, closed=closed) # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_1 = __pyx_fuse_4__pyx_f_6pandas_5_libs_6window__roll_min_max(((PyArrayObject *)__pyx_v_input), __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_r = __pyx_t_1; | |
__pyx_t_1 = 0; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1197 | |
* | |
* | |
* def roll_min(ndarray[numeric] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* """ | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* Python wrapper */ | |
static PyObject *__pyx_fuse_5__pyx_pw_6pandas_5_libs_6window_73roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_fuse_5__pyx_mdef_6pandas_5_libs_6window_73roll_min = {"__pyx_fuse_5roll_min", (PyCFunction)__pyx_fuse_5__pyx_pw_6pandas_5_libs_6window_73roll_min, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6window_20roll_min}; | |
static PyObject *__pyx_fuse_5__pyx_pw_6pandas_5_libs_6window_73roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_min (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 1); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 2); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 3); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 4); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_min") < 0)) __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_72roll_min(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_72roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
__Pyx_RefNannySetupContext("__pyx_fuse_5roll_min", 0); | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":1211 | |
* index for window computation | |
* """ | |
* return _roll_min_max(input, win, minp, index, is_max=0, closed=closed) # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_1 = __pyx_fuse_5__pyx_f_6pandas_5_libs_6window__roll_min_max(((PyArrayObject *)__pyx_v_input), __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_r = __pyx_t_1; | |
__pyx_t_1 = 0; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1197 | |
* | |
* | |
* def roll_min(ndarray[numeric] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* """ | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* Python wrapper */ | |
static PyObject *__pyx_fuse_6__pyx_pw_6pandas_5_libs_6window_75roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_fuse_6__pyx_mdef_6pandas_5_libs_6window_75roll_min = {"__pyx_fuse_6roll_min", (PyCFunction)__pyx_fuse_6__pyx_pw_6pandas_5_libs_6window_75roll_min, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6window_20roll_min}; | |
static PyObject *__pyx_fuse_6__pyx_pw_6pandas_5_libs_6window_75roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_min (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 1); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 2); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 3); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 4); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_min") < 0)) __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_74roll_min(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_74roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
__Pyx_RefNannySetupContext("__pyx_fuse_6roll_min", 0); | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":1211 | |
* index for window computation | |
* """ | |
* return _roll_min_max(input, win, minp, index, is_max=0, closed=closed) # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_1 = __pyx_fuse_6__pyx_f_6pandas_5_libs_6window__roll_min_max(((PyArrayObject *)__pyx_v_input), __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_r = __pyx_t_1; | |
__pyx_t_1 = 0; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1197 | |
* | |
* | |
* def roll_min(ndarray[numeric] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* """ | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* Python wrapper */ | |
static PyObject *__pyx_fuse_7__pyx_pw_6pandas_5_libs_6window_77roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_fuse_7__pyx_mdef_6pandas_5_libs_6window_77roll_min = {"__pyx_fuse_7roll_min", (PyCFunction)__pyx_fuse_7__pyx_pw_6pandas_5_libs_6window_77roll_min, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6window_20roll_min}; | |
static PyObject *__pyx_fuse_7__pyx_pw_6pandas_5_libs_6window_77roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_min (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 1); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 2); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 3); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 4); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_min") < 0)) __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_76roll_min(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_76roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
__Pyx_RefNannySetupContext("__pyx_fuse_7roll_min", 0); | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":1211 | |
* index for window computation | |
* """ | |
* return _roll_min_max(input, win, minp, index, is_max=0, closed=closed) # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_1 = __pyx_fuse_7__pyx_f_6pandas_5_libs_6window__roll_min_max(((PyArrayObject *)__pyx_v_input), __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_r = __pyx_t_1; | |
__pyx_t_1 = 0; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1197 | |
* | |
* | |
* def roll_min(ndarray[numeric] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* """ | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* Python wrapper */ | |
static PyObject *__pyx_fuse_8__pyx_pw_6pandas_5_libs_6window_79roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_fuse_8__pyx_mdef_6pandas_5_libs_6window_79roll_min = {"__pyx_fuse_8roll_min", (PyCFunction)__pyx_fuse_8__pyx_pw_6pandas_5_libs_6window_79roll_min, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6window_20roll_min}; | |
static PyObject *__pyx_fuse_8__pyx_pw_6pandas_5_libs_6window_79roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_min (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 1); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 2); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 3); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 4); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_min") < 0)) __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_78roll_min(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_78roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
__Pyx_RefNannySetupContext("__pyx_fuse_8roll_min", 0); | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":1211 | |
* index for window computation | |
* """ | |
* return _roll_min_max(input, win, minp, index, is_max=0, closed=closed) # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_1 = __pyx_fuse_8__pyx_f_6pandas_5_libs_6window__roll_min_max(((PyArrayObject *)__pyx_v_input), __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_r = __pyx_t_1; | |
__pyx_t_1 = 0; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1197 | |
* | |
* | |
* def roll_min(ndarray[numeric] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* """ | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* Python wrapper */ | |
static PyObject *__pyx_fuse_9__pyx_pw_6pandas_5_libs_6window_81roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
static PyMethodDef __pyx_fuse_9__pyx_mdef_6pandas_5_libs_6window_81roll_min = {"__pyx_fuse_9roll_min", (PyCFunction)__pyx_fuse_9__pyx_pw_6pandas_5_libs_6window_81roll_min, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6window_20roll_min}; | |
static PyObject *__pyx_fuse_9__pyx_pw_6pandas_5_libs_6window_81roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
PyArrayObject *__pyx_v_input = 0; | |
__pyx_t_5numpy_int64_t __pyx_v_win; | |
__pyx_t_5numpy_int64_t __pyx_v_minp; | |
PyObject *__pyx_v_index = 0; | |
PyObject *__pyx_v_closed = 0; | |
PyObject *__pyx_r = 0; | |
__Pyx_RefNannyDeclarations | |
__Pyx_RefNannySetupContext("roll_min (wrapper)", 0); | |
{ | |
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_win,&__pyx_n_s_minp,&__pyx_n_s_index,&__pyx_n_s_closed,0}; | |
PyObject* values[5] = {0,0,0,0,0}; | |
if (unlikely(__pyx_kwds)) { | |
Py_ssize_t kw_args; | |
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
switch (pos_args) { | |
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
CYTHON_FALLTHROUGH; | |
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
CYTHON_FALLTHROUGH; | |
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
CYTHON_FALLTHROUGH; | |
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
CYTHON_FALLTHROUGH; | |
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
CYTHON_FALLTHROUGH; | |
case 0: break; | |
default: goto __pyx_L5_argtuple_error; | |
} | |
kw_args = PyDict_Size(__pyx_kwds); | |
switch (pos_args) { | |
case 0: | |
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; | |
else goto __pyx_L5_argtuple_error; | |
CYTHON_FALLTHROUGH; | |
case 1: | |
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_win)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 1); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 2: | |
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minp)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 2); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 3: | |
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 3); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
CYTHON_FALLTHROUGH; | |
case 4: | |
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; | |
else { | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, 4); __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
} | |
if (unlikely(kw_args > 0)) { | |
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "roll_min") < 0)) __PYX_ERR(0, 1197, __pyx_L3_error) | |
} | |
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
goto __pyx_L5_argtuple_error; | |
} else { | |
values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
} | |
__pyx_v_input = ((PyArrayObject *)values[0]); | |
__pyx_v_win = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_win == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_v_minp = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_minp == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_v_index = values[3]; | |
__pyx_v_closed = values[4]; | |
} | |
goto __pyx_L4_argument_unpacking_done; | |
__pyx_L5_argtuple_error:; | |
__Pyx_RaiseArgtupleInvalid("roll_min", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1197, __pyx_L3_error) | |
__pyx_L3_error:; | |
__Pyx_AddTraceback("pandas._libs.window.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__Pyx_RefNannyFinishContext(); | |
return NULL; | |
__pyx_L4_argument_unpacking_done:; | |
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) __PYX_ERR(0, 1197, __pyx_L1_error) | |
__pyx_r = __pyx_pf_6pandas_5_libs_6window_80roll_min(__pyx_self, __pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed); | |
/* function exit code */ | |
goto __pyx_L0; | |
__pyx_L1_error:; | |
__pyx_r = NULL; | |
__pyx_L0:; | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
static PyObject *__pyx_pf_6pandas_5_libs_6window_80roll_min(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed) { | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
__Pyx_RefNannySetupContext("__pyx_fuse_9roll_min", 0); | |
__pyx_pybuffer_input.pybuffer.buf = NULL; | |
__pyx_pybuffer_input.refcount = 0; | |
__pyx_pybuffernd_input.data = NULL; | |
__pyx_pybuffernd_input.rcbuffer = &__pyx_pybuffer_input; | |
{ | |
__Pyx_BufFmt_StackElem __pyx_stack[1]; | |
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input.rcbuffer->pybuffer, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1197, __pyx_L1_error) | |
} | |
__pyx_pybuffernd_input.diminfo[0].strides = __pyx_pybuffernd_input.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input.diminfo[0].shape = __pyx_pybuffernd_input.rcbuffer->pybuffer.shape[0]; | |
/* "pandas/_libs/window.pyx":1211 | |
* index for window computation | |
* """ | |
* return _roll_min_max(input, win, minp, index, is_max=0, closed=closed) # <<<<<<<<<<<<<< | |
* | |
* | |
*/ | |
__Pyx_XDECREF(__pyx_r); | |
__pyx_t_1 = __pyx_fuse_9__pyx_f_6pandas_5_libs_6window__roll_min_max(((PyArrayObject *)__pyx_v_input), __pyx_v_win, __pyx_v_minp, __pyx_v_index, __pyx_v_closed, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) | |
__Pyx_GOTREF(__pyx_t_1); | |
__pyx_r = __pyx_t_1; | |
__pyx_t_1 = 0; | |
goto __pyx_L0; | |
/* "pandas/_libs/window.pyx":1197 | |
* | |
* | |
* def roll_min(ndarray[numeric] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed): | |
* """ | |
*/ | |
/* function exit code */ | |
__pyx_L1_error:; | |
__Pyx_XDECREF(__pyx_t_1); | |
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb; | |
__Pyx_PyThreadState_declare | |
__Pyx_PyThreadState_assign | |
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} | |
__Pyx_AddTraceback("pandas._libs.window.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
__pyx_r = NULL; | |
goto __pyx_L2; | |
__pyx_L0:; | |
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input.rcbuffer->pybuffer); | |
__pyx_L2:; | |
__Pyx_XGIVEREF(__pyx_r); | |
__Pyx_RefNannyFinishContext(); | |
return __pyx_r; | |
} | |
/* "pandas/_libs/window.pyx":1214 | |
* | |
* | |
* cdef _roll_min_max(ndarray[numeric] input, int64_t win, int64_t minp, # <<<<<<<<<<<<<< | |
* object index, object closed, bint is_max): | |
* """ | |
*/ | |
static PyObject *__pyx_fuse_0__pyx_f_6pandas_5_libs_6window__roll_min_max(PyArrayObject *__pyx_v_input, __pyx_t_5numpy_int64_t __pyx_v_win, __pyx_t_5numpy_int64_t __pyx_v_minp, PyObject *__pyx_v_index, PyObject *__pyx_v_closed, int __pyx_v_is_max) { | |
__pyx_t_5numpy_int8_t __pyx_v_ai; | |
int __pyx_v_is_variable; | |
int __pyx_v_should_replace; | |
__pyx_t_5numpy_int64_t __pyx_v_N; | |
__pyx_t_5numpy_int64_t __pyx_v_i; | |
Py_ssize_t __pyx_v_nobs; | |
std::deque<__pyx_t_5numpy_int64_t> __pyx_v_Q; | |
PyArrayObject *__pyx_v_starti = 0; | |
PyArrayObject *__pyx_v_endi = 0; | |
PyArrayObject *__pyx_v_output = 0; | |
__pyx_t_5numpy_int64_t *__pyx_v_death; | |
__pyx_t_5numpy_int8_t *__pyx_v_ring; | |
__pyx_t_5numpy_int8_t *__pyx_v_minvalue; | |
__pyx_t_5numpy_int8_t *__pyx_v_end; | |
__pyx_t_5numpy_int8_t *__pyx_v_last; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_endi; | |
__Pyx_Buffer __pyx_pybuffer_endi; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_input; | |
__Pyx_Buffer __pyx_pybuffer_input; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_output; | |
__Pyx_Buffer __pyx_pybuffer_output; | |
__Pyx_LocalBuf_ND __pyx_pybuffernd_starti; | |
__Pyx_Buffer __pyx_pybuffer_starti; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; | |
PyObject *__pyx_t_2 = NULL; | |
PyObject *__pyx_t_3 = NULL; | |
PyObject *__pyx_t_4 = NU |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment