Markéta Machová
4d8484644b
- Update to 0.8.3 * improved key/value handling and rejection of bad types * fix regression in consolidate_cats (caught in dask tests) - Release 0.8.2 * datetime indexes initialised to 0 to prevent overflow from randommemory * case from csv_to_parquet where stats exists but has not nulls entry * define len and bool for ParquetFile * maintain int types of optional data tha came from pandas * fix for delta encoding - Add fastparquet-pr813-updatefixes.patch gh#dask/fastparquet#813 OBS-URL: https://build.opensuse.org/request/show/1032127 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-fastparquet?expand=0&rev=40
36551 lines
1.5 MiB
36551 lines
1.5 MiB
diff --git a/.github/workflows/test_wheel.yaml b/.github/workflows/test_wheel.yaml
|
|
index 4be0194e..0d65f100 100644
|
|
--- a/.github/workflows/test_wheel.yaml
|
|
+++ b/.github/workflows/test_wheel.yaml
|
|
@@ -13,7 +13,7 @@ jobs:
|
|
os: [ubuntu-20.04, windows-2019]
|
|
architecture: ['x64']
|
|
linux_archs: ["native"]
|
|
- numpy_version: ["numpy~=1.18.0", "numpy~=1.19.0", "numpy~=1.20.0", "numpy~=1.21.0", "numpy#latest"]
|
|
+ numpy_version: ["numpy~=1.20.3", "numpy~=1.21.0", "numpy~=1.22.0", "numpy#latest"]
|
|
include:
|
|
# https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip
|
|
- os: windows-2019
|
|
diff --git a/fastparquet/cencoding.c b/fastparquet/cencoding.c
|
|
index e2429720..64b9c1a0 100644
|
|
--- a/fastparquet/cencoding.c
|
|
+++ b/fastparquet/cencoding.c
|
|
@@ -1,4 +1,4 @@
|
|
-/* Generated by Cython 0.29.26 */
|
|
+/* Generated by Cython 0.29.32 */
|
|
|
|
/* BEGIN: Cython Metadata
|
|
{
|
|
@@ -22,8 +22,8 @@ END: Cython Metadata */
|
|
#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_29_26"
|
|
-#define CYTHON_HEX_VERSION 0x001D1AF0
|
|
+#define CYTHON_ABI "0_29_32"
|
|
+#define CYTHON_HEX_VERSION 0x001D20F0
|
|
#define CYTHON_FUTURE_DIVISION 1
|
|
#include <stddef.h>
|
|
#ifndef offsetof
|
|
@@ -62,6 +62,7 @@ END: Cython Metadata */
|
|
#define CYTHON_COMPILING_IN_PYPY 1
|
|
#define CYTHON_COMPILING_IN_PYSTON 0
|
|
#define CYTHON_COMPILING_IN_CPYTHON 0
|
|
+ #define CYTHON_COMPILING_IN_NOGIL 0
|
|
#undef CYTHON_USE_TYPE_SLOTS
|
|
#define CYTHON_USE_TYPE_SLOTS 0
|
|
#undef CYTHON_USE_PYTYPE_LOOKUP
|
|
@@ -98,10 +99,14 @@ END: Cython Metadata */
|
|
#define CYTHON_USE_DICT_VERSIONS 0
|
|
#undef CYTHON_USE_EXC_INFO_STACK
|
|
#define CYTHON_USE_EXC_INFO_STACK 0
|
|
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
|
|
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
|
|
+ #endif
|
|
#elif defined(PYSTON_VERSION)
|
|
#define CYTHON_COMPILING_IN_PYPY 0
|
|
#define CYTHON_COMPILING_IN_PYSTON 1
|
|
#define CYTHON_COMPILING_IN_CPYTHON 0
|
|
+ #define CYTHON_COMPILING_IN_NOGIL 0
|
|
#ifndef CYTHON_USE_TYPE_SLOTS
|
|
#define CYTHON_USE_TYPE_SLOTS 1
|
|
#endif
|
|
@@ -139,10 +144,59 @@ END: Cython Metadata */
|
|
#define CYTHON_USE_DICT_VERSIONS 0
|
|
#undef CYTHON_USE_EXC_INFO_STACK
|
|
#define CYTHON_USE_EXC_INFO_STACK 0
|
|
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
|
|
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
|
|
+ #endif
|
|
+#elif defined(PY_NOGIL)
|
|
+ #define CYTHON_COMPILING_IN_PYPY 0
|
|
+ #define CYTHON_COMPILING_IN_PYSTON 0
|
|
+ #define CYTHON_COMPILING_IN_CPYTHON 0
|
|
+ #define CYTHON_COMPILING_IN_NOGIL 1
|
|
+ #ifndef CYTHON_USE_TYPE_SLOTS
|
|
+ #define CYTHON_USE_TYPE_SLOTS 1
|
|
+ #endif
|
|
+ #undef CYTHON_USE_PYTYPE_LOOKUP
|
|
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
|
|
+ #ifndef CYTHON_USE_ASYNC_SLOTS
|
|
+ #define CYTHON_USE_ASYNC_SLOTS 1
|
|
+ #endif
|
|
+ #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
|
|
+ #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
|
|
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 1
|
|
+ #endif
|
|
+ #ifndef CYTHON_USE_TP_FINALIZE
|
|
+ #define CYTHON_USE_TP_FINALIZE 1
|
|
+ #endif
|
|
+ #undef CYTHON_USE_DICT_VERSIONS
|
|
+ #define CYTHON_USE_DICT_VERSIONS 0
|
|
+ #undef CYTHON_USE_EXC_INFO_STACK
|
|
+ #define CYTHON_USE_EXC_INFO_STACK 0
|
|
#else
|
|
#define CYTHON_COMPILING_IN_PYPY 0
|
|
#define CYTHON_COMPILING_IN_PYSTON 0
|
|
#define CYTHON_COMPILING_IN_CPYTHON 1
|
|
+ #define CYTHON_COMPILING_IN_NOGIL 0
|
|
#ifndef CYTHON_USE_TYPE_SLOTS
|
|
#define CYTHON_USE_TYPE_SLOTS 1
|
|
#endif
|
|
@@ -185,11 +239,14 @@ END: Cython Metadata */
|
|
#ifndef CYTHON_UNPACK_METHODS
|
|
#define CYTHON_UNPACK_METHODS 1
|
|
#endif
|
|
- #ifndef CYTHON_FAST_THREAD_STATE
|
|
+ #if PY_VERSION_HEX >= 0x030B00A4
|
|
+ #undef CYTHON_FAST_THREAD_STATE
|
|
+ #define CYTHON_FAST_THREAD_STATE 0
|
|
+ #elif !defined(CYTHON_FAST_THREAD_STATE)
|
|
#define CYTHON_FAST_THREAD_STATE 1
|
|
#endif
|
|
#ifndef CYTHON_FAST_PYCALL
|
|
- #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030B00A1)
|
|
+ #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
|
|
#endif
|
|
#ifndef CYTHON_PEP489_MULTI_PHASE_INIT
|
|
#define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
|
|
@@ -200,9 +257,15 @@ END: Cython Metadata */
|
|
#ifndef CYTHON_USE_DICT_VERSIONS
|
|
#define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
|
|
#endif
|
|
- #ifndef CYTHON_USE_EXC_INFO_STACK
|
|
+ #if PY_VERSION_HEX >= 0x030B00A4
|
|
+ #undef CYTHON_USE_EXC_INFO_STACK
|
|
+ #define CYTHON_USE_EXC_INFO_STACK 0
|
|
+ #elif !defined(CYTHON_USE_EXC_INFO_STACK)
|
|
#define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
|
|
#endif
|
|
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
|
|
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
|
|
+ #endif
|
|
#endif
|
|
#if !defined(CYTHON_FAST_PYCCALL)
|
|
#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
|
|
@@ -654,8 +717,10 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
|
|
} __Pyx_PyAsyncMethodsStruct;
|
|
#endif
|
|
|
|
-#if defined(WIN32) || defined(MS_WINDOWS)
|
|
- #define _USE_MATH_DEFINES
|
|
+#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
|
|
+ #if !defined(_USE_MATH_DEFINES)
|
|
+ #define _USE_MATH_DEFINES
|
|
+ #endif
|
|
#endif
|
|
#include <math.h>
|
|
#ifdef NAN
|
|
@@ -927,30 +992,26 @@ typedef struct {
|
|
#ifndef CYTHON_ATOMICS
|
|
#define CYTHON_ATOMICS 1
|
|
#endif
|
|
+#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
|
|
#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)
|
|
+#if CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
|
|
+ (__GNUC_MINOR__ > 1 ||\
|
|
+ (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
|
|
+ #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1)
|
|
+ #define __pyx_atomic_decr_aligned(value) __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>
|
|
+#elif CYTHON_ATOMICS && defined(_MSC_VER) && CYTHON_COMPILING_IN_NOGIL
|
|
+ #include <intrin.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)
|
|
+ #define __pyx_atomic_int_type long
|
|
+ #pragma intrinsic (_InterlockedExchangeAdd)
|
|
+ #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1)
|
|
+ #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1)
|
|
#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
|
|
@@ -961,9 +1022,9 @@ typedef struct {
|
|
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)
|
|
+ __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview))
|
|
#define __pyx_sub_acquisition_count(memview)\
|
|
- __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
|
|
+ __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview))
|
|
#else
|
|
#define __pyx_add_acquisition_count(memview)\
|
|
__pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
|
|
@@ -1199,7 +1260,7 @@ struct __pyx_obj_11fastparquet_9cencoding___pyx_scope_struct_1_genexpr {
|
|
};
|
|
|
|
|
|
-/* "View.MemoryView":105
|
|
+/* "View.MemoryView":106
|
|
*
|
|
* @cname("__pyx_array")
|
|
* cdef class array: # <<<<<<<<<<<<<<
|
|
@@ -1224,7 +1285,7 @@ struct __pyx_array_obj {
|
|
};
|
|
|
|
|
|
-/* "View.MemoryView":279
|
|
+/* "View.MemoryView":280
|
|
*
|
|
* @cname('__pyx_MemviewEnum')
|
|
* cdef class Enum(object): # <<<<<<<<<<<<<<
|
|
@@ -1237,7 +1298,7 @@ struct __pyx_MemviewEnum_obj {
|
|
};
|
|
|
|
|
|
-/* "View.MemoryView":330
|
|
+/* "View.MemoryView":331
|
|
*
|
|
* @cname('__pyx_memoryview')
|
|
* cdef class memoryview(object): # <<<<<<<<<<<<<<
|
|
@@ -1260,7 +1321,7 @@ struct __pyx_memoryview_obj {
|
|
};
|
|
|
|
|
|
-/* "View.MemoryView":965
|
|
+/* "View.MemoryView":967
|
|
*
|
|
* @cname('__pyx_memoryviewslice')
|
|
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
|
|
@@ -1329,7 +1390,7 @@ static __Pyx_memviewslice __pyx_f_11fastparquet_9cencoding_12ThriftObject_to_byt
|
|
static PyObject *__pyx_f_11fastparquet_9cencoding_12ThriftObject__asdict(struct __pyx_obj_11fastparquet_9cencoding_ThriftObject *, int __pyx_skip_dispatch);
|
|
|
|
|
|
-/* "View.MemoryView":105
|
|
+/* "View.MemoryView":106
|
|
*
|
|
* @cname("__pyx_array")
|
|
* cdef class array: # <<<<<<<<<<<<<<
|
|
@@ -1343,7 +1404,7 @@ struct __pyx_vtabstruct_array {
|
|
static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
|
|
|
|
|
|
-/* "View.MemoryView":330
|
|
+/* "View.MemoryView":331
|
|
*
|
|
* @cname('__pyx_memoryview')
|
|
* cdef class memoryview(object): # <<<<<<<<<<<<<<
|
|
@@ -1363,7 +1424,7 @@ struct __pyx_vtabstruct_memoryview {
|
|
static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
|
|
|
|
|
|
-/* "View.MemoryView":965
|
|
+/* "View.MemoryView":967
|
|
*
|
|
* @cname('__pyx_memoryviewslice')
|
|
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
|
|
@@ -1606,6 +1667,12 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
|
|
#if CYTHON_FAST_PYCALL
|
|
static size_t __pyx_pyframe_localsplus_offset = 0;
|
|
#include "frameobject.h"
|
|
+#if PY_VERSION_HEX >= 0x030b00a6
|
|
+ #ifndef Py_BUILD_CORE
|
|
+ #define Py_BUILD_CORE 1
|
|
+ #endif
|
|
+ #include "internal/pycore_frame.h"
|
|
+#endif
|
|
#define __Pxy_PyFrame_Initialize_Offsets()\
|
|
((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
|
|
(void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
|
|
@@ -2772,7 +2839,7 @@ static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create
|
|
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_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
|
|
+static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (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_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
|
|
@@ -2817,7 +2884,7 @@ static PyObject *__pyx_n_u_EnumType;
|
|
static PyObject *__pyx_n_u_FileMetaData;
|
|
static PyObject *__pyx_n_u_INTEGER;
|
|
static PyObject *__pyx_n_s_ImportError;
|
|
-static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
|
|
+static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
|
|
static PyObject *__pyx_n_s_IndexError;
|
|
static PyObject *__pyx_n_u_IndexPageHeader;
|
|
static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
|
|
@@ -3228,6 +3295,8 @@ static PyObject *__pyx_int_11;
|
|
static PyObject *__pyx_int_12;
|
|
static PyObject *__pyx_int_13;
|
|
static PyObject *__pyx_int_14;
|
|
+static PyObject *__pyx_int_112105877;
|
|
+static PyObject *__pyx_int_136983863;
|
|
static PyObject *__pyx_int_184977713;
|
|
static PyObject *__pyx_int_72057594037927935;
|
|
static PyObject *__pyx_int_18446744073709551615;
|
|
@@ -3254,20 +3323,21 @@ static PyObject *__pyx_tuple__20;
|
|
static PyObject *__pyx_tuple__21;
|
|
static PyObject *__pyx_tuple__22;
|
|
static PyObject *__pyx_tuple__23;
|
|
-static PyObject *__pyx_tuple__25;
|
|
-static PyObject *__pyx_tuple__27;
|
|
-static PyObject *__pyx_tuple__29;
|
|
-static PyObject *__pyx_tuple__31;
|
|
+static PyObject *__pyx_tuple__24;
|
|
+static PyObject *__pyx_tuple__26;
|
|
+static PyObject *__pyx_tuple__28;
|
|
+static PyObject *__pyx_tuple__30;
|
|
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_codeobj__24;
|
|
-static PyObject *__pyx_codeobj__26;
|
|
-static PyObject *__pyx_codeobj__28;
|
|
-static PyObject *__pyx_codeobj__30;
|
|
-static PyObject *__pyx_codeobj__37;
|
|
+static PyObject *__pyx_tuple__37;
|
|
+static PyObject *__pyx_codeobj__25;
|
|
+static PyObject *__pyx_codeobj__27;
|
|
+static PyObject *__pyx_codeobj__29;
|
|
+static PyObject *__pyx_codeobj__31;
|
|
+static PyObject *__pyx_codeobj__38;
|
|
/* Late includes */
|
|
|
|
/* "fastparquet/cencoding.pyx":24
|
|
@@ -8900,10 +8970,10 @@ static PyObject *__pyx_pf_11fastparquet_9cencoding_22_assemble_objects(CYTHON_UN
|
|
}
|
|
__pyx_t_7 = __pyx_v_i;
|
|
__pyx_t_8 = ((PyObject * *) ( /* dim=0 */ (__pyx_v_assign.data + __pyx_t_7 * __pyx_v_assign.strides[0]) ));
|
|
- __Pyx_GOTREF(*__pyx_t_8);
|
|
- __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_8);
|
|
+ __Pyx_XGOTREF(*__pyx_t_8);
|
|
+ __Pyx_INCREF(__pyx_t_2); __Pyx_XDECREF(*__pyx_t_8);
|
|
*__pyx_t_8 = __pyx_t_2;
|
|
- __Pyx_GIVEREF(*__pyx_t_8);
|
|
+ __Pyx_XGIVEREF(*__pyx_t_8);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
|
|
/* "fastparquet/cencoding.pyx":442
|
|
@@ -8957,6 +9027,7 @@ static PyObject *__pyx_pf_11fastparquet_9cencoding_22_assemble_objects(CYTHON_UN
|
|
*/
|
|
__pyx_t_7 = (__pyx_v_i - 1);
|
|
__pyx_t_9 = (PyObject *) *((PyObject * *) ( /* dim=0 */ (__pyx_v_assign.data + __pyx_t_7 * __pyx_v_assign.strides[0]) ));
|
|
+ if (unlikely(__pyx_t_9 == NULL)) __pyx_t_9 = Py_None;
|
|
__Pyx_INCREF((PyObject*)__pyx_t_9);
|
|
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_extend); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 447, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
@@ -9133,10 +9204,10 @@ static PyObject *__pyx_pf_11fastparquet_9cencoding_22_assemble_objects(CYTHON_UN
|
|
}
|
|
__pyx_t_7 = __pyx_v_i;
|
|
__pyx_t_8 = ((PyObject * *) ( /* dim=0 */ (__pyx_v_assign.data + __pyx_t_7 * __pyx_v_assign.strides[0]) ));
|
|
- __Pyx_GOTREF(*__pyx_t_8);
|
|
- __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(*__pyx_t_8);
|
|
+ __Pyx_XGOTREF(*__pyx_t_8);
|
|
+ __Pyx_INCREF(__pyx_t_2); __Pyx_XDECREF(*__pyx_t_8);
|
|
*__pyx_t_8 = __pyx_t_2;
|
|
- __Pyx_GIVEREF(*__pyx_t_8);
|
|
+ __Pyx_XGIVEREF(*__pyx_t_8);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
|
|
/* "fastparquet/cencoding.pyx":460
|
|
@@ -9159,6 +9230,7 @@ static PyObject *__pyx_pf_11fastparquet_9cencoding_22_assemble_objects(CYTHON_UN
|
|
/*else*/ {
|
|
__pyx_t_7 = (__pyx_v_i - 1);
|
|
__pyx_t_10 = (PyObject *) *((PyObject * *) ( /* dim=0 */ (__pyx_v_assign.data + __pyx_t_7 * __pyx_v_assign.strides[0]) ));
|
|
+ if (unlikely(__pyx_t_10 == NULL)) __pyx_t_10 = Py_None;
|
|
__Pyx_INCREF((PyObject*)__pyx_t_10);
|
|
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_extend); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 463, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_9);
|
|
@@ -17274,7 +17346,7 @@ static PyObject *__pyx_pf_11fastparquet_9cencoding_32dict_eq(CYTHON_UNUSED PyObj
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":122
|
|
+/* "View.MemoryView":123
|
|
* cdef bint dtype_is_object
|
|
*
|
|
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
|
|
@@ -17326,13 +17398,13 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
|
|
case 1:
|
|
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
|
|
else {
|
|
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
|
|
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 123, __pyx_L3_error)
|
|
}
|
|
CYTHON_FALLTHROUGH;
|
|
case 2:
|
|
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
|
|
else {
|
|
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
|
|
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 123, __pyx_L3_error)
|
|
}
|
|
CYTHON_FALLTHROUGH;
|
|
case 3:
|
|
@@ -17348,7 +17420,7 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
|
|
}
|
|
}
|
|
if (unlikely(kw_args > 0)) {
|
|
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
|
|
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 123, __pyx_L3_error)
|
|
}
|
|
} else {
|
|
switch (PyTuple_GET_SIZE(__pyx_args)) {
|
|
@@ -17364,14 +17436,14 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
|
|
}
|
|
}
|
|
__pyx_v_shape = ((PyObject*)values[0]);
|
|
- __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
|
|
+ __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
|
|
__pyx_v_format = values[2];
|
|
__pyx_v_mode = values[3];
|
|
if (values[4]) {
|
|
- __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
|
|
+ __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 124, __pyx_L3_error)
|
|
} else {
|
|
|
|
- /* "View.MemoryView":123
|
|
+ /* "View.MemoryView":124
|
|
*
|
|
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
|
|
* mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
|
|
@@ -17383,19 +17455,19 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
|
|
}
|
|
goto __pyx_L4_argument_unpacking_done;
|
|
__pyx_L5_argtuple_error:;
|
|
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
|
|
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 123, __pyx_L3_error)
|
|
__pyx_L3_error:;
|
|
__Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__Pyx_RefNannyFinishContext();
|
|
return -1;
|
|
__pyx_L4_argument_unpacking_done:;
|
|
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
|
|
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 123, __pyx_L1_error)
|
|
if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
|
|
- PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 122, __pyx_L1_error)
|
|
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 123, __pyx_L1_error)
|
|
}
|
|
__pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
|
|
|
|
- /* "View.MemoryView":122
|
|
+ /* "View.MemoryView":123
|
|
* cdef bint dtype_is_object
|
|
*
|
|
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
|
|
@@ -17437,7 +17509,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
__Pyx_RefNannySetupContext("__cinit__", 0);
|
|
__Pyx_INCREF(__pyx_v_format);
|
|
|
|
- /* "View.MemoryView":129
|
|
+ /* "View.MemoryView":130
|
|
* cdef PyObject **p
|
|
*
|
|
* self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
|
|
@@ -17446,12 +17518,12 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
*/
|
|
if (unlikely(__pyx_v_shape == Py_None)) {
|
|
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
|
|
- __PYX_ERR(1, 129, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 130, __pyx_L1_error)
|
|
}
|
|
- __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
|
|
+ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 130, __pyx_L1_error)
|
|
__pyx_v_self->ndim = ((int)__pyx_t_1);
|
|
|
|
- /* "View.MemoryView":130
|
|
+ /* "View.MemoryView":131
|
|
*
|
|
* self.ndim = <int> len(shape)
|
|
* self.itemsize = itemsize # <<<<<<<<<<<<<<
|
|
@@ -17460,7 +17532,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
*/
|
|
__pyx_v_self->itemsize = __pyx_v_itemsize;
|
|
|
|
- /* "View.MemoryView":132
|
|
+ /* "View.MemoryView":133
|
|
* self.itemsize = itemsize
|
|
*
|
|
* if not self.ndim: # <<<<<<<<<<<<<<
|
|
@@ -17470,20 +17542,20 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
__pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
|
|
if (unlikely(__pyx_t_2)) {
|
|
|
|
- /* "View.MemoryView":133
|
|
+ /* "View.MemoryView":134
|
|
*
|
|
* if not self.ndim:
|
|
* raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
|
|
*
|
|
* if itemsize <= 0:
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
|
|
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __PYX_ERR(1, 133, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 134, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":132
|
|
+ /* "View.MemoryView":133
|
|
* self.itemsize = itemsize
|
|
*
|
|
* if not self.ndim: # <<<<<<<<<<<<<<
|
|
@@ -17492,7 +17564,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":135
|
|
+ /* "View.MemoryView":136
|
|
* raise ValueError("Empty shape tuple for cython.array")
|
|
*
|
|
* if itemsize <= 0: # <<<<<<<<<<<<<<
|
|
@@ -17502,20 +17574,20 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
__pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
|
|
if (unlikely(__pyx_t_2)) {
|
|
|
|
- /* "View.MemoryView":136
|
|
+ /* "View.MemoryView":137
|
|
*
|
|
* if itemsize <= 0:
|
|
* raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
|
|
*
|
|
* if not isinstance(format, bytes):
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
|
|
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __PYX_ERR(1, 136, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 137, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":135
|
|
+ /* "View.MemoryView":136
|
|
* raise ValueError("Empty shape tuple for cython.array")
|
|
*
|
|
* if itemsize <= 0: # <<<<<<<<<<<<<<
|
|
@@ -17524,7 +17596,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":138
|
|
+ /* "View.MemoryView":139
|
|
* raise ValueError("itemsize <= 0 for cython.array")
|
|
*
|
|
* if not isinstance(format, bytes): # <<<<<<<<<<<<<<
|
|
@@ -17535,14 +17607,14 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
__pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
|
|
if (__pyx_t_4) {
|
|
|
|
- /* "View.MemoryView":139
|
|
+ /* "View.MemoryView":140
|
|
*
|
|
* if not isinstance(format, bytes):
|
|
* format = format.encode('ASCII') # <<<<<<<<<<<<<<
|
|
* self._format = format # keep a reference to the byte string
|
|
* self.format = self._format
|
|
*/
|
|
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
|
|
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 140, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__pyx_t_6 = NULL;
|
|
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
|
|
@@ -17556,13 +17628,13 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
}
|
|
__pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
|
|
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
- if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
|
|
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 140, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
__Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
|
|
__pyx_t_3 = 0;
|
|
|
|
- /* "View.MemoryView":138
|
|
+ /* "View.MemoryView":139
|
|
* raise ValueError("itemsize <= 0 for cython.array")
|
|
*
|
|
* if not isinstance(format, bytes): # <<<<<<<<<<<<<<
|
|
@@ -17571,14 +17643,14 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":140
|
|
+ /* "View.MemoryView":141
|
|
* if not isinstance(format, bytes):
|
|
* format = format.encode('ASCII')
|
|
* self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
|
|
* self.format = self._format
|
|
*
|
|
*/
|
|
- if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
|
|
+ if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 141, __pyx_L1_error)
|
|
__pyx_t_3 = __pyx_v_format;
|
|
__Pyx_INCREF(__pyx_t_3);
|
|
__Pyx_GIVEREF(__pyx_t_3);
|
|
@@ -17587,7 +17659,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
__pyx_v_self->_format = ((PyObject*)__pyx_t_3);
|
|
__pyx_t_3 = 0;
|
|
|
|
- /* "View.MemoryView":141
|
|
+ /* "View.MemoryView":142
|
|
* format = format.encode('ASCII')
|
|
* self._format = format # keep a reference to the byte string
|
|
* self.format = self._format # <<<<<<<<<<<<<<
|
|
@@ -17596,12 +17668,12 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
*/
|
|
if (unlikely(__pyx_v_self->_format == Py_None)) {
|
|
PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
|
|
- __PYX_ERR(1, 141, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 142, __pyx_L1_error)
|
|
}
|
|
- __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
|
|
+ __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 142, __pyx_L1_error)
|
|
__pyx_v_self->format = __pyx_t_7;
|
|
|
|
- /* "View.MemoryView":144
|
|
+ /* "View.MemoryView":145
|
|
*
|
|
*
|
|
* self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
|
|
@@ -17610,7 +17682,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
*/
|
|
__pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
|
|
|
|
- /* "View.MemoryView":145
|
|
+ /* "View.MemoryView":146
|
|
*
|
|
* self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
|
|
* self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
|
|
@@ -17619,7 +17691,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
*/
|
|
__pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
|
|
|
|
- /* "View.MemoryView":147
|
|
+ /* "View.MemoryView":148
|
|
* self._strides = self._shape + self.ndim
|
|
*
|
|
* if not self._shape: # <<<<<<<<<<<<<<
|
|
@@ -17629,20 +17701,20 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
__pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
|
|
if (unlikely(__pyx_t_4)) {
|
|
|
|
- /* "View.MemoryView":148
|
|
+ /* "View.MemoryView":149
|
|
*
|
|
* if not self._shape:
|
|
* raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
|
|
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __PYX_ERR(1, 148, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 149, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":147
|
|
+ /* "View.MemoryView":148
|
|
* self._strides = self._shape + self.ndim
|
|
*
|
|
* if not self._shape: # <<<<<<<<<<<<<<
|
|
@@ -17651,7 +17723,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":151
|
|
+ /* "View.MemoryView":152
|
|
*
|
|
*
|
|
* for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
|
|
@@ -17663,18 +17735,18 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
for (;;) {
|
|
if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
|
|
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
- __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
|
|
+ __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 152, __pyx_L1_error)
|
|
#else
|
|
- __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
|
|
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 152, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
#endif
|
|
- __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
|
|
+ __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 152, __pyx_L1_error)
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
__pyx_v_dim = __pyx_t_9;
|
|
__pyx_v_idx = __pyx_t_8;
|
|
__pyx_t_8 = (__pyx_t_8 + 1);
|
|
|
|
- /* "View.MemoryView":152
|
|
+ /* "View.MemoryView":153
|
|
*
|
|
* for idx, dim in enumerate(shape):
|
|
* if dim <= 0: # <<<<<<<<<<<<<<
|
|
@@ -17684,18 +17756,18 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
__pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
|
|
if (unlikely(__pyx_t_4)) {
|
|
|
|
- /* "View.MemoryView":153
|
|
+ /* "View.MemoryView":154
|
|
* for idx, dim in enumerate(shape):
|
|
* if dim <= 0:
|
|
* raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
|
|
* self._shape[idx] = dim
|
|
*
|
|
*/
|
|
- __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
|
|
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 154, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
- __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
|
|
+ __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 154, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
- __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
|
|
+ __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 154, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
__Pyx_GIVEREF(__pyx_t_5);
|
|
PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
|
|
@@ -17703,17 +17775,17 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
|
|
__pyx_t_5 = 0;
|
|
__pyx_t_6 = 0;
|
|
- __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
|
|
+ __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 154, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
- __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
|
|
+ __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 154, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
__Pyx_Raise(__pyx_t_10, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
- __PYX_ERR(1, 153, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 154, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":152
|
|
+ /* "View.MemoryView":153
|
|
*
|
|
* for idx, dim in enumerate(shape):
|
|
* if dim <= 0: # <<<<<<<<<<<<<<
|
|
@@ -17722,7 +17794,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":154
|
|
+ /* "View.MemoryView":155
|
|
* if dim <= 0:
|
|
* raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
|
|
* self._shape[idx] = dim # <<<<<<<<<<<<<<
|
|
@@ -17731,7 +17803,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
*/
|
|
(__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
|
|
|
|
- /* "View.MemoryView":151
|
|
+ /* "View.MemoryView":152
|
|
*
|
|
*
|
|
* for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
|
|
@@ -17741,17 +17813,17 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
}
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
- /* "View.MemoryView":157
|
|
+ /* "View.MemoryView":158
|
|
*
|
|
* cdef char order
|
|
* if mode == 'fortran': # <<<<<<<<<<<<<<
|
|
* order = b'F'
|
|
* self.mode = u'fortran'
|
|
*/
|
|
- __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
|
|
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error)
|
|
if (__pyx_t_4) {
|
|
|
|
- /* "View.MemoryView":158
|
|
+ /* "View.MemoryView":159
|
|
* cdef char order
|
|
* if mode == 'fortran':
|
|
* order = b'F' # <<<<<<<<<<<<<<
|
|
@@ -17760,7 +17832,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
*/
|
|
__pyx_v_order = 'F';
|
|
|
|
- /* "View.MemoryView":159
|
|
+ /* "View.MemoryView":160
|
|
* if mode == 'fortran':
|
|
* order = b'F'
|
|
* self.mode = u'fortran' # <<<<<<<<<<<<<<
|
|
@@ -17773,7 +17845,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
__Pyx_DECREF(__pyx_v_self->mode);
|
|
__pyx_v_self->mode = __pyx_n_u_fortran;
|
|
|
|
- /* "View.MemoryView":157
|
|
+ /* "View.MemoryView":158
|
|
*
|
|
* cdef char order
|
|
* if mode == 'fortran': # <<<<<<<<<<<<<<
|
|
@@ -17783,17 +17855,17 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
goto __pyx_L10;
|
|
}
|
|
|
|
- /* "View.MemoryView":160
|
|
+ /* "View.MemoryView":161
|
|
* order = b'F'
|
|
* self.mode = u'fortran'
|
|
* elif mode == 'c': # <<<<<<<<<<<<<<
|
|
* order = b'C'
|
|
* self.mode = u'c'
|
|
*/
|
|
- __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
|
|
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 161, __pyx_L1_error)
|
|
if (likely(__pyx_t_4)) {
|
|
|
|
- /* "View.MemoryView":161
|
|
+ /* "View.MemoryView":162
|
|
* self.mode = u'fortran'
|
|
* elif mode == 'c':
|
|
* order = b'C' # <<<<<<<<<<<<<<
|
|
@@ -17802,7 +17874,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
*/
|
|
__pyx_v_order = 'C';
|
|
|
|
- /* "View.MemoryView":162
|
|
+ /* "View.MemoryView":163
|
|
* elif mode == 'c':
|
|
* order = b'C'
|
|
* self.mode = u'c' # <<<<<<<<<<<<<<
|
|
@@ -17815,7 +17887,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
__Pyx_DECREF(__pyx_v_self->mode);
|
|
__pyx_v_self->mode = __pyx_n_u_c;
|
|
|
|
- /* "View.MemoryView":160
|
|
+ /* "View.MemoryView":161
|
|
* order = b'F'
|
|
* self.mode = u'fortran'
|
|
* elif mode == 'c': # <<<<<<<<<<<<<<
|
|
@@ -17825,7 +17897,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
goto __pyx_L10;
|
|
}
|
|
|
|
- /* "View.MemoryView":164
|
|
+ /* "View.MemoryView":165
|
|
* self.mode = u'c'
|
|
* else:
|
|
* raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
|
|
@@ -17833,18 +17905,18 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
* self.len = fill_contig_strides_array(self._shape, self._strides,
|
|
*/
|
|
/*else*/ {
|
|
- __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
|
|
+ __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 165, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
|
|
+ __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 165, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__Pyx_Raise(__pyx_t_10, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
- __PYX_ERR(1, 164, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 165, __pyx_L1_error)
|
|
}
|
|
__pyx_L10:;
|
|
|
|
- /* "View.MemoryView":166
|
|
+ /* "View.MemoryView":167
|
|
* raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
|
|
*
|
|
* self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
|
|
@@ -17853,7 +17925,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
*/
|
|
__pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
|
|
|
|
- /* "View.MemoryView":169
|
|
+ /* "View.MemoryView":170
|
|
* itemsize, self.ndim, order)
|
|
*
|
|
* self.free_data = allocate_buffer # <<<<<<<<<<<<<<
|
|
@@ -17862,19 +17934,19 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
*/
|
|
__pyx_v_self->free_data = __pyx_v_allocate_buffer;
|
|
|
|
- /* "View.MemoryView":170
|
|
+ /* "View.MemoryView":171
|
|
*
|
|
* self.free_data = allocate_buffer
|
|
* self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
|
|
* if allocate_buffer:
|
|
*
|
|
*/
|
|
- __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
|
|
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
|
|
+ __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 171, __pyx_L1_error)
|
|
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 171, __pyx_L1_error)
|
|
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
__pyx_v_self->dtype_is_object = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":171
|
|
+ /* "View.MemoryView":172
|
|
* self.free_data = allocate_buffer
|
|
* self.dtype_is_object = format == b'O'
|
|
* if allocate_buffer: # <<<<<<<<<<<<<<
|
|
@@ -17884,7 +17956,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
__pyx_t_4 = (__pyx_v_allocate_buffer != 0);
|
|
if (__pyx_t_4) {
|
|
|
|
- /* "View.MemoryView":174
|
|
+ /* "View.MemoryView":175
|
|
*
|
|
*
|
|
* self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
|
|
@@ -17893,7 +17965,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
*/
|
|
__pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
|
|
|
|
- /* "View.MemoryView":175
|
|
+ /* "View.MemoryView":176
|
|
*
|
|
* self.data = <char *>malloc(self.len)
|
|
* if not self.data: # <<<<<<<<<<<<<<
|
|
@@ -17903,20 +17975,20 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
__pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
|
|
if (unlikely(__pyx_t_4)) {
|
|
|
|
- /* "View.MemoryView":176
|
|
+ /* "View.MemoryView":177
|
|
* self.data = <char *>malloc(self.len)
|
|
* if not self.data:
|
|
* raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
|
|
*
|
|
* if self.dtype_is_object:
|
|
*/
|
|
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
|
|
+ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 177, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
__Pyx_Raise(__pyx_t_10, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
- __PYX_ERR(1, 176, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 177, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":175
|
|
+ /* "View.MemoryView":176
|
|
*
|
|
* self.data = <char *>malloc(self.len)
|
|
* if not self.data: # <<<<<<<<<<<<<<
|
|
@@ -17925,7 +17997,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":178
|
|
+ /* "View.MemoryView":179
|
|
* raise MemoryError("unable to allocate array data.")
|
|
*
|
|
* if self.dtype_is_object: # <<<<<<<<<<<<<<
|
|
@@ -17935,7 +18007,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
__pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
|
|
if (__pyx_t_4) {
|
|
|
|
- /* "View.MemoryView":179
|
|
+ /* "View.MemoryView":180
|
|
*
|
|
* if self.dtype_is_object:
|
|
* p = <PyObject **> self.data # <<<<<<<<<<<<<<
|
|
@@ -17944,7 +18016,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
*/
|
|
__pyx_v_p = ((PyObject **)__pyx_v_self->data);
|
|
|
|
- /* "View.MemoryView":180
|
|
+ /* "View.MemoryView":181
|
|
* if self.dtype_is_object:
|
|
* p = <PyObject **> self.data
|
|
* for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
|
|
@@ -17953,18 +18025,18 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
*/
|
|
if (unlikely(__pyx_v_itemsize == 0)) {
|
|
PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
|
|
- __PYX_ERR(1, 180, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 181, __pyx_L1_error)
|
|
}
|
|
else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
|
|
PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
|
|
- __PYX_ERR(1, 180, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 181, __pyx_L1_error)
|
|
}
|
|
__pyx_t_1 = (__pyx_v_self->len / __pyx_v_itemsize);
|
|
__pyx_t_9 = __pyx_t_1;
|
|
for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
|
|
__pyx_v_i = __pyx_t_11;
|
|
|
|
- /* "View.MemoryView":181
|
|
+ /* "View.MemoryView":182
|
|
* p = <PyObject **> self.data
|
|
* for i in range(self.len / itemsize):
|
|
* p[i] = Py_None # <<<<<<<<<<<<<<
|
|
@@ -17973,7 +18045,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
*/
|
|
(__pyx_v_p[__pyx_v_i]) = Py_None;
|
|
|
|
- /* "View.MemoryView":182
|
|
+ /* "View.MemoryView":183
|
|
* for i in range(self.len / itemsize):
|
|
* p[i] = Py_None
|
|
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
|
|
@@ -17983,7 +18055,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
Py_INCREF(Py_None);
|
|
}
|
|
|
|
- /* "View.MemoryView":178
|
|
+ /* "View.MemoryView":179
|
|
* raise MemoryError("unable to allocate array data.")
|
|
*
|
|
* if self.dtype_is_object: # <<<<<<<<<<<<<<
|
|
@@ -17992,7 +18064,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":171
|
|
+ /* "View.MemoryView":172
|
|
* self.free_data = allocate_buffer
|
|
* self.dtype_is_object = format == b'O'
|
|
* if allocate_buffer: # <<<<<<<<<<<<<<
|
|
@@ -18001,7 +18073,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":122
|
|
+ /* "View.MemoryView":123
|
|
* cdef bint dtype_is_object
|
|
*
|
|
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
|
|
@@ -18025,7 +18097,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":185
|
|
+/* "View.MemoryView":186
|
|
*
|
|
* @cname('getbuffer')
|
|
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
|
|
@@ -18068,7 +18140,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru
|
|
__pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
|
|
__Pyx_GIVEREF(__pyx_v_info->obj);
|
|
|
|
- /* "View.MemoryView":186
|
|
+ /* "View.MemoryView":187
|
|
* @cname('getbuffer')
|
|
* def __getbuffer__(self, Py_buffer *info, int flags):
|
|
* cdef int bufmode = -1 # <<<<<<<<<<<<<<
|
|
@@ -18077,18 +18149,18 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru
|
|
*/
|
|
__pyx_v_bufmode = -1;
|
|
|
|
- /* "View.MemoryView":187
|
|
+ /* "View.MemoryView":188
|
|
* def __getbuffer__(self, Py_buffer *info, int flags):
|
|
* cdef int bufmode = -1
|
|
* if self.mode == u"c": # <<<<<<<<<<<<<<
|
|
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
* elif self.mode == u"fortran":
|
|
*/
|
|
- __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
|
|
+ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 188, __pyx_L1_error)
|
|
__pyx_t_2 = (__pyx_t_1 != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":188
|
|
+ /* "View.MemoryView":189
|
|
* cdef int bufmode = -1
|
|
* if self.mode == u"c":
|
|
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
|
|
@@ -18097,7 +18169,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru
|
|
*/
|
|
__pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
|
|
|
|
- /* "View.MemoryView":187
|
|
+ /* "View.MemoryView":188
|
|
* def __getbuffer__(self, Py_buffer *info, int flags):
|
|
* cdef int bufmode = -1
|
|
* if self.mode == u"c": # <<<<<<<<<<<<<<
|
|
@@ -18107,18 +18179,18 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
- /* "View.MemoryView":189
|
|
+ /* "View.MemoryView":190
|
|
* if self.mode == u"c":
|
|
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
* elif self.mode == u"fortran": # <<<<<<<<<<<<<<
|
|
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
* if not (flags & bufmode):
|
|
*/
|
|
- __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
|
|
+ __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 190, __pyx_L1_error)
|
|
__pyx_t_1 = (__pyx_t_2 != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":190
|
|
+ /* "View.MemoryView":191
|
|
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
* elif self.mode == u"fortran":
|
|
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
|
|
@@ -18127,7 +18199,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru
|
|
*/
|
|
__pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
|
|
|
|
- /* "View.MemoryView":189
|
|
+ /* "View.MemoryView":190
|
|
* if self.mode == u"c":
|
|
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
* elif self.mode == u"fortran": # <<<<<<<<<<<<<<
|
|
@@ -18137,7 +18209,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru
|
|
}
|
|
__pyx_L3:;
|
|
|
|
- /* "View.MemoryView":191
|
|
+ /* "View.MemoryView":192
|
|
* elif self.mode == u"fortran":
|
|
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
* if not (flags & bufmode): # <<<<<<<<<<<<<<
|
|
@@ -18147,20 +18219,20 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru
|
|
__pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
|
|
if (unlikely(__pyx_t_1)) {
|
|
|
|
- /* "View.MemoryView":192
|
|
+ /* "View.MemoryView":193
|
|
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
* if not (flags & bufmode):
|
|
* raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
|
|
* info.buf = self.data
|
|
* info.len = self.len
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
|
|
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 193, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __PYX_ERR(1, 192, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 193, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":191
|
|
+ /* "View.MemoryView":192
|
|
* elif self.mode == u"fortran":
|
|
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
* if not (flags & bufmode): # <<<<<<<<<<<<<<
|
|
@@ -18169,7 +18241,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":193
|
|
+ /* "View.MemoryView":194
|
|
* if not (flags & bufmode):
|
|
* raise ValueError("Can only create a buffer that is contiguous in memory.")
|
|
* info.buf = self.data # <<<<<<<<<<<<<<
|
|
@@ -18179,7 +18251,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru
|
|
__pyx_t_4 = __pyx_v_self->data;
|
|
__pyx_v_info->buf = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":194
|
|
+ /* "View.MemoryView":195
|
|
* raise ValueError("Can only create a buffer that is contiguous in memory.")
|
|
* info.buf = self.data
|
|
* info.len = self.len # <<<<<<<<<<<<<<
|
|
@@ -18189,7 +18261,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru
|
|
__pyx_t_5 = __pyx_v_self->len;
|
|
__pyx_v_info->len = __pyx_t_5;
|
|
|
|
- /* "View.MemoryView":195
|
|
+ /* "View.MemoryView":196
|
|
* info.buf = self.data
|
|
* info.len = self.len
|
|
* info.ndim = self.ndim # <<<<<<<<<<<<<<
|
|
@@ -18199,7 +18271,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru
|
|
__pyx_t_6 = __pyx_v_self->ndim;
|
|
__pyx_v_info->ndim = __pyx_t_6;
|
|
|
|
- /* "View.MemoryView":196
|
|
+ /* "View.MemoryView":197
|
|
* info.len = self.len
|
|
* info.ndim = self.ndim
|
|
* info.shape = self._shape # <<<<<<<<<<<<<<
|
|
@@ -18209,7 +18281,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru
|
|
__pyx_t_7 = __pyx_v_self->_shape;
|
|
__pyx_v_info->shape = __pyx_t_7;
|
|
|
|
- /* "View.MemoryView":197
|
|
+ /* "View.MemoryView":198
|
|
* info.ndim = self.ndim
|
|
* info.shape = self._shape
|
|
* info.strides = self._strides # <<<<<<<<<<<<<<
|
|
@@ -18219,7 +18291,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru
|
|
__pyx_t_7 = __pyx_v_self->_strides;
|
|
__pyx_v_info->strides = __pyx_t_7;
|
|
|
|
- /* "View.MemoryView":198
|
|
+ /* "View.MemoryView":199
|
|
* info.shape = self._shape
|
|
* info.strides = self._strides
|
|
* info.suboffsets = NULL # <<<<<<<<<<<<<<
|
|
@@ -18228,7 +18300,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru
|
|
*/
|
|
__pyx_v_info->suboffsets = NULL;
|
|
|
|
- /* "View.MemoryView":199
|
|
+ /* "View.MemoryView":200
|
|
* info.strides = self._strides
|
|
* info.suboffsets = NULL
|
|
* info.itemsize = self.itemsize # <<<<<<<<<<<<<<
|
|
@@ -18238,7 +18310,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru
|
|
__pyx_t_5 = __pyx_v_self->itemsize;
|
|
__pyx_v_info->itemsize = __pyx_t_5;
|
|
|
|
- /* "View.MemoryView":200
|
|
+ /* "View.MemoryView":201
|
|
* info.suboffsets = NULL
|
|
* info.itemsize = self.itemsize
|
|
* info.readonly = 0 # <<<<<<<<<<<<<<
|
|
@@ -18247,7 +18319,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru
|
|
*/
|
|
__pyx_v_info->readonly = 0;
|
|
|
|
- /* "View.MemoryView":202
|
|
+ /* "View.MemoryView":203
|
|
* info.readonly = 0
|
|
*
|
|
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
|
|
@@ -18257,7 +18329,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru
|
|
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":203
|
|
+ /* "View.MemoryView":204
|
|
*
|
|
* if flags & PyBUF_FORMAT:
|
|
* info.format = self.format # <<<<<<<<<<<<<<
|
|
@@ -18267,7 +18339,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru
|
|
__pyx_t_4 = __pyx_v_self->format;
|
|
__pyx_v_info->format = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":202
|
|
+ /* "View.MemoryView":203
|
|
* info.readonly = 0
|
|
*
|
|
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
|
|
@@ -18277,7 +18349,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru
|
|
goto __pyx_L5;
|
|
}
|
|
|
|
- /* "View.MemoryView":205
|
|
+ /* "View.MemoryView":206
|
|
* info.format = self.format
|
|
* else:
|
|
* info.format = NULL # <<<<<<<<<<<<<<
|
|
@@ -18289,7 +18361,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru
|
|
}
|
|
__pyx_L5:;
|
|
|
|
- /* "View.MemoryView":207
|
|
+ /* "View.MemoryView":208
|
|
* info.format = NULL
|
|
*
|
|
* info.obj = self # <<<<<<<<<<<<<<
|
|
@@ -18302,7 +18374,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru
|
|
__Pyx_DECREF(__pyx_v_info->obj);
|
|
__pyx_v_info->obj = ((PyObject *)__pyx_v_self);
|
|
|
|
- /* "View.MemoryView":185
|
|
+ /* "View.MemoryView":186
|
|
*
|
|
* @cname('getbuffer')
|
|
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
|
|
@@ -18332,7 +18404,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":211
|
|
+/* "View.MemoryView":212
|
|
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
|
|
*
|
|
* def __dealloc__(array self): # <<<<<<<<<<<<<<
|
|
@@ -18356,7 +18428,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc
|
|
int __pyx_t_1;
|
|
__Pyx_RefNannySetupContext("__dealloc__", 0);
|
|
|
|
- /* "View.MemoryView":212
|
|
+ /* "View.MemoryView":213
|
|
*
|
|
* def __dealloc__(array self):
|
|
* if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
|
|
@@ -18366,7 +18438,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc
|
|
__pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":213
|
|
+ /* "View.MemoryView":214
|
|
* def __dealloc__(array self):
|
|
* if self.callback_free_data != NULL:
|
|
* self.callback_free_data(self.data) # <<<<<<<<<<<<<<
|
|
@@ -18375,7 +18447,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc
|
|
*/
|
|
__pyx_v_self->callback_free_data(__pyx_v_self->data);
|
|
|
|
- /* "View.MemoryView":212
|
|
+ /* "View.MemoryView":213
|
|
*
|
|
* def __dealloc__(array self):
|
|
* if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
|
|
@@ -18385,7 +18457,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
- /* "View.MemoryView":214
|
|
+ /* "View.MemoryView":215
|
|
* if self.callback_free_data != NULL:
|
|
* self.callback_free_data(self.data)
|
|
* elif self.free_data: # <<<<<<<<<<<<<<
|
|
@@ -18395,7 +18467,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc
|
|
__pyx_t_1 = (__pyx_v_self->free_data != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":215
|
|
+ /* "View.MemoryView":216
|
|
* self.callback_free_data(self.data)
|
|
* elif self.free_data:
|
|
* if self.dtype_is_object: # <<<<<<<<<<<<<<
|
|
@@ -18405,7 +18477,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc
|
|
__pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":216
|
|
+ /* "View.MemoryView":217
|
|
* elif self.free_data:
|
|
* if self.dtype_is_object:
|
|
* refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
|
|
@@ -18414,7 +18486,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc
|
|
*/
|
|
__pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
|
|
|
|
- /* "View.MemoryView":215
|
|
+ /* "View.MemoryView":216
|
|
* self.callback_free_data(self.data)
|
|
* elif self.free_data:
|
|
* if self.dtype_is_object: # <<<<<<<<<<<<<<
|
|
@@ -18423,7 +18495,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":218
|
|
+ /* "View.MemoryView":219
|
|
* refcount_objects_in_slice(self.data, self._shape,
|
|
* self._strides, self.ndim, False)
|
|
* free(self.data) # <<<<<<<<<<<<<<
|
|
@@ -18432,7 +18504,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc
|
|
*/
|
|
free(__pyx_v_self->data);
|
|
|
|
- /* "View.MemoryView":214
|
|
+ /* "View.MemoryView":215
|
|
* if self.callback_free_data != NULL:
|
|
* self.callback_free_data(self.data)
|
|
* elif self.free_data: # <<<<<<<<<<<<<<
|
|
@@ -18442,7 +18514,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc
|
|
}
|
|
__pyx_L3:;
|
|
|
|
- /* "View.MemoryView":219
|
|
+ /* "View.MemoryView":220
|
|
* self._strides, self.ndim, False)
|
|
* free(self.data)
|
|
* PyObject_Free(self._shape) # <<<<<<<<<<<<<<
|
|
@@ -18451,7 +18523,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc
|
|
*/
|
|
PyObject_Free(__pyx_v_self->_shape);
|
|
|
|
- /* "View.MemoryView":211
|
|
+ /* "View.MemoryView":212
|
|
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
|
|
*
|
|
* def __dealloc__(array self): # <<<<<<<<<<<<<<
|
|
@@ -18463,7 +18535,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc
|
|
__Pyx_RefNannyFinishContext();
|
|
}
|
|
|
|
-/* "View.MemoryView":222
|
|
+/* "View.MemoryView":223
|
|
*
|
|
* @property
|
|
* def memview(self): # <<<<<<<<<<<<<<
|
|
@@ -18493,7 +18565,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct _
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__get__", 0);
|
|
|
|
- /* "View.MemoryView":223
|
|
+ /* "View.MemoryView":224
|
|
* @property
|
|
* def memview(self):
|
|
* return self.get_memview() # <<<<<<<<<<<<<<
|
|
@@ -18501,13 +18573,13 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct _
|
|
* @cname('get_memview')
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
|
|
+ __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 224, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_r = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":222
|
|
+ /* "View.MemoryView":223
|
|
*
|
|
* @property
|
|
* def memview(self): # <<<<<<<<<<<<<<
|
|
@@ -18526,7 +18598,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct _
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":226
|
|
+/* "View.MemoryView":227
|
|
*
|
|
* @cname('get_memview')
|
|
* cdef get_memview(self): # <<<<<<<<<<<<<<
|
|
@@ -18546,7 +18618,7 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("get_memview", 0);
|
|
|
|
- /* "View.MemoryView":227
|
|
+ /* "View.MemoryView":228
|
|
* @cname('get_memview')
|
|
* cdef get_memview(self):
|
|
* flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
|
|
@@ -18555,7 +18627,7 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
|
|
*/
|
|
__pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
|
|
|
|
- /* "View.MemoryView":228
|
|
+ /* "View.MemoryView":229
|
|
* cdef get_memview(self):
|
|
* flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
|
|
* return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
|
|
@@ -18563,11 +18635,11 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
|
|
* def __len__(self):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 229, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
|
|
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 229, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_INCREF(((PyObject *)__pyx_v_self));
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
|
|
@@ -18578,14 +18650,14 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
|
|
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
|
|
__pyx_t_1 = 0;
|
|
__pyx_t_2 = 0;
|
|
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 229, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":226
|
|
+ /* "View.MemoryView":227
|
|
*
|
|
* @cname('get_memview')
|
|
* cdef get_memview(self): # <<<<<<<<<<<<<<
|
|
@@ -18606,7 +18678,7 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":230
|
|
+/* "View.MemoryView":231
|
|
* return memoryview(self, flags, self.dtype_is_object)
|
|
*
|
|
* def __len__(self): # <<<<<<<<<<<<<<
|
|
@@ -18632,7 +18704,7 @@ static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(str
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__len__", 0);
|
|
|
|
- /* "View.MemoryView":231
|
|
+ /* "View.MemoryView":232
|
|
*
|
|
* def __len__(self):
|
|
* return self._shape[0] # <<<<<<<<<<<<<<
|
|
@@ -18642,7 +18714,7 @@ static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(str
|
|
__pyx_r = (__pyx_v_self->_shape[0]);
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":230
|
|
+ /* "View.MemoryView":231
|
|
* return memoryview(self, flags, self.dtype_is_object)
|
|
*
|
|
* def __len__(self): # <<<<<<<<<<<<<<
|
|
@@ -18656,7 +18728,7 @@ static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(str
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":233
|
|
+/* "View.MemoryView":234
|
|
* return self._shape[0]
|
|
*
|
|
* def __getattr__(self, attr): # <<<<<<<<<<<<<<
|
|
@@ -18687,7 +18759,7 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__getattr__", 0);
|
|
|
|
- /* "View.MemoryView":234
|
|
+ /* "View.MemoryView":235
|
|
*
|
|
* def __getattr__(self, attr):
|
|
* return getattr(self.memview, attr) # <<<<<<<<<<<<<<
|
|
@@ -18695,16 +18767,16 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
|
|
* def __getitem__(self, item):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 235, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":233
|
|
+ /* "View.MemoryView":234
|
|
* return self._shape[0]
|
|
*
|
|
* def __getattr__(self, attr): # <<<<<<<<<<<<<<
|
|
@@ -18724,7 +18796,7 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":236
|
|
+/* "View.MemoryView":237
|
|
* return getattr(self.memview, attr)
|
|
*
|
|
* def __getitem__(self, item): # <<<<<<<<<<<<<<
|
|
@@ -18755,7 +18827,7 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__getitem__", 0);
|
|
|
|
- /* "View.MemoryView":237
|
|
+ /* "View.MemoryView":238
|
|
*
|
|
* def __getitem__(self, item):
|
|
* return self.memview[item] # <<<<<<<<<<<<<<
|
|
@@ -18763,16 +18835,16 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__
|
|
* def __setitem__(self, item, value):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 238, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 238, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":236
|
|
+ /* "View.MemoryView":237
|
|
* return getattr(self.memview, attr)
|
|
*
|
|
* def __getitem__(self, item): # <<<<<<<<<<<<<<
|
|
@@ -18792,7 +18864,7 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":239
|
|
+/* "View.MemoryView":240
|
|
* return self.memview[item]
|
|
*
|
|
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
|
|
@@ -18822,19 +18894,19 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struc
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__setitem__", 0);
|
|
|
|
- /* "View.MemoryView":240
|
|
+ /* "View.MemoryView":241
|
|
*
|
|
* def __setitem__(self, item, value):
|
|
* self.memview[item] = value # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
- if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
|
|
+ if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 241, __pyx_L1_error)
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
|
|
- /* "View.MemoryView":239
|
|
+ /* "View.MemoryView":240
|
|
* return self.memview[item]
|
|
*
|
|
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
|
|
@@ -18967,7 +19039,7 @@ static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":244
|
|
+/* "View.MemoryView":245
|
|
*
|
|
* @cname("__pyx_array_new")
|
|
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
|
|
@@ -18989,7 +19061,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("array_cwrapper", 0);
|
|
|
|
- /* "View.MemoryView":248
|
|
+ /* "View.MemoryView":249
|
|
* cdef array result
|
|
*
|
|
* if buf == NULL: # <<<<<<<<<<<<<<
|
|
@@ -18999,20 +19071,20 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
|
|
__pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":249
|
|
+ /* "View.MemoryView":250
|
|
*
|
|
* if buf == NULL:
|
|
* result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
|
|
* else:
|
|
* result = array(shape, itemsize, format, mode.decode('ASCII'),
|
|
*/
|
|
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
|
|
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 250, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
|
|
+ __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 250, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
|
|
+ __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
|
|
+ __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 250, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__Pyx_INCREF(__pyx_v_shape);
|
|
__Pyx_GIVEREF(__pyx_v_shape);
|
|
@@ -19026,13 +19098,13 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
|
|
__pyx_t_2 = 0;
|
|
__pyx_t_3 = 0;
|
|
__pyx_t_4 = 0;
|
|
- __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
|
|
+ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
__pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
|
|
__pyx_t_4 = 0;
|
|
|
|
- /* "View.MemoryView":248
|
|
+ /* "View.MemoryView":249
|
|
* cdef array result
|
|
*
|
|
* if buf == NULL: # <<<<<<<<<<<<<<
|
|
@@ -19042,7 +19114,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
- /* "View.MemoryView":251
|
|
+ /* "View.MemoryView":252
|
|
* result = array(shape, itemsize, format, mode.decode('ASCII'))
|
|
* else:
|
|
* result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
|
|
@@ -19050,13 +19122,13 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
|
|
* result.data = buf
|
|
*/
|
|
/*else*/ {
|
|
- __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
|
|
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 252, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
|
|
+ __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 252, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
- __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
|
|
+ __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
|
|
+ __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_INCREF(__pyx_v_shape);
|
|
__Pyx_GIVEREF(__pyx_v_shape);
|
|
@@ -19071,32 +19143,32 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
|
|
__pyx_t_5 = 0;
|
|
__pyx_t_3 = 0;
|
|
|
|
- /* "View.MemoryView":252
|
|
+ /* "View.MemoryView":253
|
|
* else:
|
|
* result = array(shape, itemsize, format, mode.decode('ASCII'),
|
|
* allocate_buffer=False) # <<<<<<<<<<<<<<
|
|
* result.data = buf
|
|
*
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
|
|
+ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 253, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
|
|
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 253, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":251
|
|
+ /* "View.MemoryView":252
|
|
* result = array(shape, itemsize, format, mode.decode('ASCII'))
|
|
* else:
|
|
* result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
|
|
* allocate_buffer=False)
|
|
* result.data = buf
|
|
*/
|
|
- __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
|
|
+ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 252, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
|
|
__pyx_t_5 = 0;
|
|
|
|
- /* "View.MemoryView":253
|
|
+ /* "View.MemoryView":254
|
|
* result = array(shape, itemsize, format, mode.decode('ASCII'),
|
|
* allocate_buffer=False)
|
|
* result.data = buf # <<<<<<<<<<<<<<
|
|
@@ -19107,7 +19179,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
|
|
}
|
|
__pyx_L3:;
|
|
|
|
- /* "View.MemoryView":255
|
|
+ /* "View.MemoryView":256
|
|
* result.data = buf
|
|
*
|
|
* return result # <<<<<<<<<<<<<<
|
|
@@ -19119,7 +19191,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
|
|
__pyx_r = __pyx_v_result;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":244
|
|
+ /* "View.MemoryView":245
|
|
*
|
|
* @cname("__pyx_array_new")
|
|
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
|
|
@@ -19142,7 +19214,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":281
|
|
+/* "View.MemoryView":282
|
|
* cdef class Enum(object):
|
|
* cdef object name
|
|
* def __init__(self, name): # <<<<<<<<<<<<<<
|
|
@@ -19179,7 +19251,7 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar
|
|
else goto __pyx_L5_argtuple_error;
|
|
}
|
|
if (unlikely(kw_args > 0)) {
|
|
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
|
|
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 282, __pyx_L3_error)
|
|
}
|
|
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
|
|
goto __pyx_L5_argtuple_error;
|
|
@@ -19190,7 +19262,7 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar
|
|
}
|
|
goto __pyx_L4_argument_unpacking_done;
|
|
__pyx_L5_argtuple_error:;
|
|
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
|
|
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 282, __pyx_L3_error)
|
|
__pyx_L3_error:;
|
|
__Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__Pyx_RefNannyFinishContext();
|
|
@@ -19208,7 +19280,7 @@ static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struc
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__init__", 0);
|
|
|
|
- /* "View.MemoryView":282
|
|
+ /* "View.MemoryView":283
|
|
* cdef object name
|
|
* def __init__(self, name):
|
|
* self.name = name # <<<<<<<<<<<<<<
|
|
@@ -19221,7 +19293,7 @@ static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struc
|
|
__Pyx_DECREF(__pyx_v_self->name);
|
|
__pyx_v_self->name = __pyx_v_name;
|
|
|
|
- /* "View.MemoryView":281
|
|
+ /* "View.MemoryView":282
|
|
* cdef class Enum(object):
|
|
* cdef object name
|
|
* def __init__(self, name): # <<<<<<<<<<<<<<
|
|
@@ -19235,7 +19307,7 @@ static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struc
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":283
|
|
+/* "View.MemoryView":284
|
|
* def __init__(self, name):
|
|
* self.name = name
|
|
* def __repr__(self): # <<<<<<<<<<<<<<
|
|
@@ -19261,7 +19333,7 @@ static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr_
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__repr__", 0);
|
|
|
|
- /* "View.MemoryView":284
|
|
+ /* "View.MemoryView":285
|
|
* self.name = name
|
|
* def __repr__(self):
|
|
* return self.name # <<<<<<<<<<<<<<
|
|
@@ -19273,7 +19345,7 @@ static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr_
|
|
__pyx_r = __pyx_v_self->name;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":283
|
|
+ /* "View.MemoryView":284
|
|
* def __init__(self, name):
|
|
* self.name = name
|
|
* def __repr__(self): # <<<<<<<<<<<<<<
|
|
@@ -19581,7 +19653,7 @@ static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_Me
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":298
|
|
+/* "View.MemoryView":299
|
|
*
|
|
* @cname('__pyx_align_pointer')
|
|
* cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
|
|
@@ -19595,7 +19667,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
|
|
void *__pyx_r;
|
|
int __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":300
|
|
+ /* "View.MemoryView":301
|
|
* cdef void *align_pointer(void *memory, size_t alignment) nogil:
|
|
* "Align pointer memory on a given boundary"
|
|
* cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
|
|
@@ -19604,7 +19676,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
|
|
*/
|
|
__pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
|
|
|
|
- /* "View.MemoryView":304
|
|
+ /* "View.MemoryView":305
|
|
*
|
|
* with cython.cdivision(True):
|
|
* offset = aligned_p % alignment # <<<<<<<<<<<<<<
|
|
@@ -19613,7 +19685,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
|
|
*/
|
|
__pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
|
|
|
|
- /* "View.MemoryView":306
|
|
+ /* "View.MemoryView":307
|
|
* offset = aligned_p % alignment
|
|
*
|
|
* if offset > 0: # <<<<<<<<<<<<<<
|
|
@@ -19623,7 +19695,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
|
|
__pyx_t_1 = ((__pyx_v_offset > 0) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":307
|
|
+ /* "View.MemoryView":308
|
|
*
|
|
* if offset > 0:
|
|
* aligned_p += alignment - offset # <<<<<<<<<<<<<<
|
|
@@ -19632,7 +19704,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
|
|
*/
|
|
__pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
|
|
|
|
- /* "View.MemoryView":306
|
|
+ /* "View.MemoryView":307
|
|
* offset = aligned_p % alignment
|
|
*
|
|
* if offset > 0: # <<<<<<<<<<<<<<
|
|
@@ -19641,7 +19713,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":309
|
|
+ /* "View.MemoryView":310
|
|
* aligned_p += alignment - offset
|
|
*
|
|
* return <void *> aligned_p # <<<<<<<<<<<<<<
|
|
@@ -19651,7 +19723,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
|
|
__pyx_r = ((void *)__pyx_v_aligned_p);
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":298
|
|
+ /* "View.MemoryView":299
|
|
*
|
|
* @cname('__pyx_align_pointer')
|
|
* cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
|
|
@@ -19664,7 +19736,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":345
|
|
+/* "View.MemoryView":346
|
|
* cdef __Pyx_TypeInfo *typeinfo
|
|
*
|
|
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
|
|
@@ -19709,7 +19781,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
|
|
case 1:
|
|
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
|
|
else {
|
|
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
|
|
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 346, __pyx_L3_error)
|
|
}
|
|
CYTHON_FALLTHROUGH;
|
|
case 2:
|
|
@@ -19719,7 +19791,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
|
|
}
|
|
}
|
|
if (unlikely(kw_args > 0)) {
|
|
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
|
|
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 346, __pyx_L3_error)
|
|
}
|
|
} else {
|
|
switch (PyTuple_GET_SIZE(__pyx_args)) {
|
|
@@ -19732,16 +19804,16 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
|
|
}
|
|
}
|
|
__pyx_v_obj = values[0];
|
|
- __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
|
|
+ __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L3_error)
|
|
if (values[2]) {
|
|
- __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
|
|
+ __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L3_error)
|
|
} else {
|
|
__pyx_v_dtype_is_object = ((int)0);
|
|
}
|
|
}
|
|
goto __pyx_L4_argument_unpacking_done;
|
|
__pyx_L5_argtuple_error:;
|
|
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
|
|
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 346, __pyx_L3_error)
|
|
__pyx_L3_error:;
|
|
__Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__Pyx_RefNannyFinishContext();
|
|
@@ -19766,7 +19838,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__cinit__", 0);
|
|
|
|
- /* "View.MemoryView":346
|
|
+ /* "View.MemoryView":347
|
|
*
|
|
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
|
|
* self.obj = obj # <<<<<<<<<<<<<<
|
|
@@ -19779,7 +19851,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_
|
|
__Pyx_DECREF(__pyx_v_self->obj);
|
|
__pyx_v_self->obj = __pyx_v_obj;
|
|
|
|
- /* "View.MemoryView":347
|
|
+ /* "View.MemoryView":348
|
|
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
|
|
* self.obj = obj
|
|
* self.flags = flags # <<<<<<<<<<<<<<
|
|
@@ -19788,7 +19860,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_
|
|
*/
|
|
__pyx_v_self->flags = __pyx_v_flags;
|
|
|
|
- /* "View.MemoryView":348
|
|
+ /* "View.MemoryView":349
|
|
* self.obj = obj
|
|
* self.flags = flags
|
|
* if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
|
|
@@ -19808,16 +19880,16 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_
|
|
__pyx_L4_bool_binop_done:;
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":349
|
|
+ /* "View.MemoryView":350
|
|
* self.flags = flags
|
|
* if type(self) is memoryview or obj is not None:
|
|
* __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
|
|
* if <PyObject *> self.view.obj == NULL:
|
|
* (<__pyx_buffer *> &self.view).obj = Py_None
|
|
*/
|
|
- __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
|
|
+ __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 350, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":350
|
|
+ /* "View.MemoryView":351
|
|
* if type(self) is memoryview or obj is not None:
|
|
* __Pyx_GetBuffer(obj, &self.view, flags)
|
|
* if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
|
|
@@ -19827,7 +19899,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_
|
|
__pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":351
|
|
+ /* "View.MemoryView":352
|
|
* __Pyx_GetBuffer(obj, &self.view, flags)
|
|
* if <PyObject *> self.view.obj == NULL:
|
|
* (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
|
|
@@ -19836,16 +19908,16 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_
|
|
*/
|
|
((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
|
|
|
|
- /* "View.MemoryView":352
|
|
+ /* "View.MemoryView":353
|
|
* if <PyObject *> self.view.obj == NULL:
|
|
* (<__pyx_buffer *> &self.view).obj = Py_None
|
|
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
|
|
*
|
|
- * global __pyx_memoryview_thread_locks_used
|
|
+ * if not __PYX_CYTHON_ATOMICS_ENABLED():
|
|
*/
|
|
Py_INCREF(Py_None);
|
|
|
|
- /* "View.MemoryView":350
|
|
+ /* "View.MemoryView":351
|
|
* if type(self) is memoryview or obj is not None:
|
|
* __Pyx_GetBuffer(obj, &self.view, flags)
|
|
* if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
|
|
@@ -19854,7 +19926,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":348
|
|
+ /* "View.MemoryView":349
|
|
* self.obj = obj
|
|
* self.flags = flags
|
|
* if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
|
|
@@ -19864,100 +19936,119 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_
|
|
}
|
|
|
|
/* "View.MemoryView":355
|
|
+ * Py_INCREF(Py_None)
|
|
*
|
|
- * global __pyx_memoryview_thread_locks_used
|
|
- * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
|
|
- * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
|
|
- * __pyx_memoryview_thread_locks_used += 1
|
|
+ * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
|
|
+ * global __pyx_memoryview_thread_locks_used
|
|
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
|
|
*/
|
|
- __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
|
|
+ __pyx_t_1 = ((!(__PYX_CYTHON_ATOMICS_ENABLED() != 0)) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":356
|
|
- * global __pyx_memoryview_thread_locks_used
|
|
- * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
|
|
- * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
|
|
- * __pyx_memoryview_thread_locks_used += 1
|
|
- * if self.lock is NULL:
|
|
- */
|
|
- __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
|
|
-
|
|
/* "View.MemoryView":357
|
|
- * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
|
|
- * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
|
|
- * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
|
|
- * if self.lock is NULL:
|
|
- * self.lock = PyThread_allocate_lock()
|
|
+ * if not __PYX_CYTHON_ATOMICS_ENABLED():
|
|
+ * global __pyx_memoryview_thread_locks_used
|
|
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
|
|
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
|
|
+ * __pyx_memoryview_thread_locks_used += 1
|
|
*/
|
|
- __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
|
|
+ __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":355
|
|
- *
|
|
- * global __pyx_memoryview_thread_locks_used
|
|
- * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
|
|
- * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
|
|
- * __pyx_memoryview_thread_locks_used += 1
|
|
+ /* "View.MemoryView":358
|
|
+ * global __pyx_memoryview_thread_locks_used
|
|
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
|
|
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
|
|
+ * __pyx_memoryview_thread_locks_used += 1
|
|
+ * if self.lock is NULL:
|
|
*/
|
|
- }
|
|
+ __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
|
|
|
|
- /* "View.MemoryView":358
|
|
- * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
|
|
- * __pyx_memoryview_thread_locks_used += 1
|
|
- * if self.lock is NULL: # <<<<<<<<<<<<<<
|
|
- * self.lock = PyThread_allocate_lock()
|
|
+ /* "View.MemoryView":359
|
|
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
|
|
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
|
|
+ * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
|
|
* if self.lock is NULL:
|
|
+ * self.lock = PyThread_allocate_lock()
|
|
*/
|
|
- __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
|
|
- if (__pyx_t_1) {
|
|
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
|
|
|
|
- /* "View.MemoryView":359
|
|
- * __pyx_memoryview_thread_locks_used += 1
|
|
- * if self.lock is NULL:
|
|
- * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
|
|
- * if self.lock is NULL:
|
|
- * raise MemoryError
|
|
+ /* "View.MemoryView":357
|
|
+ * if not __PYX_CYTHON_ATOMICS_ENABLED():
|
|
+ * global __pyx_memoryview_thread_locks_used
|
|
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
|
|
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
|
|
+ * __pyx_memoryview_thread_locks_used += 1
|
|
*/
|
|
- __pyx_v_self->lock = PyThread_allocate_lock();
|
|
+ }
|
|
|
|
/* "View.MemoryView":360
|
|
- * if self.lock is NULL:
|
|
- * self.lock = PyThread_allocate_lock()
|
|
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
|
|
+ * __pyx_memoryview_thread_locks_used += 1
|
|
* if self.lock is NULL: # <<<<<<<<<<<<<<
|
|
- * raise MemoryError
|
|
- *
|
|
+ * self.lock = PyThread_allocate_lock()
|
|
+ * if self.lock is NULL:
|
|
*/
|
|
__pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
|
|
- if (unlikely(__pyx_t_1)) {
|
|
+ if (__pyx_t_1) {
|
|
|
|
/* "View.MemoryView":361
|
|
- * self.lock = PyThread_allocate_lock()
|
|
+ * __pyx_memoryview_thread_locks_used += 1
|
|
* if self.lock is NULL:
|
|
- * raise MemoryError # <<<<<<<<<<<<<<
|
|
+ * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
|
|
+ * if self.lock is NULL:
|
|
+ * raise MemoryError
|
|
+ */
|
|
+ __pyx_v_self->lock = PyThread_allocate_lock();
|
|
+
|
|
+ /* "View.MemoryView":362
|
|
+ * if self.lock is NULL:
|
|
+ * self.lock = PyThread_allocate_lock()
|
|
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
|
|
+ * raise MemoryError
|
|
+ *
|
|
+ */
|
|
+ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
|
|
+ if (unlikely(__pyx_t_1)) {
|
|
+
|
|
+ /* "View.MemoryView":363
|
|
+ * self.lock = PyThread_allocate_lock()
|
|
+ * if self.lock is NULL:
|
|
+ * raise MemoryError # <<<<<<<<<<<<<<
|
|
*
|
|
* if flags & PyBUF_FORMAT:
|
|
*/
|
|
- PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
|
|
+ PyErr_NoMemory(); __PYX_ERR(1, 363, __pyx_L1_error)
|
|
+
|
|
+ /* "View.MemoryView":362
|
|
+ * if self.lock is NULL:
|
|
+ * self.lock = PyThread_allocate_lock()
|
|
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
|
|
+ * raise MemoryError
|
|
+ *
|
|
+ */
|
|
+ }
|
|
|
|
/* "View.MemoryView":360
|
|
- * if self.lock is NULL:
|
|
- * self.lock = PyThread_allocate_lock()
|
|
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
|
|
+ * __pyx_memoryview_thread_locks_used += 1
|
|
* if self.lock is NULL: # <<<<<<<<<<<<<<
|
|
- * raise MemoryError
|
|
- *
|
|
+ * self.lock = PyThread_allocate_lock()
|
|
+ * if self.lock is NULL:
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":358
|
|
- * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
|
|
- * __pyx_memoryview_thread_locks_used += 1
|
|
- * if self.lock is NULL: # <<<<<<<<<<<<<<
|
|
- * self.lock = PyThread_allocate_lock()
|
|
- * if self.lock is NULL:
|
|
+ /* "View.MemoryView":355
|
|
+ * Py_INCREF(Py_None)
|
|
+ *
|
|
+ * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
|
|
+ * global __pyx_memoryview_thread_locks_used
|
|
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":363
|
|
- * raise MemoryError
|
|
+ /* "View.MemoryView":365
|
|
+ * raise MemoryError
|
|
*
|
|
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
|
|
* self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
|
|
@@ -19966,7 +20057,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_
|
|
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":364
|
|
+ /* "View.MemoryView":366
|
|
*
|
|
* if flags & PyBUF_FORMAT:
|
|
* self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
|
|
@@ -19977,24 +20068,24 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_
|
|
if (__pyx_t_2) {
|
|
} else {
|
|
__pyx_t_1 = __pyx_t_2;
|
|
- goto __pyx_L11_bool_binop_done;
|
|
+ goto __pyx_L12_bool_binop_done;
|
|
}
|
|
__pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
|
|
__pyx_t_1 = __pyx_t_2;
|
|
- __pyx_L11_bool_binop_done:;
|
|
+ __pyx_L12_bool_binop_done:;
|
|
__pyx_v_self->dtype_is_object = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":363
|
|
- * raise MemoryError
|
|
+ /* "View.MemoryView":365
|
|
+ * raise MemoryError
|
|
*
|
|
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
|
|
* self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
|
|
* else:
|
|
*/
|
|
- goto __pyx_L10;
|
|
+ goto __pyx_L11;
|
|
}
|
|
|
|
- /* "View.MemoryView":366
|
|
+ /* "View.MemoryView":368
|
|
* self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
|
|
* else:
|
|
* self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
|
|
@@ -20004,9 +20095,9 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_
|
|
/*else*/ {
|
|
__pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
|
|
}
|
|
- __pyx_L10:;
|
|
+ __pyx_L11:;
|
|
|
|
- /* "View.MemoryView":368
|
|
+ /* "View.MemoryView":370
|
|
* self.dtype_is_object = dtype_is_object
|
|
*
|
|
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
|
|
@@ -20015,7 +20106,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_
|
|
*/
|
|
__pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
|
|
|
|
- /* "View.MemoryView":370
|
|
+ /* "View.MemoryView":372
|
|
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
|
|
* <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
|
|
* self.typeinfo = NULL # <<<<<<<<<<<<<<
|
|
@@ -20024,7 +20115,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_
|
|
*/
|
|
__pyx_v_self->typeinfo = NULL;
|
|
|
|
- /* "View.MemoryView":345
|
|
+ /* "View.MemoryView":346
|
|
* cdef __Pyx_TypeInfo *typeinfo
|
|
*
|
|
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
|
|
@@ -20043,7 +20134,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":372
|
|
+/* "View.MemoryView":374
|
|
* self.typeinfo = NULL
|
|
*
|
|
* def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
|
|
@@ -20074,7 +20165,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal
|
|
PyThread_type_lock __pyx_t_7;
|
|
__Pyx_RefNannySetupContext("__dealloc__", 0);
|
|
|
|
- /* "View.MemoryView":373
|
|
+ /* "View.MemoryView":375
|
|
*
|
|
* def __dealloc__(memoryview self):
|
|
* if self.obj is not None: # <<<<<<<<<<<<<<
|
|
@@ -20085,7 +20176,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal
|
|
__pyx_t_2 = (__pyx_t_1 != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":374
|
|
+ /* "View.MemoryView":376
|
|
* def __dealloc__(memoryview self):
|
|
* if self.obj is not None:
|
|
* __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
|
|
@@ -20094,7 +20185,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal
|
|
*/
|
|
__Pyx_ReleaseBuffer((&__pyx_v_self->view));
|
|
|
|
- /* "View.MemoryView":373
|
|
+ /* "View.MemoryView":375
|
|
*
|
|
* def __dealloc__(memoryview self):
|
|
* if self.obj is not None: # <<<<<<<<<<<<<<
|
|
@@ -20104,7 +20195,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
- /* "View.MemoryView":375
|
|
+ /* "View.MemoryView":377
|
|
* if self.obj is not None:
|
|
* __Pyx_ReleaseBuffer(&self.view)
|
|
* elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
|
|
@@ -20114,7 +20205,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal
|
|
__pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":377
|
|
+ /* "View.MemoryView":379
|
|
* elif (<__pyx_buffer *> &self.view).obj == Py_None:
|
|
*
|
|
* (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
|
|
@@ -20123,7 +20214,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal
|
|
*/
|
|
((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
|
|
|
|
- /* "View.MemoryView":378
|
|
+ /* "View.MemoryView":380
|
|
*
|
|
* (<__pyx_buffer *> &self.view).obj = NULL
|
|
* Py_DECREF(Py_None) # <<<<<<<<<<<<<<
|
|
@@ -20132,7 +20223,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal
|
|
*/
|
|
Py_DECREF(Py_None);
|
|
|
|
- /* "View.MemoryView":375
|
|
+ /* "View.MemoryView":377
|
|
* if self.obj is not None:
|
|
* __Pyx_ReleaseBuffer(&self.view)
|
|
* elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
|
|
@@ -20142,7 +20233,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal
|
|
}
|
|
__pyx_L3:;
|
|
|
|
- /* "View.MemoryView":382
|
|
+ /* "View.MemoryView":384
|
|
* cdef int i
|
|
* global __pyx_memoryview_thread_locks_used
|
|
* if self.lock != NULL: # <<<<<<<<<<<<<<
|
|
@@ -20152,7 +20243,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal
|
|
__pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":383
|
|
+ /* "View.MemoryView":385
|
|
* global __pyx_memoryview_thread_locks_used
|
|
* if self.lock != NULL:
|
|
* for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
|
|
@@ -20164,7 +20255,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal
|
|
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
|
|
__pyx_v_i = __pyx_t_5;
|
|
|
|
- /* "View.MemoryView":384
|
|
+ /* "View.MemoryView":386
|
|
* if self.lock != NULL:
|
|
* for i in range(__pyx_memoryview_thread_locks_used):
|
|
* if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
|
|
@@ -20174,7 +20265,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal
|
|
__pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":385
|
|
+ /* "View.MemoryView":387
|
|
* for i in range(__pyx_memoryview_thread_locks_used):
|
|
* if __pyx_memoryview_thread_locks[i] is self.lock:
|
|
* __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
|
|
@@ -20183,7 +20274,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal
|
|
*/
|
|
__pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
|
|
|
|
- /* "View.MemoryView":386
|
|
+ /* "View.MemoryView":388
|
|
* if __pyx_memoryview_thread_locks[i] is self.lock:
|
|
* __pyx_memoryview_thread_locks_used -= 1
|
|
* if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
|
|
@@ -20193,7 +20284,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal
|
|
__pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":388
|
|
+ /* "View.MemoryView":390
|
|
* if i != __pyx_memoryview_thread_locks_used:
|
|
* __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
|
|
* __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
|
|
@@ -20203,7 +20294,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal
|
|
__pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
|
|
__pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
|
|
|
|
- /* "View.MemoryView":387
|
|
+ /* "View.MemoryView":389
|
|
* __pyx_memoryview_thread_locks_used -= 1
|
|
* if i != __pyx_memoryview_thread_locks_used:
|
|
* __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
|
|
@@ -20213,7 +20304,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal
|
|
(__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
|
|
(__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
|
|
|
|
- /* "View.MemoryView":386
|
|
+ /* "View.MemoryView":388
|
|
* if __pyx_memoryview_thread_locks[i] is self.lock:
|
|
* __pyx_memoryview_thread_locks_used -= 1
|
|
* if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
|
|
@@ -20222,7 +20313,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":389
|
|
+ /* "View.MemoryView":391
|
|
* __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
|
|
* __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
|
|
* break # <<<<<<<<<<<<<<
|
|
@@ -20231,7 +20322,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal
|
|
*/
|
|
goto __pyx_L6_break;
|
|
|
|
- /* "View.MemoryView":384
|
|
+ /* "View.MemoryView":386
|
|
* if self.lock != NULL:
|
|
* for i in range(__pyx_memoryview_thread_locks_used):
|
|
* if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
|
|
@@ -20242,7 +20333,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal
|
|
}
|
|
/*else*/ {
|
|
|
|
- /* "View.MemoryView":391
|
|
+ /* "View.MemoryView":393
|
|
* break
|
|
* else:
|
|
* PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
|
|
@@ -20253,7 +20344,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal
|
|
}
|
|
__pyx_L6_break:;
|
|
|
|
- /* "View.MemoryView":382
|
|
+ /* "View.MemoryView":384
|
|
* cdef int i
|
|
* global __pyx_memoryview_thread_locks_used
|
|
* if self.lock != NULL: # <<<<<<<<<<<<<<
|
|
@@ -20262,7 +20353,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":372
|
|
+ /* "View.MemoryView":374
|
|
* self.typeinfo = NULL
|
|
*
|
|
* def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
|
|
@@ -20274,7 +20365,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal
|
|
__Pyx_RefNannyFinishContext();
|
|
}
|
|
|
|
-/* "View.MemoryView":393
|
|
+/* "View.MemoryView":395
|
|
* PyThread_free_lock(self.lock)
|
|
*
|
|
* cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
|
|
@@ -20300,7 +20391,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("get_item_pointer", 0);
|
|
|
|
- /* "View.MemoryView":395
|
|
+ /* "View.MemoryView":397
|
|
* cdef char *get_item_pointer(memoryview self, object index) except NULL:
|
|
* cdef Py_ssize_t dim
|
|
* cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
|
|
@@ -20309,7 +20400,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
|
|
*/
|
|
__pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
|
|
|
|
- /* "View.MemoryView":397
|
|
+ /* "View.MemoryView":399
|
|
* cdef char *itemp = <char *> self.view.buf
|
|
*
|
|
* for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
|
|
@@ -20321,26 +20412,26 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
|
|
__pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
|
|
__pyx_t_4 = NULL;
|
|
} else {
|
|
- __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
|
|
+ __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 399, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
|
|
+ __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error)
|
|
}
|
|
for (;;) {
|
|
if (likely(!__pyx_t_4)) {
|
|
if (likely(PyList_CheckExact(__pyx_t_2))) {
|
|
if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
|
|
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
- __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
|
|
+ __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 399, __pyx_L1_error)
|
|
#else
|
|
- __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
|
|
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
#endif
|
|
} else {
|
|
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
|
|
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
- __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
|
|
+ __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 399, __pyx_L1_error)
|
|
#else
|
|
- __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
|
|
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
#endif
|
|
}
|
|
@@ -20350,7 +20441,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
|
|
PyObject* exc_type = PyErr_Occurred();
|
|
if (exc_type) {
|
|
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
|
|
- else __PYX_ERR(1, 397, __pyx_L1_error)
|
|
+ else __PYX_ERR(1, 399, __pyx_L1_error)
|
|
}
|
|
break;
|
|
}
|
|
@@ -20361,18 +20452,18 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
|
|
__pyx_v_dim = __pyx_t_1;
|
|
__pyx_t_1 = (__pyx_t_1 + 1);
|
|
|
|
- /* "View.MemoryView":398
|
|
+ /* "View.MemoryView":400
|
|
*
|
|
* for dim, idx in enumerate(index):
|
|
* itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
|
|
*
|
|
* return itemp
|
|
*/
|
|
- __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error)
|
|
- __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error)
|
|
+ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 400, __pyx_L1_error)
|
|
+ __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 400, __pyx_L1_error)
|
|
__pyx_v_itemp = __pyx_t_7;
|
|
|
|
- /* "View.MemoryView":397
|
|
+ /* "View.MemoryView":399
|
|
* cdef char *itemp = <char *> self.view.buf
|
|
*
|
|
* for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
|
|
@@ -20382,7 +20473,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
|
|
}
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
|
|
- /* "View.MemoryView":400
|
|
+ /* "View.MemoryView":402
|
|
* itemp = pybuffer_index(&self.view, itemp, idx, dim)
|
|
*
|
|
* return itemp # <<<<<<<<<<<<<<
|
|
@@ -20392,7 +20483,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
|
|
__pyx_r = __pyx_v_itemp;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":393
|
|
+ /* "View.MemoryView":395
|
|
* PyThread_free_lock(self.lock)
|
|
*
|
|
* cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
|
|
@@ -20412,7 +20503,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":403
|
|
+/* "View.MemoryView":405
|
|
*
|
|
*
|
|
* def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
|
|
@@ -20450,7 +20541,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__getitem__", 0);
|
|
|
|
- /* "View.MemoryView":404
|
|
+ /* "View.MemoryView":406
|
|
*
|
|
* def __getitem__(memoryview self, object index):
|
|
* if index is Ellipsis: # <<<<<<<<<<<<<<
|
|
@@ -20461,7 +20552,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_
|
|
__pyx_t_2 = (__pyx_t_1 != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":405
|
|
+ /* "View.MemoryView":407
|
|
* def __getitem__(memoryview self, object index):
|
|
* if index is Ellipsis:
|
|
* return self # <<<<<<<<<<<<<<
|
|
@@ -20473,7 +20564,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_
|
|
__pyx_r = ((PyObject *)__pyx_v_self);
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":404
|
|
+ /* "View.MemoryView":406
|
|
*
|
|
* def __getitem__(memoryview self, object index):
|
|
* if index is Ellipsis: # <<<<<<<<<<<<<<
|
|
@@ -20482,14 +20573,14 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":407
|
|
+ /* "View.MemoryView":409
|
|
* return self
|
|
*
|
|
* have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef char *itemp
|
|
*/
|
|
- __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
|
|
+ __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
if (likely(__pyx_t_3 != Py_None)) {
|
|
PyObject* sequence = __pyx_t_3;
|
|
@@ -20497,7 +20588,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_
|
|
if (unlikely(size != 2)) {
|
|
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
|
|
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
|
|
- __PYX_ERR(1, 407, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 409, __pyx_L1_error)
|
|
}
|
|
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
|
|
@@ -20505,31 +20596,31 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_
|
|
__Pyx_INCREF(__pyx_t_4);
|
|
__Pyx_INCREF(__pyx_t_5);
|
|
#else
|
|
- __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
|
|
+ __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 409, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
|
|
+ __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 409, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
#endif
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
} else {
|
|
- __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
|
|
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __pyx_L1_error)
|
|
}
|
|
__pyx_v_have_slices = __pyx_t_4;
|
|
__pyx_t_4 = 0;
|
|
__pyx_v_indices = __pyx_t_5;
|
|
__pyx_t_5 = 0;
|
|
|
|
- /* "View.MemoryView":410
|
|
+ /* "View.MemoryView":412
|
|
*
|
|
* cdef char *itemp
|
|
* if have_slices: # <<<<<<<<<<<<<<
|
|
* return memview_slice(self, indices)
|
|
* else:
|
|
*/
|
|
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 412, __pyx_L1_error)
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":411
|
|
+ /* "View.MemoryView":413
|
|
* cdef char *itemp
|
|
* if have_slices:
|
|
* return memview_slice(self, indices) # <<<<<<<<<<<<<<
|
|
@@ -20537,13 +20628,13 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_
|
|
* itemp = self.get_item_pointer(indices)
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
|
|
+ __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 413, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__pyx_r = __pyx_t_3;
|
|
__pyx_t_3 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":410
|
|
+ /* "View.MemoryView":412
|
|
*
|
|
* cdef char *itemp
|
|
* if have_slices: # <<<<<<<<<<<<<<
|
|
@@ -20552,7 +20643,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":413
|
|
+ /* "View.MemoryView":415
|
|
* return memview_slice(self, indices)
|
|
* else:
|
|
* itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
|
|
@@ -20560,10 +20651,10 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_
|
|
*
|
|
*/
|
|
/*else*/ {
|
|
- __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error)
|
|
+ __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 415, __pyx_L1_error)
|
|
__pyx_v_itemp = __pyx_t_6;
|
|
|
|
- /* "View.MemoryView":414
|
|
+ /* "View.MemoryView":416
|
|
* else:
|
|
* itemp = self.get_item_pointer(indices)
|
|
* return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
|
|
@@ -20571,14 +20662,14 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_
|
|
* def __setitem__(memoryview self, object index, object value):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error)
|
|
+ __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__pyx_r = __pyx_t_3;
|
|
__pyx_t_3 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
|
|
- /* "View.MemoryView":403
|
|
+ /* "View.MemoryView":405
|
|
*
|
|
*
|
|
* def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
|
|
@@ -20601,7 +20692,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":416
|
|
+/* "View.MemoryView":418
|
|
* return self.convert_item_to_object(itemp)
|
|
*
|
|
* def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
|
|
@@ -20637,7 +20728,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit
|
|
__Pyx_RefNannySetupContext("__setitem__", 0);
|
|
__Pyx_INCREF(__pyx_v_index);
|
|
|
|
- /* "View.MemoryView":417
|
|
+ /* "View.MemoryView":419
|
|
*
|
|
* def __setitem__(memoryview self, object index, object value):
|
|
* if self.view.readonly: # <<<<<<<<<<<<<<
|
|
@@ -20647,20 +20738,20 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit
|
|
__pyx_t_1 = (__pyx_v_self->view.readonly != 0);
|
|
if (unlikely(__pyx_t_1)) {
|
|
|
|
- /* "View.MemoryView":418
|
|
+ /* "View.MemoryView":420
|
|
* def __setitem__(memoryview self, object index, object value):
|
|
* if self.view.readonly:
|
|
* raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
|
|
*
|
|
* have_slices, index = _unellipsify(index, self.view.ndim)
|
|
*/
|
|
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __PYX_ERR(1, 418, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 420, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":417
|
|
+ /* "View.MemoryView":419
|
|
*
|
|
* def __setitem__(memoryview self, object index, object value):
|
|
* if self.view.readonly: # <<<<<<<<<<<<<<
|
|
@@ -20669,14 +20760,14 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":420
|
|
+ /* "View.MemoryView":422
|
|
* raise TypeError("Cannot assign to read-only memoryview")
|
|
*
|
|
* have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
|
|
*
|
|
* if have_slices:
|
|
*/
|
|
- __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
|
|
+ __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 422, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
if (likely(__pyx_t_2 != Py_None)) {
|
|
PyObject* sequence = __pyx_t_2;
|
|
@@ -20684,7 +20775,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit
|
|
if (unlikely(size != 2)) {
|
|
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
|
|
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
|
|
- __PYX_ERR(1, 420, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 422, __pyx_L1_error)
|
|
}
|
|
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
|
|
@@ -20692,67 +20783,67 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit
|
|
__Pyx_INCREF(__pyx_t_3);
|
|
__Pyx_INCREF(__pyx_t_4);
|
|
#else
|
|
- __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
|
|
+ __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 422, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
|
|
+ __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 422, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
#endif
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
} else {
|
|
- __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
|
|
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 422, __pyx_L1_error)
|
|
}
|
|
__pyx_v_have_slices = __pyx_t_3;
|
|
__pyx_t_3 = 0;
|
|
__Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
|
|
__pyx_t_4 = 0;
|
|
|
|
- /* "View.MemoryView":422
|
|
+ /* "View.MemoryView":424
|
|
* have_slices, index = _unellipsify(index, self.view.ndim)
|
|
*
|
|
* if have_slices: # <<<<<<<<<<<<<<
|
|
* obj = self.is_slice(value)
|
|
* if obj:
|
|
*/
|
|
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":423
|
|
+ /* "View.MemoryView":425
|
|
*
|
|
* if have_slices:
|
|
* obj = self.is_slice(value) # <<<<<<<<<<<<<<
|
|
* if obj:
|
|
* self.setitem_slice_assignment(self[index], obj)
|
|
*/
|
|
- __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
|
|
+ __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_v_obj = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
|
|
- /* "View.MemoryView":424
|
|
+ /* "View.MemoryView":426
|
|
* if have_slices:
|
|
* obj = self.is_slice(value)
|
|
* if obj: # <<<<<<<<<<<<<<
|
|
* self.setitem_slice_assignment(self[index], obj)
|
|
* else:
|
|
*/
|
|
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 426, __pyx_L1_error)
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":425
|
|
+ /* "View.MemoryView":427
|
|
* obj = self.is_slice(value)
|
|
* if obj:
|
|
* self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
|
|
* else:
|
|
* self.setitem_slice_assign_scalar(self[index], value)
|
|
*/
|
|
- __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error)
|
|
+ __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __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;
|
|
|
|
- /* "View.MemoryView":424
|
|
+ /* "View.MemoryView":426
|
|
* if have_slices:
|
|
* obj = self.is_slice(value)
|
|
* if obj: # <<<<<<<<<<<<<<
|
|
@@ -20762,7 +20853,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit
|
|
goto __pyx_L5;
|
|
}
|
|
|
|
- /* "View.MemoryView":427
|
|
+ /* "View.MemoryView":429
|
|
* self.setitem_slice_assignment(self[index], obj)
|
|
* else:
|
|
* self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
|
|
@@ -20770,17 +20861,17 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit
|
|
* self.setitem_indexed(index, value)
|
|
*/
|
|
/*else*/ {
|
|
- __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
|
|
+ __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 429, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
- if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
|
|
- __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
|
|
+ if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 429, __pyx_L1_error)
|
|
+ __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
}
|
|
__pyx_L5:;
|
|
|
|
- /* "View.MemoryView":422
|
|
+ /* "View.MemoryView":424
|
|
* have_slices, index = _unellipsify(index, self.view.ndim)
|
|
*
|
|
* if have_slices: # <<<<<<<<<<<<<<
|
|
@@ -20790,7 +20881,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit
|
|
goto __pyx_L4;
|
|
}
|
|
|
|
- /* "View.MemoryView":429
|
|
+ /* "View.MemoryView":431
|
|
* self.setitem_slice_assign_scalar(self[index], value)
|
|
* else:
|
|
* self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
|
|
@@ -20798,13 +20889,13 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit
|
|
* cdef is_slice(self, obj):
|
|
*/
|
|
/*else*/ {
|
|
- __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
|
|
+ __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 431, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
}
|
|
__pyx_L4:;
|
|
|
|
- /* "View.MemoryView":416
|
|
+ /* "View.MemoryView":418
|
|
* return self.convert_item_to_object(itemp)
|
|
*
|
|
* def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
|
|
@@ -20829,7 +20920,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":431
|
|
+/* "View.MemoryView":433
|
|
* self.setitem_indexed(index, value)
|
|
*
|
|
* cdef is_slice(self, obj): # <<<<<<<<<<<<<<
|
|
@@ -20855,7 +20946,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
|
|
__Pyx_RefNannySetupContext("is_slice", 0);
|
|
__Pyx_INCREF(__pyx_v_obj);
|
|
|
|
- /* "View.MemoryView":432
|
|
+ /* "View.MemoryView":434
|
|
*
|
|
* cdef is_slice(self, obj):
|
|
* if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
|
|
@@ -20866,7 +20957,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
|
|
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":433
|
|
+ /* "View.MemoryView":435
|
|
* cdef is_slice(self, obj):
|
|
* if not isinstance(obj, memoryview):
|
|
* try: # <<<<<<<<<<<<<<
|
|
@@ -20882,34 +20973,34 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
|
|
__Pyx_XGOTREF(__pyx_t_5);
|
|
/*try:*/ {
|
|
|
|
- /* "View.MemoryView":434
|
|
+ /* "View.MemoryView":436
|
|
* if not isinstance(obj, memoryview):
|
|
* try:
|
|
* obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
|
|
* self.dtype_is_object)
|
|
* except TypeError:
|
|
*/
|
|
- __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error)
|
|
+ __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 436, __pyx_L4_error)
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
|
|
- /* "View.MemoryView":435
|
|
+ /* "View.MemoryView":437
|
|
* try:
|
|
* obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
|
|
* self.dtype_is_object) # <<<<<<<<<<<<<<
|
|
* except TypeError:
|
|
* return None
|
|
*/
|
|
- __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
|
|
+ __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 437, __pyx_L4_error)
|
|
__Pyx_GOTREF(__pyx_t_7);
|
|
|
|
- /* "View.MemoryView":434
|
|
+ /* "View.MemoryView":436
|
|
* if not isinstance(obj, memoryview):
|
|
* try:
|
|
* obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
|
|
* self.dtype_is_object)
|
|
* except TypeError:
|
|
*/
|
|
- __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
|
|
+ __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 436, __pyx_L4_error)
|
|
__Pyx_GOTREF(__pyx_t_8);
|
|
__Pyx_INCREF(__pyx_v_obj);
|
|
__Pyx_GIVEREF(__pyx_v_obj);
|
|
@@ -20920,13 +21011,13 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
|
|
PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
|
|
__pyx_t_6 = 0;
|
|
__pyx_t_7 = 0;
|
|
- __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error)
|
|
+ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 436, __pyx_L4_error)
|
|
__Pyx_GOTREF(__pyx_t_7);
|
|
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
|
|
__Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
|
|
__pyx_t_7 = 0;
|
|
|
|
- /* "View.MemoryView":433
|
|
+ /* "View.MemoryView":435
|
|
* cdef is_slice(self, obj):
|
|
* if not isinstance(obj, memoryview):
|
|
* try: # <<<<<<<<<<<<<<
|
|
@@ -20943,7 +21034,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
|
|
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
|
|
|
|
- /* "View.MemoryView":436
|
|
+ /* "View.MemoryView":438
|
|
* obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
|
|
* self.dtype_is_object)
|
|
* except TypeError: # <<<<<<<<<<<<<<
|
|
@@ -20953,12 +21044,12 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
|
|
__pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
|
|
if (__pyx_t_9) {
|
|
__Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
|
|
+ if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 438, __pyx_L6_except_error)
|
|
__Pyx_GOTREF(__pyx_t_7);
|
|
__Pyx_GOTREF(__pyx_t_8);
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
|
|
- /* "View.MemoryView":437
|
|
+ /* "View.MemoryView":439
|
|
* self.dtype_is_object)
|
|
* except TypeError:
|
|
* return None # <<<<<<<<<<<<<<
|
|
@@ -20975,7 +21066,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
|
|
goto __pyx_L6_except_error;
|
|
__pyx_L6_except_error:;
|
|
|
|
- /* "View.MemoryView":433
|
|
+ /* "View.MemoryView":435
|
|
* cdef is_slice(self, obj):
|
|
* if not isinstance(obj, memoryview):
|
|
* try: # <<<<<<<<<<<<<<
|
|
@@ -20996,7 +21087,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
|
|
__pyx_L9_try_end:;
|
|
}
|
|
|
|
- /* "View.MemoryView":432
|
|
+ /* "View.MemoryView":434
|
|
*
|
|
* cdef is_slice(self, obj):
|
|
* if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
|
|
@@ -21005,7 +21096,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":439
|
|
+ /* "View.MemoryView":441
|
|
* return None
|
|
*
|
|
* return obj # <<<<<<<<<<<<<<
|
|
@@ -21017,7 +21108,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
|
|
__pyx_r = __pyx_v_obj;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":431
|
|
+ /* "View.MemoryView":433
|
|
* self.setitem_indexed(index, value)
|
|
*
|
|
* cdef is_slice(self, obj): # <<<<<<<<<<<<<<
|
|
@@ -21039,7 +21130,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":441
|
|
+/* "View.MemoryView":443
|
|
* return obj
|
|
*
|
|
* cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
|
|
@@ -21063,52 +21154,52 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
|
|
|
|
- /* "View.MemoryView":445
|
|
+ /* "View.MemoryView":447
|
|
* cdef __Pyx_memviewslice src_slice
|
|
*
|
|
* memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
|
|
* get_slice_from_memview(dst, &dst_slice)[0],
|
|
* src.ndim, dst.ndim, self.dtype_is_object)
|
|
*/
|
|
- if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
|
|
- __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
|
|
+ if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 447, __pyx_L1_error)
|
|
+ __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 447, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":446
|
|
+ /* "View.MemoryView":448
|
|
*
|
|
* memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
|
|
* get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
|
|
* src.ndim, dst.ndim, self.dtype_is_object)
|
|
*
|
|
*/
|
|
- if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
|
|
- __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error)
|
|
+ if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 448, __pyx_L1_error)
|
|
+ __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 448, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":447
|
|
+ /* "View.MemoryView":449
|
|
* memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
|
|
* get_slice_from_memview(dst, &dst_slice)[0],
|
|
* src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef setitem_slice_assign_scalar(self, memoryview dst, value):
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
|
|
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 449, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
|
|
+ __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 449, __pyx_L1_error)
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
|
|
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 449, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
|
|
+ __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 449, __pyx_L1_error)
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
- /* "View.MemoryView":445
|
|
+ /* "View.MemoryView":447
|
|
* cdef __Pyx_memviewslice src_slice
|
|
*
|
|
* memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
|
|
* get_slice_from_memview(dst, &dst_slice)[0],
|
|
* src.ndim, dst.ndim, self.dtype_is_object)
|
|
*/
|
|
- __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 445, __pyx_L1_error)
|
|
+ __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 447, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":441
|
|
+ /* "View.MemoryView":443
|
|
* return obj
|
|
*
|
|
* cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
|
|
@@ -21129,7 +21220,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":449
|
|
+/* "View.MemoryView":451
|
|
* src.ndim, dst.ndim, self.dtype_is_object)
|
|
*
|
|
* cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
|
|
@@ -21162,7 +21253,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
|
|
|
|
- /* "View.MemoryView":451
|
|
+ /* "View.MemoryView":453
|
|
* cdef setitem_slice_assign_scalar(self, memoryview dst, value):
|
|
* cdef int array[128]
|
|
* cdef void *tmp = NULL # <<<<<<<<<<<<<<
|
|
@@ -21171,17 +21262,17 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
|
|
*/
|
|
__pyx_v_tmp = NULL;
|
|
|
|
- /* "View.MemoryView":456
|
|
+ /* "View.MemoryView":458
|
|
* cdef __Pyx_memviewslice *dst_slice
|
|
* cdef __Pyx_memviewslice tmp_slice
|
|
* dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
|
|
*
|
|
* if <size_t>self.view.itemsize > sizeof(array):
|
|
*/
|
|
- __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error)
|
|
+ __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 458, __pyx_L1_error)
|
|
__pyx_v_dst_slice = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":458
|
|
+ /* "View.MemoryView":460
|
|
* dst_slice = get_slice_from_memview(dst, &tmp_slice)
|
|
*
|
|
* if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
|
|
@@ -21191,7 +21282,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
|
|
__pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":459
|
|
+ /* "View.MemoryView":461
|
|
*
|
|
* if <size_t>self.view.itemsize > sizeof(array):
|
|
* tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
|
|
@@ -21200,7 +21291,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
|
|
*/
|
|
__pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
|
|
|
|
- /* "View.MemoryView":460
|
|
+ /* "View.MemoryView":462
|
|
* if <size_t>self.view.itemsize > sizeof(array):
|
|
* tmp = PyMem_Malloc(self.view.itemsize)
|
|
* if tmp == NULL: # <<<<<<<<<<<<<<
|
|
@@ -21210,16 +21301,16 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
|
|
__pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
|
|
if (unlikely(__pyx_t_2)) {
|
|
|
|
- /* "View.MemoryView":461
|
|
+ /* "View.MemoryView":463
|
|
* tmp = PyMem_Malloc(self.view.itemsize)
|
|
* if tmp == NULL:
|
|
* raise MemoryError # <<<<<<<<<<<<<<
|
|
* item = tmp
|
|
* else:
|
|
*/
|
|
- PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
|
|
+ PyErr_NoMemory(); __PYX_ERR(1, 463, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":460
|
|
+ /* "View.MemoryView":462
|
|
* if <size_t>self.view.itemsize > sizeof(array):
|
|
* tmp = PyMem_Malloc(self.view.itemsize)
|
|
* if tmp == NULL: # <<<<<<<<<<<<<<
|
|
@@ -21228,7 +21319,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":462
|
|
+ /* "View.MemoryView":464
|
|
* if tmp == NULL:
|
|
* raise MemoryError
|
|
* item = tmp # <<<<<<<<<<<<<<
|
|
@@ -21237,7 +21328,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
|
|
*/
|
|
__pyx_v_item = __pyx_v_tmp;
|
|
|
|
- /* "View.MemoryView":458
|
|
+ /* "View.MemoryView":460
|
|
* dst_slice = get_slice_from_memview(dst, &tmp_slice)
|
|
*
|
|
* if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
|
|
@@ -21247,7 +21338,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
- /* "View.MemoryView":464
|
|
+ /* "View.MemoryView":466
|
|
* item = tmp
|
|
* else:
|
|
* item = <void *> array # <<<<<<<<<<<<<<
|
|
@@ -21259,7 +21350,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
|
|
}
|
|
__pyx_L3:;
|
|
|
|
- /* "View.MemoryView":466
|
|
+ /* "View.MemoryView":468
|
|
* item = <void *> array
|
|
*
|
|
* try: # <<<<<<<<<<<<<<
|
|
@@ -21268,7 +21359,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
|
|
*/
|
|
/*try:*/ {
|
|
|
|
- /* "View.MemoryView":467
|
|
+ /* "View.MemoryView":469
|
|
*
|
|
* try:
|
|
* if self.dtype_is_object: # <<<<<<<<<<<<<<
|
|
@@ -21278,7 +21369,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
|
|
__pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":468
|
|
+ /* "View.MemoryView":470
|
|
* try:
|
|
* if self.dtype_is_object:
|
|
* (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
|
|
@@ -21287,7 +21378,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
|
|
*/
|
|
(((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
|
|
|
|
- /* "View.MemoryView":467
|
|
+ /* "View.MemoryView":469
|
|
*
|
|
* try:
|
|
* if self.dtype_is_object: # <<<<<<<<<<<<<<
|
|
@@ -21297,7 +21388,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
|
|
goto __pyx_L8;
|
|
}
|
|
|
|
- /* "View.MemoryView":470
|
|
+ /* "View.MemoryView":472
|
|
* (<PyObject **> item)[0] = <PyObject *> value
|
|
* else:
|
|
* self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
|
|
@@ -21305,13 +21396,13 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
|
|
*
|
|
*/
|
|
/*else*/ {
|
|
- __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error)
|
|
+ __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 472, __pyx_L6_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
}
|
|
__pyx_L8:;
|
|
|
|
- /* "View.MemoryView":474
|
|
+ /* "View.MemoryView":476
|
|
*
|
|
*
|
|
* if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
|
|
@@ -21321,18 +21412,18 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
|
|
__pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":475
|
|
+ /* "View.MemoryView":477
|
|
*
|
|
* if self.view.suboffsets != NULL:
|
|
* assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
|
|
* slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
|
|
* item, self.dtype_is_object)
|
|
*/
|
|
- __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error)
|
|
+ __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 477, __pyx_L6_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
- /* "View.MemoryView":474
|
|
+ /* "View.MemoryView":476
|
|
*
|
|
*
|
|
* if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
|
|
@@ -21341,7 +21432,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":476
|
|
+ /* "View.MemoryView":478
|
|
* if self.view.suboffsets != NULL:
|
|
* assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
|
|
* slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
|
|
@@ -21351,7 +21442,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
|
|
__pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
|
|
}
|
|
|
|
- /* "View.MemoryView":479
|
|
+ /* "View.MemoryView":481
|
|
* item, self.dtype_is_object)
|
|
* finally:
|
|
* PyMem_Free(tmp) # <<<<<<<<<<<<<<
|
|
@@ -21398,7 +21489,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
|
|
__pyx_L7:;
|
|
}
|
|
|
|
- /* "View.MemoryView":449
|
|
+ /* "View.MemoryView":451
|
|
* src.ndim, dst.ndim, self.dtype_is_object)
|
|
*
|
|
* cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
|
|
@@ -21419,7 +21510,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":481
|
|
+/* "View.MemoryView":483
|
|
* PyMem_Free(tmp)
|
|
*
|
|
* cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
|
|
@@ -21438,28 +21529,28 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("setitem_indexed", 0);
|
|
|
|
- /* "View.MemoryView":482
|
|
+ /* "View.MemoryView":484
|
|
*
|
|
* cdef setitem_indexed(self, index, value):
|
|
* cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
|
|
* self.assign_item_from_object(itemp, value)
|
|
*
|
|
*/
|
|
- __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error)
|
|
+ __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 484, __pyx_L1_error)
|
|
__pyx_v_itemp = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":483
|
|
+ /* "View.MemoryView":485
|
|
* cdef setitem_indexed(self, index, value):
|
|
* cdef char *itemp = self.get_item_pointer(index)
|
|
* self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef convert_item_to_object(self, char *itemp):
|
|
*/
|
|
- __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error)
|
|
+ __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 485, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
|
|
- /* "View.MemoryView":481
|
|
+ /* "View.MemoryView":483
|
|
* PyMem_Free(tmp)
|
|
*
|
|
* cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
|
|
@@ -21480,7 +21571,7 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":485
|
|
+/* "View.MemoryView":487
|
|
* self.assign_item_from_object(itemp, value)
|
|
*
|
|
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
|
|
@@ -21510,31 +21601,31 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("convert_item_to_object", 0);
|
|
|
|
- /* "View.MemoryView":488
|
|
+ /* "View.MemoryView":490
|
|
* """Only used if instantiated manually by the user, or if Cython doesn't
|
|
* know how to convert the type"""
|
|
* import struct # <<<<<<<<<<<<<<
|
|
* cdef bytes bytesitem
|
|
*
|
|
*/
|
|
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 490, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_v_struct = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
|
|
- /* "View.MemoryView":491
|
|
+ /* "View.MemoryView":493
|
|
* cdef bytes bytesitem
|
|
*
|
|
* bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
|
|
* try:
|
|
* result = struct.unpack(self.view.format, bytesitem)
|
|
*/
|
|
- __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
|
|
__pyx_t_1 = 0;
|
|
|
|
- /* "View.MemoryView":492
|
|
+ /* "View.MemoryView":494
|
|
*
|
|
* bytesitem = itemp[:self.view.itemsize]
|
|
* try: # <<<<<<<<<<<<<<
|
|
@@ -21550,16 +21641,16 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
|
|
__Pyx_XGOTREF(__pyx_t_4);
|
|
/*try:*/ {
|
|
|
|
- /* "View.MemoryView":493
|
|
+ /* "View.MemoryView":495
|
|
* bytesitem = itemp[:self.view.itemsize]
|
|
* try:
|
|
* result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
|
|
* except struct.error:
|
|
* raise ValueError("Unable to convert item to object")
|
|
*/
|
|
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error)
|
|
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 495, __pyx_L3_error)
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
- __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
|
|
+ __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L3_error)
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
__pyx_t_7 = NULL;
|
|
__pyx_t_8 = 0;
|
|
@@ -21576,7 +21667,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
|
|
#if CYTHON_FAST_PYCALL
|
|
if (PyFunction_Check(__pyx_t_5)) {
|
|
PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
|
|
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
|
|
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
|
|
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
@@ -21585,14 +21676,14 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
|
|
#if CYTHON_FAST_PYCCALL
|
|
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
|
|
PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
|
|
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
|
|
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
|
|
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
} else
|
|
#endif
|
|
{
|
|
- __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
|
|
+ __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 495, __pyx_L3_error)
|
|
__Pyx_GOTREF(__pyx_t_9);
|
|
if (__pyx_t_7) {
|
|
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
|
|
@@ -21603,7 +21694,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
|
|
__Pyx_GIVEREF(__pyx_v_bytesitem);
|
|
PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
|
|
__pyx_t_6 = 0;
|
|
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
|
|
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
}
|
|
@@ -21611,7 +21702,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
|
|
__pyx_v_result = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
|
|
- /* "View.MemoryView":492
|
|
+ /* "View.MemoryView":494
|
|
*
|
|
* bytesitem = itemp[:self.view.itemsize]
|
|
* try: # <<<<<<<<<<<<<<
|
|
@@ -21620,7 +21711,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":497
|
|
+ /* "View.MemoryView":499
|
|
* raise ValueError("Unable to convert item to object")
|
|
* else:
|
|
* if len(self.view.format) == 1: # <<<<<<<<<<<<<<
|
|
@@ -21632,7 +21723,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
|
|
__pyx_t_11 = ((__pyx_t_10 == 1) != 0);
|
|
if (__pyx_t_11) {
|
|
|
|
- /* "View.MemoryView":498
|
|
+ /* "View.MemoryView":500
|
|
* else:
|
|
* if len(self.view.format) == 1:
|
|
* return result[0] # <<<<<<<<<<<<<<
|
|
@@ -21640,13 +21731,13 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
|
|
*
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error)
|
|
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 500, __pyx_L5_except_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_r = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
goto __pyx_L6_except_return;
|
|
|
|
- /* "View.MemoryView":497
|
|
+ /* "View.MemoryView":499
|
|
* raise ValueError("Unable to convert item to object")
|
|
* else:
|
|
* if len(self.view.format) == 1: # <<<<<<<<<<<<<<
|
|
@@ -21655,7 +21746,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":499
|
|
+ /* "View.MemoryView":501
|
|
* if len(self.view.format) == 1:
|
|
* return result[0]
|
|
* return result # <<<<<<<<<<<<<<
|
|
@@ -21674,7 +21765,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
|
|
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
|
|
- /* "View.MemoryView":494
|
|
+ /* "View.MemoryView":496
|
|
* try:
|
|
* result = struct.unpack(self.view.format, bytesitem)
|
|
* except struct.error: # <<<<<<<<<<<<<<
|
|
@@ -21682,7 +21773,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
|
|
* else:
|
|
*/
|
|
__Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
|
|
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error)
|
|
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 496, __pyx_L5_except_error)
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
__pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
|
|
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
@@ -21690,28 +21781,28 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
|
|
__pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
|
|
if (__pyx_t_8) {
|
|
__Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
|
|
+ if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 496, __pyx_L5_except_error)
|
|
__Pyx_GOTREF(__pyx_t_9);
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
|
|
- /* "View.MemoryView":495
|
|
+ /* "View.MemoryView":497
|
|
* result = struct.unpack(self.view.format, bytesitem)
|
|
* except struct.error:
|
|
* raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
|
|
* else:
|
|
* if len(self.view.format) == 1:
|
|
*/
|
|
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
|
|
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 497, __pyx_L5_except_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(1, 495, __pyx_L5_except_error)
|
|
+ __PYX_ERR(1, 497, __pyx_L5_except_error)
|
|
}
|
|
goto __pyx_L5_except_error;
|
|
__pyx_L5_except_error:;
|
|
|
|
- /* "View.MemoryView":492
|
|
+ /* "View.MemoryView":494
|
|
*
|
|
* bytesitem = itemp[:self.view.itemsize]
|
|
* try: # <<<<<<<<<<<<<<
|
|
@@ -21731,7 +21822,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
|
|
goto __pyx_L0;
|
|
}
|
|
|
|
- /* "View.MemoryView":485
|
|
+ /* "View.MemoryView":487
|
|
* self.assign_item_from_object(itemp, value)
|
|
*
|
|
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
|
|
@@ -21757,7 +21848,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":501
|
|
+/* "View.MemoryView":503
|
|
* return result
|
|
*
|
|
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
|
|
@@ -21791,19 +21882,19 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("assign_item_from_object", 0);
|
|
|
|
- /* "View.MemoryView":504
|
|
+ /* "View.MemoryView":506
|
|
* """Only used if instantiated manually by the user, or if Cython doesn't
|
|
* know how to convert the type"""
|
|
* import struct # <<<<<<<<<<<<<<
|
|
* cdef char c
|
|
* cdef bytes bytesvalue
|
|
*/
|
|
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 506, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_v_struct = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
|
|
- /* "View.MemoryView":509
|
|
+ /* "View.MemoryView":511
|
|
* cdef Py_ssize_t i
|
|
*
|
|
* if isinstance(value, tuple): # <<<<<<<<<<<<<<
|
|
@@ -21814,37 +21905,37 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
|
|
__pyx_t_3 = (__pyx_t_2 != 0);
|
|
if (__pyx_t_3) {
|
|
|
|
- /* "View.MemoryView":510
|
|
+ /* "View.MemoryView":512
|
|
*
|
|
* if isinstance(value, tuple):
|
|
* bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
|
|
* else:
|
|
* bytesvalue = struct.pack(self.view.format, value)
|
|
*/
|
|
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
|
|
+ __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
|
|
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 512, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__Pyx_GIVEREF(__pyx_t_4);
|
|
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
|
|
__pyx_t_4 = 0;
|
|
- __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
|
|
+ __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
|
|
+ __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __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;
|
|
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
|
|
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
- if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error)
|
|
+ if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
|
|
__pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
|
|
__pyx_t_4 = 0;
|
|
|
|
- /* "View.MemoryView":509
|
|
+ /* "View.MemoryView":511
|
|
* cdef Py_ssize_t i
|
|
*
|
|
* if isinstance(value, tuple): # <<<<<<<<<<<<<<
|
|
@@ -21854,7 +21945,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
- /* "View.MemoryView":512
|
|
+ /* "View.MemoryView":514
|
|
* bytesvalue = struct.pack(self.view.format, *value)
|
|
* else:
|
|
* bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
|
|
@@ -21862,9 +21953,9 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
|
|
* for i, c in enumerate(bytesvalue):
|
|
*/
|
|
/*else*/ {
|
|
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
|
|
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 514, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
- __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 514, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_5 = NULL;
|
|
__pyx_t_7 = 0;
|
|
@@ -21881,7 +21972,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
|
|
#if CYTHON_FAST_PYCALL
|
|
if (PyFunction_Check(__pyx_t_6)) {
|
|
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
|
|
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
|
|
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
|
|
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
@@ -21890,14 +21981,14 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
|
|
#if CYTHON_FAST_PYCCALL
|
|
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
|
|
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
|
|
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
|
|
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
|
|
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
} else
|
|
#endif
|
|
{
|
|
- __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
|
|
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 514, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_8);
|
|
if (__pyx_t_5) {
|
|
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
|
|
@@ -21908,18 +21999,18 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
|
|
__Pyx_GIVEREF(__pyx_v_value);
|
|
PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
|
|
__pyx_t_1 = 0;
|
|
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
|
|
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
- if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
|
|
+ if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 514, __pyx_L1_error)
|
|
__pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
|
|
__pyx_t_4 = 0;
|
|
}
|
|
__pyx_L3:;
|
|
|
|
- /* "View.MemoryView":514
|
|
+ /* "View.MemoryView":516
|
|
* bytesvalue = struct.pack(self.view.format, value)
|
|
*
|
|
* for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
|
|
@@ -21929,7 +22020,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
|
|
__pyx_t_9 = 0;
|
|
if (unlikely(__pyx_v_bytesvalue == Py_None)) {
|
|
PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
|
|
- __PYX_ERR(1, 514, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 516, __pyx_L1_error)
|
|
}
|
|
__Pyx_INCREF(__pyx_v_bytesvalue);
|
|
__pyx_t_10 = __pyx_v_bytesvalue;
|
|
@@ -21939,7 +22030,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
|
|
__pyx_t_11 = __pyx_t_14;
|
|
__pyx_v_c = (__pyx_t_11[0]);
|
|
|
|
- /* "View.MemoryView":515
|
|
+ /* "View.MemoryView":517
|
|
*
|
|
* for i, c in enumerate(bytesvalue):
|
|
* itemp[i] = c # <<<<<<<<<<<<<<
|
|
@@ -21948,7 +22039,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
|
|
*/
|
|
__pyx_v_i = __pyx_t_9;
|
|
|
|
- /* "View.MemoryView":514
|
|
+ /* "View.MemoryView":516
|
|
* bytesvalue = struct.pack(self.view.format, value)
|
|
*
|
|
* for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
|
|
@@ -21957,7 +22048,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
|
|
*/
|
|
__pyx_t_9 = (__pyx_t_9 + 1);
|
|
|
|
- /* "View.MemoryView":515
|
|
+ /* "View.MemoryView":517
|
|
*
|
|
* for i, c in enumerate(bytesvalue):
|
|
* itemp[i] = c # <<<<<<<<<<<<<<
|
|
@@ -21968,7 +22059,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
|
|
}
|
|
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
|
|
- /* "View.MemoryView":501
|
|
+ /* "View.MemoryView":503
|
|
* return result
|
|
*
|
|
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
|
|
@@ -21996,7 +22087,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":518
|
|
+/* "View.MemoryView":520
|
|
*
|
|
* @cname('getbuffer')
|
|
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
|
|
@@ -22039,7 +22130,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
__pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
|
|
__Pyx_GIVEREF(__pyx_v_info->obj);
|
|
|
|
- /* "View.MemoryView":519
|
|
+ /* "View.MemoryView":521
|
|
* @cname('getbuffer')
|
|
* def __getbuffer__(self, Py_buffer *info, int flags):
|
|
* if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
|
|
@@ -22057,20 +22148,20 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
__pyx_L4_bool_binop_done:;
|
|
if (unlikely(__pyx_t_1)) {
|
|
|
|
- /* "View.MemoryView":520
|
|
+ /* "View.MemoryView":522
|
|
* def __getbuffer__(self, Py_buffer *info, int flags):
|
|
* if flags & PyBUF_WRITABLE and self.view.readonly:
|
|
* raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
|
|
*
|
|
* if flags & PyBUF_ND:
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
|
|
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 522, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __PYX_ERR(1, 520, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 522, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":519
|
|
+ /* "View.MemoryView":521
|
|
* @cname('getbuffer')
|
|
* def __getbuffer__(self, Py_buffer *info, int flags):
|
|
* if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
|
|
@@ -22079,7 +22170,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":522
|
|
+ /* "View.MemoryView":524
|
|
* raise ValueError("Cannot create writable memory view from read-only memoryview")
|
|
*
|
|
* if flags & PyBUF_ND: # <<<<<<<<<<<<<<
|
|
@@ -22089,7 +22180,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
__pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":523
|
|
+ /* "View.MemoryView":525
|
|
*
|
|
* if flags & PyBUF_ND:
|
|
* info.shape = self.view.shape # <<<<<<<<<<<<<<
|
|
@@ -22099,7 +22190,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
__pyx_t_4 = __pyx_v_self->view.shape;
|
|
__pyx_v_info->shape = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":522
|
|
+ /* "View.MemoryView":524
|
|
* raise ValueError("Cannot create writable memory view from read-only memoryview")
|
|
*
|
|
* if flags & PyBUF_ND: # <<<<<<<<<<<<<<
|
|
@@ -22109,7 +22200,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
goto __pyx_L6;
|
|
}
|
|
|
|
- /* "View.MemoryView":525
|
|
+ /* "View.MemoryView":527
|
|
* info.shape = self.view.shape
|
|
* else:
|
|
* info.shape = NULL # <<<<<<<<<<<<<<
|
|
@@ -22121,7 +22212,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
}
|
|
__pyx_L6:;
|
|
|
|
- /* "View.MemoryView":527
|
|
+ /* "View.MemoryView":529
|
|
* info.shape = NULL
|
|
*
|
|
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
|
|
@@ -22131,7 +22222,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
__pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":528
|
|
+ /* "View.MemoryView":530
|
|
*
|
|
* if flags & PyBUF_STRIDES:
|
|
* info.strides = self.view.strides # <<<<<<<<<<<<<<
|
|
@@ -22141,7 +22232,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
__pyx_t_4 = __pyx_v_self->view.strides;
|
|
__pyx_v_info->strides = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":527
|
|
+ /* "View.MemoryView":529
|
|
* info.shape = NULL
|
|
*
|
|
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
|
|
@@ -22151,7 +22242,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
goto __pyx_L7;
|
|
}
|
|
|
|
- /* "View.MemoryView":530
|
|
+ /* "View.MemoryView":532
|
|
* info.strides = self.view.strides
|
|
* else:
|
|
* info.strides = NULL # <<<<<<<<<<<<<<
|
|
@@ -22163,7 +22254,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
}
|
|
__pyx_L7:;
|
|
|
|
- /* "View.MemoryView":532
|
|
+ /* "View.MemoryView":534
|
|
* info.strides = NULL
|
|
*
|
|
* if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
|
|
@@ -22173,7 +22264,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
__pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":533
|
|
+ /* "View.MemoryView":535
|
|
*
|
|
* if flags & PyBUF_INDIRECT:
|
|
* info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
|
|
@@ -22183,7 +22274,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
__pyx_t_4 = __pyx_v_self->view.suboffsets;
|
|
__pyx_v_info->suboffsets = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":532
|
|
+ /* "View.MemoryView":534
|
|
* info.strides = NULL
|
|
*
|
|
* if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
|
|
@@ -22193,7 +22284,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
goto __pyx_L8;
|
|
}
|
|
|
|
- /* "View.MemoryView":535
|
|
+ /* "View.MemoryView":537
|
|
* info.suboffsets = self.view.suboffsets
|
|
* else:
|
|
* info.suboffsets = NULL # <<<<<<<<<<<<<<
|
|
@@ -22205,7 +22296,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
}
|
|
__pyx_L8:;
|
|
|
|
- /* "View.MemoryView":537
|
|
+ /* "View.MemoryView":539
|
|
* info.suboffsets = NULL
|
|
*
|
|
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
|
|
@@ -22215,7 +22306,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":538
|
|
+ /* "View.MemoryView":540
|
|
*
|
|
* if flags & PyBUF_FORMAT:
|
|
* info.format = self.view.format # <<<<<<<<<<<<<<
|
|
@@ -22225,7 +22316,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
__pyx_t_5 = __pyx_v_self->view.format;
|
|
__pyx_v_info->format = __pyx_t_5;
|
|
|
|
- /* "View.MemoryView":537
|
|
+ /* "View.MemoryView":539
|
|
* info.suboffsets = NULL
|
|
*
|
|
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
|
|
@@ -22235,7 +22326,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
goto __pyx_L9;
|
|
}
|
|
|
|
- /* "View.MemoryView":540
|
|
+ /* "View.MemoryView":542
|
|
* info.format = self.view.format
|
|
* else:
|
|
* info.format = NULL # <<<<<<<<<<<<<<
|
|
@@ -22247,7 +22338,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
}
|
|
__pyx_L9:;
|
|
|
|
- /* "View.MemoryView":542
|
|
+ /* "View.MemoryView":544
|
|
* info.format = NULL
|
|
*
|
|
* info.buf = self.view.buf # <<<<<<<<<<<<<<
|
|
@@ -22257,7 +22348,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
__pyx_t_6 = __pyx_v_self->view.buf;
|
|
__pyx_v_info->buf = __pyx_t_6;
|
|
|
|
- /* "View.MemoryView":543
|
|
+ /* "View.MemoryView":545
|
|
*
|
|
* info.buf = self.view.buf
|
|
* info.ndim = self.view.ndim # <<<<<<<<<<<<<<
|
|
@@ -22267,7 +22358,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
__pyx_t_7 = __pyx_v_self->view.ndim;
|
|
__pyx_v_info->ndim = __pyx_t_7;
|
|
|
|
- /* "View.MemoryView":544
|
|
+ /* "View.MemoryView":546
|
|
* info.buf = self.view.buf
|
|
* info.ndim = self.view.ndim
|
|
* info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
|
|
@@ -22277,7 +22368,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
__pyx_t_8 = __pyx_v_self->view.itemsize;
|
|
__pyx_v_info->itemsize = __pyx_t_8;
|
|
|
|
- /* "View.MemoryView":545
|
|
+ /* "View.MemoryView":547
|
|
* info.ndim = self.view.ndim
|
|
* info.itemsize = self.view.itemsize
|
|
* info.len = self.view.len # <<<<<<<<<<<<<<
|
|
@@ -22287,7 +22378,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
__pyx_t_8 = __pyx_v_self->view.len;
|
|
__pyx_v_info->len = __pyx_t_8;
|
|
|
|
- /* "View.MemoryView":546
|
|
+ /* "View.MemoryView":548
|
|
* info.itemsize = self.view.itemsize
|
|
* info.len = self.view.len
|
|
* info.readonly = self.view.readonly # <<<<<<<<<<<<<<
|
|
@@ -22297,7 +22388,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
__pyx_t_1 = __pyx_v_self->view.readonly;
|
|
__pyx_v_info->readonly = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":547
|
|
+ /* "View.MemoryView":549
|
|
* info.len = self.view.len
|
|
* info.readonly = self.view.readonly
|
|
* info.obj = self # <<<<<<<<<<<<<<
|
|
@@ -22310,7 +22401,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
__Pyx_DECREF(__pyx_v_info->obj);
|
|
__pyx_v_info->obj = ((PyObject *)__pyx_v_self);
|
|
|
|
- /* "View.MemoryView":518
|
|
+ /* "View.MemoryView":520
|
|
*
|
|
* @cname('getbuffer')
|
|
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
|
|
@@ -22340,7 +22431,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":553
|
|
+/* "View.MemoryView":555
|
|
*
|
|
* @property
|
|
* def T(self): # <<<<<<<<<<<<<<
|
|
@@ -22372,29 +22463,29 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__get__", 0);
|
|
|
|
- /* "View.MemoryView":554
|
|
+ /* "View.MemoryView":556
|
|
* @property
|
|
* def T(self):
|
|
* cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
|
|
* transpose_memslice(&result.from_slice)
|
|
* return result
|
|
*/
|
|
- __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
|
|
+ __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
- if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
|
|
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 556, __pyx_L1_error)
|
|
__pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
|
|
__pyx_t_1 = 0;
|
|
|
|
- /* "View.MemoryView":555
|
|
+ /* "View.MemoryView":557
|
|
* def T(self):
|
|
* cdef _memoryviewslice result = memoryview_copy(self)
|
|
* transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
|
|
* return result
|
|
*
|
|
*/
|
|
- __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 555, __pyx_L1_error)
|
|
+ __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 557, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":556
|
|
+ /* "View.MemoryView":558
|
|
* cdef _memoryviewslice result = memoryview_copy(self)
|
|
* transpose_memslice(&result.from_slice)
|
|
* return result # <<<<<<<<<<<<<<
|
|
@@ -22406,7 +22497,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _
|
|
__pyx_r = ((PyObject *)__pyx_v_result);
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":553
|
|
+ /* "View.MemoryView":555
|
|
*
|
|
* @property
|
|
* def T(self): # <<<<<<<<<<<<<<
|
|
@@ -22426,7 +22517,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":559
|
|
+/* "View.MemoryView":561
|
|
*
|
|
* @property
|
|
* def base(self): # <<<<<<<<<<<<<<
|
|
@@ -22452,7 +22543,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struc
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__get__", 0);
|
|
|
|
- /* "View.MemoryView":560
|
|
+ /* "View.MemoryView":562
|
|
* @property
|
|
* def base(self):
|
|
* return self.obj # <<<<<<<<<<<<<<
|
|
@@ -22464,7 +22555,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struc
|
|
__pyx_r = __pyx_v_self->obj;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":559
|
|
+ /* "View.MemoryView":561
|
|
*
|
|
* @property
|
|
* def base(self): # <<<<<<<<<<<<<<
|
|
@@ -22479,7 +22570,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struc
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":563
|
|
+/* "View.MemoryView":565
|
|
*
|
|
* @property
|
|
* def shape(self): # <<<<<<<<<<<<<<
|
|
@@ -22514,7 +22605,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(stru
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__get__", 0);
|
|
|
|
- /* "View.MemoryView":564
|
|
+ /* "View.MemoryView":566
|
|
* @property
|
|
* def shape(self):
|
|
* return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
|
|
@@ -22522,25 +22613,25 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(stru
|
|
* @property
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
|
|
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 566, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
|
|
for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
|
|
__pyx_t_2 = __pyx_t_4;
|
|
__pyx_v_length = (__pyx_t_2[0]);
|
|
- __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
|
|
+ __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 566, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
|
|
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 566, __pyx_L1_error)
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
}
|
|
- __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
|
|
+ __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 566, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_r = __pyx_t_5;
|
|
__pyx_t_5 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":563
|
|
+ /* "View.MemoryView":565
|
|
*
|
|
* @property
|
|
* def shape(self): # <<<<<<<<<<<<<<
|
|
@@ -22560,7 +22651,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(stru
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":567
|
|
+/* "View.MemoryView":569
|
|
*
|
|
* @property
|
|
* def strides(self): # <<<<<<<<<<<<<<
|
|
@@ -22596,7 +22687,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__get__", 0);
|
|
|
|
- /* "View.MemoryView":568
|
|
+ /* "View.MemoryView":570
|
|
* @property
|
|
* def strides(self):
|
|
* if self.view.strides == NULL: # <<<<<<<<<<<<<<
|
|
@@ -22606,20 +22697,20 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st
|
|
__pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
|
|
if (unlikely(__pyx_t_1)) {
|
|
|
|
- /* "View.MemoryView":570
|
|
+ /* "View.MemoryView":572
|
|
* if self.view.strides == NULL:
|
|
*
|
|
* raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
|
|
*
|
|
* return tuple([stride for stride in self.view.strides[:self.view.ndim]])
|
|
*/
|
|
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __PYX_ERR(1, 570, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 572, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":568
|
|
+ /* "View.MemoryView":570
|
|
* @property
|
|
* def strides(self):
|
|
* if self.view.strides == NULL: # <<<<<<<<<<<<<<
|
|
@@ -22628,7 +22719,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":572
|
|
+ /* "View.MemoryView":574
|
|
* raise ValueError("Buffer view does not expose strides")
|
|
*
|
|
* return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
|
|
@@ -22636,25 +22727,25 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st
|
|
* @property
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
|
|
+ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
|
|
for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
|
|
__pyx_t_3 = __pyx_t_5;
|
|
__pyx_v_stride = (__pyx_t_3[0]);
|
|
- __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
|
|
+ __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 574, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
|
|
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 574, __pyx_L1_error)
|
|
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
}
|
|
- __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
|
|
+ __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 574, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__pyx_r = __pyx_t_6;
|
|
__pyx_t_6 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":567
|
|
+ /* "View.MemoryView":569
|
|
*
|
|
* @property
|
|
* def strides(self): # <<<<<<<<<<<<<<
|
|
@@ -22674,7 +22765,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":575
|
|
+/* "View.MemoryView":577
|
|
*
|
|
* @property
|
|
* def suboffsets(self): # <<<<<<<<<<<<<<
|
|
@@ -22710,7 +22801,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__get__", 0);
|
|
|
|
- /* "View.MemoryView":576
|
|
+ /* "View.MemoryView":578
|
|
* @property
|
|
* def suboffsets(self):
|
|
* if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
|
|
@@ -22720,7 +22811,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_
|
|
__pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":577
|
|
+ /* "View.MemoryView":579
|
|
* def suboffsets(self):
|
|
* if self.view.suboffsets == NULL:
|
|
* return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
|
|
@@ -22728,16 +22819,16 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_
|
|
* return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__16, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
|
|
+ __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__16, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__pyx_r = __pyx_t_3;
|
|
__pyx_t_3 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":576
|
|
+ /* "View.MemoryView":578
|
|
* @property
|
|
* def suboffsets(self):
|
|
* if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
|
|
@@ -22746,7 +22837,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":579
|
|
+ /* "View.MemoryView":581
|
|
* return (-1,) * self.view.ndim
|
|
*
|
|
* return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
|
|
@@ -22754,25 +22845,25 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_
|
|
* @property
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
|
|
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 581, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
|
|
for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
|
|
__pyx_t_4 = __pyx_t_6;
|
|
__pyx_v_suboffset = (__pyx_t_4[0]);
|
|
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
|
|
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 581, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
|
|
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 581, __pyx_L1_error)
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
}
|
|
- __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
|
|
+ __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 581, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":575
|
|
+ /* "View.MemoryView":577
|
|
*
|
|
* @property
|
|
* def suboffsets(self): # <<<<<<<<<<<<<<
|
|
@@ -22792,7 +22883,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":582
|
|
+/* "View.MemoryView":584
|
|
*
|
|
* @property
|
|
* def ndim(self): # <<<<<<<<<<<<<<
|
|
@@ -22822,7 +22913,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struc
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__get__", 0);
|
|
|
|
- /* "View.MemoryView":583
|
|
+ /* "View.MemoryView":585
|
|
* @property
|
|
* def ndim(self):
|
|
* return self.view.ndim # <<<<<<<<<<<<<<
|
|
@@ -22830,13 +22921,13 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struc
|
|
* @property
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 585, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_r = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":582
|
|
+ /* "View.MemoryView":584
|
|
*
|
|
* @property
|
|
* def ndim(self): # <<<<<<<<<<<<<<
|
|
@@ -22855,7 +22946,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struc
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":586
|
|
+/* "View.MemoryView":588
|
|
*
|
|
* @property
|
|
* def itemsize(self): # <<<<<<<<<<<<<<
|
|
@@ -22885,7 +22976,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(s
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__get__", 0);
|
|
|
|
- /* "View.MemoryView":587
|
|
+ /* "View.MemoryView":589
|
|
* @property
|
|
* def itemsize(self):
|
|
* return self.view.itemsize # <<<<<<<<<<<<<<
|
|
@@ -22893,13 +22984,13 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(s
|
|
* @property
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
|
|
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 589, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_r = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":586
|
|
+ /* "View.MemoryView":588
|
|
*
|
|
* @property
|
|
* def itemsize(self): # <<<<<<<<<<<<<<
|
|
@@ -22918,7 +23009,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(s
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":590
|
|
+/* "View.MemoryView":592
|
|
*
|
|
* @property
|
|
* def nbytes(self): # <<<<<<<<<<<<<<
|
|
@@ -22950,7 +23041,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__get__", 0);
|
|
|
|
- /* "View.MemoryView":591
|
|
+ /* "View.MemoryView":593
|
|
* @property
|
|
* def nbytes(self):
|
|
* return self.size * self.view.itemsize # <<<<<<<<<<<<<<
|
|
@@ -22958,11 +23049,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str
|
|
* @property
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 593, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
|
|
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 593, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
|
|
+ __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 593, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
@@ -22970,7 +23061,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str
|
|
__pyx_t_3 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":590
|
|
+ /* "View.MemoryView":592
|
|
*
|
|
* @property
|
|
* def nbytes(self): # <<<<<<<<<<<<<<
|
|
@@ -22991,7 +23082,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":594
|
|
+/* "View.MemoryView":596
|
|
*
|
|
* @property
|
|
* def size(self): # <<<<<<<<<<<<<<
|
|
@@ -23028,7 +23119,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__get__", 0);
|
|
|
|
- /* "View.MemoryView":595
|
|
+ /* "View.MemoryView":597
|
|
* @property
|
|
* def size(self):
|
|
* if self._size is None: # <<<<<<<<<<<<<<
|
|
@@ -23039,7 +23130,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc
|
|
__pyx_t_2 = (__pyx_t_1 != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":596
|
|
+ /* "View.MemoryView":598
|
|
* def size(self):
|
|
* if self._size is None:
|
|
* result = 1 # <<<<<<<<<<<<<<
|
|
@@ -23049,7 +23140,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc
|
|
__Pyx_INCREF(__pyx_int_1);
|
|
__pyx_v_result = __pyx_int_1;
|
|
|
|
- /* "View.MemoryView":598
|
|
+ /* "View.MemoryView":600
|
|
* result = 1
|
|
*
|
|
* for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
|
|
@@ -23059,25 +23150,25 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc
|
|
__pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
|
|
for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
|
|
__pyx_t_3 = __pyx_t_5;
|
|
- __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
|
|
+ __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 600, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
__Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
|
|
__pyx_t_6 = 0;
|
|
|
|
- /* "View.MemoryView":599
|
|
+ /* "View.MemoryView":601
|
|
*
|
|
* for length in self.view.shape[:self.view.ndim]:
|
|
* result *= length # <<<<<<<<<<<<<<
|
|
*
|
|
* self._size = result
|
|
*/
|
|
- __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
|
|
+ __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 601, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
__Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
|
|
__pyx_t_6 = 0;
|
|
}
|
|
|
|
- /* "View.MemoryView":601
|
|
+ /* "View.MemoryView":603
|
|
* result *= length
|
|
*
|
|
* self._size = result # <<<<<<<<<<<<<<
|
|
@@ -23090,7 +23181,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc
|
|
__Pyx_DECREF(__pyx_v_self->_size);
|
|
__pyx_v_self->_size = __pyx_v_result;
|
|
|
|
- /* "View.MemoryView":595
|
|
+ /* "View.MemoryView":597
|
|
* @property
|
|
* def size(self):
|
|
* if self._size is None: # <<<<<<<<<<<<<<
|
|
@@ -23099,7 +23190,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":603
|
|
+ /* "View.MemoryView":605
|
|
* self._size = result
|
|
*
|
|
* return self._size # <<<<<<<<<<<<<<
|
|
@@ -23111,7 +23202,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc
|
|
__pyx_r = __pyx_v_self->_size;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":594
|
|
+ /* "View.MemoryView":596
|
|
*
|
|
* @property
|
|
* def size(self): # <<<<<<<<<<<<<<
|
|
@@ -23132,7 +23223,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":605
|
|
+/* "View.MemoryView":607
|
|
* return self._size
|
|
*
|
|
* def __len__(self): # <<<<<<<<<<<<<<
|
|
@@ -23159,7 +23250,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1
|
|
int __pyx_t_1;
|
|
__Pyx_RefNannySetupContext("__len__", 0);
|
|
|
|
- /* "View.MemoryView":606
|
|
+ /* "View.MemoryView":608
|
|
*
|
|
* def __len__(self):
|
|
* if self.view.ndim >= 1: # <<<<<<<<<<<<<<
|
|
@@ -23169,7 +23260,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1
|
|
__pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":607
|
|
+ /* "View.MemoryView":609
|
|
* def __len__(self):
|
|
* if self.view.ndim >= 1:
|
|
* return self.view.shape[0] # <<<<<<<<<<<<<<
|
|
@@ -23179,7 +23270,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1
|
|
__pyx_r = (__pyx_v_self->view.shape[0]);
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":606
|
|
+ /* "View.MemoryView":608
|
|
*
|
|
* def __len__(self):
|
|
* if self.view.ndim >= 1: # <<<<<<<<<<<<<<
|
|
@@ -23188,7 +23279,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":609
|
|
+ /* "View.MemoryView":611
|
|
* return self.view.shape[0]
|
|
*
|
|
* return 0 # <<<<<<<<<<<<<<
|
|
@@ -23198,7 +23289,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1
|
|
__pyx_r = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":605
|
|
+ /* "View.MemoryView":607
|
|
* return self._size
|
|
*
|
|
* def __len__(self): # <<<<<<<<<<<<<<
|
|
@@ -23212,7 +23303,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":611
|
|
+/* "View.MemoryView":613
|
|
* return 0
|
|
*
|
|
* def __repr__(self): # <<<<<<<<<<<<<<
|
|
@@ -23244,7 +23335,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__repr__", 0);
|
|
|
|
- /* "View.MemoryView":612
|
|
+ /* "View.MemoryView":614
|
|
*
|
|
* def __repr__(self):
|
|
* return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
|
|
@@ -23252,33 +23343,33 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12
|
|
*
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 614, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 614, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
|
|
- /* "View.MemoryView":613
|
|
+ /* "View.MemoryView":615
|
|
* def __repr__(self):
|
|
* return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
|
|
* id(self)) # <<<<<<<<<<<<<<
|
|
*
|
|
* def __str__(self):
|
|
*/
|
|
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 615, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
|
|
- /* "View.MemoryView":612
|
|
+ /* "View.MemoryView":614
|
|
*
|
|
* def __repr__(self):
|
|
* return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
|
|
* id(self))
|
|
*
|
|
*/
|
|
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
|
|
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 614, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_GIVEREF(__pyx_t_1);
|
|
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
|
|
@@ -23286,14 +23377,14 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12
|
|
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
|
|
__pyx_t_1 = 0;
|
|
__pyx_t_2 = 0;
|
|
- __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":611
|
|
+ /* "View.MemoryView":613
|
|
* return 0
|
|
*
|
|
* def __repr__(self): # <<<<<<<<<<<<<<
|
|
@@ -23314,7 +23405,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":615
|
|
+/* "View.MemoryView":617
|
|
* id(self))
|
|
*
|
|
* def __str__(self): # <<<<<<<<<<<<<<
|
|
@@ -23345,7 +23436,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__str__", 0);
|
|
|
|
- /* "View.MemoryView":616
|
|
+ /* "View.MemoryView":618
|
|
*
|
|
* def __str__(self):
|
|
* return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
|
|
@@ -23353,27 +23444,27 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14
|
|
*
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
|
|
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_GIVEREF(__pyx_t_1);
|
|
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
|
|
__pyx_t_1 = 0;
|
|
- __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__pyx_r = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":615
|
|
+ /* "View.MemoryView":617
|
|
* id(self))
|
|
*
|
|
* def __str__(self): # <<<<<<<<<<<<<<
|
|
@@ -23393,7 +23484,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":619
|
|
+/* "View.MemoryView":621
|
|
*
|
|
*
|
|
* def is_c_contig(self): # <<<<<<<<<<<<<<
|
|
@@ -23426,17 +23517,17 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("is_c_contig", 0);
|
|
|
|
- /* "View.MemoryView":622
|
|
+ /* "View.MemoryView":624
|
|
* cdef __Pyx_memviewslice *mslice
|
|
* cdef __Pyx_memviewslice tmp
|
|
* mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
|
|
* return slice_is_contig(mslice[0], 'C', self.view.ndim)
|
|
*
|
|
*/
|
|
- __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error)
|
|
+ __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 624, __pyx_L1_error)
|
|
__pyx_v_mslice = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":623
|
|
+ /* "View.MemoryView":625
|
|
* cdef __Pyx_memviewslice tmp
|
|
* mslice = get_slice_from_memview(self, &tmp)
|
|
* return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
|
|
@@ -23444,13 +23535,13 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16
|
|
* def is_f_contig(self):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 625, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":619
|
|
+ /* "View.MemoryView":621
|
|
*
|
|
*
|
|
* def is_c_contig(self): # <<<<<<<<<<<<<<
|
|
@@ -23469,7 +23560,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":625
|
|
+/* "View.MemoryView":627
|
|
* return slice_is_contig(mslice[0], 'C', self.view.ndim)
|
|
*
|
|
* def is_f_contig(self): # <<<<<<<<<<<<<<
|
|
@@ -23502,17 +23593,17 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("is_f_contig", 0);
|
|
|
|
- /* "View.MemoryView":628
|
|
+ /* "View.MemoryView":630
|
|
* cdef __Pyx_memviewslice *mslice
|
|
* cdef __Pyx_memviewslice tmp
|
|
* mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
|
|
* return slice_is_contig(mslice[0], 'F', self.view.ndim)
|
|
*
|
|
*/
|
|
- __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error)
|
|
+ __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 630, __pyx_L1_error)
|
|
__pyx_v_mslice = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":629
|
|
+ /* "View.MemoryView":631
|
|
* cdef __Pyx_memviewslice tmp
|
|
* mslice = get_slice_from_memview(self, &tmp)
|
|
* return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
|
|
@@ -23520,13 +23611,13 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18
|
|
* def copy(self):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 631, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":625
|
|
+ /* "View.MemoryView":627
|
|
* return slice_is_contig(mslice[0], 'C', self.view.ndim)
|
|
*
|
|
* def is_f_contig(self): # <<<<<<<<<<<<<<
|
|
@@ -23545,7 +23636,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":631
|
|
+/* "View.MemoryView":633
|
|
* return slice_is_contig(mslice[0], 'F', self.view.ndim)
|
|
*
|
|
* def copy(self): # <<<<<<<<<<<<<<
|
|
@@ -23578,7 +23669,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("copy", 0);
|
|
|
|
- /* "View.MemoryView":633
|
|
+ /* "View.MemoryView":635
|
|
* def copy(self):
|
|
* cdef __Pyx_memviewslice mslice
|
|
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
|
|
@@ -23587,7 +23678,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20
|
|
*/
|
|
__pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
|
|
|
|
- /* "View.MemoryView":635
|
|
+ /* "View.MemoryView":637
|
|
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
|
|
*
|
|
* slice_copy(self, &mslice) # <<<<<<<<<<<<<<
|
|
@@ -23596,17 +23687,17 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20
|
|
*/
|
|
__pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
|
|
|
|
- /* "View.MemoryView":636
|
|
+ /* "View.MemoryView":638
|
|
*
|
|
* slice_copy(self, &mslice)
|
|
* mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
|
|
* self.view.itemsize,
|
|
* flags|PyBUF_C_CONTIGUOUS,
|
|
*/
|
|
- __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error)
|
|
+ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 638, __pyx_L1_error)
|
|
__pyx_v_mslice = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":641
|
|
+ /* "View.MemoryView":643
|
|
* self.dtype_is_object)
|
|
*
|
|
* return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
|
|
@@ -23614,13 +23705,13 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20
|
|
* def copy_fortran(self):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error)
|
|
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 643, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":631
|
|
+ /* "View.MemoryView":633
|
|
* return slice_is_contig(mslice[0], 'F', self.view.ndim)
|
|
*
|
|
* def copy(self): # <<<<<<<<<<<<<<
|
|
@@ -23639,7 +23730,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":643
|
|
+/* "View.MemoryView":645
|
|
* return memoryview_copy_from_slice(self, &mslice)
|
|
*
|
|
* def copy_fortran(self): # <<<<<<<<<<<<<<
|
|
@@ -23673,7 +23764,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("copy_fortran", 0);
|
|
|
|
- /* "View.MemoryView":645
|
|
+ /* "View.MemoryView":647
|
|
* def copy_fortran(self):
|
|
* cdef __Pyx_memviewslice src, dst
|
|
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
|
|
@@ -23682,7 +23773,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22
|
|
*/
|
|
__pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
|
|
|
|
- /* "View.MemoryView":647
|
|
+ /* "View.MemoryView":649
|
|
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
|
|
*
|
|
* slice_copy(self, &src) # <<<<<<<<<<<<<<
|
|
@@ -23691,17 +23782,17 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22
|
|
*/
|
|
__pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
|
|
|
|
- /* "View.MemoryView":648
|
|
+ /* "View.MemoryView":650
|
|
*
|
|
* slice_copy(self, &src)
|
|
* dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
|
|
* self.view.itemsize,
|
|
* flags|PyBUF_F_CONTIGUOUS,
|
|
*/
|
|
- __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error)
|
|
+ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 650, __pyx_L1_error)
|
|
__pyx_v_dst = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":653
|
|
+ /* "View.MemoryView":655
|
|
* self.dtype_is_object)
|
|
*
|
|
* return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
|
|
@@ -23709,13 +23800,13 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22
|
|
*
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
|
|
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 655, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":643
|
|
+ /* "View.MemoryView":645
|
|
* return memoryview_copy_from_slice(self, &mslice)
|
|
*
|
|
* def copy_fortran(self): # <<<<<<<<<<<<<<
|
|
@@ -23847,7 +23938,7 @@ static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED st
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":657
|
|
+/* "View.MemoryView":659
|
|
*
|
|
* @cname('__pyx_memoryview_new')
|
|
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
|
|
@@ -23867,18 +23958,18 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
|
|
|
|
- /* "View.MemoryView":658
|
|
+ /* "View.MemoryView":660
|
|
* @cname('__pyx_memoryview_new')
|
|
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
|
|
* cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
|
|
* result.typeinfo = typeinfo
|
|
* return result
|
|
*/
|
|
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 660, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 660, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
|
|
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 660, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_INCREF(__pyx_v_o);
|
|
__Pyx_GIVEREF(__pyx_v_o);
|
|
@@ -23889,13 +23980,13 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
|
|
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
|
|
__pyx_t_1 = 0;
|
|
__pyx_t_2 = 0;
|
|
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 660, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
|
|
__pyx_t_2 = 0;
|
|
|
|
- /* "View.MemoryView":659
|
|
+ /* "View.MemoryView":661
|
|
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
|
|
* cdef memoryview result = memoryview(o, flags, dtype_is_object)
|
|
* result.typeinfo = typeinfo # <<<<<<<<<<<<<<
|
|
@@ -23904,7 +23995,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
|
|
*/
|
|
__pyx_v_result->typeinfo = __pyx_v_typeinfo;
|
|
|
|
- /* "View.MemoryView":660
|
|
+ /* "View.MemoryView":662
|
|
* cdef memoryview result = memoryview(o, flags, dtype_is_object)
|
|
* result.typeinfo = typeinfo
|
|
* return result # <<<<<<<<<<<<<<
|
|
@@ -23916,7 +24007,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
|
|
__pyx_r = ((PyObject *)__pyx_v_result);
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":657
|
|
+ /* "View.MemoryView":659
|
|
*
|
|
* @cname('__pyx_memoryview_new')
|
|
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
|
|
@@ -23938,7 +24029,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":663
|
|
+/* "View.MemoryView":665
|
|
*
|
|
* @cname('__pyx_memoryview_check')
|
|
* cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
|
|
@@ -23952,7 +24043,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
|
|
int __pyx_t_1;
|
|
__Pyx_RefNannySetupContext("memoryview_check", 0);
|
|
|
|
- /* "View.MemoryView":664
|
|
+ /* "View.MemoryView":666
|
|
* @cname('__pyx_memoryview_check')
|
|
* cdef inline bint memoryview_check(object o):
|
|
* return isinstance(o, memoryview) # <<<<<<<<<<<<<<
|
|
@@ -23963,7 +24054,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
|
|
__pyx_r = __pyx_t_1;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":663
|
|
+ /* "View.MemoryView":665
|
|
*
|
|
* @cname('__pyx_memoryview_check')
|
|
* cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
|
|
@@ -23977,7 +24068,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":666
|
|
+/* "View.MemoryView":668
|
|
* return isinstance(o, memoryview)
|
|
*
|
|
* cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
|
|
@@ -24011,7 +24102,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("_unellipsify", 0);
|
|
|
|
- /* "View.MemoryView":671
|
|
+ /* "View.MemoryView":673
|
|
* full slices.
|
|
* """
|
|
* if not isinstance(index, tuple): # <<<<<<<<<<<<<<
|
|
@@ -24022,14 +24113,14 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":672
|
|
+ /* "View.MemoryView":674
|
|
* """
|
|
* if not isinstance(index, tuple):
|
|
* tup = (index,) # <<<<<<<<<<<<<<
|
|
* else:
|
|
* tup = index
|
|
*/
|
|
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
|
|
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 674, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_INCREF(__pyx_v_index);
|
|
__Pyx_GIVEREF(__pyx_v_index);
|
|
@@ -24037,7 +24128,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
__pyx_v_tup = __pyx_t_3;
|
|
__pyx_t_3 = 0;
|
|
|
|
- /* "View.MemoryView":671
|
|
+ /* "View.MemoryView":673
|
|
* full slices.
|
|
* """
|
|
* if not isinstance(index, tuple): # <<<<<<<<<<<<<<
|
|
@@ -24047,7 +24138,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
- /* "View.MemoryView":674
|
|
+ /* "View.MemoryView":676
|
|
* tup = (index,)
|
|
* else:
|
|
* tup = index # <<<<<<<<<<<<<<
|
|
@@ -24060,19 +24151,19 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
}
|
|
__pyx_L3:;
|
|
|
|
- /* "View.MemoryView":676
|
|
+ /* "View.MemoryView":678
|
|
* tup = index
|
|
*
|
|
* result = [] # <<<<<<<<<<<<<<
|
|
* have_slices = False
|
|
* seen_ellipsis = False
|
|
*/
|
|
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
|
|
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 678, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__pyx_v_result = ((PyObject*)__pyx_t_3);
|
|
__pyx_t_3 = 0;
|
|
|
|
- /* "View.MemoryView":677
|
|
+ /* "View.MemoryView":679
|
|
*
|
|
* result = []
|
|
* have_slices = False # <<<<<<<<<<<<<<
|
|
@@ -24081,7 +24172,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
*/
|
|
__pyx_v_have_slices = 0;
|
|
|
|
- /* "View.MemoryView":678
|
|
+ /* "View.MemoryView":680
|
|
* result = []
|
|
* have_slices = False
|
|
* seen_ellipsis = False # <<<<<<<<<<<<<<
|
|
@@ -24090,7 +24181,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
*/
|
|
__pyx_v_seen_ellipsis = 0;
|
|
|
|
- /* "View.MemoryView":679
|
|
+ /* "View.MemoryView":681
|
|
* have_slices = False
|
|
* seen_ellipsis = False
|
|
* for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
|
|
@@ -24103,26 +24194,26 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
__pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
|
|
__pyx_t_6 = NULL;
|
|
} else {
|
|
- __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
|
|
+ __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 681, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
|
|
+ __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 681, __pyx_L1_error)
|
|
}
|
|
for (;;) {
|
|
if (likely(!__pyx_t_6)) {
|
|
if (likely(PyList_CheckExact(__pyx_t_4))) {
|
|
if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
|
|
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
- __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
|
|
+ __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 681, __pyx_L1_error)
|
|
#else
|
|
- __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
|
|
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_7);
|
|
#endif
|
|
} else {
|
|
if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
|
|
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
- __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
|
|
+ __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 681, __pyx_L1_error)
|
|
#else
|
|
- __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
|
|
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_7);
|
|
#endif
|
|
}
|
|
@@ -24132,7 +24223,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
PyObject* exc_type = PyErr_Occurred();
|
|
if (exc_type) {
|
|
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
|
|
- else __PYX_ERR(1, 679, __pyx_L1_error)
|
|
+ else __PYX_ERR(1, 681, __pyx_L1_error)
|
|
}
|
|
break;
|
|
}
|
|
@@ -24142,13 +24233,13 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
__pyx_t_7 = 0;
|
|
__Pyx_INCREF(__pyx_t_3);
|
|
__Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
|
|
- __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
|
|
+ __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_7);
|
|
__Pyx_DECREF(__pyx_t_3);
|
|
__pyx_t_3 = __pyx_t_7;
|
|
__pyx_t_7 = 0;
|
|
|
|
- /* "View.MemoryView":680
|
|
+ /* "View.MemoryView":682
|
|
* seen_ellipsis = False
|
|
* for idx, item in enumerate(tup):
|
|
* if item is Ellipsis: # <<<<<<<<<<<<<<
|
|
@@ -24159,7 +24250,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
__pyx_t_1 = (__pyx_t_2 != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":681
|
|
+ /* "View.MemoryView":683
|
|
* for idx, item in enumerate(tup):
|
|
* if item is Ellipsis:
|
|
* if not seen_ellipsis: # <<<<<<<<<<<<<<
|
|
@@ -24169,15 +24260,15 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
__pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":682
|
|
+ /* "View.MemoryView":684
|
|
* if item is Ellipsis:
|
|
* if not seen_ellipsis:
|
|
* result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
|
|
* seen_ellipsis = True
|
|
* else:
|
|
*/
|
|
- __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
|
|
- __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error)
|
|
+ __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 684, __pyx_L1_error)
|
|
+ __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_7);
|
|
{ Py_ssize_t __pyx_temp;
|
|
for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
|
|
@@ -24186,10 +24277,10 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__19);
|
|
}
|
|
}
|
|
- __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
|
|
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 684, __pyx_L1_error)
|
|
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
|
|
- /* "View.MemoryView":683
|
|
+ /* "View.MemoryView":685
|
|
* if not seen_ellipsis:
|
|
* result.extend([slice(None)] * (ndim - len(tup) + 1))
|
|
* seen_ellipsis = True # <<<<<<<<<<<<<<
|
|
@@ -24198,7 +24289,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
*/
|
|
__pyx_v_seen_ellipsis = 1;
|
|
|
|
- /* "View.MemoryView":681
|
|
+ /* "View.MemoryView":683
|
|
* for idx, item in enumerate(tup):
|
|
* if item is Ellipsis:
|
|
* if not seen_ellipsis: # <<<<<<<<<<<<<<
|
|
@@ -24208,7 +24299,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
goto __pyx_L7;
|
|
}
|
|
|
|
- /* "View.MemoryView":685
|
|
+ /* "View.MemoryView":687
|
|
* seen_ellipsis = True
|
|
* else:
|
|
* result.append(slice(None)) # <<<<<<<<<<<<<<
|
|
@@ -24216,11 +24307,11 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
* else:
|
|
*/
|
|
/*else*/ {
|
|
- __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__19); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
|
|
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__19); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 687, __pyx_L1_error)
|
|
}
|
|
__pyx_L7:;
|
|
|
|
- /* "View.MemoryView":686
|
|
+ /* "View.MemoryView":688
|
|
* else:
|
|
* result.append(slice(None))
|
|
* have_slices = True # <<<<<<<<<<<<<<
|
|
@@ -24229,7 +24320,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
*/
|
|
__pyx_v_have_slices = 1;
|
|
|
|
- /* "View.MemoryView":680
|
|
+ /* "View.MemoryView":682
|
|
* seen_ellipsis = False
|
|
* for idx, item in enumerate(tup):
|
|
* if item is Ellipsis: # <<<<<<<<<<<<<<
|
|
@@ -24239,7 +24330,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
goto __pyx_L6;
|
|
}
|
|
|
|
- /* "View.MemoryView":688
|
|
+ /* "View.MemoryView":690
|
|
* have_slices = True
|
|
* else:
|
|
* if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
|
|
@@ -24259,23 +24350,23 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
__pyx_L9_bool_binop_done:;
|
|
if (unlikely(__pyx_t_1)) {
|
|
|
|
- /* "View.MemoryView":689
|
|
+ /* "View.MemoryView":691
|
|
* else:
|
|
* if not isinstance(item, slice) and not PyIndex_Check(item):
|
|
* raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
|
|
*
|
|
* have_slices = have_slices or isinstance(item, slice)
|
|
*/
|
|
- __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error)
|
|
+ __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 691, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_7);
|
|
- __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
|
|
+ __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 691, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_11);
|
|
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
__Pyx_Raise(__pyx_t_11, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
|
|
- __PYX_ERR(1, 689, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 691, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":688
|
|
+ /* "View.MemoryView":690
|
|
* have_slices = True
|
|
* else:
|
|
* if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
|
|
@@ -24284,7 +24375,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":691
|
|
+ /* "View.MemoryView":693
|
|
* raise TypeError("Cannot index with type '%s'" % type(item))
|
|
*
|
|
* have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
|
|
@@ -24303,18 +24394,18 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
__pyx_L11_bool_binop_done:;
|
|
__pyx_v_have_slices = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":692
|
|
+ /* "View.MemoryView":694
|
|
*
|
|
* have_slices = have_slices or isinstance(item, slice)
|
|
* result.append(item) # <<<<<<<<<<<<<<
|
|
*
|
|
* nslices = ndim - len(result)
|
|
*/
|
|
- __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
|
|
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
|
|
}
|
|
__pyx_L6:;
|
|
|
|
- /* "View.MemoryView":679
|
|
+ /* "View.MemoryView":681
|
|
* have_slices = False
|
|
* seen_ellipsis = False
|
|
* for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
|
|
@@ -24325,17 +24416,17 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
- /* "View.MemoryView":694
|
|
+ /* "View.MemoryView":696
|
|
* result.append(item)
|
|
*
|
|
* nslices = ndim - len(result) # <<<<<<<<<<<<<<
|
|
* if nslices:
|
|
* result.extend([slice(None)] * nslices)
|
|
*/
|
|
- __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
|
|
+ __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
|
|
__pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
|
|
|
|
- /* "View.MemoryView":695
|
|
+ /* "View.MemoryView":697
|
|
*
|
|
* nslices = ndim - len(result)
|
|
* if nslices: # <<<<<<<<<<<<<<
|
|
@@ -24345,14 +24436,14 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
__pyx_t_1 = (__pyx_v_nslices != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":696
|
|
+ /* "View.MemoryView":698
|
|
* nslices = ndim - len(result)
|
|
* if nslices:
|
|
* result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
|
|
*
|
|
* return have_slices or nslices, tuple(result)
|
|
*/
|
|
- __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error)
|
|
+ __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 698, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
{ Py_ssize_t __pyx_temp;
|
|
for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
|
|
@@ -24361,10 +24452,10 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__19);
|
|
}
|
|
}
|
|
- __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
|
|
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 698, __pyx_L1_error)
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
- /* "View.MemoryView":695
|
|
+ /* "View.MemoryView":697
|
|
*
|
|
* nslices = ndim - len(result)
|
|
* if nslices: # <<<<<<<<<<<<<<
|
|
@@ -24373,7 +24464,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":698
|
|
+ /* "View.MemoryView":700
|
|
* result.extend([slice(None)] * nslices)
|
|
*
|
|
* return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
|
|
@@ -24383,20 +24474,20 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
__Pyx_XDECREF(__pyx_r);
|
|
if (!__pyx_v_have_slices) {
|
|
} else {
|
|
- __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
|
|
+ __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__pyx_t_3 = __pyx_t_4;
|
|
__pyx_t_4 = 0;
|
|
goto __pyx_L14_bool_binop_done;
|
|
}
|
|
- __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
|
|
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__pyx_t_3 = __pyx_t_4;
|
|
__pyx_t_4 = 0;
|
|
__pyx_L14_bool_binop_done:;
|
|
- __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
|
|
+ __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
|
|
+ __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 700, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_11);
|
|
__Pyx_GIVEREF(__pyx_t_3);
|
|
PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
|
|
@@ -24408,7 +24499,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
__pyx_t_11 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":666
|
|
+ /* "View.MemoryView":668
|
|
* return isinstance(o, memoryview)
|
|
*
|
|
* cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
|
|
@@ -24434,7 +24525,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":700
|
|
+/* "View.MemoryView":702
|
|
* return have_slices or nslices, tuple(result)
|
|
*
|
|
* cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
|
|
@@ -24456,7 +24547,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
|
|
|
|
- /* "View.MemoryView":701
|
|
+ /* "View.MemoryView":703
|
|
*
|
|
* cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
|
|
* for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
|
|
@@ -24468,7 +24559,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __
|
|
__pyx_t_1 = __pyx_t_3;
|
|
__pyx_v_suboffset = (__pyx_t_1[0]);
|
|
|
|
- /* "View.MemoryView":702
|
|
+ /* "View.MemoryView":704
|
|
* cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
|
|
* for suboffset in suboffsets[:ndim]:
|
|
* if suboffset >= 0: # <<<<<<<<<<<<<<
|
|
@@ -24478,20 +24569,20 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __
|
|
__pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
|
|
if (unlikely(__pyx_t_4)) {
|
|
|
|
- /* "View.MemoryView":703
|
|
+ /* "View.MemoryView":705
|
|
* for suboffset in suboffsets[:ndim]:
|
|
* if suboffset >= 0:
|
|
* raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
|
|
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 705, __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(1, 703, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 705, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":702
|
|
+ /* "View.MemoryView":704
|
|
* cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
|
|
* for suboffset in suboffsets[:ndim]:
|
|
* if suboffset >= 0: # <<<<<<<<<<<<<<
|
|
@@ -24501,7 +24592,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __
|
|
}
|
|
}
|
|
|
|
- /* "View.MemoryView":700
|
|
+ /* "View.MemoryView":702
|
|
* return have_slices or nslices, tuple(result)
|
|
*
|
|
* cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
|
|
@@ -24522,7 +24613,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":710
|
|
+/* "View.MemoryView":712
|
|
*
|
|
* @cname('__pyx_memview_slice')
|
|
* cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
|
|
@@ -24566,7 +24657,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("memview_slice", 0);
|
|
|
|
- /* "View.MemoryView":711
|
|
+ /* "View.MemoryView":713
|
|
* @cname('__pyx_memview_slice')
|
|
* cdef memoryview memview_slice(memoryview memview, object indices):
|
|
* cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
|
|
@@ -24576,7 +24667,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
__pyx_v_new_ndim = 0;
|
|
__pyx_v_suboffset_dim = -1;
|
|
|
|
- /* "View.MemoryView":718
|
|
+ /* "View.MemoryView":720
|
|
*
|
|
*
|
|
* memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
|
|
@@ -24585,7 +24676,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
*/
|
|
(void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
|
|
|
|
- /* "View.MemoryView":722
|
|
+ /* "View.MemoryView":724
|
|
* cdef _memoryviewslice memviewsliceobj
|
|
*
|
|
* assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
|
|
@@ -24596,12 +24687,12 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
if (unlikely(!Py_OptimizeFlag)) {
|
|
if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
|
|
PyErr_SetNone(PyExc_AssertionError);
|
|
- __PYX_ERR(1, 722, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 724, __pyx_L1_error)
|
|
}
|
|
}
|
|
#endif
|
|
|
|
- /* "View.MemoryView":724
|
|
+ /* "View.MemoryView":726
|
|
* assert memview.view.ndim > 0
|
|
*
|
|
* if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
|
|
@@ -24612,20 +24703,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
__pyx_t_2 = (__pyx_t_1 != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":725
|
|
+ /* "View.MemoryView":727
|
|
*
|
|
* if isinstance(memview, _memoryviewslice):
|
|
* memviewsliceobj = memview # <<<<<<<<<<<<<<
|
|
* p_src = &memviewsliceobj.from_slice
|
|
* else:
|
|
*/
|
|
- if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error)
|
|
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 727, __pyx_L1_error)
|
|
__pyx_t_3 = ((PyObject *)__pyx_v_memview);
|
|
__Pyx_INCREF(__pyx_t_3);
|
|
__pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
|
|
__pyx_t_3 = 0;
|
|
|
|
- /* "View.MemoryView":726
|
|
+ /* "View.MemoryView":728
|
|
* if isinstance(memview, _memoryviewslice):
|
|
* memviewsliceobj = memview
|
|
* p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
|
|
@@ -24634,7 +24725,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
*/
|
|
__pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
|
|
|
|
- /* "View.MemoryView":724
|
|
+ /* "View.MemoryView":726
|
|
* assert memview.view.ndim > 0
|
|
*
|
|
* if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
|
|
@@ -24644,7 +24735,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
- /* "View.MemoryView":728
|
|
+ /* "View.MemoryView":730
|
|
* p_src = &memviewsliceobj.from_slice
|
|
* else:
|
|
* slice_copy(memview, &src) # <<<<<<<<<<<<<<
|
|
@@ -24654,7 +24745,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
/*else*/ {
|
|
__pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
|
|
|
|
- /* "View.MemoryView":729
|
|
+ /* "View.MemoryView":731
|
|
* else:
|
|
* slice_copy(memview, &src)
|
|
* p_src = &src # <<<<<<<<<<<<<<
|
|
@@ -24665,7 +24756,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
}
|
|
__pyx_L3:;
|
|
|
|
- /* "View.MemoryView":735
|
|
+ /* "View.MemoryView":737
|
|
*
|
|
*
|
|
* dst.memview = p_src.memview # <<<<<<<<<<<<<<
|
|
@@ -24675,7 +24766,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
__pyx_t_4 = __pyx_v_p_src->memview;
|
|
__pyx_v_dst.memview = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":736
|
|
+ /* "View.MemoryView":738
|
|
*
|
|
* dst.memview = p_src.memview
|
|
* dst.data = p_src.data # <<<<<<<<<<<<<<
|
|
@@ -24685,7 +24776,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
__pyx_t_5 = __pyx_v_p_src->data;
|
|
__pyx_v_dst.data = __pyx_t_5;
|
|
|
|
- /* "View.MemoryView":741
|
|
+ /* "View.MemoryView":743
|
|
*
|
|
*
|
|
* cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
|
|
@@ -24694,7 +24785,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
*/
|
|
__pyx_v_p_dst = (&__pyx_v_dst);
|
|
|
|
- /* "View.MemoryView":742
|
|
+ /* "View.MemoryView":744
|
|
*
|
|
* cdef __Pyx_memviewslice *p_dst = &dst
|
|
* cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
|
|
@@ -24703,7 +24794,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
*/
|
|
__pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
|
|
|
|
- /* "View.MemoryView":746
|
|
+ /* "View.MemoryView":748
|
|
* cdef bint have_start, have_stop, have_step
|
|
*
|
|
* for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
|
|
@@ -24715,26 +24806,26 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
__pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
|
|
__pyx_t_8 = NULL;
|
|
} else {
|
|
- __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
|
|
+ __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 748, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
|
|
+ __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 748, __pyx_L1_error)
|
|
}
|
|
for (;;) {
|
|
if (likely(!__pyx_t_8)) {
|
|
if (likely(PyList_CheckExact(__pyx_t_3))) {
|
|
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
|
|
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
- __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
|
|
+ __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 748, __pyx_L1_error)
|
|
#else
|
|
- __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
|
|
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_9);
|
|
#endif
|
|
} else {
|
|
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
|
|
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
- __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
|
|
+ __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 748, __pyx_L1_error)
|
|
#else
|
|
- __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
|
|
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_9);
|
|
#endif
|
|
}
|
|
@@ -24744,7 +24835,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
PyObject* exc_type = PyErr_Occurred();
|
|
if (exc_type) {
|
|
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
|
|
- else __PYX_ERR(1, 746, __pyx_L1_error)
|
|
+ else __PYX_ERR(1, 748, __pyx_L1_error)
|
|
}
|
|
break;
|
|
}
|
|
@@ -24755,7 +24846,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
__pyx_v_dim = __pyx_t_6;
|
|
__pyx_t_6 = (__pyx_t_6 + 1);
|
|
|
|
- /* "View.MemoryView":747
|
|
+ /* "View.MemoryView":749
|
|
*
|
|
* for dim, index in enumerate(indices):
|
|
* if PyIndex_Check(index): # <<<<<<<<<<<<<<
|
|
@@ -24765,25 +24856,25 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
__pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":751
|
|
+ /* "View.MemoryView":753
|
|
* p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
|
|
* dim, new_ndim, p_suboffset_dim,
|
|
* index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
|
|
* 0, 0, 0, # have_{start,stop,step}
|
|
* False)
|
|
*/
|
|
- __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error)
|
|
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 753, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":748
|
|
+ /* "View.MemoryView":750
|
|
* for dim, index in enumerate(indices):
|
|
* if PyIndex_Check(index):
|
|
* slice_memviewslice( # <<<<<<<<<<<<<<
|
|
* p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
|
|
* dim, new_ndim, p_suboffset_dim,
|
|
*/
|
|
- __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 748, __pyx_L1_error)
|
|
+ __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 750, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":747
|
|
+ /* "View.MemoryView":749
|
|
*
|
|
* for dim, index in enumerate(indices):
|
|
* if PyIndex_Check(index): # <<<<<<<<<<<<<<
|
|
@@ -24793,7 +24884,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
goto __pyx_L6;
|
|
}
|
|
|
|
- /* "View.MemoryView":754
|
|
+ /* "View.MemoryView":756
|
|
* 0, 0, 0, # have_{start,stop,step}
|
|
* False)
|
|
* elif index is None: # <<<<<<<<<<<<<<
|
|
@@ -24804,7 +24895,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
__pyx_t_1 = (__pyx_t_2 != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":755
|
|
+ /* "View.MemoryView":757
|
|
* False)
|
|
* elif index is None:
|
|
* p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
|
|
@@ -24813,7 +24904,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
*/
|
|
(__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
|
|
|
|
- /* "View.MemoryView":756
|
|
+ /* "View.MemoryView":758
|
|
* elif index is None:
|
|
* p_dst.shape[new_ndim] = 1
|
|
* p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
|
|
@@ -24822,7 +24913,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
*/
|
|
(__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
|
|
|
|
- /* "View.MemoryView":757
|
|
+ /* "View.MemoryView":759
|
|
* p_dst.shape[new_ndim] = 1
|
|
* p_dst.strides[new_ndim] = 0
|
|
* p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
|
|
@@ -24831,7 +24922,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
*/
|
|
(__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
|
|
|
|
- /* "View.MemoryView":758
|
|
+ /* "View.MemoryView":760
|
|
* p_dst.strides[new_ndim] = 0
|
|
* p_dst.suboffsets[new_ndim] = -1
|
|
* new_ndim += 1 # <<<<<<<<<<<<<<
|
|
@@ -24840,7 +24931,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
*/
|
|
__pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
|
|
|
|
- /* "View.MemoryView":754
|
|
+ /* "View.MemoryView":756
|
|
* 0, 0, 0, # have_{start,stop,step}
|
|
* False)
|
|
* elif index is None: # <<<<<<<<<<<<<<
|
|
@@ -24850,7 +24941,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
goto __pyx_L6;
|
|
}
|
|
|
|
- /* "View.MemoryView":760
|
|
+ /* "View.MemoryView":762
|
|
* new_ndim += 1
|
|
* else:
|
|
* start = index.start or 0 # <<<<<<<<<<<<<<
|
|
@@ -24858,13 +24949,13 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
* step = index.step or 0
|
|
*/
|
|
/*else*/ {
|
|
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
|
|
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_9);
|
|
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
|
|
if (!__pyx_t_1) {
|
|
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
} else {
|
|
- __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error)
|
|
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
|
|
__pyx_t_10 = __pyx_t_12;
|
|
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
goto __pyx_L7_bool_binop_done;
|
|
@@ -24873,20 +24964,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
__pyx_L7_bool_binop_done:;
|
|
__pyx_v_start = __pyx_t_10;
|
|
|
|
- /* "View.MemoryView":761
|
|
+ /* "View.MemoryView":763
|
|
* else:
|
|
* start = index.start or 0
|
|
* stop = index.stop or 0 # <<<<<<<<<<<<<<
|
|
* step = index.step or 0
|
|
*
|
|
*/
|
|
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
|
|
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 763, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_9);
|
|
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 763, __pyx_L1_error)
|
|
if (!__pyx_t_1) {
|
|
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
} else {
|
|
- __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error)
|
|
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 763, __pyx_L1_error)
|
|
__pyx_t_10 = __pyx_t_12;
|
|
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
goto __pyx_L9_bool_binop_done;
|
|
@@ -24895,20 +24986,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
__pyx_L9_bool_binop_done:;
|
|
__pyx_v_stop = __pyx_t_10;
|
|
|
|
- /* "View.MemoryView":762
|
|
+ /* "View.MemoryView":764
|
|
* start = index.start or 0
|
|
* stop = index.stop or 0
|
|
* step = index.step or 0 # <<<<<<<<<<<<<<
|
|
*
|
|
* have_start = index.start is not None
|
|
*/
|
|
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
|
|
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_9);
|
|
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 764, __pyx_L1_error)
|
|
if (!__pyx_t_1) {
|
|
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
} else {
|
|
- __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
|
|
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 764, __pyx_L1_error)
|
|
__pyx_t_10 = __pyx_t_12;
|
|
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
goto __pyx_L11_bool_binop_done;
|
|
@@ -24917,55 +25008,55 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
__pyx_L11_bool_binop_done:;
|
|
__pyx_v_step = __pyx_t_10;
|
|
|
|
- /* "View.MemoryView":764
|
|
+ /* "View.MemoryView":766
|
|
* step = index.step or 0
|
|
*
|
|
* have_start = index.start is not None # <<<<<<<<<<<<<<
|
|
* have_stop = index.stop is not None
|
|
* have_step = index.step is not None
|
|
*/
|
|
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
|
|
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_9);
|
|
__pyx_t_1 = (__pyx_t_9 != Py_None);
|
|
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
__pyx_v_have_start = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":765
|
|
+ /* "View.MemoryView":767
|
|
*
|
|
* have_start = index.start is not None
|
|
* have_stop = index.stop is not None # <<<<<<<<<<<<<<
|
|
* have_step = index.step is not None
|
|
*
|
|
*/
|
|
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error)
|
|
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 767, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_9);
|
|
__pyx_t_1 = (__pyx_t_9 != Py_None);
|
|
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
__pyx_v_have_stop = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":766
|
|
+ /* "View.MemoryView":768
|
|
* have_start = index.start is not None
|
|
* have_stop = index.stop is not None
|
|
* have_step = index.step is not None # <<<<<<<<<<<<<<
|
|
*
|
|
* slice_memviewslice(
|
|
*/
|
|
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
|
|
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 768, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_9);
|
|
__pyx_t_1 = (__pyx_t_9 != Py_None);
|
|
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
__pyx_v_have_step = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":768
|
|
+ /* "View.MemoryView":770
|
|
* have_step = index.step is not None
|
|
*
|
|
* slice_memviewslice( # <<<<<<<<<<<<<<
|
|
* p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
|
|
* dim, new_ndim, p_suboffset_dim,
|
|
*/
|
|
- __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 768, __pyx_L1_error)
|
|
+ __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 770, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":774
|
|
+ /* "View.MemoryView":776
|
|
* have_start, have_stop, have_step,
|
|
* True)
|
|
* new_ndim += 1 # <<<<<<<<<<<<<<
|
|
@@ -24976,7 +25067,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
}
|
|
__pyx_L6:;
|
|
|
|
- /* "View.MemoryView":746
|
|
+ /* "View.MemoryView":748
|
|
* cdef bint have_start, have_stop, have_step
|
|
*
|
|
* for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
|
|
@@ -24986,7 +25077,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
}
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
- /* "View.MemoryView":776
|
|
+ /* "View.MemoryView":778
|
|
* new_ndim += 1
|
|
*
|
|
* if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
|
|
@@ -24997,7 +25088,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
__pyx_t_2 = (__pyx_t_1 != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":777
|
|
+ /* "View.MemoryView":779
|
|
*
|
|
* if isinstance(memview, _memoryviewslice):
|
|
* return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
|
|
@@ -25006,39 +25097,39 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
*/
|
|
__Pyx_XDECREF(((PyObject *)__pyx_r));
|
|
|
|
- /* "View.MemoryView":778
|
|
+ /* "View.MemoryView":780
|
|
* if isinstance(memview, _memoryviewslice):
|
|
* return memoryview_fromslice(dst, new_ndim,
|
|
* memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
|
|
* memviewsliceobj.to_dtype_func,
|
|
* memview.dtype_is_object)
|
|
*/
|
|
- if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
|
|
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 780, __pyx_L1_error) }
|
|
|
|
- /* "View.MemoryView":779
|
|
+ /* "View.MemoryView":781
|
|
* return memoryview_fromslice(dst, new_ndim,
|
|
* memviewsliceobj.to_object_func,
|
|
* memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
|
|
* memview.dtype_is_object)
|
|
* else:
|
|
*/
|
|
- if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
|
|
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 781, __pyx_L1_error) }
|
|
|
|
- /* "View.MemoryView":777
|
|
+ /* "View.MemoryView":779
|
|
*
|
|
* if isinstance(memview, _memoryviewslice):
|
|
* return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
|
|
* memviewsliceobj.to_object_func,
|
|
* memviewsliceobj.to_dtype_func,
|
|
*/
|
|
- __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
|
|
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 779, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
- if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
|
|
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 779, __pyx_L1_error)
|
|
__pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
|
|
__pyx_t_3 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":776
|
|
+ /* "View.MemoryView":778
|
|
* new_ndim += 1
|
|
*
|
|
* if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
|
|
@@ -25047,7 +25138,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":782
|
|
+ /* "View.MemoryView":784
|
|
* memview.dtype_is_object)
|
|
* else:
|
|
* return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
|
|
@@ -25057,30 +25148,30 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
/*else*/ {
|
|
__Pyx_XDECREF(((PyObject *)__pyx_r));
|
|
|
|
- /* "View.MemoryView":783
|
|
+ /* "View.MemoryView":785
|
|
* else:
|
|
* return memoryview_fromslice(dst, new_ndim, NULL, NULL,
|
|
* memview.dtype_is_object) # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error)
|
|
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 784, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
|
|
- /* "View.MemoryView":782
|
|
+ /* "View.MemoryView":784
|
|
* memview.dtype_is_object)
|
|
* else:
|
|
* return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
|
|
* memview.dtype_is_object)
|
|
*
|
|
*/
|
|
- if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
|
|
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 784, __pyx_L1_error)
|
|
__pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
|
|
__pyx_t_3 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
|
|
- /* "View.MemoryView":710
|
|
+ /* "View.MemoryView":712
|
|
*
|
|
* @cname('__pyx_memview_slice')
|
|
* cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
|
|
@@ -25102,7 +25193,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":807
|
|
+/* "View.MemoryView":809
|
|
*
|
|
* @cname('__pyx_memoryview_slice_memviewslice')
|
|
* cdef int slice_memviewslice( # <<<<<<<<<<<<<<
|
|
@@ -25121,7 +25212,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
|
|
- /* "View.MemoryView":827
|
|
+ /* "View.MemoryView":829
|
|
* cdef bint negative_step
|
|
*
|
|
* if not is_slice: # <<<<<<<<<<<<<<
|
|
@@ -25131,7 +25222,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
__pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":829
|
|
+ /* "View.MemoryView":831
|
|
* if not is_slice:
|
|
*
|
|
* if start < 0: # <<<<<<<<<<<<<<
|
|
@@ -25141,7 +25232,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
__pyx_t_1 = ((__pyx_v_start < 0) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":830
|
|
+ /* "View.MemoryView":832
|
|
*
|
|
* if start < 0:
|
|
* start += shape # <<<<<<<<<<<<<<
|
|
@@ -25150,7 +25241,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
__pyx_v_start = (__pyx_v_start + __pyx_v_shape);
|
|
|
|
- /* "View.MemoryView":829
|
|
+ /* "View.MemoryView":831
|
|
* if not is_slice:
|
|
*
|
|
* if start < 0: # <<<<<<<<<<<<<<
|
|
@@ -25159,7 +25250,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":831
|
|
+ /* "View.MemoryView":833
|
|
* if start < 0:
|
|
* start += shape
|
|
* if not 0 <= start < shape: # <<<<<<<<<<<<<<
|
|
@@ -25173,16 +25264,16 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":832
|
|
+ /* "View.MemoryView":834
|
|
* start += shape
|
|
* if not 0 <= start < shape:
|
|
* _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
|
|
* else:
|
|
*
|
|
*/
|
|
- __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
|
|
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 834, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":831
|
|
+ /* "View.MemoryView":833
|
|
* if start < 0:
|
|
* start += shape
|
|
* if not 0 <= start < shape: # <<<<<<<<<<<<<<
|
|
@@ -25191,7 +25282,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":827
|
|
+ /* "View.MemoryView":829
|
|
* cdef bint negative_step
|
|
*
|
|
* if not is_slice: # <<<<<<<<<<<<<<
|
|
@@ -25201,7 +25292,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
- /* "View.MemoryView":835
|
|
+ /* "View.MemoryView":837
|
|
* else:
|
|
*
|
|
* negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
|
|
@@ -25220,7 +25311,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
__pyx_L6_bool_binop_done:;
|
|
__pyx_v_negative_step = __pyx_t_2;
|
|
|
|
- /* "View.MemoryView":837
|
|
+ /* "View.MemoryView":839
|
|
* negative_step = have_step != 0 and step < 0
|
|
*
|
|
* if have_step and step == 0: # <<<<<<<<<<<<<<
|
|
@@ -25238,16 +25329,16 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
__pyx_L9_bool_binop_done:;
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":838
|
|
+ /* "View.MemoryView":840
|
|
*
|
|
* if have_step and step == 0:
|
|
* _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 838, __pyx_L1_error)
|
|
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 840, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":837
|
|
+ /* "View.MemoryView":839
|
|
* negative_step = have_step != 0 and step < 0
|
|
*
|
|
* if have_step and step == 0: # <<<<<<<<<<<<<<
|
|
@@ -25256,7 +25347,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":841
|
|
+ /* "View.MemoryView":843
|
|
*
|
|
*
|
|
* if have_start: # <<<<<<<<<<<<<<
|
|
@@ -25266,7 +25357,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
__pyx_t_2 = (__pyx_v_have_start != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":842
|
|
+ /* "View.MemoryView":844
|
|
*
|
|
* if have_start:
|
|
* if start < 0: # <<<<<<<<<<<<<<
|
|
@@ -25276,7 +25367,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
__pyx_t_2 = ((__pyx_v_start < 0) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":843
|
|
+ /* "View.MemoryView":845
|
|
* if have_start:
|
|
* if start < 0:
|
|
* start += shape # <<<<<<<<<<<<<<
|
|
@@ -25285,7 +25376,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
__pyx_v_start = (__pyx_v_start + __pyx_v_shape);
|
|
|
|
- /* "View.MemoryView":844
|
|
+ /* "View.MemoryView":846
|
|
* if start < 0:
|
|
* start += shape
|
|
* if start < 0: # <<<<<<<<<<<<<<
|
|
@@ -25295,7 +25386,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
__pyx_t_2 = ((__pyx_v_start < 0) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":845
|
|
+ /* "View.MemoryView":847
|
|
* start += shape
|
|
* if start < 0:
|
|
* start = 0 # <<<<<<<<<<<<<<
|
|
@@ -25304,7 +25395,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
__pyx_v_start = 0;
|
|
|
|
- /* "View.MemoryView":844
|
|
+ /* "View.MemoryView":846
|
|
* if start < 0:
|
|
* start += shape
|
|
* if start < 0: # <<<<<<<<<<<<<<
|
|
@@ -25313,7 +25404,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":842
|
|
+ /* "View.MemoryView":844
|
|
*
|
|
* if have_start:
|
|
* if start < 0: # <<<<<<<<<<<<<<
|
|
@@ -25323,7 +25414,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
goto __pyx_L12;
|
|
}
|
|
|
|
- /* "View.MemoryView":846
|
|
+ /* "View.MemoryView":848
|
|
* if start < 0:
|
|
* start = 0
|
|
* elif start >= shape: # <<<<<<<<<<<<<<
|
|
@@ -25333,7 +25424,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
__pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":847
|
|
+ /* "View.MemoryView":849
|
|
* start = 0
|
|
* elif start >= shape:
|
|
* if negative_step: # <<<<<<<<<<<<<<
|
|
@@ -25343,7 +25434,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
__pyx_t_2 = (__pyx_v_negative_step != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":848
|
|
+ /* "View.MemoryView":850
|
|
* elif start >= shape:
|
|
* if negative_step:
|
|
* start = shape - 1 # <<<<<<<<<<<<<<
|
|
@@ -25352,7 +25443,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
__pyx_v_start = (__pyx_v_shape - 1);
|
|
|
|
- /* "View.MemoryView":847
|
|
+ /* "View.MemoryView":849
|
|
* start = 0
|
|
* elif start >= shape:
|
|
* if negative_step: # <<<<<<<<<<<<<<
|
|
@@ -25362,7 +25453,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
goto __pyx_L14;
|
|
}
|
|
|
|
- /* "View.MemoryView":850
|
|
+ /* "View.MemoryView":852
|
|
* start = shape - 1
|
|
* else:
|
|
* start = shape # <<<<<<<<<<<<<<
|
|
@@ -25374,7 +25465,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
}
|
|
__pyx_L14:;
|
|
|
|
- /* "View.MemoryView":846
|
|
+ /* "View.MemoryView":848
|
|
* if start < 0:
|
|
* start = 0
|
|
* elif start >= shape: # <<<<<<<<<<<<<<
|
|
@@ -25384,7 +25475,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
}
|
|
__pyx_L12:;
|
|
|
|
- /* "View.MemoryView":841
|
|
+ /* "View.MemoryView":843
|
|
*
|
|
*
|
|
* if have_start: # <<<<<<<<<<<<<<
|
|
@@ -25394,7 +25485,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
goto __pyx_L11;
|
|
}
|
|
|
|
- /* "View.MemoryView":852
|
|
+ /* "View.MemoryView":854
|
|
* start = shape
|
|
* else:
|
|
* if negative_step: # <<<<<<<<<<<<<<
|
|
@@ -25405,7 +25496,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
__pyx_t_2 = (__pyx_v_negative_step != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":853
|
|
+ /* "View.MemoryView":855
|
|
* else:
|
|
* if negative_step:
|
|
* start = shape - 1 # <<<<<<<<<<<<<<
|
|
@@ -25414,7 +25505,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
__pyx_v_start = (__pyx_v_shape - 1);
|
|
|
|
- /* "View.MemoryView":852
|
|
+ /* "View.MemoryView":854
|
|
* start = shape
|
|
* else:
|
|
* if negative_step: # <<<<<<<<<<<<<<
|
|
@@ -25424,7 +25515,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
goto __pyx_L15;
|
|
}
|
|
|
|
- /* "View.MemoryView":855
|
|
+ /* "View.MemoryView":857
|
|
* start = shape - 1
|
|
* else:
|
|
* start = 0 # <<<<<<<<<<<<<<
|
|
@@ -25438,7 +25529,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
}
|
|
__pyx_L11:;
|
|
|
|
- /* "View.MemoryView":857
|
|
+ /* "View.MemoryView":859
|
|
* start = 0
|
|
*
|
|
* if have_stop: # <<<<<<<<<<<<<<
|
|
@@ -25448,7 +25539,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
__pyx_t_2 = (__pyx_v_have_stop != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":858
|
|
+ /* "View.MemoryView":860
|
|
*
|
|
* if have_stop:
|
|
* if stop < 0: # <<<<<<<<<<<<<<
|
|
@@ -25458,7 +25549,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
__pyx_t_2 = ((__pyx_v_stop < 0) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":859
|
|
+ /* "View.MemoryView":861
|
|
* if have_stop:
|
|
* if stop < 0:
|
|
* stop += shape # <<<<<<<<<<<<<<
|
|
@@ -25467,7 +25558,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
__pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
|
|
|
|
- /* "View.MemoryView":860
|
|
+ /* "View.MemoryView":862
|
|
* if stop < 0:
|
|
* stop += shape
|
|
* if stop < 0: # <<<<<<<<<<<<<<
|
|
@@ -25477,7 +25568,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
__pyx_t_2 = ((__pyx_v_stop < 0) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":861
|
|
+ /* "View.MemoryView":863
|
|
* stop += shape
|
|
* if stop < 0:
|
|
* stop = 0 # <<<<<<<<<<<<<<
|
|
@@ -25486,7 +25577,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
__pyx_v_stop = 0;
|
|
|
|
- /* "View.MemoryView":860
|
|
+ /* "View.MemoryView":862
|
|
* if stop < 0:
|
|
* stop += shape
|
|
* if stop < 0: # <<<<<<<<<<<<<<
|
|
@@ -25495,7 +25586,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":858
|
|
+ /* "View.MemoryView":860
|
|
*
|
|
* if have_stop:
|
|
* if stop < 0: # <<<<<<<<<<<<<<
|
|
@@ -25505,7 +25596,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
goto __pyx_L17;
|
|
}
|
|
|
|
- /* "View.MemoryView":862
|
|
+ /* "View.MemoryView":864
|
|
* if stop < 0:
|
|
* stop = 0
|
|
* elif stop > shape: # <<<<<<<<<<<<<<
|
|
@@ -25515,7 +25606,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
__pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":863
|
|
+ /* "View.MemoryView":865
|
|
* stop = 0
|
|
* elif stop > shape:
|
|
* stop = shape # <<<<<<<<<<<<<<
|
|
@@ -25524,7 +25615,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
__pyx_v_stop = __pyx_v_shape;
|
|
|
|
- /* "View.MemoryView":862
|
|
+ /* "View.MemoryView":864
|
|
* if stop < 0:
|
|
* stop = 0
|
|
* elif stop > shape: # <<<<<<<<<<<<<<
|
|
@@ -25534,7 +25625,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
}
|
|
__pyx_L17:;
|
|
|
|
- /* "View.MemoryView":857
|
|
+ /* "View.MemoryView":859
|
|
* start = 0
|
|
*
|
|
* if have_stop: # <<<<<<<<<<<<<<
|
|
@@ -25544,7 +25635,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
goto __pyx_L16;
|
|
}
|
|
|
|
- /* "View.MemoryView":865
|
|
+ /* "View.MemoryView":867
|
|
* stop = shape
|
|
* else:
|
|
* if negative_step: # <<<<<<<<<<<<<<
|
|
@@ -25555,7 +25646,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
__pyx_t_2 = (__pyx_v_negative_step != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":866
|
|
+ /* "View.MemoryView":868
|
|
* else:
|
|
* if negative_step:
|
|
* stop = -1 # <<<<<<<<<<<<<<
|
|
@@ -25564,7 +25655,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
__pyx_v_stop = -1L;
|
|
|
|
- /* "View.MemoryView":865
|
|
+ /* "View.MemoryView":867
|
|
* stop = shape
|
|
* else:
|
|
* if negative_step: # <<<<<<<<<<<<<<
|
|
@@ -25574,7 +25665,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
goto __pyx_L19;
|
|
}
|
|
|
|
- /* "View.MemoryView":868
|
|
+ /* "View.MemoryView":870
|
|
* stop = -1
|
|
* else:
|
|
* stop = shape # <<<<<<<<<<<<<<
|
|
@@ -25588,7 +25679,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
}
|
|
__pyx_L16:;
|
|
|
|
- /* "View.MemoryView":870
|
|
+ /* "View.MemoryView":872
|
|
* stop = shape
|
|
*
|
|
* if not have_step: # <<<<<<<<<<<<<<
|
|
@@ -25598,7 +25689,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
__pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":871
|
|
+ /* "View.MemoryView":873
|
|
*
|
|
* if not have_step:
|
|
* step = 1 # <<<<<<<<<<<<<<
|
|
@@ -25607,7 +25698,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
__pyx_v_step = 1;
|
|
|
|
- /* "View.MemoryView":870
|
|
+ /* "View.MemoryView":872
|
|
* stop = shape
|
|
*
|
|
* if not have_step: # <<<<<<<<<<<<<<
|
|
@@ -25616,7 +25707,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":875
|
|
+ /* "View.MemoryView":877
|
|
*
|
|
* with cython.cdivision(True):
|
|
* new_shape = (stop - start) // step # <<<<<<<<<<<<<<
|
|
@@ -25625,7 +25716,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
__pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
|
|
|
|
- /* "View.MemoryView":877
|
|
+ /* "View.MemoryView":879
|
|
* new_shape = (stop - start) // step
|
|
*
|
|
* if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
|
|
@@ -25635,7 +25726,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
__pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":878
|
|
+ /* "View.MemoryView":880
|
|
*
|
|
* if (stop - start) - step * new_shape:
|
|
* new_shape += 1 # <<<<<<<<<<<<<<
|
|
@@ -25644,7 +25735,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
__pyx_v_new_shape = (__pyx_v_new_shape + 1);
|
|
|
|
- /* "View.MemoryView":877
|
|
+ /* "View.MemoryView":879
|
|
* new_shape = (stop - start) // step
|
|
*
|
|
* if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
|
|
@@ -25653,7 +25744,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":880
|
|
+ /* "View.MemoryView":882
|
|
* new_shape += 1
|
|
*
|
|
* if new_shape < 0: # <<<<<<<<<<<<<<
|
|
@@ -25663,7 +25754,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
__pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":881
|
|
+ /* "View.MemoryView":883
|
|
*
|
|
* if new_shape < 0:
|
|
* new_shape = 0 # <<<<<<<<<<<<<<
|
|
@@ -25672,7 +25763,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
__pyx_v_new_shape = 0;
|
|
|
|
- /* "View.MemoryView":880
|
|
+ /* "View.MemoryView":882
|
|
* new_shape += 1
|
|
*
|
|
* if new_shape < 0: # <<<<<<<<<<<<<<
|
|
@@ -25681,7 +25772,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":884
|
|
+ /* "View.MemoryView":886
|
|
*
|
|
*
|
|
* dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
|
|
@@ -25690,7 +25781,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
(__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
|
|
|
|
- /* "View.MemoryView":885
|
|
+ /* "View.MemoryView":887
|
|
*
|
|
* dst.strides[new_ndim] = stride * step
|
|
* dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
|
|
@@ -25699,7 +25790,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
(__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
|
|
|
|
- /* "View.MemoryView":886
|
|
+ /* "View.MemoryView":888
|
|
* dst.strides[new_ndim] = stride * step
|
|
* dst.shape[new_ndim] = new_shape
|
|
* dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
|
|
@@ -25710,7 +25801,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
}
|
|
__pyx_L3:;
|
|
|
|
- /* "View.MemoryView":889
|
|
+ /* "View.MemoryView":891
|
|
*
|
|
*
|
|
* if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
|
|
@@ -25720,7 +25811,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
__pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":890
|
|
+ /* "View.MemoryView":892
|
|
*
|
|
* if suboffset_dim[0] < 0:
|
|
* dst.data += start * stride # <<<<<<<<<<<<<<
|
|
@@ -25729,7 +25820,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
__pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
|
|
|
|
- /* "View.MemoryView":889
|
|
+ /* "View.MemoryView":891
|
|
*
|
|
*
|
|
* if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
|
|
@@ -25739,7 +25830,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
goto __pyx_L23;
|
|
}
|
|
|
|
- /* "View.MemoryView":892
|
|
+ /* "View.MemoryView":894
|
|
* dst.data += start * stride
|
|
* else:
|
|
* dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
|
|
@@ -25752,7 +25843,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
}
|
|
__pyx_L23:;
|
|
|
|
- /* "View.MemoryView":894
|
|
+ /* "View.MemoryView":896
|
|
* dst.suboffsets[suboffset_dim[0]] += start * stride
|
|
*
|
|
* if suboffset >= 0: # <<<<<<<<<<<<<<
|
|
@@ -25762,7 +25853,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
__pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":895
|
|
+ /* "View.MemoryView":897
|
|
*
|
|
* if suboffset >= 0:
|
|
* if not is_slice: # <<<<<<<<<<<<<<
|
|
@@ -25772,7 +25863,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
__pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":896
|
|
+ /* "View.MemoryView":898
|
|
* if suboffset >= 0:
|
|
* if not is_slice:
|
|
* if new_ndim == 0: # <<<<<<<<<<<<<<
|
|
@@ -25782,7 +25873,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
__pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":897
|
|
+ /* "View.MemoryView":899
|
|
* if not is_slice:
|
|
* if new_ndim == 0:
|
|
* dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
|
|
@@ -25791,7 +25882,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
__pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
|
|
|
|
- /* "View.MemoryView":896
|
|
+ /* "View.MemoryView":898
|
|
* if suboffset >= 0:
|
|
* if not is_slice:
|
|
* if new_ndim == 0: # <<<<<<<<<<<<<<
|
|
@@ -25801,7 +25892,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
goto __pyx_L26;
|
|
}
|
|
|
|
- /* "View.MemoryView":899
|
|
+ /* "View.MemoryView":901
|
|
* dst.data = (<char **> dst.data)[0] + suboffset
|
|
* else:
|
|
* _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
|
|
@@ -25810,18 +25901,18 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
/*else*/ {
|
|
|
|
- /* "View.MemoryView":900
|
|
+ /* "View.MemoryView":902
|
|
* else:
|
|
* _err_dim(IndexError, "All dimensions preceding dimension %d "
|
|
* "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
|
|
* else:
|
|
* suboffset_dim[0] = new_ndim
|
|
*/
|
|
- __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 899, __pyx_L1_error)
|
|
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 901, __pyx_L1_error)
|
|
}
|
|
__pyx_L26:;
|
|
|
|
- /* "View.MemoryView":895
|
|
+ /* "View.MemoryView":897
|
|
*
|
|
* if suboffset >= 0:
|
|
* if not is_slice: # <<<<<<<<<<<<<<
|
|
@@ -25831,7 +25922,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
goto __pyx_L25;
|
|
}
|
|
|
|
- /* "View.MemoryView":902
|
|
+ /* "View.MemoryView":904
|
|
* "must be indexed and not sliced", dim)
|
|
* else:
|
|
* suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
|
|
@@ -25843,7 +25934,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
}
|
|
__pyx_L25:;
|
|
|
|
- /* "View.MemoryView":894
|
|
+ /* "View.MemoryView":896
|
|
* dst.suboffsets[suboffset_dim[0]] += start * stride
|
|
*
|
|
* if suboffset >= 0: # <<<<<<<<<<<<<<
|
|
@@ -25852,7 +25943,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":904
|
|
+ /* "View.MemoryView":906
|
|
* suboffset_dim[0] = new_ndim
|
|
*
|
|
* return 0 # <<<<<<<<<<<<<<
|
|
@@ -25862,7 +25953,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
__pyx_r = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":807
|
|
+ /* "View.MemoryView":809
|
|
*
|
|
* @cname('__pyx_memoryview_slice_memviewslice')
|
|
* cdef int slice_memviewslice( # <<<<<<<<<<<<<<
|
|
@@ -25886,7 +25977,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":910
|
|
+/* "View.MemoryView":912
|
|
*
|
|
* @cname('__pyx_pybuffer_index')
|
|
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
|
|
@@ -25911,7 +26002,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("pybuffer_index", 0);
|
|
|
|
- /* "View.MemoryView":912
|
|
+ /* "View.MemoryView":914
|
|
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
|
|
* Py_ssize_t dim) except NULL:
|
|
* cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
|
|
@@ -25920,7 +26011,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
|
|
*/
|
|
__pyx_v_suboffset = -1L;
|
|
|
|
- /* "View.MemoryView":913
|
|
+ /* "View.MemoryView":915
|
|
* Py_ssize_t dim) except NULL:
|
|
* cdef Py_ssize_t shape, stride, suboffset = -1
|
|
* cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
|
|
@@ -25930,7 +26021,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
|
|
__pyx_t_1 = __pyx_v_view->itemsize;
|
|
__pyx_v_itemsize = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":916
|
|
+ /* "View.MemoryView":918
|
|
* cdef char *resultp
|
|
*
|
|
* if view.ndim == 0: # <<<<<<<<<<<<<<
|
|
@@ -25940,7 +26031,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
|
|
__pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":917
|
|
+ /* "View.MemoryView":919
|
|
*
|
|
* if view.ndim == 0:
|
|
* shape = view.len / itemsize # <<<<<<<<<<<<<<
|
|
@@ -25949,15 +26040,15 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
|
|
*/
|
|
if (unlikely(__pyx_v_itemsize == 0)) {
|
|
PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
|
|
- __PYX_ERR(1, 917, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 919, __pyx_L1_error)
|
|
}
|
|
else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
|
|
PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
|
|
- __PYX_ERR(1, 917, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 919, __pyx_L1_error)
|
|
}
|
|
__pyx_v_shape = (__pyx_v_view->len / __pyx_v_itemsize);
|
|
|
|
- /* "View.MemoryView":918
|
|
+ /* "View.MemoryView":920
|
|
* if view.ndim == 0:
|
|
* shape = view.len / itemsize
|
|
* stride = itemsize # <<<<<<<<<<<<<<
|
|
@@ -25966,7 +26057,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
|
|
*/
|
|
__pyx_v_stride = __pyx_v_itemsize;
|
|
|
|
- /* "View.MemoryView":916
|
|
+ /* "View.MemoryView":918
|
|
* cdef char *resultp
|
|
*
|
|
* if view.ndim == 0: # <<<<<<<<<<<<<<
|
|
@@ -25976,7 +26067,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
- /* "View.MemoryView":920
|
|
+ /* "View.MemoryView":922
|
|
* stride = itemsize
|
|
* else:
|
|
* shape = view.shape[dim] # <<<<<<<<<<<<<<
|
|
@@ -25986,7 +26077,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
|
|
/*else*/ {
|
|
__pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
|
|
|
|
- /* "View.MemoryView":921
|
|
+ /* "View.MemoryView":923
|
|
* else:
|
|
* shape = view.shape[dim]
|
|
* stride = view.strides[dim] # <<<<<<<<<<<<<<
|
|
@@ -25995,7 +26086,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
|
|
*/
|
|
__pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
|
|
|
|
- /* "View.MemoryView":922
|
|
+ /* "View.MemoryView":924
|
|
* shape = view.shape[dim]
|
|
* stride = view.strides[dim]
|
|
* if view.suboffsets != NULL: # <<<<<<<<<<<<<<
|
|
@@ -26005,7 +26096,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
|
|
__pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":923
|
|
+ /* "View.MemoryView":925
|
|
* stride = view.strides[dim]
|
|
* if view.suboffsets != NULL:
|
|
* suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
|
|
@@ -26014,7 +26105,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
|
|
*/
|
|
__pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
|
|
|
|
- /* "View.MemoryView":922
|
|
+ /* "View.MemoryView":924
|
|
* shape = view.shape[dim]
|
|
* stride = view.strides[dim]
|
|
* if view.suboffsets != NULL: # <<<<<<<<<<<<<<
|
|
@@ -26025,7 +26116,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
|
|
}
|
|
__pyx_L3:;
|
|
|
|
- /* "View.MemoryView":925
|
|
+ /* "View.MemoryView":927
|
|
* suboffset = view.suboffsets[dim]
|
|
*
|
|
* if index < 0: # <<<<<<<<<<<<<<
|
|
@@ -26035,7 +26126,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
|
|
__pyx_t_2 = ((__pyx_v_index < 0) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":926
|
|
+ /* "View.MemoryView":928
|
|
*
|
|
* if index < 0:
|
|
* index += view.shape[dim] # <<<<<<<<<<<<<<
|
|
@@ -26044,7 +26135,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
|
|
*/
|
|
__pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
|
|
|
|
- /* "View.MemoryView":927
|
|
+ /* "View.MemoryView":929
|
|
* if index < 0:
|
|
* index += view.shape[dim]
|
|
* if index < 0: # <<<<<<<<<<<<<<
|
|
@@ -26054,26 +26145,26 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
|
|
__pyx_t_2 = ((__pyx_v_index < 0) != 0);
|
|
if (unlikely(__pyx_t_2)) {
|
|
|
|
- /* "View.MemoryView":928
|
|
+ /* "View.MemoryView":930
|
|
* index += view.shape[dim]
|
|
* if index < 0:
|
|
* raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
|
|
*
|
|
* if index >= shape:
|
|
*/
|
|
- __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
|
|
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 930, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error)
|
|
+ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 930, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
|
|
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 930, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __PYX_ERR(1, 928, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 930, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":927
|
|
+ /* "View.MemoryView":929
|
|
* if index < 0:
|
|
* index += view.shape[dim]
|
|
* if index < 0: # <<<<<<<<<<<<<<
|
|
@@ -26082,7 +26173,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":925
|
|
+ /* "View.MemoryView":927
|
|
* suboffset = view.suboffsets[dim]
|
|
*
|
|
* if index < 0: # <<<<<<<<<<<<<<
|
|
@@ -26091,7 +26182,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":930
|
|
+ /* "View.MemoryView":932
|
|
* raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
|
|
*
|
|
* if index >= shape: # <<<<<<<<<<<<<<
|
|
@@ -26101,26 +26192,26 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
|
|
__pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
|
|
if (unlikely(__pyx_t_2)) {
|
|
|
|
- /* "View.MemoryView":931
|
|
+ /* "View.MemoryView":933
|
|
*
|
|
* if index >= shape:
|
|
* raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
|
|
*
|
|
* resultp = bufp + index * stride
|
|
*/
|
|
- __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
|
|
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 933, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error)
|
|
+ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 933, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
|
|
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 933, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __PYX_ERR(1, 931, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 933, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":930
|
|
+ /* "View.MemoryView":932
|
|
* raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
|
|
*
|
|
* if index >= shape: # <<<<<<<<<<<<<<
|
|
@@ -26129,7 +26220,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":933
|
|
+ /* "View.MemoryView":935
|
|
* raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
|
|
*
|
|
* resultp = bufp + index * stride # <<<<<<<<<<<<<<
|
|
@@ -26138,7 +26229,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
|
|
*/
|
|
__pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
|
|
|
|
- /* "View.MemoryView":934
|
|
+ /* "View.MemoryView":936
|
|
*
|
|
* resultp = bufp + index * stride
|
|
* if suboffset >= 0: # <<<<<<<<<<<<<<
|
|
@@ -26148,7 +26239,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
|
|
__pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":935
|
|
+ /* "View.MemoryView":937
|
|
* resultp = bufp + index * stride
|
|
* if suboffset >= 0:
|
|
* resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
|
|
@@ -26157,7 +26248,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
|
|
*/
|
|
__pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
|
|
|
|
- /* "View.MemoryView":934
|
|
+ /* "View.MemoryView":936
|
|
*
|
|
* resultp = bufp + index * stride
|
|
* if suboffset >= 0: # <<<<<<<<<<<<<<
|
|
@@ -26166,7 +26257,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":937
|
|
+ /* "View.MemoryView":939
|
|
* resultp = (<char **> resultp)[0] + suboffset
|
|
*
|
|
* return resultp # <<<<<<<<<<<<<<
|
|
@@ -26176,7 +26267,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
|
|
__pyx_r = __pyx_v_resultp;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":910
|
|
+ /* "View.MemoryView":912
|
|
*
|
|
* @cname('__pyx_pybuffer_index')
|
|
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
|
|
@@ -26195,7 +26286,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":943
|
|
+/* "View.MemoryView":945
|
|
*
|
|
* @cname('__pyx_memslice_transpose')
|
|
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
|
|
@@ -26223,7 +26314,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
|
|
- /* "View.MemoryView":944
|
|
+ /* "View.MemoryView":946
|
|
* @cname('__pyx_memslice_transpose')
|
|
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
|
|
* cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
|
|
@@ -26233,7 +26324,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
|
|
__pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
|
|
__pyx_v_ndim = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":946
|
|
+ /* "View.MemoryView":948
|
|
* cdef int ndim = memslice.memview.view.ndim
|
|
*
|
|
* cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
|
|
@@ -26243,7 +26334,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
|
|
__pyx_t_2 = __pyx_v_memslice->shape;
|
|
__pyx_v_shape = __pyx_t_2;
|
|
|
|
- /* "View.MemoryView":947
|
|
+ /* "View.MemoryView":949
|
|
*
|
|
* cdef Py_ssize_t *shape = memslice.shape
|
|
* cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
|
|
@@ -26253,7 +26344,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
|
|
__pyx_t_2 = __pyx_v_memslice->strides;
|
|
__pyx_v_strides = __pyx_t_2;
|
|
|
|
- /* "View.MemoryView":951
|
|
+ /* "View.MemoryView":953
|
|
*
|
|
* cdef int i, j
|
|
* for i in range(ndim / 2): # <<<<<<<<<<<<<<
|
|
@@ -26265,7 +26356,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
|
|
for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
|
|
__pyx_v_i = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":952
|
|
+ /* "View.MemoryView":954
|
|
* cdef int i, j
|
|
* for i in range(ndim / 2):
|
|
* j = ndim - 1 - i # <<<<<<<<<<<<<<
|
|
@@ -26274,7 +26365,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
|
|
*/
|
|
__pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
|
|
|
|
- /* "View.MemoryView":953
|
|
+ /* "View.MemoryView":955
|
|
* for i in range(ndim / 2):
|
|
* j = ndim - 1 - i
|
|
* strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
|
|
@@ -26286,7 +26377,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
|
|
(__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
|
|
(__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
|
|
|
|
- /* "View.MemoryView":954
|
|
+ /* "View.MemoryView":956
|
|
* j = ndim - 1 - i
|
|
* strides[i], strides[j] = strides[j], strides[i]
|
|
* shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
|
|
@@ -26298,7 +26389,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
|
|
(__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
|
|
(__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
|
|
|
|
- /* "View.MemoryView":956
|
|
+ /* "View.MemoryView":958
|
|
* shape[i], shape[j] = shape[j], shape[i]
|
|
*
|
|
* if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
|
|
@@ -26316,16 +26407,16 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
|
|
__pyx_L6_bool_binop_done:;
|
|
if (__pyx_t_7) {
|
|
|
|
- /* "View.MemoryView":957
|
|
+ /* "View.MemoryView":959
|
|
*
|
|
* if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
|
|
* _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
|
|
*
|
|
* return 1
|
|
*/
|
|
- __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 957, __pyx_L1_error)
|
|
+ __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 959, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":956
|
|
+ /* "View.MemoryView":958
|
|
* shape[i], shape[j] = shape[j], shape[i]
|
|
*
|
|
* if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
|
|
@@ -26335,7 +26426,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
|
|
}
|
|
}
|
|
|
|
- /* "View.MemoryView":959
|
|
+ /* "View.MemoryView":961
|
|
* _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
|
|
*
|
|
* return 1 # <<<<<<<<<<<<<<
|
|
@@ -26345,7 +26436,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
|
|
__pyx_r = 1;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":943
|
|
+ /* "View.MemoryView":945
|
|
*
|
|
* @cname('__pyx_memslice_transpose')
|
|
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
|
|
@@ -26369,7 +26460,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":976
|
|
+/* "View.MemoryView":978
|
|
* cdef int (*to_dtype_func)(char *, object) except 0
|
|
*
|
|
* def __dealloc__(self): # <<<<<<<<<<<<<<
|
|
@@ -26392,7 +26483,7 @@ static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewsl
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__dealloc__", 0);
|
|
|
|
- /* "View.MemoryView":977
|
|
+ /* "View.MemoryView":979
|
|
*
|
|
* def __dealloc__(self):
|
|
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
|
|
@@ -26401,7 +26492,7 @@ static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewsl
|
|
*/
|
|
__PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
|
|
|
|
- /* "View.MemoryView":976
|
|
+ /* "View.MemoryView":978
|
|
* cdef int (*to_dtype_func)(char *, object) except 0
|
|
*
|
|
* def __dealloc__(self): # <<<<<<<<<<<<<<
|
|
@@ -26413,7 +26504,7 @@ static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewsl
|
|
__Pyx_RefNannyFinishContext();
|
|
}
|
|
|
|
-/* "View.MemoryView":979
|
|
+/* "View.MemoryView":981
|
|
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
|
|
*
|
|
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
|
|
@@ -26431,7 +26522,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("convert_item_to_object", 0);
|
|
|
|
- /* "View.MemoryView":980
|
|
+ /* "View.MemoryView":982
|
|
*
|
|
* cdef convert_item_to_object(self, char *itemp):
|
|
* if self.to_object_func != NULL: # <<<<<<<<<<<<<<
|
|
@@ -26441,7 +26532,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
|
|
__pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":981
|
|
+ /* "View.MemoryView":983
|
|
* cdef convert_item_to_object(self, char *itemp):
|
|
* if self.to_object_func != NULL:
|
|
* return self.to_object_func(itemp) # <<<<<<<<<<<<<<
|
|
@@ -26449,13 +26540,13 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
|
|
* return memoryview.convert_item_to_object(self, itemp)
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
|
|
+ __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":980
|
|
+ /* "View.MemoryView":982
|
|
*
|
|
* cdef convert_item_to_object(self, char *itemp):
|
|
* if self.to_object_func != NULL: # <<<<<<<<<<<<<<
|
|
@@ -26464,7 +26555,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":983
|
|
+ /* "View.MemoryView":985
|
|
* return self.to_object_func(itemp)
|
|
* else:
|
|
* return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
|
|
@@ -26473,14 +26564,14 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
|
|
*/
|
|
/*else*/ {
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
|
|
+ __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 985, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
|
|
- /* "View.MemoryView":979
|
|
+ /* "View.MemoryView":981
|
|
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
|
|
*
|
|
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
|
|
@@ -26499,7 +26590,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":985
|
|
+/* "View.MemoryView":987
|
|
* return memoryview.convert_item_to_object(self, itemp)
|
|
*
|
|
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
|
|
@@ -26518,7 +26609,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("assign_item_from_object", 0);
|
|
|
|
- /* "View.MemoryView":986
|
|
+ /* "View.MemoryView":988
|
|
*
|
|
* cdef assign_item_from_object(self, char *itemp, object value):
|
|
* if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
|
|
@@ -26528,16 +26619,16 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
|
|
__pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":987
|
|
+ /* "View.MemoryView":989
|
|
* cdef assign_item_from_object(self, char *itemp, object value):
|
|
* if self.to_dtype_func != NULL:
|
|
* self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
|
|
* else:
|
|
* memoryview.assign_item_from_object(self, itemp, value)
|
|
*/
|
|
- __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 987, __pyx_L1_error)
|
|
+ __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 989, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":986
|
|
+ /* "View.MemoryView":988
|
|
*
|
|
* cdef assign_item_from_object(self, char *itemp, object value):
|
|
* if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
|
|
@@ -26547,7 +26638,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
- /* "View.MemoryView":989
|
|
+ /* "View.MemoryView":991
|
|
* self.to_dtype_func(itemp, value)
|
|
* else:
|
|
* memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
|
|
@@ -26555,13 +26646,13 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
|
|
* @property
|
|
*/
|
|
/*else*/ {
|
|
- __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error)
|
|
+ __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 991, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
}
|
|
__pyx_L3:;
|
|
|
|
- /* "View.MemoryView":985
|
|
+ /* "View.MemoryView":987
|
|
* return memoryview.convert_item_to_object(self, itemp)
|
|
*
|
|
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
|
|
@@ -26582,7 +26673,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":992
|
|
+/* "View.MemoryView":994
|
|
*
|
|
* @property
|
|
* def base(self): # <<<<<<<<<<<<<<
|
|
@@ -26608,7 +26699,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__get__", 0);
|
|
|
|
- /* "View.MemoryView":993
|
|
+ /* "View.MemoryView":995
|
|
* @property
|
|
* def base(self):
|
|
* return self.from_object # <<<<<<<<<<<<<<
|
|
@@ -26620,7 +26711,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__
|
|
__pyx_r = __pyx_v_self->from_object;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":992
|
|
+ /* "View.MemoryView":994
|
|
*
|
|
* @property
|
|
* def base(self): # <<<<<<<<<<<<<<
|
|
@@ -26748,7 +26839,7 @@ static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUS
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":999
|
|
+/* "View.MemoryView":1001
|
|
*
|
|
* @cname('__pyx_memoryview_fromslice')
|
|
* cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
|
|
@@ -26776,7 +26867,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("memoryview_fromslice", 0);
|
|
|
|
- /* "View.MemoryView":1007
|
|
+ /* "View.MemoryView":1009
|
|
* cdef _memoryviewslice result
|
|
*
|
|
* if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
|
|
@@ -26786,7 +26877,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
__pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":1008
|
|
+ /* "View.MemoryView":1010
|
|
*
|
|
* if <PyObject *> memviewslice.memview == Py_None:
|
|
* return None # <<<<<<<<<<<<<<
|
|
@@ -26797,7 +26888,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":1007
|
|
+ /* "View.MemoryView":1009
|
|
* cdef _memoryviewslice result
|
|
*
|
|
* if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
|
|
@@ -26806,16 +26897,16 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1013
|
|
+ /* "View.MemoryView":1015
|
|
*
|
|
*
|
|
* result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
|
|
*
|
|
* result.from_slice = memviewslice
|
|
*/
|
|
- __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
|
|
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1015, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_INCREF(Py_None);
|
|
__Pyx_GIVEREF(Py_None);
|
|
@@ -26826,13 +26917,13 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
__Pyx_GIVEREF(__pyx_t_2);
|
|
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
|
|
__pyx_t_2 = 0;
|
|
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
|
|
__pyx_t_2 = 0;
|
|
|
|
- /* "View.MemoryView":1015
|
|
+ /* "View.MemoryView":1017
|
|
* result = _memoryviewslice(None, 0, dtype_is_object)
|
|
*
|
|
* result.from_slice = memviewslice # <<<<<<<<<<<<<<
|
|
@@ -26841,7 +26932,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
__pyx_v_result->from_slice = __pyx_v_memviewslice;
|
|
|
|
- /* "View.MemoryView":1016
|
|
+ /* "View.MemoryView":1018
|
|
*
|
|
* result.from_slice = memviewslice
|
|
* __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
|
|
@@ -26850,14 +26941,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
__PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
|
|
|
|
- /* "View.MemoryView":1018
|
|
+ /* "View.MemoryView":1020
|
|
* __PYX_INC_MEMVIEW(&memviewslice, 1)
|
|
*
|
|
* result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
|
|
* result.typeinfo = memviewslice.memview.typeinfo
|
|
*
|
|
*/
|
|
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1020, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_GIVEREF(__pyx_t_2);
|
|
__Pyx_GOTREF(__pyx_v_result->from_object);
|
|
@@ -26865,7 +26956,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
__pyx_v_result->from_object = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
|
|
- /* "View.MemoryView":1019
|
|
+ /* "View.MemoryView":1021
|
|
*
|
|
* result.from_object = (<memoryview> memviewslice.memview).base
|
|
* result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
|
|
@@ -26875,7 +26966,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
__pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
|
|
__pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1021
|
|
+ /* "View.MemoryView":1023
|
|
* result.typeinfo = memviewslice.memview.typeinfo
|
|
*
|
|
* result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
|
|
@@ -26885,7 +26976,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
__pyx_t_5 = __pyx_v_memviewslice.memview->view;
|
|
__pyx_v_result->__pyx_base.view = __pyx_t_5;
|
|
|
|
- /* "View.MemoryView":1022
|
|
+ /* "View.MemoryView":1024
|
|
*
|
|
* result.view = memviewslice.memview.view
|
|
* result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
|
|
@@ -26894,7 +26985,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
__pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
|
|
|
|
- /* "View.MemoryView":1023
|
|
+ /* "View.MemoryView":1025
|
|
* result.view = memviewslice.memview.view
|
|
* result.view.buf = <void *> memviewslice.data
|
|
* result.view.ndim = ndim # <<<<<<<<<<<<<<
|
|
@@ -26903,7 +26994,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
__pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
|
|
|
|
- /* "View.MemoryView":1024
|
|
+ /* "View.MemoryView":1026
|
|
* result.view.buf = <void *> memviewslice.data
|
|
* result.view.ndim = ndim
|
|
* (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
|
|
@@ -26912,7 +27003,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
|
|
|
|
- /* "View.MemoryView":1025
|
|
+ /* "View.MemoryView":1027
|
|
* result.view.ndim = ndim
|
|
* (<__pyx_buffer *> &result.view).obj = Py_None
|
|
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
|
|
@@ -26921,7 +27012,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
Py_INCREF(Py_None);
|
|
|
|
- /* "View.MemoryView":1027
|
|
+ /* "View.MemoryView":1029
|
|
* Py_INCREF(Py_None)
|
|
*
|
|
* if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
|
|
@@ -26931,7 +27022,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
__pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":1028
|
|
+ /* "View.MemoryView":1030
|
|
*
|
|
* if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
|
|
* result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
|
|
@@ -26940,7 +27031,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
__pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
|
|
|
|
- /* "View.MemoryView":1027
|
|
+ /* "View.MemoryView":1029
|
|
* Py_INCREF(Py_None)
|
|
*
|
|
* if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
|
|
@@ -26950,7 +27041,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
goto __pyx_L4;
|
|
}
|
|
|
|
- /* "View.MemoryView":1030
|
|
+ /* "View.MemoryView":1032
|
|
* result.flags = PyBUF_RECORDS
|
|
* else:
|
|
* result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
|
|
@@ -26962,7 +27053,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
}
|
|
__pyx_L4:;
|
|
|
|
- /* "View.MemoryView":1032
|
|
+ /* "View.MemoryView":1034
|
|
* result.flags = PyBUF_RECORDS_RO
|
|
*
|
|
* result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
|
|
@@ -26971,7 +27062,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
__pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
|
|
|
|
- /* "View.MemoryView":1033
|
|
+ /* "View.MemoryView":1035
|
|
*
|
|
* result.view.shape = <Py_ssize_t *> result.from_slice.shape
|
|
* result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
|
|
@@ -26980,7 +27071,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
__pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
|
|
|
|
- /* "View.MemoryView":1036
|
|
+ /* "View.MemoryView":1038
|
|
*
|
|
*
|
|
* result.view.suboffsets = NULL # <<<<<<<<<<<<<<
|
|
@@ -26989,7 +27080,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
__pyx_v_result->__pyx_base.view.suboffsets = NULL;
|
|
|
|
- /* "View.MemoryView":1037
|
|
+ /* "View.MemoryView":1039
|
|
*
|
|
* result.view.suboffsets = NULL
|
|
* for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
|
|
@@ -27001,7 +27092,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
__pyx_t_6 = __pyx_t_8;
|
|
__pyx_v_suboffset = (__pyx_t_6[0]);
|
|
|
|
- /* "View.MemoryView":1038
|
|
+ /* "View.MemoryView":1040
|
|
* result.view.suboffsets = NULL
|
|
* for suboffset in result.from_slice.suboffsets[:ndim]:
|
|
* if suboffset >= 0: # <<<<<<<<<<<<<<
|
|
@@ -27011,7 +27102,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
__pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":1039
|
|
+ /* "View.MemoryView":1041
|
|
* for suboffset in result.from_slice.suboffsets[:ndim]:
|
|
* if suboffset >= 0:
|
|
* result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
|
|
@@ -27020,7 +27111,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
__pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
|
|
|
|
- /* "View.MemoryView":1040
|
|
+ /* "View.MemoryView":1042
|
|
* if suboffset >= 0:
|
|
* result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
|
|
* break # <<<<<<<<<<<<<<
|
|
@@ -27029,7 +27120,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
goto __pyx_L6_break;
|
|
|
|
- /* "View.MemoryView":1038
|
|
+ /* "View.MemoryView":1040
|
|
* result.view.suboffsets = NULL
|
|
* for suboffset in result.from_slice.suboffsets[:ndim]:
|
|
* if suboffset >= 0: # <<<<<<<<<<<<<<
|
|
@@ -27040,7 +27131,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
}
|
|
__pyx_L6_break:;
|
|
|
|
- /* "View.MemoryView":1042
|
|
+ /* "View.MemoryView":1044
|
|
* break
|
|
*
|
|
* result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
|
|
@@ -27050,7 +27141,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
__pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
|
|
__pyx_v_result->__pyx_base.view.len = __pyx_t_9;
|
|
|
|
- /* "View.MemoryView":1043
|
|
+ /* "View.MemoryView":1045
|
|
*
|
|
* result.view.len = result.view.itemsize
|
|
* for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
|
|
@@ -27060,29 +27151,29 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
__pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
|
|
for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
|
|
__pyx_t_6 = __pyx_t_8;
|
|
- __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
|
|
+ __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1045, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
|
|
__pyx_t_2 = 0;
|
|
|
|
- /* "View.MemoryView":1044
|
|
+ /* "View.MemoryView":1046
|
|
* result.view.len = result.view.itemsize
|
|
* for length in result.view.shape[:ndim]:
|
|
* result.view.len *= length # <<<<<<<<<<<<<<
|
|
*
|
|
* result.to_object_func = to_object_func
|
|
*/
|
|
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
|
|
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1046, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
|
|
+ __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1046, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
|
|
+ __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1046, __pyx_L1_error)
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__pyx_v_result->__pyx_base.view.len = __pyx_t_9;
|
|
}
|
|
|
|
- /* "View.MemoryView":1046
|
|
+ /* "View.MemoryView":1048
|
|
* result.view.len *= length
|
|
*
|
|
* result.to_object_func = to_object_func # <<<<<<<<<<<<<<
|
|
@@ -27091,7 +27182,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
__pyx_v_result->to_object_func = __pyx_v_to_object_func;
|
|
|
|
- /* "View.MemoryView":1047
|
|
+ /* "View.MemoryView":1049
|
|
*
|
|
* result.to_object_func = to_object_func
|
|
* result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
|
|
@@ -27100,7 +27191,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
__pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
|
|
|
|
- /* "View.MemoryView":1049
|
|
+ /* "View.MemoryView":1051
|
|
* result.to_dtype_func = to_dtype_func
|
|
*
|
|
* return result # <<<<<<<<<<<<<<
|
|
@@ -27112,7 +27203,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
__pyx_r = ((PyObject *)__pyx_v_result);
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":999
|
|
+ /* "View.MemoryView":1001
|
|
*
|
|
* @cname('__pyx_memoryview_fromslice')
|
|
* cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
|
|
@@ -27134,7 +27225,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1052
|
|
+/* "View.MemoryView":1054
|
|
*
|
|
* @cname('__pyx_memoryview_get_slice_from_memoryview')
|
|
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
|
|
@@ -27154,7 +27245,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("get_slice_from_memview", 0);
|
|
|
|
- /* "View.MemoryView":1055
|
|
+ /* "View.MemoryView":1057
|
|
* __Pyx_memviewslice *mslice) except NULL:
|
|
* cdef _memoryviewslice obj
|
|
* if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
|
|
@@ -27165,20 +27256,20 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
|
|
__pyx_t_2 = (__pyx_t_1 != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1056
|
|
+ /* "View.MemoryView":1058
|
|
* cdef _memoryviewslice obj
|
|
* if isinstance(memview, _memoryviewslice):
|
|
* obj = memview # <<<<<<<<<<<<<<
|
|
* return &obj.from_slice
|
|
* else:
|
|
*/
|
|
- if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
|
|
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1058, __pyx_L1_error)
|
|
__pyx_t_3 = ((PyObject *)__pyx_v_memview);
|
|
__Pyx_INCREF(__pyx_t_3);
|
|
__pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
|
|
__pyx_t_3 = 0;
|
|
|
|
- /* "View.MemoryView":1057
|
|
+ /* "View.MemoryView":1059
|
|
* if isinstance(memview, _memoryviewslice):
|
|
* obj = memview
|
|
* return &obj.from_slice # <<<<<<<<<<<<<<
|
|
@@ -27188,7 +27279,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
|
|
__pyx_r = (&__pyx_v_obj->from_slice);
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":1055
|
|
+ /* "View.MemoryView":1057
|
|
* __Pyx_memviewslice *mslice) except NULL:
|
|
* cdef _memoryviewslice obj
|
|
* if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
|
|
@@ -27197,7 +27288,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1059
|
|
+ /* "View.MemoryView":1061
|
|
* return &obj.from_slice
|
|
* else:
|
|
* slice_copy(memview, mslice) # <<<<<<<<<<<<<<
|
|
@@ -27207,7 +27298,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
|
|
/*else*/ {
|
|
__pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
|
|
|
|
- /* "View.MemoryView":1060
|
|
+ /* "View.MemoryView":1062
|
|
* else:
|
|
* slice_copy(memview, mslice)
|
|
* return mslice # <<<<<<<<<<<<<<
|
|
@@ -27218,7 +27309,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
|
|
goto __pyx_L0;
|
|
}
|
|
|
|
- /* "View.MemoryView":1052
|
|
+ /* "View.MemoryView":1054
|
|
*
|
|
* @cname('__pyx_memoryview_get_slice_from_memoryview')
|
|
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
|
|
@@ -27237,7 +27328,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1063
|
|
+/* "View.MemoryView":1065
|
|
*
|
|
* @cname('__pyx_memoryview_slice_copy')
|
|
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
|
|
@@ -27258,7 +27349,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
|
|
Py_ssize_t __pyx_t_5;
|
|
__Pyx_RefNannySetupContext("slice_copy", 0);
|
|
|
|
- /* "View.MemoryView":1067
|
|
+ /* "View.MemoryView":1069
|
|
* cdef (Py_ssize_t*) shape, strides, suboffsets
|
|
*
|
|
* shape = memview.view.shape # <<<<<<<<<<<<<<
|
|
@@ -27268,7 +27359,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
|
|
__pyx_t_1 = __pyx_v_memview->view.shape;
|
|
__pyx_v_shape = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":1068
|
|
+ /* "View.MemoryView":1070
|
|
*
|
|
* shape = memview.view.shape
|
|
* strides = memview.view.strides # <<<<<<<<<<<<<<
|
|
@@ -27278,7 +27369,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
|
|
__pyx_t_1 = __pyx_v_memview->view.strides;
|
|
__pyx_v_strides = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":1069
|
|
+ /* "View.MemoryView":1071
|
|
* shape = memview.view.shape
|
|
* strides = memview.view.strides
|
|
* suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
|
|
@@ -27288,7 +27379,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
|
|
__pyx_t_1 = __pyx_v_memview->view.suboffsets;
|
|
__pyx_v_suboffsets = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":1071
|
|
+ /* "View.MemoryView":1073
|
|
* suboffsets = memview.view.suboffsets
|
|
*
|
|
* dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
|
|
@@ -27297,7 +27388,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
|
|
*/
|
|
__pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
|
|
|
|
- /* "View.MemoryView":1072
|
|
+ /* "View.MemoryView":1074
|
|
*
|
|
* dst.memview = <__pyx_memoryview *> memview
|
|
* dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
|
|
@@ -27306,7 +27397,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
|
|
*/
|
|
__pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
|
|
|
|
- /* "View.MemoryView":1074
|
|
+ /* "View.MemoryView":1076
|
|
* dst.data = <char *> memview.view.buf
|
|
*
|
|
* for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
|
|
@@ -27318,7 +27409,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
|
|
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
|
|
__pyx_v_dim = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1075
|
|
+ /* "View.MemoryView":1077
|
|
*
|
|
* for dim in range(memview.view.ndim):
|
|
* dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
|
|
@@ -27327,7 +27418,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
|
|
*/
|
|
(__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
|
|
|
|
- /* "View.MemoryView":1076
|
|
+ /* "View.MemoryView":1078
|
|
* for dim in range(memview.view.ndim):
|
|
* dst.shape[dim] = shape[dim]
|
|
* dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
|
|
@@ -27336,7 +27427,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
|
|
*/
|
|
(__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
|
|
|
|
- /* "View.MemoryView":1077
|
|
+ /* "View.MemoryView":1079
|
|
* dst.shape[dim] = shape[dim]
|
|
* dst.strides[dim] = strides[dim]
|
|
* dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
|
|
@@ -27351,7 +27442,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
|
|
(__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
|
|
}
|
|
|
|
- /* "View.MemoryView":1063
|
|
+ /* "View.MemoryView":1065
|
|
*
|
|
* @cname('__pyx_memoryview_slice_copy')
|
|
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
|
|
@@ -27363,7 +27454,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
|
|
__Pyx_RefNannyFinishContext();
|
|
}
|
|
|
|
-/* "View.MemoryView":1080
|
|
+/* "View.MemoryView":1082
|
|
*
|
|
* @cname('__pyx_memoryview_copy_object')
|
|
* cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
|
|
@@ -27381,7 +27472,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("memoryview_copy", 0);
|
|
|
|
- /* "View.MemoryView":1083
|
|
+ /* "View.MemoryView":1085
|
|
* "Create a new memoryview object"
|
|
* cdef __Pyx_memviewslice memviewslice
|
|
* slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
|
|
@@ -27390,7 +27481,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
|
|
*/
|
|
__pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
|
|
|
|
- /* "View.MemoryView":1084
|
|
+ /* "View.MemoryView":1086
|
|
* cdef __Pyx_memviewslice memviewslice
|
|
* slice_copy(memview, &memviewslice)
|
|
* return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
|
|
@@ -27398,13 +27489,13 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
|
|
* @cname('__pyx_memoryview_copy_object_from_slice')
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
|
|
+ __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1086, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_r = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":1080
|
|
+ /* "View.MemoryView":1082
|
|
*
|
|
* @cname('__pyx_memoryview_copy_object')
|
|
* cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
|
|
@@ -27423,7 +27514,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1087
|
|
+/* "View.MemoryView":1089
|
|
*
|
|
* @cname('__pyx_memoryview_copy_object_from_slice')
|
|
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
|
|
@@ -27446,7 +27537,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
|
|
|
|
- /* "View.MemoryView":1094
|
|
+ /* "View.MemoryView":1096
|
|
* cdef int (*to_dtype_func)(char *, object) except 0
|
|
*
|
|
* if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
|
|
@@ -27457,7 +27548,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
|
|
__pyx_t_2 = (__pyx_t_1 != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1095
|
|
+ /* "View.MemoryView":1097
|
|
*
|
|
* if isinstance(memview, _memoryviewslice):
|
|
* to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
|
|
@@ -27467,7 +27558,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
|
|
__pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
|
|
__pyx_v_to_object_func = __pyx_t_3;
|
|
|
|
- /* "View.MemoryView":1096
|
|
+ /* "View.MemoryView":1098
|
|
* if isinstance(memview, _memoryviewslice):
|
|
* to_object_func = (<_memoryviewslice> memview).to_object_func
|
|
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
|
|
@@ -27477,7 +27568,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
|
|
__pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
|
|
__pyx_v_to_dtype_func = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1094
|
|
+ /* "View.MemoryView":1096
|
|
* cdef int (*to_dtype_func)(char *, object) except 0
|
|
*
|
|
* if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
|
|
@@ -27487,7 +27578,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
- /* "View.MemoryView":1098
|
|
+ /* "View.MemoryView":1100
|
|
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
|
|
* else:
|
|
* to_object_func = NULL # <<<<<<<<<<<<<<
|
|
@@ -27497,7 +27588,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
|
|
/*else*/ {
|
|
__pyx_v_to_object_func = NULL;
|
|
|
|
- /* "View.MemoryView":1099
|
|
+ /* "View.MemoryView":1101
|
|
* else:
|
|
* to_object_func = NULL
|
|
* to_dtype_func = NULL # <<<<<<<<<<<<<<
|
|
@@ -27508,7 +27599,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
|
|
}
|
|
__pyx_L3:;
|
|
|
|
- /* "View.MemoryView":1101
|
|
+ /* "View.MemoryView":1103
|
|
* to_dtype_func = NULL
|
|
*
|
|
* return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
|
|
@@ -27517,20 +27608,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
|
|
- /* "View.MemoryView":1103
|
|
+ /* "View.MemoryView":1105
|
|
* return memoryview_fromslice(memviewslice[0], memview.view.ndim,
|
|
* to_object_func, to_dtype_func,
|
|
* memview.dtype_is_object) # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error)
|
|
+ __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1103, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__pyx_r = __pyx_t_5;
|
|
__pyx_t_5 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":1087
|
|
+ /* "View.MemoryView":1089
|
|
*
|
|
* @cname('__pyx_memoryview_copy_object_from_slice')
|
|
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
|
|
@@ -27549,7 +27640,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1109
|
|
+/* "View.MemoryView":1111
|
|
*
|
|
*
|
|
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
|
|
@@ -27561,7 +27652,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
|
|
Py_ssize_t __pyx_r;
|
|
int __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":1110
|
|
+ /* "View.MemoryView":1112
|
|
*
|
|
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
|
|
* if arg < 0: # <<<<<<<<<<<<<<
|
|
@@ -27571,7 +27662,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
|
|
__pyx_t_1 = ((__pyx_v_arg < 0) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":1111
|
|
+ /* "View.MemoryView":1113
|
|
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
|
|
* if arg < 0:
|
|
* return -arg # <<<<<<<<<<<<<<
|
|
@@ -27581,7 +27672,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
|
|
__pyx_r = (-__pyx_v_arg);
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":1110
|
|
+ /* "View.MemoryView":1112
|
|
*
|
|
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
|
|
* if arg < 0: # <<<<<<<<<<<<<<
|
|
@@ -27590,7 +27681,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1113
|
|
+ /* "View.MemoryView":1115
|
|
* return -arg
|
|
* else:
|
|
* return arg # <<<<<<<<<<<<<<
|
|
@@ -27602,7 +27693,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
|
|
goto __pyx_L0;
|
|
}
|
|
|
|
- /* "View.MemoryView":1109
|
|
+ /* "View.MemoryView":1111
|
|
*
|
|
*
|
|
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
|
|
@@ -27615,7 +27706,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1116
|
|
+/* "View.MemoryView":1118
|
|
*
|
|
* @cname('__pyx_get_best_slice_order')
|
|
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
|
|
@@ -27633,7 +27724,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
int __pyx_t_3;
|
|
int __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1121
|
|
+ /* "View.MemoryView":1123
|
|
* """
|
|
* cdef int i
|
|
* cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
|
|
@@ -27642,7 +27733,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
*/
|
|
__pyx_v_c_stride = 0;
|
|
|
|
- /* "View.MemoryView":1122
|
|
+ /* "View.MemoryView":1124
|
|
* cdef int i
|
|
* cdef Py_ssize_t c_stride = 0
|
|
* cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
|
|
@@ -27651,7 +27742,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
*/
|
|
__pyx_v_f_stride = 0;
|
|
|
|
- /* "View.MemoryView":1124
|
|
+ /* "View.MemoryView":1126
|
|
* cdef Py_ssize_t f_stride = 0
|
|
*
|
|
* for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
|
|
@@ -27661,7 +27752,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
|
|
__pyx_v_i = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":1125
|
|
+ /* "View.MemoryView":1127
|
|
*
|
|
* for i in range(ndim - 1, -1, -1):
|
|
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
|
|
@@ -27671,7 +27762,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
__pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1126
|
|
+ /* "View.MemoryView":1128
|
|
* for i in range(ndim - 1, -1, -1):
|
|
* if mslice.shape[i] > 1:
|
|
* c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
|
|
@@ -27680,7 +27771,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
*/
|
|
__pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
|
|
|
|
- /* "View.MemoryView":1127
|
|
+ /* "View.MemoryView":1129
|
|
* if mslice.shape[i] > 1:
|
|
* c_stride = mslice.strides[i]
|
|
* break # <<<<<<<<<<<<<<
|
|
@@ -27689,7 +27780,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
*/
|
|
goto __pyx_L4_break;
|
|
|
|
- /* "View.MemoryView":1125
|
|
+ /* "View.MemoryView":1127
|
|
*
|
|
* for i in range(ndim - 1, -1, -1):
|
|
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
|
|
@@ -27700,7 +27791,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
}
|
|
__pyx_L4_break:;
|
|
|
|
- /* "View.MemoryView":1129
|
|
+ /* "View.MemoryView":1131
|
|
* break
|
|
*
|
|
* for i in range(ndim): # <<<<<<<<<<<<<<
|
|
@@ -27712,7 +27803,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
|
|
__pyx_v_i = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1130
|
|
+ /* "View.MemoryView":1132
|
|
*
|
|
* for i in range(ndim):
|
|
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
|
|
@@ -27722,7 +27813,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
__pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1131
|
|
+ /* "View.MemoryView":1133
|
|
* for i in range(ndim):
|
|
* if mslice.shape[i] > 1:
|
|
* f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
|
|
@@ -27731,7 +27822,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
*/
|
|
__pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
|
|
|
|
- /* "View.MemoryView":1132
|
|
+ /* "View.MemoryView":1134
|
|
* if mslice.shape[i] > 1:
|
|
* f_stride = mslice.strides[i]
|
|
* break # <<<<<<<<<<<<<<
|
|
@@ -27740,7 +27831,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
*/
|
|
goto __pyx_L7_break;
|
|
|
|
- /* "View.MemoryView":1130
|
|
+ /* "View.MemoryView":1132
|
|
*
|
|
* for i in range(ndim):
|
|
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
|
|
@@ -27751,7 +27842,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
}
|
|
__pyx_L7_break:;
|
|
|
|
- /* "View.MemoryView":1134
|
|
+ /* "View.MemoryView":1136
|
|
* break
|
|
*
|
|
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
|
|
@@ -27761,7 +27852,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
__pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1135
|
|
+ /* "View.MemoryView":1137
|
|
*
|
|
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
|
|
* return 'C' # <<<<<<<<<<<<<<
|
|
@@ -27771,7 +27862,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
__pyx_r = 'C';
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":1134
|
|
+ /* "View.MemoryView":1136
|
|
* break
|
|
*
|
|
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
|
|
@@ -27780,7 +27871,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1137
|
|
+ /* "View.MemoryView":1139
|
|
* return 'C'
|
|
* else:
|
|
* return 'F' # <<<<<<<<<<<<<<
|
|
@@ -27792,7 +27883,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
goto __pyx_L0;
|
|
}
|
|
|
|
- /* "View.MemoryView":1116
|
|
+ /* "View.MemoryView":1118
|
|
*
|
|
* @cname('__pyx_get_best_slice_order')
|
|
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
|
|
@@ -27805,7 +27896,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1140
|
|
+/* "View.MemoryView":1142
|
|
*
|
|
* @cython.cdivision(True)
|
|
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
|
|
@@ -27826,7 +27917,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
Py_ssize_t __pyx_t_5;
|
|
Py_ssize_t __pyx_t_6;
|
|
|
|
- /* "View.MemoryView":1147
|
|
+ /* "View.MemoryView":1149
|
|
*
|
|
* cdef Py_ssize_t i
|
|
* cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
|
|
@@ -27835,7 +27926,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
*/
|
|
__pyx_v_src_extent = (__pyx_v_src_shape[0]);
|
|
|
|
- /* "View.MemoryView":1148
|
|
+ /* "View.MemoryView":1150
|
|
* cdef Py_ssize_t i
|
|
* cdef Py_ssize_t src_extent = src_shape[0]
|
|
* cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
|
|
@@ -27844,7 +27935,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
*/
|
|
__pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
|
|
|
|
- /* "View.MemoryView":1149
|
|
+ /* "View.MemoryView":1151
|
|
* cdef Py_ssize_t src_extent = src_shape[0]
|
|
* cdef Py_ssize_t dst_extent = dst_shape[0]
|
|
* cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
|
|
@@ -27853,7 +27944,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
*/
|
|
__pyx_v_src_stride = (__pyx_v_src_strides[0]);
|
|
|
|
- /* "View.MemoryView":1150
|
|
+ /* "View.MemoryView":1152
|
|
* cdef Py_ssize_t dst_extent = dst_shape[0]
|
|
* cdef Py_ssize_t src_stride = src_strides[0]
|
|
* cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
|
|
@@ -27862,7 +27953,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
*/
|
|
__pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
|
|
|
|
- /* "View.MemoryView":1152
|
|
+ /* "View.MemoryView":1154
|
|
* cdef Py_ssize_t dst_stride = dst_strides[0]
|
|
*
|
|
* if ndim == 1: # <<<<<<<<<<<<<<
|
|
@@ -27872,7 +27963,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
__pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":1153
|
|
+ /* "View.MemoryView":1155
|
|
*
|
|
* if ndim == 1:
|
|
* if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
|
|
@@ -27892,7 +27983,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
goto __pyx_L5_bool_binop_done;
|
|
}
|
|
|
|
- /* "View.MemoryView":1154
|
|
+ /* "View.MemoryView":1156
|
|
* if ndim == 1:
|
|
* if (src_stride > 0 and dst_stride > 0 and
|
|
* <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
|
|
@@ -27907,7 +27998,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
__pyx_t_1 = __pyx_t_3;
|
|
__pyx_L5_bool_binop_done:;
|
|
|
|
- /* "View.MemoryView":1153
|
|
+ /* "View.MemoryView":1155
|
|
*
|
|
* if ndim == 1:
|
|
* if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
|
|
@@ -27916,7 +28007,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
*/
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":1155
|
|
+ /* "View.MemoryView":1157
|
|
* if (src_stride > 0 and dst_stride > 0 and
|
|
* <size_t> src_stride == itemsize == <size_t> dst_stride):
|
|
* memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
|
|
@@ -27925,7 +28016,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
*/
|
|
(void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
|
|
|
|
- /* "View.MemoryView":1153
|
|
+ /* "View.MemoryView":1155
|
|
*
|
|
* if ndim == 1:
|
|
* if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
|
|
@@ -27935,7 +28026,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
goto __pyx_L4;
|
|
}
|
|
|
|
- /* "View.MemoryView":1157
|
|
+ /* "View.MemoryView":1159
|
|
* memcpy(dst_data, src_data, itemsize * dst_extent)
|
|
* else:
|
|
* for i in range(dst_extent): # <<<<<<<<<<<<<<
|
|
@@ -27948,7 +28039,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
|
|
__pyx_v_i = __pyx_t_6;
|
|
|
|
- /* "View.MemoryView":1158
|
|
+ /* "View.MemoryView":1160
|
|
* else:
|
|
* for i in range(dst_extent):
|
|
* memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
|
|
@@ -27957,7 +28048,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
*/
|
|
(void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
|
|
|
|
- /* "View.MemoryView":1159
|
|
+ /* "View.MemoryView":1161
|
|
* for i in range(dst_extent):
|
|
* memcpy(dst_data, src_data, itemsize)
|
|
* src_data += src_stride # <<<<<<<<<<<<<<
|
|
@@ -27966,7 +28057,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
*/
|
|
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
|
|
|
|
- /* "View.MemoryView":1160
|
|
+ /* "View.MemoryView":1162
|
|
* memcpy(dst_data, src_data, itemsize)
|
|
* src_data += src_stride
|
|
* dst_data += dst_stride # <<<<<<<<<<<<<<
|
|
@@ -27978,7 +28069,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
}
|
|
__pyx_L4:;
|
|
|
|
- /* "View.MemoryView":1152
|
|
+ /* "View.MemoryView":1154
|
|
* cdef Py_ssize_t dst_stride = dst_strides[0]
|
|
*
|
|
* if ndim == 1: # <<<<<<<<<<<<<<
|
|
@@ -27988,7 +28079,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
- /* "View.MemoryView":1162
|
|
+ /* "View.MemoryView":1164
|
|
* dst_data += dst_stride
|
|
* else:
|
|
* for i in range(dst_extent): # <<<<<<<<<<<<<<
|
|
@@ -28001,7 +28092,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
|
|
__pyx_v_i = __pyx_t_6;
|
|
|
|
- /* "View.MemoryView":1163
|
|
+ /* "View.MemoryView":1165
|
|
* else:
|
|
* for i in range(dst_extent):
|
|
* _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
|
|
@@ -28010,7 +28101,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
*/
|
|
_copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
|
|
|
|
- /* "View.MemoryView":1167
|
|
+ /* "View.MemoryView":1169
|
|
* src_shape + 1, dst_shape + 1,
|
|
* ndim - 1, itemsize)
|
|
* src_data += src_stride # <<<<<<<<<<<<<<
|
|
@@ -28019,7 +28110,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
*/
|
|
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
|
|
|
|
- /* "View.MemoryView":1168
|
|
+ /* "View.MemoryView":1170
|
|
* ndim - 1, itemsize)
|
|
* src_data += src_stride
|
|
* dst_data += dst_stride # <<<<<<<<<<<<<<
|
|
@@ -28031,7 +28122,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
}
|
|
__pyx_L3:;
|
|
|
|
- /* "View.MemoryView":1140
|
|
+ /* "View.MemoryView":1142
|
|
*
|
|
* @cython.cdivision(True)
|
|
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
|
|
@@ -28042,7 +28133,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
/* function exit code */
|
|
}
|
|
|
|
-/* "View.MemoryView":1170
|
|
+/* "View.MemoryView":1172
|
|
* dst_data += dst_stride
|
|
*
|
|
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
|
|
@@ -28052,7 +28143,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
|
|
static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
|
|
|
|
- /* "View.MemoryView":1173
|
|
+ /* "View.MemoryView":1175
|
|
* __Pyx_memviewslice *dst,
|
|
* int ndim, size_t itemsize) nogil:
|
|
* _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
|
|
@@ -28061,7 +28152,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi
|
|
*/
|
|
_copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
|
|
|
|
- /* "View.MemoryView":1170
|
|
+ /* "View.MemoryView":1172
|
|
* dst_data += dst_stride
|
|
*
|
|
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
|
|
@@ -28072,7 +28163,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi
|
|
/* function exit code */
|
|
}
|
|
|
|
-/* "View.MemoryView":1177
|
|
+/* "View.MemoryView":1179
|
|
*
|
|
* @cname('__pyx_memoryview_slice_get_size')
|
|
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
|
|
@@ -28089,7 +28180,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
|
|
Py_ssize_t *__pyx_t_3;
|
|
Py_ssize_t *__pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1179
|
|
+ /* "View.MemoryView":1181
|
|
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
|
|
* "Return the size of the memory occupied by the slice in number of bytes"
|
|
* cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
|
|
@@ -28099,7 +28190,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
|
|
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
|
|
__pyx_v_size = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":1181
|
|
+ /* "View.MemoryView":1183
|
|
* cdef Py_ssize_t shape, size = src.memview.view.itemsize
|
|
*
|
|
* for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
|
|
@@ -28111,7 +28202,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
|
|
__pyx_t_2 = __pyx_t_4;
|
|
__pyx_v_shape = (__pyx_t_2[0]);
|
|
|
|
- /* "View.MemoryView":1182
|
|
+ /* "View.MemoryView":1184
|
|
*
|
|
* for shape in src.shape[:ndim]:
|
|
* size *= shape # <<<<<<<<<<<<<<
|
|
@@ -28121,7 +28212,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
|
|
__pyx_v_size = (__pyx_v_size * __pyx_v_shape);
|
|
}
|
|
|
|
- /* "View.MemoryView":1184
|
|
+ /* "View.MemoryView":1186
|
|
* size *= shape
|
|
*
|
|
* return size # <<<<<<<<<<<<<<
|
|
@@ -28131,7 +28222,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
|
|
__pyx_r = __pyx_v_size;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":1177
|
|
+ /* "View.MemoryView":1179
|
|
*
|
|
* @cname('__pyx_memoryview_slice_get_size')
|
|
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
|
|
@@ -28144,7 +28235,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1187
|
|
+/* "View.MemoryView":1189
|
|
*
|
|
* @cname('__pyx_fill_contig_strides_array')
|
|
* cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
|
|
@@ -28160,7 +28251,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
|
|
int __pyx_t_3;
|
|
int __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1196
|
|
+ /* "View.MemoryView":1198
|
|
* cdef int idx
|
|
*
|
|
* if order == 'F': # <<<<<<<<<<<<<<
|
|
@@ -28170,7 +28261,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
|
|
__pyx_t_1 = ((__pyx_v_order == 'F') != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":1197
|
|
+ /* "View.MemoryView":1199
|
|
*
|
|
* if order == 'F':
|
|
* for idx in range(ndim): # <<<<<<<<<<<<<<
|
|
@@ -28182,7 +28273,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
|
|
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
|
|
__pyx_v_idx = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1198
|
|
+ /* "View.MemoryView":1200
|
|
* if order == 'F':
|
|
* for idx in range(ndim):
|
|
* strides[idx] = stride # <<<<<<<<<<<<<<
|
|
@@ -28191,7 +28282,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
|
|
*/
|
|
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
|
|
|
|
- /* "View.MemoryView":1199
|
|
+ /* "View.MemoryView":1201
|
|
* for idx in range(ndim):
|
|
* strides[idx] = stride
|
|
* stride *= shape[idx] # <<<<<<<<<<<<<<
|
|
@@ -28201,7 +28292,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
|
|
__pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
|
|
}
|
|
|
|
- /* "View.MemoryView":1196
|
|
+ /* "View.MemoryView":1198
|
|
* cdef int idx
|
|
*
|
|
* if order == 'F': # <<<<<<<<<<<<<<
|
|
@@ -28211,7 +28302,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
- /* "View.MemoryView":1201
|
|
+ /* "View.MemoryView":1203
|
|
* stride *= shape[idx]
|
|
* else:
|
|
* for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
|
|
@@ -28222,7 +28313,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
|
|
for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
|
|
__pyx_v_idx = __pyx_t_2;
|
|
|
|
- /* "View.MemoryView":1202
|
|
+ /* "View.MemoryView":1204
|
|
* else:
|
|
* for idx in range(ndim - 1, -1, -1):
|
|
* strides[idx] = stride # <<<<<<<<<<<<<<
|
|
@@ -28231,7 +28322,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
|
|
*/
|
|
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
|
|
|
|
- /* "View.MemoryView":1203
|
|
+ /* "View.MemoryView":1205
|
|
* for idx in range(ndim - 1, -1, -1):
|
|
* strides[idx] = stride
|
|
* stride *= shape[idx] # <<<<<<<<<<<<<<
|
|
@@ -28243,7 +28334,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
|
|
}
|
|
__pyx_L3:;
|
|
|
|
- /* "View.MemoryView":1205
|
|
+ /* "View.MemoryView":1207
|
|
* stride *= shape[idx]
|
|
*
|
|
* return stride # <<<<<<<<<<<<<<
|
|
@@ -28253,7 +28344,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
|
|
__pyx_r = __pyx_v_stride;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":1187
|
|
+ /* "View.MemoryView":1189
|
|
*
|
|
* @cname('__pyx_fill_contig_strides_array')
|
|
* cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
|
|
@@ -28266,7 +28357,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1208
|
|
+/* "View.MemoryView":1210
|
|
*
|
|
* @cname('__pyx_memoryview_copy_data_to_temp')
|
|
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
|
|
@@ -28290,7 +28381,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
|
|
- /* "View.MemoryView":1219
|
|
+ /* "View.MemoryView":1221
|
|
* cdef void *result
|
|
*
|
|
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
|
|
@@ -28300,7 +28391,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
|
|
__pyx_v_itemsize = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":1220
|
|
+ /* "View.MemoryView":1222
|
|
*
|
|
* cdef size_t itemsize = src.memview.view.itemsize
|
|
* cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
|
|
@@ -28309,7 +28400,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
*/
|
|
__pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
|
|
|
|
- /* "View.MemoryView":1222
|
|
+ /* "View.MemoryView":1224
|
|
* cdef size_t size = slice_get_size(src, ndim)
|
|
*
|
|
* result = malloc(size) # <<<<<<<<<<<<<<
|
|
@@ -28318,7 +28409,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
*/
|
|
__pyx_v_result = malloc(__pyx_v_size);
|
|
|
|
- /* "View.MemoryView":1223
|
|
+ /* "View.MemoryView":1225
|
|
*
|
|
* result = malloc(size)
|
|
* if not result: # <<<<<<<<<<<<<<
|
|
@@ -28328,16 +28419,16 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
__pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1224
|
|
+ /* "View.MemoryView":1226
|
|
* result = malloc(size)
|
|
* if not result:
|
|
* _err(MemoryError, NULL) # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
|
|
+ __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1226, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":1223
|
|
+ /* "View.MemoryView":1225
|
|
*
|
|
* result = malloc(size)
|
|
* if not result: # <<<<<<<<<<<<<<
|
|
@@ -28346,7 +28437,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1227
|
|
+ /* "View.MemoryView":1229
|
|
*
|
|
*
|
|
* tmpslice.data = <char *> result # <<<<<<<<<<<<<<
|
|
@@ -28355,7 +28446,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
*/
|
|
__pyx_v_tmpslice->data = ((char *)__pyx_v_result);
|
|
|
|
- /* "View.MemoryView":1228
|
|
+ /* "View.MemoryView":1230
|
|
*
|
|
* tmpslice.data = <char *> result
|
|
* tmpslice.memview = src.memview # <<<<<<<<<<<<<<
|
|
@@ -28365,7 +28456,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
__pyx_t_4 = __pyx_v_src->memview;
|
|
__pyx_v_tmpslice->memview = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1229
|
|
+ /* "View.MemoryView":1231
|
|
* tmpslice.data = <char *> result
|
|
* tmpslice.memview = src.memview
|
|
* for i in range(ndim): # <<<<<<<<<<<<<<
|
|
@@ -28377,7 +28468,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
|
|
__pyx_v_i = __pyx_t_6;
|
|
|
|
- /* "View.MemoryView":1230
|
|
+ /* "View.MemoryView":1232
|
|
* tmpslice.memview = src.memview
|
|
* for i in range(ndim):
|
|
* tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
|
|
@@ -28386,7 +28477,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
*/
|
|
(__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
|
|
|
|
- /* "View.MemoryView":1231
|
|
+ /* "View.MemoryView":1233
|
|
* for i in range(ndim):
|
|
* tmpslice.shape[i] = src.shape[i]
|
|
* tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
|
|
@@ -28396,7 +28487,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
(__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
|
|
}
|
|
|
|
- /* "View.MemoryView":1233
|
|
+ /* "View.MemoryView":1235
|
|
* tmpslice.suboffsets[i] = -1
|
|
*
|
|
* fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
|
|
@@ -28405,7 +28496,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
*/
|
|
(void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
|
|
|
|
- /* "View.MemoryView":1237
|
|
+ /* "View.MemoryView":1239
|
|
*
|
|
*
|
|
* for i in range(ndim): # <<<<<<<<<<<<<<
|
|
@@ -28417,7 +28508,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
|
|
__pyx_v_i = __pyx_t_6;
|
|
|
|
- /* "View.MemoryView":1238
|
|
+ /* "View.MemoryView":1240
|
|
*
|
|
* for i in range(ndim):
|
|
* if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
|
|
@@ -28427,7 +28518,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
__pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1239
|
|
+ /* "View.MemoryView":1241
|
|
* for i in range(ndim):
|
|
* if tmpslice.shape[i] == 1:
|
|
* tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
|
|
@@ -28436,7 +28527,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
*/
|
|
(__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
|
|
|
|
- /* "View.MemoryView":1238
|
|
+ /* "View.MemoryView":1240
|
|
*
|
|
* for i in range(ndim):
|
|
* if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
|
|
@@ -28446,7 +28537,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
}
|
|
}
|
|
|
|
- /* "View.MemoryView":1241
|
|
+ /* "View.MemoryView":1243
|
|
* tmpslice.strides[i] = 0
|
|
*
|
|
* if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
|
|
@@ -28456,7 +28547,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
__pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1242
|
|
+ /* "View.MemoryView":1244
|
|
*
|
|
* if slice_is_contig(src[0], order, ndim):
|
|
* memcpy(result, src.data, size) # <<<<<<<<<<<<<<
|
|
@@ -28465,7 +28556,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
*/
|
|
(void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
|
|
|
|
- /* "View.MemoryView":1241
|
|
+ /* "View.MemoryView":1243
|
|
* tmpslice.strides[i] = 0
|
|
*
|
|
* if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
|
|
@@ -28475,7 +28566,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
goto __pyx_L9;
|
|
}
|
|
|
|
- /* "View.MemoryView":1244
|
|
+ /* "View.MemoryView":1246
|
|
* memcpy(result, src.data, size)
|
|
* else:
|
|
* copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
|
|
@@ -28487,7 +28578,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
}
|
|
__pyx_L9:;
|
|
|
|
- /* "View.MemoryView":1246
|
|
+ /* "View.MemoryView":1248
|
|
* copy_strided_to_strided(src, tmpslice, ndim, itemsize)
|
|
*
|
|
* return result # <<<<<<<<<<<<<<
|
|
@@ -28497,7 +28588,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
__pyx_r = __pyx_v_result;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":1208
|
|
+ /* "View.MemoryView":1210
|
|
*
|
|
* @cname('__pyx_memoryview_copy_data_to_temp')
|
|
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
|
|
@@ -28521,7 +28612,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1251
|
|
+/* "View.MemoryView":1253
|
|
*
|
|
* @cname('__pyx_memoryview_err_extents')
|
|
* cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
|
|
@@ -28544,20 +28635,20 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
|
|
#endif
|
|
__Pyx_RefNannySetupContext("_err_extents", 0);
|
|
|
|
- /* "View.MemoryView":1254
|
|
+ /* "View.MemoryView":1256
|
|
* Py_ssize_t extent2) except -1 with gil:
|
|
* raise ValueError("got differing extents in dimension %d (got %d and %d)" %
|
|
* (i, extent1, extent2)) # <<<<<<<<<<<<<<
|
|
*
|
|
* @cname('__pyx_memoryview_err_dim')
|
|
*/
|
|
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1256, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
|
|
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1256, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
|
|
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1256, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
|
|
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1256, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__Pyx_GIVEREF(__pyx_t_1);
|
|
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
|
|
@@ -28569,24 +28660,24 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
|
|
__pyx_t_2 = 0;
|
|
__pyx_t_3 = 0;
|
|
|
|
- /* "View.MemoryView":1253
|
|
+ /* "View.MemoryView":1255
|
|
* cdef int _err_extents(int i, Py_ssize_t extent1,
|
|
* Py_ssize_t extent2) except -1 with gil:
|
|
* raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
|
|
* (i, extent1, extent2))
|
|
*
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error)
|
|
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1255, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
|
|
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1255, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- __PYX_ERR(1, 1253, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 1255, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":1251
|
|
+ /* "View.MemoryView":1253
|
|
*
|
|
* @cname('__pyx_memoryview_err_extents')
|
|
* cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
|
|
@@ -28609,7 +28700,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1257
|
|
+/* "View.MemoryView":1259
|
|
*
|
|
* @cname('__pyx_memoryview_err_dim')
|
|
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
|
|
@@ -28633,18 +28724,18 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
|
|
__Pyx_RefNannySetupContext("_err_dim", 0);
|
|
__Pyx_INCREF(__pyx_v_error);
|
|
|
|
- /* "View.MemoryView":1258
|
|
+ /* "View.MemoryView":1260
|
|
* @cname('__pyx_memoryview_err_dim')
|
|
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
|
|
* raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
|
|
*
|
|
* @cname('__pyx_memoryview_err')
|
|
*/
|
|
- __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1260, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
|
|
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1260, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
|
|
+ __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1260, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
@@ -28662,14 +28753,14 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
|
|
__pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
|
|
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
|
|
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1260, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
- __PYX_ERR(1, 1258, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 1260, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":1257
|
|
+ /* "View.MemoryView":1259
|
|
*
|
|
* @cname('__pyx_memoryview_err_dim')
|
|
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
|
|
@@ -28693,7 +28784,7 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1261
|
|
+/* "View.MemoryView":1263
|
|
*
|
|
* @cname('__pyx_memoryview_err')
|
|
* cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
|
|
@@ -28718,7 +28809,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
|
|
__Pyx_RefNannySetupContext("_err", 0);
|
|
__Pyx_INCREF(__pyx_v_error);
|
|
|
|
- /* "View.MemoryView":1262
|
|
+ /* "View.MemoryView":1264
|
|
* @cname('__pyx_memoryview_err')
|
|
* cdef int _err(object error, char *msg) except -1 with gil:
|
|
* if msg != NULL: # <<<<<<<<<<<<<<
|
|
@@ -28728,14 +28819,14 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
|
|
__pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
|
|
if (unlikely(__pyx_t_1)) {
|
|
|
|
- /* "View.MemoryView":1263
|
|
+ /* "View.MemoryView":1265
|
|
* cdef int _err(object error, char *msg) except -1 with gil:
|
|
* if msg != NULL:
|
|
* raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
|
|
* else:
|
|
* raise error
|
|
*/
|
|
- __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error)
|
|
+ __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1265, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_INCREF(__pyx_v_error);
|
|
__pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
|
|
@@ -28751,14 +28842,14 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
|
|
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
|
|
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
|
|
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1265, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __PYX_ERR(1, 1263, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 1265, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":1262
|
|
+ /* "View.MemoryView":1264
|
|
* @cname('__pyx_memoryview_err')
|
|
* cdef int _err(object error, char *msg) except -1 with gil:
|
|
* if msg != NULL: # <<<<<<<<<<<<<<
|
|
@@ -28767,7 +28858,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1265
|
|
+ /* "View.MemoryView":1267
|
|
* raise error(msg.decode('ascii'))
|
|
* else:
|
|
* raise error # <<<<<<<<<<<<<<
|
|
@@ -28776,10 +28867,10 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
|
|
*/
|
|
/*else*/ {
|
|
__Pyx_Raise(__pyx_v_error, 0, 0, 0);
|
|
- __PYX_ERR(1, 1265, __pyx_L1_error)
|
|
+ __PYX_ERR(1, 1267, __pyx_L1_error)
|
|
}
|
|
|
|
- /* "View.MemoryView":1261
|
|
+ /* "View.MemoryView":1263
|
|
*
|
|
* @cname('__pyx_memoryview_err')
|
|
* cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
|
|
@@ -28803,7 +28894,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1268
|
|
+/* "View.MemoryView":1270
|
|
*
|
|
* @cname('__pyx_memoryview_copy_contents')
|
|
* cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
|
|
@@ -28833,7 +28924,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
|
|
- /* "View.MemoryView":1276
|
|
+ /* "View.MemoryView":1278
|
|
* Check for overlapping memory and verify the shapes.
|
|
* """
|
|
* cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
|
|
@@ -28842,7 +28933,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_v_tmpdata = NULL;
|
|
|
|
- /* "View.MemoryView":1277
|
|
+ /* "View.MemoryView":1279
|
|
* """
|
|
* cdef void *tmpdata = NULL
|
|
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
|
|
@@ -28852,7 +28943,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_1 = __pyx_v_src.memview->view.itemsize;
|
|
__pyx_v_itemsize = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":1279
|
|
+ /* "View.MemoryView":1281
|
|
* cdef size_t itemsize = src.memview.view.itemsize
|
|
* cdef int i
|
|
* cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
|
|
@@ -28861,7 +28952,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
|
|
|
|
- /* "View.MemoryView":1280
|
|
+ /* "View.MemoryView":1282
|
|
* cdef int i
|
|
* cdef char order = get_best_order(&src, src_ndim)
|
|
* cdef bint broadcasting = False # <<<<<<<<<<<<<<
|
|
@@ -28870,7 +28961,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_v_broadcasting = 0;
|
|
|
|
- /* "View.MemoryView":1281
|
|
+ /* "View.MemoryView":1283
|
|
* cdef char order = get_best_order(&src, src_ndim)
|
|
* cdef bint broadcasting = False
|
|
* cdef bint direct_copy = False # <<<<<<<<<<<<<<
|
|
@@ -28879,7 +28970,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_v_direct_copy = 0;
|
|
|
|
- /* "View.MemoryView":1284
|
|
+ /* "View.MemoryView":1286
|
|
* cdef __Pyx_memviewslice tmp
|
|
*
|
|
* if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
|
|
@@ -28889,7 +28980,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1285
|
|
+ /* "View.MemoryView":1287
|
|
*
|
|
* if src_ndim < dst_ndim:
|
|
* broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
|
|
@@ -28898,7 +28989,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
|
|
|
|
- /* "View.MemoryView":1284
|
|
+ /* "View.MemoryView":1286
|
|
* cdef __Pyx_memviewslice tmp
|
|
*
|
|
* if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
|
|
@@ -28908,7 +28999,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
- /* "View.MemoryView":1286
|
|
+ /* "View.MemoryView":1288
|
|
* if src_ndim < dst_ndim:
|
|
* broadcast_leading(&src, src_ndim, dst_ndim)
|
|
* elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
|
|
@@ -28918,7 +29009,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1287
|
|
+ /* "View.MemoryView":1289
|
|
* broadcast_leading(&src, src_ndim, dst_ndim)
|
|
* elif dst_ndim < src_ndim:
|
|
* broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
|
|
@@ -28927,7 +29018,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
|
|
|
|
- /* "View.MemoryView":1286
|
|
+ /* "View.MemoryView":1288
|
|
* if src_ndim < dst_ndim:
|
|
* broadcast_leading(&src, src_ndim, dst_ndim)
|
|
* elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
|
|
@@ -28937,7 +29028,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
}
|
|
__pyx_L3:;
|
|
|
|
- /* "View.MemoryView":1289
|
|
+ /* "View.MemoryView":1291
|
|
* broadcast_leading(&dst, dst_ndim, src_ndim)
|
|
*
|
|
* cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
|
|
@@ -28953,7 +29044,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
}
|
|
__pyx_v_ndim = __pyx_t_5;
|
|
|
|
- /* "View.MemoryView":1291
|
|
+ /* "View.MemoryView":1293
|
|
* cdef int ndim = max(src_ndim, dst_ndim)
|
|
*
|
|
* for i in range(ndim): # <<<<<<<<<<<<<<
|
|
@@ -28965,7 +29056,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
|
|
__pyx_v_i = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1292
|
|
+ /* "View.MemoryView":1294
|
|
*
|
|
* for i in range(ndim):
|
|
* if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
|
|
@@ -28975,7 +29066,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1293
|
|
+ /* "View.MemoryView":1295
|
|
* for i in range(ndim):
|
|
* if src.shape[i] != dst.shape[i]:
|
|
* if src.shape[i] == 1: # <<<<<<<<<<<<<<
|
|
@@ -28985,7 +29076,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1294
|
|
+ /* "View.MemoryView":1296
|
|
* if src.shape[i] != dst.shape[i]:
|
|
* if src.shape[i] == 1:
|
|
* broadcasting = True # <<<<<<<<<<<<<<
|
|
@@ -28994,7 +29085,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_v_broadcasting = 1;
|
|
|
|
- /* "View.MemoryView":1295
|
|
+ /* "View.MemoryView":1297
|
|
* if src.shape[i] == 1:
|
|
* broadcasting = True
|
|
* src.strides[i] = 0 # <<<<<<<<<<<<<<
|
|
@@ -29003,7 +29094,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
(__pyx_v_src.strides[__pyx_v_i]) = 0;
|
|
|
|
- /* "View.MemoryView":1293
|
|
+ /* "View.MemoryView":1295
|
|
* for i in range(ndim):
|
|
* if src.shape[i] != dst.shape[i]:
|
|
* if src.shape[i] == 1: # <<<<<<<<<<<<<<
|
|
@@ -29013,7 +29104,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
goto __pyx_L7;
|
|
}
|
|
|
|
- /* "View.MemoryView":1297
|
|
+ /* "View.MemoryView":1299
|
|
* src.strides[i] = 0
|
|
* else:
|
|
* _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
|
|
@@ -29021,11 +29112,11 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
* if src.suboffsets[i] >= 0:
|
|
*/
|
|
/*else*/ {
|
|
- __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
|
|
+ __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1299, __pyx_L1_error)
|
|
}
|
|
__pyx_L7:;
|
|
|
|
- /* "View.MemoryView":1292
|
|
+ /* "View.MemoryView":1294
|
|
*
|
|
* for i in range(ndim):
|
|
* if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
|
|
@@ -29034,7 +29125,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1299
|
|
+ /* "View.MemoryView":1301
|
|
* _err_extents(i, dst.shape[i], src.shape[i])
|
|
*
|
|
* if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
|
|
@@ -29044,16 +29135,16 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1300
|
|
+ /* "View.MemoryView":1302
|
|
*
|
|
* if src.suboffsets[i] >= 0:
|
|
* _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
|
|
*
|
|
* if slices_overlap(&src, &dst, ndim, itemsize):
|
|
*/
|
|
- __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error)
|
|
+ __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1302, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":1299
|
|
+ /* "View.MemoryView":1301
|
|
* _err_extents(i, dst.shape[i], src.shape[i])
|
|
*
|
|
* if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
|
|
@@ -29063,7 +29154,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
}
|
|
}
|
|
|
|
- /* "View.MemoryView":1302
|
|
+ /* "View.MemoryView":1304
|
|
* _err_dim(ValueError, "Dimension %d is not direct", i)
|
|
*
|
|
* if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
|
|
@@ -29073,7 +29164,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1304
|
|
+ /* "View.MemoryView":1306
|
|
* if slices_overlap(&src, &dst, ndim, itemsize):
|
|
*
|
|
* if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
|
|
@@ -29083,7 +29174,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1305
|
|
+ /* "View.MemoryView":1307
|
|
*
|
|
* if not slice_is_contig(src, order, ndim):
|
|
* order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
|
|
@@ -29092,7 +29183,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
|
|
|
|
- /* "View.MemoryView":1304
|
|
+ /* "View.MemoryView":1306
|
|
* if slices_overlap(&src, &dst, ndim, itemsize):
|
|
*
|
|
* if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
|
|
@@ -29101,17 +29192,17 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1307
|
|
+ /* "View.MemoryView":1309
|
|
* order = get_best_order(&dst, ndim)
|
|
*
|
|
* tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
|
|
* src = tmp
|
|
*
|
|
*/
|
|
- __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error)
|
|
+ __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1309, __pyx_L1_error)
|
|
__pyx_v_tmpdata = __pyx_t_7;
|
|
|
|
- /* "View.MemoryView":1308
|
|
+ /* "View.MemoryView":1310
|
|
*
|
|
* tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
|
|
* src = tmp # <<<<<<<<<<<<<<
|
|
@@ -29120,7 +29211,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_v_src = __pyx_v_tmp;
|
|
|
|
- /* "View.MemoryView":1302
|
|
+ /* "View.MemoryView":1304
|
|
* _err_dim(ValueError, "Dimension %d is not direct", i)
|
|
*
|
|
* if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
|
|
@@ -29129,7 +29220,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1310
|
|
+ /* "View.MemoryView":1312
|
|
* src = tmp
|
|
*
|
|
* if not broadcasting: # <<<<<<<<<<<<<<
|
|
@@ -29139,7 +29230,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1313
|
|
+ /* "View.MemoryView":1315
|
|
*
|
|
*
|
|
* if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
|
|
@@ -29149,7 +29240,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1314
|
|
+ /* "View.MemoryView":1316
|
|
*
|
|
* if slice_is_contig(src, 'C', ndim):
|
|
* direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
|
|
@@ -29158,7 +29249,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
|
|
|
|
- /* "View.MemoryView":1313
|
|
+ /* "View.MemoryView":1315
|
|
*
|
|
*
|
|
* if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
|
|
@@ -29168,7 +29259,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
goto __pyx_L12;
|
|
}
|
|
|
|
- /* "View.MemoryView":1315
|
|
+ /* "View.MemoryView":1317
|
|
* if slice_is_contig(src, 'C', ndim):
|
|
* direct_copy = slice_is_contig(dst, 'C', ndim)
|
|
* elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
|
|
@@ -29178,7 +29269,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1316
|
|
+ /* "View.MemoryView":1318
|
|
* direct_copy = slice_is_contig(dst, 'C', ndim)
|
|
* elif slice_is_contig(src, 'F', ndim):
|
|
* direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
|
|
@@ -29187,7 +29278,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
|
|
|
|
- /* "View.MemoryView":1315
|
|
+ /* "View.MemoryView":1317
|
|
* if slice_is_contig(src, 'C', ndim):
|
|
* direct_copy = slice_is_contig(dst, 'C', ndim)
|
|
* elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
|
|
@@ -29197,7 +29288,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
}
|
|
__pyx_L12:;
|
|
|
|
- /* "View.MemoryView":1318
|
|
+ /* "View.MemoryView":1320
|
|
* direct_copy = slice_is_contig(dst, 'F', ndim)
|
|
*
|
|
* if direct_copy: # <<<<<<<<<<<<<<
|
|
@@ -29207,7 +29298,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_2 = (__pyx_v_direct_copy != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1320
|
|
+ /* "View.MemoryView":1322
|
|
* if direct_copy:
|
|
*
|
|
* refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
|
|
@@ -29216,7 +29307,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
|
|
|
|
- /* "View.MemoryView":1321
|
|
+ /* "View.MemoryView":1323
|
|
*
|
|
* refcount_copying(&dst, dtype_is_object, ndim, False)
|
|
* memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
|
|
@@ -29225,7 +29316,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
(void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
|
|
|
|
- /* "View.MemoryView":1322
|
|
+ /* "View.MemoryView":1324
|
|
* refcount_copying(&dst, dtype_is_object, ndim, False)
|
|
* memcpy(dst.data, src.data, slice_get_size(&src, ndim))
|
|
* refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
|
|
@@ -29234,7 +29325,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
|
|
|
|
- /* "View.MemoryView":1323
|
|
+ /* "View.MemoryView":1325
|
|
* memcpy(dst.data, src.data, slice_get_size(&src, ndim))
|
|
* refcount_copying(&dst, dtype_is_object, ndim, True)
|
|
* free(tmpdata) # <<<<<<<<<<<<<<
|
|
@@ -29243,7 +29334,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
free(__pyx_v_tmpdata);
|
|
|
|
- /* "View.MemoryView":1324
|
|
+ /* "View.MemoryView":1326
|
|
* refcount_copying(&dst, dtype_is_object, ndim, True)
|
|
* free(tmpdata)
|
|
* return 0 # <<<<<<<<<<<<<<
|
|
@@ -29253,7 +29344,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_r = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":1318
|
|
+ /* "View.MemoryView":1320
|
|
* direct_copy = slice_is_contig(dst, 'F', ndim)
|
|
*
|
|
* if direct_copy: # <<<<<<<<<<<<<<
|
|
@@ -29262,7 +29353,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1310
|
|
+ /* "View.MemoryView":1312
|
|
* src = tmp
|
|
*
|
|
* if not broadcasting: # <<<<<<<<<<<<<<
|
|
@@ -29271,7 +29362,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1326
|
|
+ /* "View.MemoryView":1328
|
|
* return 0
|
|
*
|
|
* if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
|
|
@@ -29285,25 +29376,25 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_8 = (__pyx_t_2 != 0);
|
|
if (__pyx_t_8) {
|
|
|
|
- /* "View.MemoryView":1329
|
|
+ /* "View.MemoryView":1331
|
|
*
|
|
*
|
|
* transpose_memslice(&src) # <<<<<<<<<<<<<<
|
|
* transpose_memslice(&dst)
|
|
*
|
|
*/
|
|
- __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
|
|
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1331, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":1330
|
|
+ /* "View.MemoryView":1332
|
|
*
|
|
* transpose_memslice(&src)
|
|
* transpose_memslice(&dst) # <<<<<<<<<<<<<<
|
|
*
|
|
* refcount_copying(&dst, dtype_is_object, ndim, False)
|
|
*/
|
|
- __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
|
|
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1332, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":1326
|
|
+ /* "View.MemoryView":1328
|
|
* return 0
|
|
*
|
|
* if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
|
|
@@ -29312,7 +29403,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1332
|
|
+ /* "View.MemoryView":1334
|
|
* transpose_memslice(&dst)
|
|
*
|
|
* refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
|
|
@@ -29321,7 +29412,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
|
|
|
|
- /* "View.MemoryView":1333
|
|
+ /* "View.MemoryView":1335
|
|
*
|
|
* refcount_copying(&dst, dtype_is_object, ndim, False)
|
|
* copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
|
|
@@ -29330,7 +29421,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
|
|
|
|
- /* "View.MemoryView":1334
|
|
+ /* "View.MemoryView":1336
|
|
* refcount_copying(&dst, dtype_is_object, ndim, False)
|
|
* copy_strided_to_strided(&src, &dst, ndim, itemsize)
|
|
* refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
|
|
@@ -29339,7 +29430,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
|
|
|
|
- /* "View.MemoryView":1336
|
|
+ /* "View.MemoryView":1338
|
|
* refcount_copying(&dst, dtype_is_object, ndim, True)
|
|
*
|
|
* free(tmpdata) # <<<<<<<<<<<<<<
|
|
@@ -29348,7 +29439,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
free(__pyx_v_tmpdata);
|
|
|
|
- /* "View.MemoryView":1337
|
|
+ /* "View.MemoryView":1339
|
|
*
|
|
* free(tmpdata)
|
|
* return 0 # <<<<<<<<<<<<<<
|
|
@@ -29358,7 +29449,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_r = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":1268
|
|
+ /* "View.MemoryView":1270
|
|
*
|
|
* @cname('__pyx_memoryview_copy_contents')
|
|
* cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
|
|
@@ -29382,7 +29473,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1340
|
|
+/* "View.MemoryView":1342
|
|
*
|
|
* @cname('__pyx_memoryview_broadcast_leading')
|
|
* cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
|
|
@@ -29397,7 +29488,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic
|
|
int __pyx_t_2;
|
|
int __pyx_t_3;
|
|
|
|
- /* "View.MemoryView":1344
|
|
+ /* "View.MemoryView":1346
|
|
* int ndim_other) nogil:
|
|
* cdef int i
|
|
* cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
|
|
@@ -29406,7 +29497,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic
|
|
*/
|
|
__pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
|
|
|
|
- /* "View.MemoryView":1346
|
|
+ /* "View.MemoryView":1348
|
|
* cdef int offset = ndim_other - ndim
|
|
*
|
|
* for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
|
|
@@ -29416,7 +29507,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic
|
|
for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
|
|
__pyx_v_i = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":1347
|
|
+ /* "View.MemoryView":1349
|
|
*
|
|
* for i in range(ndim - 1, -1, -1):
|
|
* mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
|
|
@@ -29425,7 +29516,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic
|
|
*/
|
|
(__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
|
|
|
|
- /* "View.MemoryView":1348
|
|
+ /* "View.MemoryView":1350
|
|
* for i in range(ndim - 1, -1, -1):
|
|
* mslice.shape[i + offset] = mslice.shape[i]
|
|
* mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
|
|
@@ -29434,7 +29525,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic
|
|
*/
|
|
(__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
|
|
|
|
- /* "View.MemoryView":1349
|
|
+ /* "View.MemoryView":1351
|
|
* mslice.shape[i + offset] = mslice.shape[i]
|
|
* mslice.strides[i + offset] = mslice.strides[i]
|
|
* mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
|
|
@@ -29444,7 +29535,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic
|
|
(__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
|
|
}
|
|
|
|
- /* "View.MemoryView":1351
|
|
+ /* "View.MemoryView":1353
|
|
* mslice.suboffsets[i + offset] = mslice.suboffsets[i]
|
|
*
|
|
* for i in range(offset): # <<<<<<<<<<<<<<
|
|
@@ -29456,7 +29547,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic
|
|
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
|
|
__pyx_v_i = __pyx_t_3;
|
|
|
|
- /* "View.MemoryView":1352
|
|
+ /* "View.MemoryView":1354
|
|
*
|
|
* for i in range(offset):
|
|
* mslice.shape[i] = 1 # <<<<<<<<<<<<<<
|
|
@@ -29465,7 +29556,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic
|
|
*/
|
|
(__pyx_v_mslice->shape[__pyx_v_i]) = 1;
|
|
|
|
- /* "View.MemoryView":1353
|
|
+ /* "View.MemoryView":1355
|
|
* for i in range(offset):
|
|
* mslice.shape[i] = 1
|
|
* mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
|
|
@@ -29474,7 +29565,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic
|
|
*/
|
|
(__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
|
|
|
|
- /* "View.MemoryView":1354
|
|
+ /* "View.MemoryView":1356
|
|
* mslice.shape[i] = 1
|
|
* mslice.strides[i] = mslice.strides[0]
|
|
* mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
|
|
@@ -29484,7 +29575,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic
|
|
(__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
|
|
}
|
|
|
|
- /* "View.MemoryView":1340
|
|
+ /* "View.MemoryView":1342
|
|
*
|
|
* @cname('__pyx_memoryview_broadcast_leading')
|
|
* cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
|
|
@@ -29495,7 +29586,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic
|
|
/* function exit code */
|
|
}
|
|
|
|
-/* "View.MemoryView":1362
|
|
+/* "View.MemoryView":1364
|
|
*
|
|
* @cname('__pyx_memoryview_refcount_copying')
|
|
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
|
|
@@ -29506,7 +29597,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic
|
|
static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
|
|
int __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":1366
|
|
+ /* "View.MemoryView":1368
|
|
*
|
|
*
|
|
* if dtype_is_object: # <<<<<<<<<<<<<<
|
|
@@ -29516,7 +29607,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
|
|
__pyx_t_1 = (__pyx_v_dtype_is_object != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":1367
|
|
+ /* "View.MemoryView":1369
|
|
*
|
|
* if dtype_is_object:
|
|
* refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
|
|
@@ -29525,7 +29616,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
|
|
*/
|
|
__pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
|
|
|
|
- /* "View.MemoryView":1366
|
|
+ /* "View.MemoryView":1368
|
|
*
|
|
*
|
|
* if dtype_is_object: # <<<<<<<<<<<<<<
|
|
@@ -29534,7 +29625,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1362
|
|
+ /* "View.MemoryView":1364
|
|
*
|
|
* @cname('__pyx_memoryview_refcount_copying')
|
|
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
|
|
@@ -29545,7 +29636,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
|
|
/* function exit code */
|
|
}
|
|
|
|
-/* "View.MemoryView":1371
|
|
+/* "View.MemoryView":1373
|
|
*
|
|
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
|
|
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
|
|
@@ -29560,7 +29651,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
|
|
#endif
|
|
__Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
|
|
|
|
- /* "View.MemoryView":1374
|
|
+ /* "View.MemoryView":1376
|
|
* Py_ssize_t *strides, int ndim,
|
|
* bint inc) with gil:
|
|
* refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
|
|
@@ -29569,7 +29660,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
|
|
*/
|
|
__pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
|
|
|
|
- /* "View.MemoryView":1371
|
|
+ /* "View.MemoryView":1373
|
|
*
|
|
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
|
|
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
|
|
@@ -29584,7 +29675,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
|
|
#endif
|
|
}
|
|
|
|
-/* "View.MemoryView":1377
|
|
+/* "View.MemoryView":1379
|
|
*
|
|
* @cname('__pyx_memoryview_refcount_objects_in_slice')
|
|
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
|
|
@@ -29601,7 +29692,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
int __pyx_t_4;
|
|
__Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
|
|
|
|
- /* "View.MemoryView":1381
|
|
+ /* "View.MemoryView":1383
|
|
* cdef Py_ssize_t i
|
|
*
|
|
* for i in range(shape[0]): # <<<<<<<<<<<<<<
|
|
@@ -29613,7 +29704,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
|
|
__pyx_v_i = __pyx_t_3;
|
|
|
|
- /* "View.MemoryView":1382
|
|
+ /* "View.MemoryView":1384
|
|
*
|
|
* for i in range(shape[0]):
|
|
* if ndim == 1: # <<<<<<<<<<<<<<
|
|
@@ -29623,7 +29714,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
__pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
|
|
if (__pyx_t_4) {
|
|
|
|
- /* "View.MemoryView":1383
|
|
+ /* "View.MemoryView":1385
|
|
* for i in range(shape[0]):
|
|
* if ndim == 1:
|
|
* if inc: # <<<<<<<<<<<<<<
|
|
@@ -29633,7 +29724,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
__pyx_t_4 = (__pyx_v_inc != 0);
|
|
if (__pyx_t_4) {
|
|
|
|
- /* "View.MemoryView":1384
|
|
+ /* "View.MemoryView":1386
|
|
* if ndim == 1:
|
|
* if inc:
|
|
* Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
|
|
@@ -29642,7 +29733,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
*/
|
|
Py_INCREF((((PyObject **)__pyx_v_data)[0]));
|
|
|
|
- /* "View.MemoryView":1383
|
|
+ /* "View.MemoryView":1385
|
|
* for i in range(shape[0]):
|
|
* if ndim == 1:
|
|
* if inc: # <<<<<<<<<<<<<<
|
|
@@ -29652,7 +29743,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
goto __pyx_L6;
|
|
}
|
|
|
|
- /* "View.MemoryView":1386
|
|
+ /* "View.MemoryView":1388
|
|
* Py_INCREF((<PyObject **> data)[0])
|
|
* else:
|
|
* Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
|
|
@@ -29664,7 +29755,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
}
|
|
__pyx_L6:;
|
|
|
|
- /* "View.MemoryView":1382
|
|
+ /* "View.MemoryView":1384
|
|
*
|
|
* for i in range(shape[0]):
|
|
* if ndim == 1: # <<<<<<<<<<<<<<
|
|
@@ -29674,7 +29765,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
goto __pyx_L5;
|
|
}
|
|
|
|
- /* "View.MemoryView":1388
|
|
+ /* "View.MemoryView":1390
|
|
* Py_DECREF((<PyObject **> data)[0])
|
|
* else:
|
|
* refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
|
|
@@ -29683,7 +29774,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
*/
|
|
/*else*/ {
|
|
|
|
- /* "View.MemoryView":1389
|
|
+ /* "View.MemoryView":1391
|
|
* else:
|
|
* refcount_objects_in_slice(data, shape + 1, strides + 1,
|
|
* ndim - 1, inc) # <<<<<<<<<<<<<<
|
|
@@ -29694,7 +29785,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
}
|
|
__pyx_L5:;
|
|
|
|
- /* "View.MemoryView":1391
|
|
+ /* "View.MemoryView":1393
|
|
* ndim - 1, inc)
|
|
*
|
|
* data += strides[0] # <<<<<<<<<<<<<<
|
|
@@ -29704,7 +29795,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
__pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
|
|
}
|
|
|
|
- /* "View.MemoryView":1377
|
|
+ /* "View.MemoryView":1379
|
|
*
|
|
* @cname('__pyx_memoryview_refcount_objects_in_slice')
|
|
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
|
|
@@ -29716,7 +29807,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
__Pyx_RefNannyFinishContext();
|
|
}
|
|
|
|
-/* "View.MemoryView":1397
|
|
+/* "View.MemoryView":1399
|
|
*
|
|
* @cname('__pyx_memoryview_slice_assign_scalar')
|
|
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
|
|
@@ -29726,7 +29817,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
|
|
static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
|
|
|
|
- /* "View.MemoryView":1400
|
|
+ /* "View.MemoryView":1402
|
|
* size_t itemsize, void *item,
|
|
* bint dtype_is_object) nogil:
|
|
* refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
|
|
@@ -29735,7 +29826,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
|
|
*/
|
|
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
|
|
|
|
- /* "View.MemoryView":1401
|
|
+ /* "View.MemoryView":1403
|
|
* bint dtype_is_object) nogil:
|
|
* refcount_copying(dst, dtype_is_object, ndim, False)
|
|
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
|
|
@@ -29744,7 +29835,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
|
|
*/
|
|
__pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
|
|
|
|
- /* "View.MemoryView":1403
|
|
+ /* "View.MemoryView":1405
|
|
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
|
|
* itemsize, item)
|
|
* refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
|
|
@@ -29753,7 +29844,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
|
|
*/
|
|
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
|
|
|
|
- /* "View.MemoryView":1397
|
|
+ /* "View.MemoryView":1399
|
|
*
|
|
* @cname('__pyx_memoryview_slice_assign_scalar')
|
|
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
|
|
@@ -29764,7 +29855,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
|
|
/* function exit code */
|
|
}
|
|
|
|
-/* "View.MemoryView":1407
|
|
+/* "View.MemoryView":1409
|
|
*
|
|
* @cname('__pyx_memoryview__slice_assign_scalar')
|
|
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
|
|
@@ -29781,7 +29872,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
|
|
Py_ssize_t __pyx_t_3;
|
|
Py_ssize_t __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1411
|
|
+ /* "View.MemoryView":1413
|
|
* size_t itemsize, void *item) nogil:
|
|
* cdef Py_ssize_t i
|
|
* cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
|
|
@@ -29790,7 +29881,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
|
|
*/
|
|
__pyx_v_stride = (__pyx_v_strides[0]);
|
|
|
|
- /* "View.MemoryView":1412
|
|
+ /* "View.MemoryView":1414
|
|
* cdef Py_ssize_t i
|
|
* cdef Py_ssize_t stride = strides[0]
|
|
* cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
|
|
@@ -29799,7 +29890,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
|
|
*/
|
|
__pyx_v_extent = (__pyx_v_shape[0]);
|
|
|
|
- /* "View.MemoryView":1414
|
|
+ /* "View.MemoryView":1416
|
|
* cdef Py_ssize_t extent = shape[0]
|
|
*
|
|
* if ndim == 1: # <<<<<<<<<<<<<<
|
|
@@ -29809,7 +29900,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
|
|
__pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":1415
|
|
+ /* "View.MemoryView":1417
|
|
*
|
|
* if ndim == 1:
|
|
* for i in range(extent): # <<<<<<<<<<<<<<
|
|
@@ -29821,7 +29912,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
|
|
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
|
|
__pyx_v_i = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1416
|
|
+ /* "View.MemoryView":1418
|
|
* if ndim == 1:
|
|
* for i in range(extent):
|
|
* memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
|
|
@@ -29830,7 +29921,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
|
|
*/
|
|
(void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
|
|
|
|
- /* "View.MemoryView":1417
|
|
+ /* "View.MemoryView":1419
|
|
* for i in range(extent):
|
|
* memcpy(data, item, itemsize)
|
|
* data += stride # <<<<<<<<<<<<<<
|
|
@@ -29840,7 +29931,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
|
|
__pyx_v_data = (__pyx_v_data + __pyx_v_stride);
|
|
}
|
|
|
|
- /* "View.MemoryView":1414
|
|
+ /* "View.MemoryView":1416
|
|
* cdef Py_ssize_t extent = shape[0]
|
|
*
|
|
* if ndim == 1: # <<<<<<<<<<<<<<
|
|
@@ -29850,7 +29941,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
- /* "View.MemoryView":1419
|
|
+ /* "View.MemoryView":1421
|
|
* data += stride
|
|
* else:
|
|
* for i in range(extent): # <<<<<<<<<<<<<<
|
|
@@ -29863,7 +29954,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
|
|
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
|
|
__pyx_v_i = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1420
|
|
+ /* "View.MemoryView":1422
|
|
* else:
|
|
* for i in range(extent):
|
|
* _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
|
|
@@ -29872,7 +29963,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
|
|
*/
|
|
__pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
|
|
|
|
- /* "View.MemoryView":1422
|
|
+ /* "View.MemoryView":1424
|
|
* _slice_assign_scalar(data, shape + 1, strides + 1,
|
|
* ndim - 1, itemsize, item)
|
|
* data += stride # <<<<<<<<<<<<<<
|
|
@@ -29884,7 +29975,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
|
|
}
|
|
__pyx_L3:;
|
|
|
|
- /* "View.MemoryView":1407
|
|
+ /* "View.MemoryView":1409
|
|
*
|
|
* @cname('__pyx_memoryview__slice_assign_scalar')
|
|
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
|
|
@@ -29982,12 +30073,12 @@ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSE
|
|
PyObject *__pyx_v___pyx_result = 0;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
- int __pyx_t_1;
|
|
- PyObject *__pyx_t_2 = NULL;
|
|
- PyObject *__pyx_t_3 = NULL;
|
|
+ PyObject *__pyx_t_1 = NULL;
|
|
+ int __pyx_t_2;
|
|
+ int __pyx_t_3;
|
|
PyObject *__pyx_t_4 = NULL;
|
|
PyObject *__pyx_t_5 = NULL;
|
|
- int __pyx_t_6;
|
|
+ PyObject *__pyx_t_6 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
@@ -29996,114 +30087,118 @@ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSE
|
|
/* "(tree fragment)":4
|
|
* cdef object __pyx_PickleError
|
|
* cdef object __pyx_result
|
|
- * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
|
|
+ * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
|
|
* from pickle import PickleError as __pyx_PickleError
|
|
- * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
|
|
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
|
|
*/
|
|
- __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
|
|
- if (__pyx_t_1) {
|
|
+ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__23, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __pyx_t_3 = (__pyx_t_2 != 0);
|
|
+ if (__pyx_t_3) {
|
|
|
|
/* "(tree fragment)":5
|
|
* cdef object __pyx_result
|
|
- * if __pyx_checksum != 0xb068931:
|
|
+ * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
|
|
* from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
|
|
- * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
|
|
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
|
|
* __pyx_result = Enum.__new__(__pyx_type)
|
|
*/
|
|
- __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_INCREF(__pyx_n_s_PickleError);
|
|
__Pyx_GIVEREF(__pyx_n_s_PickleError);
|
|
- PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
|
|
- __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __Pyx_INCREF(__pyx_t_2);
|
|
- __pyx_v___pyx_PickleError = __pyx_t_2;
|
|
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
|
|
+ __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __Pyx_INCREF(__pyx_t_1);
|
|
+ __pyx_v___pyx_PickleError = __pyx_t_1;
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
|
|
/* "(tree fragment)":6
|
|
- * if __pyx_checksum != 0xb068931:
|
|
+ * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
|
|
* from pickle import PickleError as __pyx_PickleError
|
|
- * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
|
|
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
|
|
* __pyx_result = Enum.__new__(__pyx_type)
|
|
* if __pyx_state is not None:
|
|
*/
|
|
- __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
+ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_5);
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__Pyx_INCREF(__pyx_v___pyx_PickleError);
|
|
- __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
|
|
- 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_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
|
|
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
|
|
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
|
|
+ if (likely(__pyx_t_6)) {
|
|
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
|
|
+ __Pyx_INCREF(__pyx_t_6);
|
|
__Pyx_INCREF(function);
|
|
- __Pyx_DECREF_SET(__pyx_t_2, function);
|
|
+ __Pyx_DECREF_SET(__pyx_t_1, function);
|
|
}
|
|
}
|
|
- __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
|
|
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
+ __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
|
|
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__PYX_ERR(1, 6, __pyx_L1_error)
|
|
|
|
/* "(tree fragment)":4
|
|
* cdef object __pyx_PickleError
|
|
* cdef object __pyx_result
|
|
- * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
|
|
+ * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
|
|
* from pickle import PickleError as __pyx_PickleError
|
|
- * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
|
|
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
|
|
*/
|
|
}
|
|
|
|
/* "(tree fragment)":7
|
|
* from pickle import PickleError as __pyx_PickleError
|
|
- * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
|
|
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
|
|
* __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
|
|
* if __pyx_state is not None:
|
|
* __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
|
|
*/
|
|
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_4 = NULL;
|
|
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
|
|
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
|
|
- if (likely(__pyx_t_4)) {
|
|
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
|
|
- __Pyx_INCREF(__pyx_t_4);
|
|
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_t_5 = NULL;
|
|
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
|
|
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
|
|
+ if (likely(__pyx_t_5)) {
|
|
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
|
|
+ __Pyx_INCREF(__pyx_t_5);
|
|
__Pyx_INCREF(function);
|
|
- __Pyx_DECREF_SET(__pyx_t_2, function);
|
|
+ __Pyx_DECREF_SET(__pyx_t_1, function);
|
|
}
|
|
}
|
|
- __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
|
|
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __pyx_v___pyx_result = __pyx_t_3;
|
|
- __pyx_t_3 = 0;
|
|
+ __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type);
|
|
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __pyx_v___pyx_result = __pyx_t_4;
|
|
+ __pyx_t_4 = 0;
|
|
|
|
/* "(tree fragment)":8
|
|
- * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
|
|
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
|
|
* __pyx_result = Enum.__new__(__pyx_type)
|
|
* if __pyx_state is not None: # <<<<<<<<<<<<<<
|
|
* __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
|
|
* return __pyx_result
|
|
*/
|
|
- __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
|
|
- __pyx_t_6 = (__pyx_t_1 != 0);
|
|
- if (__pyx_t_6) {
|
|
+ __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
|
|
+ __pyx_t_2 = (__pyx_t_3 != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
/* "(tree fragment)":9
|
|
* __pyx_result = Enum.__new__(__pyx_type)
|
|
@@ -30113,12 +30208,12 @@ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSE
|
|
* cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __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, 9, __pyx_L1_error)
|
|
- __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
+ __pyx_t_4 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
|
|
/* "(tree fragment)":8
|
|
- * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
|
|
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
|
|
* __pyx_result = Enum.__new__(__pyx_type)
|
|
* if __pyx_state is not None: # <<<<<<<<<<<<<<
|
|
* __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
|
|
@@ -30146,10 +30241,10 @@ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSE
|
|
|
|
/* function exit code */
|
|
__pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_2);
|
|
- __Pyx_XDECREF(__pyx_t_3);
|
|
+ __Pyx_XDECREF(__pyx_t_1);
|
|
__Pyx_XDECREF(__pyx_t_4);
|
|
__Pyx_XDECREF(__pyx_t_5);
|
|
+ __Pyx_XDECREF(__pyx_t_6);
|
|
__Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
@@ -30413,13 +30508,13 @@ static PyTypeObject __pyx_type_11fastparquet_9cencoding_NumpyIO = {
|
|
#if PY_VERSION_HEX >= 0x030400a1
|
|
0, /*tp_finalize*/
|
|
#endif
|
|
- #if PY_VERSION_HEX >= 0x030800b1
|
|
+ #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
|
|
0, /*tp_vectorcall*/
|
|
#endif
|
|
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
|
|
0, /*tp_print*/
|
|
#endif
|
|
- #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
|
|
+ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
|
|
0, /*tp_pypy_flags*/
|
|
#endif
|
|
};
|
|
@@ -30657,13 +30752,13 @@ static PyTypeObject __pyx_type_11fastparquet_9cencoding_ThriftObject = {
|
|
#if PY_VERSION_HEX >= 0x030400a1
|
|
0, /*tp_finalize*/
|
|
#endif
|
|
- #if PY_VERSION_HEX >= 0x030800b1
|
|
+ #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
|
|
0, /*tp_vectorcall*/
|
|
#endif
|
|
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
|
|
0, /*tp_print*/
|
|
#endif
|
|
- #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
|
|
+ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
|
|
0, /*tp_pypy_flags*/
|
|
#endif
|
|
};
|
|
@@ -30789,13 +30884,13 @@ static PyTypeObject __pyx_type_11fastparquet_9cencoding___pyx_scope_struct__dict
|
|
#if PY_VERSION_HEX >= 0x030400a1
|
|
0, /*tp_finalize*/
|
|
#endif
|
|
- #if PY_VERSION_HEX >= 0x030800b1
|
|
+ #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
|
|
0, /*tp_vectorcall*/
|
|
#endif
|
|
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
|
|
0, /*tp_print*/
|
|
#endif
|
|
- #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
|
|
+ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
|
|
0, /*tp_pypy_flags*/
|
|
#endif
|
|
};
|
|
@@ -30906,13 +31001,13 @@ static PyTypeObject __pyx_type_11fastparquet_9cencoding___pyx_scope_struct_1_gen
|
|
#if PY_VERSION_HEX >= 0x030400a1
|
|
0, /*tp_finalize*/
|
|
#endif
|
|
- #if PY_VERSION_HEX >= 0x030800b1
|
|
+ #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
|
|
0, /*tp_vectorcall*/
|
|
#endif
|
|
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
|
|
0, /*tp_print*/
|
|
#endif
|
|
- #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
|
|
+ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
|
|
0, /*tp_pypy_flags*/
|
|
#endif
|
|
};
|
|
@@ -31098,13 +31193,13 @@ static PyTypeObject __pyx_type___pyx_array = {
|
|
#if PY_VERSION_HEX >= 0x030400a1
|
|
0, /*tp_finalize*/
|
|
#endif
|
|
- #if PY_VERSION_HEX >= 0x030800b1
|
|
+ #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
|
|
0, /*tp_vectorcall*/
|
|
#endif
|
|
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
|
|
0, /*tp_print*/
|
|
#endif
|
|
- #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
|
|
+ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
|
|
0, /*tp_pypy_flags*/
|
|
#endif
|
|
};
|
|
@@ -31220,13 +31315,13 @@ static PyTypeObject __pyx_type___pyx_MemviewEnum = {
|
|
#if PY_VERSION_HEX >= 0x030400a1
|
|
0, /*tp_finalize*/
|
|
#endif
|
|
- #if PY_VERSION_HEX >= 0x030800b1
|
|
+ #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
|
|
0, /*tp_vectorcall*/
|
|
#endif
|
|
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
|
|
0, /*tp_print*/
|
|
#endif
|
|
- #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
|
|
+ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
|
|
0, /*tp_pypy_flags*/
|
|
#endif
|
|
};
|
|
@@ -31484,13 +31579,13 @@ static PyTypeObject __pyx_type___pyx_memoryview = {
|
|
#if PY_VERSION_HEX >= 0x030400a1
|
|
0, /*tp_finalize*/
|
|
#endif
|
|
- #if PY_VERSION_HEX >= 0x030800b1
|
|
+ #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
|
|
0, /*tp_vectorcall*/
|
|
#endif
|
|
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
|
|
0, /*tp_print*/
|
|
#endif
|
|
- #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
|
|
+ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
|
|
0, /*tp_pypy_flags*/
|
|
#endif
|
|
};
|
|
@@ -31633,13 +31728,13 @@ static PyTypeObject __pyx_type___pyx_memoryviewslice = {
|
|
#if PY_VERSION_HEX >= 0x030400a1
|
|
0, /*tp_finalize*/
|
|
#endif
|
|
- #if PY_VERSION_HEX >= 0x030800b1
|
|
+ #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
|
|
0, /*tp_vectorcall*/
|
|
#endif
|
|
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
|
|
0, /*tp_print*/
|
|
#endif
|
|
- #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
|
|
+ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
|
|
0, /*tp_pypy_flags*/
|
|
#endif
|
|
};
|
|
@@ -31741,7 +31836,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
|
|
{&__pyx_n_u_FileMetaData, __pyx_k_FileMetaData, sizeof(__pyx_k_FileMetaData), 0, 1, 0, 1},
|
|
{&__pyx_n_u_INTEGER, __pyx_k_INTEGER, sizeof(__pyx_k_INTEGER), 0, 1, 0, 1},
|
|
{&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
|
|
- {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
|
|
+ {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
|
|
{&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
|
|
{&__pyx_n_u_IndexPageHeader, __pyx_k_IndexPageHeader, sizeof(__pyx_k_IndexPageHeader), 0, 1, 0, 1},
|
|
{&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
|
|
@@ -32045,12 +32140,12 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
|
|
__pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 734, __pyx_L1_error)
|
|
__pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 834, __pyx_L1_error)
|
|
__pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 894, __pyx_L1_error)
|
|
- __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 133, __pyx_L1_error)
|
|
- __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
|
|
- __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
|
|
- __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
|
|
- __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
|
|
- __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error)
|
|
+ __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 134, __pyx_L1_error)
|
|
+ __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 149, __pyx_L1_error)
|
|
+ __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 152, __pyx_L1_error)
|
|
+ __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 406, __pyx_L1_error)
|
|
+ __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 615, __pyx_L1_error)
|
|
+ __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 834, __pyx_L1_error)
|
|
return 0;
|
|
__pyx_L1_error:;
|
|
return -1;
|
|
@@ -32079,58 +32174,58 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
|
|
__Pyx_GOTREF(__pyx_tuple__2);
|
|
__Pyx_GIVEREF(__pyx_tuple__2);
|
|
|
|
- /* "View.MemoryView":133
|
|
+ /* "View.MemoryView":134
|
|
*
|
|
* if not self.ndim:
|
|
* raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
|
|
*
|
|
* if itemsize <= 0:
|
|
*/
|
|
- __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 133, __pyx_L1_error)
|
|
+ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 134, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_tuple__5);
|
|
__Pyx_GIVEREF(__pyx_tuple__5);
|
|
|
|
- /* "View.MemoryView":136
|
|
+ /* "View.MemoryView":137
|
|
*
|
|
* if itemsize <= 0:
|
|
* raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
|
|
*
|
|
* if not isinstance(format, bytes):
|
|
*/
|
|
- __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 136, __pyx_L1_error)
|
|
+ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 137, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_tuple__6);
|
|
__Pyx_GIVEREF(__pyx_tuple__6);
|
|
|
|
- /* "View.MemoryView":148
|
|
+ /* "View.MemoryView":149
|
|
*
|
|
* if not self._shape:
|
|
* raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 148, __pyx_L1_error)
|
|
+ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 149, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_tuple__7);
|
|
__Pyx_GIVEREF(__pyx_tuple__7);
|
|
|
|
- /* "View.MemoryView":176
|
|
+ /* "View.MemoryView":177
|
|
* self.data = <char *>malloc(self.len)
|
|
* if not self.data:
|
|
* raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
|
|
*
|
|
* if self.dtype_is_object:
|
|
*/
|
|
- __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 176, __pyx_L1_error)
|
|
+ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 177, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_tuple__8);
|
|
__Pyx_GIVEREF(__pyx_tuple__8);
|
|
|
|
- /* "View.MemoryView":192
|
|
+ /* "View.MemoryView":193
|
|
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
* if not (flags & bufmode):
|
|
* raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
|
|
* info.buf = self.data
|
|
* info.len = self.len
|
|
*/
|
|
- __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 192, __pyx_L1_error)
|
|
+ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 193, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_tuple__9);
|
|
__Pyx_GIVEREF(__pyx_tuple__9);
|
|
|
|
@@ -32153,58 +32248,58 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
|
|
__Pyx_GOTREF(__pyx_tuple__11);
|
|
__Pyx_GIVEREF(__pyx_tuple__11);
|
|
|
|
- /* "View.MemoryView":418
|
|
+ /* "View.MemoryView":420
|
|
* def __setitem__(memoryview self, object index, object value):
|
|
* if self.view.readonly:
|
|
* raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
|
|
*
|
|
* have_slices, index = _unellipsify(index, self.view.ndim)
|
|
*/
|
|
- __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 418, __pyx_L1_error)
|
|
+ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 420, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_tuple__12);
|
|
__Pyx_GIVEREF(__pyx_tuple__12);
|
|
|
|
- /* "View.MemoryView":495
|
|
+ /* "View.MemoryView":497
|
|
* result = struct.unpack(self.view.format, bytesitem)
|
|
* except struct.error:
|
|
* raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
|
|
* else:
|
|
* if len(self.view.format) == 1:
|
|
*/
|
|
- __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 495, __pyx_L1_error)
|
|
+ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 497, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_tuple__13);
|
|
__Pyx_GIVEREF(__pyx_tuple__13);
|
|
|
|
- /* "View.MemoryView":520
|
|
+ /* "View.MemoryView":522
|
|
* def __getbuffer__(self, Py_buffer *info, int flags):
|
|
* if flags & PyBUF_WRITABLE and self.view.readonly:
|
|
* raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
|
|
*
|
|
* if flags & PyBUF_ND:
|
|
*/
|
|
- __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 520, __pyx_L1_error)
|
|
+ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 522, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_tuple__14);
|
|
__Pyx_GIVEREF(__pyx_tuple__14);
|
|
|
|
- /* "View.MemoryView":570
|
|
+ /* "View.MemoryView":572
|
|
* if self.view.strides == NULL:
|
|
*
|
|
* raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
|
|
*
|
|
* return tuple([stride for stride in self.view.strides[:self.view.ndim]])
|
|
*/
|
|
- __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 570, __pyx_L1_error)
|
|
+ __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 572, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_tuple__15);
|
|
__Pyx_GIVEREF(__pyx_tuple__15);
|
|
|
|
- /* "View.MemoryView":577
|
|
+ /* "View.MemoryView":579
|
|
* def suboffsets(self):
|
|
* if self.view.suboffsets == NULL:
|
|
* return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
|
|
*
|
|
* return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
|
|
*/
|
|
- __pyx_tuple__16 = PyTuple_New(1); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 577, __pyx_L1_error)
|
|
+ __pyx_tuple__16 = PyTuple_New(1); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 579, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_tuple__16);
|
|
__Pyx_INCREF(__pyx_int_neg_1);
|
|
__Pyx_GIVEREF(__pyx_int_neg_1);
|
|
@@ -32230,25 +32325,25 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
|
|
__Pyx_GOTREF(__pyx_tuple__18);
|
|
__Pyx_GIVEREF(__pyx_tuple__18);
|
|
|
|
- /* "View.MemoryView":682
|
|
+ /* "View.MemoryView":684
|
|
* if item is Ellipsis:
|
|
* if not seen_ellipsis:
|
|
* result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
|
|
* seen_ellipsis = True
|
|
* else:
|
|
*/
|
|
- __pyx_slice__19 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__19)) __PYX_ERR(1, 682, __pyx_L1_error)
|
|
+ __pyx_slice__19 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__19)) __PYX_ERR(1, 684, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_slice__19);
|
|
__Pyx_GIVEREF(__pyx_slice__19);
|
|
|
|
- /* "View.MemoryView":703
|
|
+ /* "View.MemoryView":705
|
|
* for suboffset in suboffsets[:ndim]:
|
|
* if suboffset >= 0:
|
|
* raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 703, __pyx_L1_error)
|
|
+ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 705, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_tuple__20);
|
|
__Pyx_GIVEREF(__pyx_tuple__20);
|
|
|
|
@@ -32270,6 +32365,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
|
|
__pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 4, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_tuple__22);
|
|
__Pyx_GIVEREF(__pyx_tuple__22);
|
|
+ __pyx_tuple__23 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 4, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__23);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__23);
|
|
|
|
/* "fastparquet/cencoding.pyx":401
|
|
*
|
|
@@ -32278,10 +32376,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
|
|
* val, dic, d,
|
|
* char null, null_val, int32_t max_defi, int32_t prev_i):
|
|
*/
|
|
- __pyx_tuple__23 = PyTuple_Pack(18, __pyx_n_s_assign, __pyx_n_s_defi, __pyx_n_s_rep, __pyx_n_s_val, __pyx_n_s_dic, __pyx_n_s_d, __pyx_n_s_null, __pyx_n_s_null_val, __pyx_n_s_max_defi, __pyx_n_s_prev_i, __pyx_n_s_counter, __pyx_n_s_i, __pyx_n_s_re, __pyx_n_s_de, __pyx_n_s_vali, __pyx_n_s_started, __pyx_n_s_have_null, __pyx_n_s_part); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 401, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__23);
|
|
- __Pyx_GIVEREF(__pyx_tuple__23);
|
|
- __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(10, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastparquet_cencoding_pyx, __pyx_n_s_assemble_objects, 401, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 401, __pyx_L1_error)
|
|
+ __pyx_tuple__24 = PyTuple_Pack(18, __pyx_n_s_assign, __pyx_n_s_defi, __pyx_n_s_rep, __pyx_n_s_val, __pyx_n_s_dic, __pyx_n_s_d, __pyx_n_s_null, __pyx_n_s_null_val, __pyx_n_s_max_defi, __pyx_n_s_prev_i, __pyx_n_s_counter, __pyx_n_s_i, __pyx_n_s_re, __pyx_n_s_de, __pyx_n_s_vali, __pyx_n_s_started, __pyx_n_s_have_null, __pyx_n_s_part); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 401, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__24);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__24);
|
|
+ __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(10, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastparquet_cencoding_pyx, __pyx_n_s_assemble_objects, 401, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 401, __pyx_L1_error)
|
|
|
|
/* "fastparquet/cencoding.pyx":693
|
|
*
|
|
@@ -32290,10 +32388,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
|
|
* cdef NumpyIO buf
|
|
* if isinstance(buffer, NumpyIO):
|
|
*/
|
|
- __pyx_tuple__25 = PyTuple_Pack(4, __pyx_n_s_buffer, __pyx_n_s_name, __pyx_n_s_buf, __pyx_n_s_o); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 693, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__25);
|
|
- __Pyx_GIVEREF(__pyx_tuple__25);
|
|
- __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastparquet_cencoding_pyx, __pyx_n_s_from_buffer, 693, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 693, __pyx_L1_error)
|
|
+ __pyx_tuple__26 = PyTuple_Pack(4, __pyx_n_s_buffer, __pyx_n_s_name, __pyx_n_s_buf, __pyx_n_s_o); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 693, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__26);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__26);
|
|
+ __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastparquet_cencoding_pyx, __pyx_n_s_from_buffer, 693, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 693, __pyx_L1_error)
|
|
|
|
/* "fastparquet/cencoding.pyx":845
|
|
*
|
|
@@ -32302,10 +32400,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
|
|
* cdef spec = specs[thrift_name]
|
|
* cdef int i
|
|
*/
|
|
- __pyx_tuple__27 = PyTuple_Pack(10, __pyx_n_s_thrift_name, __pyx_n_s_i32, __pyx_n_s_i32list, __pyx_n_s_kwargs, __pyx_n_s_spec, __pyx_n_s_i, __pyx_n_s_k, __pyx_n_s_out, __pyx_n_s_v, __pyx_n_s_it); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 845, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__27);
|
|
- __Pyx_GIVEREF(__pyx_tuple__27);
|
|
- __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastparquet_cencoding_pyx, __pyx_n_s_from_fields, 845, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 845, __pyx_L1_error)
|
|
+ __pyx_tuple__28 = PyTuple_Pack(10, __pyx_n_s_thrift_name, __pyx_n_s_i32, __pyx_n_s_i32list, __pyx_n_s_kwargs, __pyx_n_s_spec, __pyx_n_s_i, __pyx_n_s_k, __pyx_n_s_out, __pyx_n_s_v, __pyx_n_s_it); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 845, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__28);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__28);
|
|
+ __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastparquet_cencoding_pyx, __pyx_n_s_from_fields, 845, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 845, __pyx_L1_error)
|
|
|
|
/* "fastparquet/cencoding.pyx":869
|
|
*
|
|
@@ -32314,75 +32412,75 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
|
|
* """ dicts are equal if none-None keys match """
|
|
* if isinstance(d1, ThriftObject):
|
|
*/
|
|
- __pyx_tuple__29 = PyTuple_Pack(6, __pyx_n_s_d1, __pyx_n_s_d2, __pyx_n_s_k, __pyx_n_s_s, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 869, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__29);
|
|
- __Pyx_GIVEREF(__pyx_tuple__29);
|
|
- __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastparquet_cencoding_pyx, __pyx_n_s_dict_eq, 869, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 869, __pyx_L1_error)
|
|
+ __pyx_tuple__30 = PyTuple_Pack(6, __pyx_n_s_d1, __pyx_n_s_d2, __pyx_n_s_k, __pyx_n_s_s, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 869, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__30);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__30);
|
|
+ __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastparquet_cencoding_pyx, __pyx_n_s_dict_eq, 869, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 869, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":286
|
|
+ /* "View.MemoryView":287
|
|
* return self.name
|
|
*
|
|
* cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
|
|
* cdef strided = Enum("<strided and direct>") # default
|
|
* cdef indirect = Enum("<strided and indirect>")
|
|
*/
|
|
- __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 286, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__31);
|
|
- __Pyx_GIVEREF(__pyx_tuple__31);
|
|
+ __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 287, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__32);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__32);
|
|
|
|
- /* "View.MemoryView":287
|
|
+ /* "View.MemoryView":288
|
|
*
|
|
* cdef generic = Enum("<strided and direct or indirect>")
|
|
* cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
|
|
* cdef indirect = Enum("<strided and indirect>")
|
|
*
|
|
*/
|
|
- __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 287, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__32);
|
|
- __Pyx_GIVEREF(__pyx_tuple__32);
|
|
+ __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 288, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__33);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__33);
|
|
|
|
- /* "View.MemoryView":288
|
|
+ /* "View.MemoryView":289
|
|
* cdef generic = Enum("<strided and direct or indirect>")
|
|
* cdef strided = Enum("<strided and direct>") # default
|
|
* cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 288, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__33);
|
|
- __Pyx_GIVEREF(__pyx_tuple__33);
|
|
+ __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 289, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__34);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__34);
|
|
|
|
- /* "View.MemoryView":291
|
|
+ /* "View.MemoryView":292
|
|
*
|
|
*
|
|
* cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
|
|
* cdef indirect_contiguous = Enum("<contiguous and indirect>")
|
|
*
|
|
*/
|
|
- __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 291, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__34);
|
|
- __Pyx_GIVEREF(__pyx_tuple__34);
|
|
+ __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 292, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__35);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__35);
|
|
|
|
- /* "View.MemoryView":292
|
|
+ /* "View.MemoryView":293
|
|
*
|
|
* cdef contiguous = Enum("<contiguous and direct>")
|
|
* cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 292, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__35);
|
|
- __Pyx_GIVEREF(__pyx_tuple__35);
|
|
+ __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 293, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__36);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__36);
|
|
|
|
/* "(tree fragment)":1
|
|
* def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
|
|
* cdef object __pyx_PickleError
|
|
* cdef object __pyx_result
|
|
*/
|
|
- __pyx_tuple__36 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 1, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__36);
|
|
- __Pyx_GIVEREF(__pyx_tuple__36);
|
|
- __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(1, 1, __pyx_L1_error)
|
|
+ __pyx_tuple__37 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 1, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__37);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__37);
|
|
+ __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(1, 1, __pyx_L1_error)
|
|
__Pyx_RefNannyFinishContext();
|
|
return 0;
|
|
__pyx_L1_error:;
|
|
@@ -32409,6 +32507,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
|
|
__pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
__pyx_int_13 = PyInt_FromLong(13); if (unlikely(!__pyx_int_13)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
__pyx_int_14 = PyInt_FromLong(14); if (unlikely(!__pyx_int_14)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
+ __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
+ __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
__pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
__pyx_int_72057594037927935 = PyInt_FromString((char *)"72057594037927935", 0, 0); if (unlikely(!__pyx_int_72057594037927935)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
__pyx_int_18446744073709551615 = PyInt_FromString((char *)"18446744073709551615", 0, 0); if (unlikely(!__pyx_int_18446744073709551615)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
@@ -32515,21 +32615,21 @@ static int __Pyx_modinit_type_init_code(void) {
|
|
__pyx_ptype_11fastparquet_9cencoding___pyx_scope_struct_1_genexpr = &__pyx_type_11fastparquet_9cencoding___pyx_scope_struct_1_genexpr;
|
|
__pyx_vtabptr_array = &__pyx_vtable_array;
|
|
__pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
|
|
- if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
|
|
+ if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
|
|
#if PY_VERSION_HEX < 0x030800B1
|
|
__pyx_type___pyx_array.tp_print = 0;
|
|
#endif
|
|
- if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
|
|
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
|
|
+ if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
|
|
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
|
|
__pyx_array_type = &__pyx_type___pyx_array;
|
|
- if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
|
|
+ if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 280, __pyx_L1_error)
|
|
#if PY_VERSION_HEX < 0x030800B1
|
|
__pyx_type___pyx_MemviewEnum.tp_print = 0;
|
|
#endif
|
|
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
|
|
__pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
|
|
}
|
|
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
|
|
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 280, __pyx_L1_error)
|
|
__pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
|
|
__pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
|
|
__pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
|
|
@@ -32539,30 +32639,30 @@ static int __Pyx_modinit_type_init_code(void) {
|
|
__pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
|
|
__pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
|
|
__pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
|
|
- if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
|
|
+ if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
|
|
#if PY_VERSION_HEX < 0x030800B1
|
|
__pyx_type___pyx_memoryview.tp_print = 0;
|
|
#endif
|
|
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
|
|
__pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
|
|
}
|
|
- if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
|
|
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
|
|
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
|
|
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
|
|
__pyx_memoryview_type = &__pyx_type___pyx_memoryview;
|
|
__pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
|
|
__pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
|
|
__pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
|
|
__pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
|
|
__pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
|
|
- if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
|
|
+ if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
|
|
#if PY_VERSION_HEX < 0x030800B1
|
|
__pyx_type___pyx_memoryviewslice.tp_print = 0;
|
|
#endif
|
|
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
|
|
__pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
|
|
}
|
|
- if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
|
|
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
|
|
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
|
|
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
|
|
__pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
|
|
__Pyx_RefNannyFinishContext();
|
|
return 0;
|
|
@@ -33808,90 +33908,90 @@ if (!__Pyx_RefNanny) {
|
|
if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
|
|
- /* "View.MemoryView":209
|
|
+ /* "View.MemoryView":210
|
|
* info.obj = self
|
|
*
|
|
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
|
|
*
|
|
* def __dealloc__(array self):
|
|
*/
|
|
- __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 209, __pyx_L1_error)
|
|
+ __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 210, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
- if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
|
|
+ if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 210, __pyx_L1_error)
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
PyType_Modified(__pyx_array_type);
|
|
|
|
- /* "View.MemoryView":286
|
|
+ /* "View.MemoryView":287
|
|
* return self.name
|
|
*
|
|
* cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
|
|
* cdef strided = Enum("<strided and direct>") # default
|
|
* cdef indirect = Enum("<strided and indirect>")
|
|
*/
|
|
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 286, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 287, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_XGOTREF(generic);
|
|
__Pyx_DECREF_SET(generic, __pyx_t_2);
|
|
__Pyx_GIVEREF(__pyx_t_2);
|
|
__pyx_t_2 = 0;
|
|
|
|
- /* "View.MemoryView":287
|
|
+ /* "View.MemoryView":288
|
|
*
|
|
* cdef generic = Enum("<strided and direct or indirect>")
|
|
* cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
|
|
* cdef indirect = Enum("<strided and indirect>")
|
|
*
|
|
*/
|
|
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 287, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_XGOTREF(strided);
|
|
__Pyx_DECREF_SET(strided, __pyx_t_2);
|
|
__Pyx_GIVEREF(__pyx_t_2);
|
|
__pyx_t_2 = 0;
|
|
|
|
- /* "View.MemoryView":288
|
|
+ /* "View.MemoryView":289
|
|
* cdef generic = Enum("<strided and direct or indirect>")
|
|
* cdef strided = Enum("<strided and direct>") # default
|
|
* cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 289, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_XGOTREF(indirect);
|
|
__Pyx_DECREF_SET(indirect, __pyx_t_2);
|
|
__Pyx_GIVEREF(__pyx_t_2);
|
|
__pyx_t_2 = 0;
|
|
|
|
- /* "View.MemoryView":291
|
|
+ /* "View.MemoryView":292
|
|
*
|
|
*
|
|
* cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
|
|
* cdef indirect_contiguous = Enum("<contiguous and indirect>")
|
|
*
|
|
*/
|
|
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 291, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 292, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_XGOTREF(contiguous);
|
|
__Pyx_DECREF_SET(contiguous, __pyx_t_2);
|
|
__Pyx_GIVEREF(__pyx_t_2);
|
|
__pyx_t_2 = 0;
|
|
|
|
- /* "View.MemoryView":292
|
|
+ /* "View.MemoryView":293
|
|
*
|
|
* cdef contiguous = Enum("<contiguous and direct>")
|
|
* cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 292, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 293, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_XGOTREF(indirect_contiguous);
|
|
__Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2);
|
|
__Pyx_GIVEREF(__pyx_t_2);
|
|
__pyx_t_2 = 0;
|
|
|
|
- /* "View.MemoryView":316
|
|
+ /* "View.MemoryView":317
|
|
*
|
|
* DEF THREAD_LOCKS_PREALLOCATED = 8
|
|
* cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
|
|
@@ -33900,7 +34000,7 @@ if (!__Pyx_RefNanny) {
|
|
*/
|
|
__pyx_memoryview_thread_locks_used = 0;
|
|
|
|
- /* "View.MemoryView":317
|
|
+ /* "View.MemoryView":318
|
|
* DEF THREAD_LOCKS_PREALLOCATED = 8
|
|
* cdef int __pyx_memoryview_thread_locks_used = 0
|
|
* cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
|
|
@@ -33917,29 +34017,29 @@ if (!__Pyx_RefNanny) {
|
|
__pyx_t_3[7] = PyThread_allocate_lock();
|
|
memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
|
|
|
|
- /* "View.MemoryView":549
|
|
+ /* "View.MemoryView":551
|
|
* info.obj = self
|
|
*
|
|
* __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 549, __pyx_L1_error)
|
|
+ __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 551, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
- if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
|
|
+ if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 551, __pyx_L1_error)
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
PyType_Modified(__pyx_memoryview_type);
|
|
|
|
- /* "View.MemoryView":995
|
|
+ /* "View.MemoryView":997
|
|
* return self.from_object
|
|
*
|
|
* __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 995, __pyx_L1_error)
|
|
+ __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 997, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
- if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
|
|
+ if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 997, __pyx_L1_error)
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
PyType_Modified(__pyx_memoryviewslice_type);
|
|
|
|
@@ -34439,7 +34539,7 @@ __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
|
|
static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
|
|
va_list vargs;
|
|
char msg[200];
|
|
-#ifdef HAVE_STDARG_PROTOTYPES
|
|
+#if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
|
|
va_start(vargs, fmt);
|
|
#else
|
|
va_start(vargs);
|
|
@@ -35430,7 +35530,7 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq
|
|
return (equals == Py_EQ);
|
|
} else {
|
|
int result;
|
|
-#if CYTHON_USE_UNICODE_INTERNALS
|
|
+#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
|
|
Py_hash_t hash1, hash2;
|
|
hash1 = ((PyBytesObject*)s1)->ob_shash;
|
|
hash2 = ((PyBytesObject*)s2)->ob_shash;
|
|
@@ -36527,17 +36627,35 @@ static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
|
|
static int __Pyx_setup_reduce(PyObject* type_obj) {
|
|
int ret = 0;
|
|
PyObject *object_reduce = NULL;
|
|
+ PyObject *object_getstate = NULL;
|
|
PyObject *object_reduce_ex = NULL;
|
|
PyObject *reduce = NULL;
|
|
PyObject *reduce_ex = NULL;
|
|
PyObject *reduce_cython = NULL;
|
|
PyObject *setstate = NULL;
|
|
PyObject *setstate_cython = NULL;
|
|
+ PyObject *getstate = NULL;
|
|
+#if CYTHON_USE_PYTYPE_LOOKUP
|
|
+ getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
|
|
+#else
|
|
+ getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
|
|
+ if (!getstate && PyErr_Occurred()) {
|
|
+ goto __PYX_BAD;
|
|
+ }
|
|
+#endif
|
|
+ if (getstate) {
|
|
#if CYTHON_USE_PYTYPE_LOOKUP
|
|
- if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
|
|
+ object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
|
|
#else
|
|
- if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
|
|
+ object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
|
|
+ if (!object_getstate && PyErr_Occurred()) {
|
|
+ goto __PYX_BAD;
|
|
+ }
|
|
#endif
|
|
+ if (object_getstate != getstate) {
|
|
+ goto __PYX_GOOD;
|
|
+ }
|
|
+ }
|
|
#if CYTHON_USE_PYTYPE_LOOKUP
|
|
object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
|
|
#else
|
|
@@ -36582,6 +36700,8 @@ static int __Pyx_setup_reduce(PyObject* type_obj) {
|
|
#if !CYTHON_USE_PYTYPE_LOOKUP
|
|
Py_XDECREF(object_reduce);
|
|
Py_XDECREF(object_reduce_ex);
|
|
+ Py_XDECREF(object_getstate);
|
|
+ Py_XDECREF(getstate);
|
|
#endif
|
|
Py_XDECREF(reduce);
|
|
Py_XDECREF(reduce_ex);
|
|
@@ -36798,6 +36918,12 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
|
|
#include "compile.h"
|
|
#include "frameobject.h"
|
|
#include "traceback.h"
|
|
+#if PY_VERSION_HEX >= 0x030b00a6
|
|
+ #ifndef Py_BUILD_CORE
|
|
+ #define Py_BUILD_CORE 1
|
|
+ #endif
|
|
+ #include "internal/pycore_frame.h"
|
|
+#endif
|
|
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
|
|
const char *funcname, int c_line,
|
|
int py_line, const char *filename) {
|
|
@@ -36861,14 +36987,24 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line,
|
|
PyCodeObject *py_code = 0;
|
|
PyFrameObject *py_frame = 0;
|
|
PyThreadState *tstate = __Pyx_PyThreadState_Current;
|
|
+ PyObject *ptype, *pvalue, *ptraceback;
|
|
if (c_line) {
|
|
c_line = __Pyx_CLineForTraceback(tstate, c_line);
|
|
}
|
|
py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
|
|
if (!py_code) {
|
|
+ __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
|
|
py_code = __Pyx_CreateCodeObjectForTraceback(
|
|
funcname, c_line, py_line, filename);
|
|
- if (!py_code) goto bad;
|
|
+ if (!py_code) {
|
|
+ /* If the code object creation fails, then we should clear the
|
|
+ fetched exception references and propagate the new exception */
|
|
+ Py_XDECREF(ptype);
|
|
+ Py_XDECREF(pvalue);
|
|
+ Py_XDECREF(ptraceback);
|
|
+ goto bad;
|
|
+ }
|
|
+ __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
|
|
__pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
|
|
}
|
|
py_frame = PyFrame_New(
|
|
@@ -39912,6 +40048,12 @@ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name
|
|
/* CoroutineBase */
|
|
#include <structmember.h>
|
|
#include <frameobject.h>
|
|
+#if PY_VERSION_HEX >= 0x030b00a6
|
|
+ #ifndef Py_BUILD_CORE
|
|
+ #define Py_BUILD_CORE 1
|
|
+ #endif
|
|
+ #include "internal/pycore_frame.h"
|
|
+#endif
|
|
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
|
|
static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
|
|
PyObject *et, *ev, *tb;
|
|
@@ -40877,13 +41019,13 @@ static PyTypeObject __pyx_GeneratorType_type = {
|
|
#elif PY_VERSION_HEX >= 0x030400a1
|
|
0,
|
|
#endif
|
|
-#if PY_VERSION_HEX >= 0x030800b1
|
|
+#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
|
|
0,
|
|
#endif
|
|
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
|
|
0,
|
|
#endif
|
|
-#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
|
|
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
|
|
0,
|
|
#endif
|
|
};
|
|
@@ -40899,11 +41041,33 @@ static int __pyx_Generator_init(void) {
|
|
|
|
/* CheckBinaryVersion */
|
|
static int __Pyx_check_binary_version(void) {
|
|
- char ctversion[4], rtversion[4];
|
|
- PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
|
|
- PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
|
|
- if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
|
|
+ char ctversion[5];
|
|
+ int same=1, i, found_dot;
|
|
+ const char* rt_from_call = Py_GetVersion();
|
|
+ PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
|
|
+ found_dot = 0;
|
|
+ for (i = 0; i < 4; i++) {
|
|
+ if (!ctversion[i]) {
|
|
+ same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
|
|
+ break;
|
|
+ }
|
|
+ if (rt_from_call[i] != ctversion[i]) {
|
|
+ same = 0;
|
|
+ break;
|
|
+ }
|
|
+ }
|
|
+ if (!same) {
|
|
+ char rtversion[5] = {'\0'};
|
|
char message[200];
|
|
+ for (i=0; i<4; ++i) {
|
|
+ if (rt_from_call[i] == '.') {
|
|
+ if (found_dot) break;
|
|
+ found_dot = 1;
|
|
+ } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
|
|
+ break;
|
|
+ }
|
|
+ rtversion[i] = rt_from_call[i];
|
|
+ }
|
|
PyOS_snprintf(message, sizeof(message),
|
|
"compiletime version %s of module '%.100s' "
|
|
"does not match runtime version %s",
|
|
diff --git a/fastparquet/dataframe.py b/fastparquet/dataframe.py
|
|
index 55359713..d90e5add 100644
|
|
--- a/fastparquet/dataframe.py
|
|
+++ b/fastparquet/dataframe.py
|
|
@@ -104,6 +104,8 @@ def cat(col):
|
|
if hasattr(t, 'base'):
|
|
# funky pandas not-dtype
|
|
t = t.base
|
|
+ if ("M" in str(t) or "time" in str(t)) and "[" not in str(t):
|
|
+ t = t + "[ns]"
|
|
d = np.empty(0, dtype=t)
|
|
if d.dtype.kind == "M" and str(col) in timezones:
|
|
try:
|
|
diff --git a/fastparquet/speedups.c b/fastparquet/speedups.c
|
|
index 4bbc9461..1c142112 100644
|
|
--- a/fastparquet/speedups.c
|
|
+++ b/fastparquet/speedups.c
|
|
@@ -1,4 +1,4 @@
|
|
-/* Generated by Cython 0.29.28 */
|
|
+/* Generated by Cython 0.29.32 */
|
|
|
|
/* BEGIN: Cython Metadata
|
|
{
|
|
@@ -22,8 +22,8 @@ END: Cython Metadata */
|
|
#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_29_28"
|
|
-#define CYTHON_HEX_VERSION 0x001D1CF0
|
|
+#define CYTHON_ABI "0_29_32"
|
|
+#define CYTHON_HEX_VERSION 0x001D20F0
|
|
#define CYTHON_FUTURE_DIVISION 1
|
|
#include <stddef.h>
|
|
#ifndef offsetof
|
|
@@ -62,6 +62,7 @@ END: Cython Metadata */
|
|
#define CYTHON_COMPILING_IN_PYPY 1
|
|
#define CYTHON_COMPILING_IN_PYSTON 0
|
|
#define CYTHON_COMPILING_IN_CPYTHON 0
|
|
+ #define CYTHON_COMPILING_IN_NOGIL 0
|
|
#undef CYTHON_USE_TYPE_SLOTS
|
|
#define CYTHON_USE_TYPE_SLOTS 0
|
|
#undef CYTHON_USE_PYTYPE_LOOKUP
|
|
@@ -98,10 +99,14 @@ END: Cython Metadata */
|
|
#define CYTHON_USE_DICT_VERSIONS 0
|
|
#undef CYTHON_USE_EXC_INFO_STACK
|
|
#define CYTHON_USE_EXC_INFO_STACK 0
|
|
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
|
|
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
|
|
+ #endif
|
|
#elif defined(PYSTON_VERSION)
|
|
#define CYTHON_COMPILING_IN_PYPY 0
|
|
#define CYTHON_COMPILING_IN_PYSTON 1
|
|
#define CYTHON_COMPILING_IN_CPYTHON 0
|
|
+ #define CYTHON_COMPILING_IN_NOGIL 0
|
|
#ifndef CYTHON_USE_TYPE_SLOTS
|
|
#define CYTHON_USE_TYPE_SLOTS 1
|
|
#endif
|
|
@@ -139,10 +144,59 @@ END: Cython Metadata */
|
|
#define CYTHON_USE_DICT_VERSIONS 0
|
|
#undef CYTHON_USE_EXC_INFO_STACK
|
|
#define CYTHON_USE_EXC_INFO_STACK 0
|
|
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
|
|
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
|
|
+ #endif
|
|
+#elif defined(PY_NOGIL)
|
|
+ #define CYTHON_COMPILING_IN_PYPY 0
|
|
+ #define CYTHON_COMPILING_IN_PYSTON 0
|
|
+ #define CYTHON_COMPILING_IN_CPYTHON 0
|
|
+ #define CYTHON_COMPILING_IN_NOGIL 1
|
|
+ #ifndef CYTHON_USE_TYPE_SLOTS
|
|
+ #define CYTHON_USE_TYPE_SLOTS 1
|
|
+ #endif
|
|
+ #undef CYTHON_USE_PYTYPE_LOOKUP
|
|
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
|
|
+ #ifndef CYTHON_USE_ASYNC_SLOTS
|
|
+ #define CYTHON_USE_ASYNC_SLOTS 1
|
|
+ #endif
|
|
+ #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
|
|
+ #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
|
|
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 1
|
|
+ #endif
|
|
+ #ifndef CYTHON_USE_TP_FINALIZE
|
|
+ #define CYTHON_USE_TP_FINALIZE 1
|
|
+ #endif
|
|
+ #undef CYTHON_USE_DICT_VERSIONS
|
|
+ #define CYTHON_USE_DICT_VERSIONS 0
|
|
+ #undef CYTHON_USE_EXC_INFO_STACK
|
|
+ #define CYTHON_USE_EXC_INFO_STACK 0
|
|
#else
|
|
#define CYTHON_COMPILING_IN_PYPY 0
|
|
#define CYTHON_COMPILING_IN_PYSTON 0
|
|
#define CYTHON_COMPILING_IN_CPYTHON 1
|
|
+ #define CYTHON_COMPILING_IN_NOGIL 0
|
|
#ifndef CYTHON_USE_TYPE_SLOTS
|
|
#define CYTHON_USE_TYPE_SLOTS 1
|
|
#endif
|
|
@@ -192,7 +246,7 @@ END: Cython Metadata */
|
|
#define CYTHON_FAST_THREAD_STATE 1
|
|
#endif
|
|
#ifndef CYTHON_FAST_PYCALL
|
|
- #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030B00A1)
|
|
+ #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
|
|
#endif
|
|
#ifndef CYTHON_PEP489_MULTI_PHASE_INIT
|
|
#define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
|
|
@@ -209,6 +263,9 @@ END: Cython Metadata */
|
|
#elif !defined(CYTHON_USE_EXC_INFO_STACK)
|
|
#define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
|
|
#endif
|
|
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
|
|
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
|
|
+ #endif
|
|
#endif
|
|
#if !defined(CYTHON_FAST_PYCCALL)
|
|
#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
|
|
@@ -660,8 +717,10 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
|
|
} __Pyx_PyAsyncMethodsStruct;
|
|
#endif
|
|
|
|
-#if defined(WIN32) || defined(MS_WINDOWS)
|
|
- #define _USE_MATH_DEFINES
|
|
+#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
|
|
+ #if !defined(_USE_MATH_DEFINES)
|
|
+ #define _USE_MATH_DEFINES
|
|
+ #endif
|
|
#endif
|
|
#include <math.h>
|
|
#ifdef NAN
|
|
@@ -700,7 +759,13 @@ static CYTHON_INLINE float __PYX_NAN() {
|
|
#include <stdio.h>
|
|
#include "pythread.h"
|
|
#include "numpy/arrayobject.h"
|
|
+#include "numpy/ndarrayobject.h"
|
|
+#include "numpy/ndarraytypes.h"
|
|
+#include "numpy/arrayscalars.h"
|
|
#include "numpy/ufuncobject.h"
|
|
+
|
|
+ /* NumPy API declarations from "numpy/__init__.pxd" */
|
|
+
|
|
#include <stdlib.h>
|
|
#include "pystate.h"
|
|
#ifdef _OPENMP
|
|
@@ -993,30 +1058,26 @@ typedef struct {
|
|
#ifndef CYTHON_ATOMICS
|
|
#define CYTHON_ATOMICS 1
|
|
#endif
|
|
+#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
|
|
#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)
|
|
+#if CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
|
|
+ (__GNUC_MINOR__ > 1 ||\
|
|
+ (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
|
|
+ #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1)
|
|
+ #define __pyx_atomic_decr_aligned(value) __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>
|
|
+#elif CYTHON_ATOMICS && defined(_MSC_VER) && CYTHON_COMPILING_IN_NOGIL
|
|
+ #include <intrin.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)
|
|
+ #define __pyx_atomic_int_type long
|
|
+ #pragma intrinsic (_InterlockedExchangeAdd)
|
|
+ #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1)
|
|
+ #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1)
|
|
#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
|
|
@@ -1027,9 +1088,9 @@ typedef struct {
|
|
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)
|
|
+ __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview))
|
|
#define __pyx_sub_acquisition_count(memview)\
|
|
- __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
|
|
+ __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview))
|
|
#else
|
|
#define __pyx_add_acquisition_count(memview)\
|
|
__pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
|
|
@@ -1050,7 +1111,7 @@ typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
|
|
#define __Pyx_FastGilFuncInit()
|
|
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":775
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":690
|
|
* # in Cython to enable them only on the right systems.
|
|
*
|
|
* ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
|
|
@@ -1059,7 +1120,7 @@ typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
|
|
*/
|
|
typedef npy_int8 __pyx_t_5numpy_int8_t;
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":776
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":691
|
|
*
|
|
* ctypedef npy_int8 int8_t
|
|
* ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
|
|
@@ -1068,7 +1129,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t;
|
|
*/
|
|
typedef npy_int16 __pyx_t_5numpy_int16_t;
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":777
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":692
|
|
* ctypedef npy_int8 int8_t
|
|
* ctypedef npy_int16 int16_t
|
|
* ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
|
|
@@ -1077,7 +1138,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t;
|
|
*/
|
|
typedef npy_int32 __pyx_t_5numpy_int32_t;
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":778
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":693
|
|
* ctypedef npy_int16 int16_t
|
|
* ctypedef npy_int32 int32_t
|
|
* ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
|
|
@@ -1086,7 +1147,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t;
|
|
*/
|
|
typedef npy_int64 __pyx_t_5numpy_int64_t;
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":782
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":697
|
|
* #ctypedef npy_int128 int128_t
|
|
*
|
|
* ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
|
|
@@ -1095,7 +1156,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t;
|
|
*/
|
|
typedef npy_uint8 __pyx_t_5numpy_uint8_t;
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":783
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":698
|
|
*
|
|
* ctypedef npy_uint8 uint8_t
|
|
* ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
|
|
@@ -1104,7 +1165,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t;
|
|
*/
|
|
typedef npy_uint16 __pyx_t_5numpy_uint16_t;
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":784
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":699
|
|
* ctypedef npy_uint8 uint8_t
|
|
* ctypedef npy_uint16 uint16_t
|
|
* ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
|
|
@@ -1113,7 +1174,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t;
|
|
*/
|
|
typedef npy_uint32 __pyx_t_5numpy_uint32_t;
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":785
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":700
|
|
* ctypedef npy_uint16 uint16_t
|
|
* ctypedef npy_uint32 uint32_t
|
|
* ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
|
|
@@ -1122,7 +1183,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t;
|
|
*/
|
|
typedef npy_uint64 __pyx_t_5numpy_uint64_t;
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":789
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":704
|
|
* #ctypedef npy_uint128 uint128_t
|
|
*
|
|
* ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
|
|
@@ -1131,7 +1192,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t;
|
|
*/
|
|
typedef npy_float32 __pyx_t_5numpy_float32_t;
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":790
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":705
|
|
*
|
|
* ctypedef npy_float32 float32_t
|
|
* ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
|
|
@@ -1140,7 +1201,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t;
|
|
*/
|
|
typedef npy_float64 __pyx_t_5numpy_float64_t;
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":799
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":714
|
|
* # The int types are mapped a bit surprising --
|
|
* # numpy.int corresponds to 'l' and numpy.long to 'q'
|
|
* ctypedef npy_long int_t # <<<<<<<<<<<<<<
|
|
@@ -1149,7 +1210,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t;
|
|
*/
|
|
typedef npy_long __pyx_t_5numpy_int_t;
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":800
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":715
|
|
* # numpy.int corresponds to 'l' and numpy.long to 'q'
|
|
* ctypedef npy_long int_t
|
|
* ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
|
|
@@ -1158,7 +1219,7 @@ typedef npy_long __pyx_t_5numpy_int_t;
|
|
*/
|
|
typedef npy_longlong __pyx_t_5numpy_long_t;
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":801
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":716
|
|
* ctypedef npy_long int_t
|
|
* ctypedef npy_longlong long_t
|
|
* ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
|
|
@@ -1167,7 +1228,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t;
|
|
*/
|
|
typedef npy_longlong __pyx_t_5numpy_longlong_t;
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":803
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":718
|
|
* ctypedef npy_longlong longlong_t
|
|
*
|
|
* ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
|
|
@@ -1176,7 +1237,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t;
|
|
*/
|
|
typedef npy_ulong __pyx_t_5numpy_uint_t;
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":804
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":719
|
|
*
|
|
* ctypedef npy_ulong uint_t
|
|
* ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
|
|
@@ -1185,7 +1246,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t;
|
|
*/
|
|
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":805
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":720
|
|
* ctypedef npy_ulong uint_t
|
|
* ctypedef npy_ulonglong ulong_t
|
|
* ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
|
|
@@ -1194,7 +1255,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
|
|
*/
|
|
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":807
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":722
|
|
* ctypedef npy_ulonglong ulonglong_t
|
|
*
|
|
* ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
|
|
@@ -1203,7 +1264,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
|
|
*/
|
|
typedef npy_intp __pyx_t_5numpy_intp_t;
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":808
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":723
|
|
*
|
|
* ctypedef npy_intp intp_t
|
|
* ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
|
|
@@ -1212,7 +1273,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t;
|
|
*/
|
|
typedef npy_uintp __pyx_t_5numpy_uintp_t;
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":810
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":725
|
|
* ctypedef npy_uintp uintp_t
|
|
*
|
|
* ctypedef npy_double float_t # <<<<<<<<<<<<<<
|
|
@@ -1221,7 +1282,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t;
|
|
*/
|
|
typedef npy_double __pyx_t_5numpy_float_t;
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":811
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":726
|
|
*
|
|
* ctypedef npy_double float_t
|
|
* ctypedef npy_double double_t # <<<<<<<<<<<<<<
|
|
@@ -1230,7 +1291,7 @@ typedef npy_double __pyx_t_5numpy_float_t;
|
|
*/
|
|
typedef npy_double __pyx_t_5numpy_double_t;
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":812
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":727
|
|
* ctypedef npy_double float_t
|
|
* ctypedef npy_double double_t
|
|
* ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
|
|
@@ -1269,7 +1330,7 @@ struct __pyx_MemviewEnum_obj;
|
|
struct __pyx_memoryview_obj;
|
|
struct __pyx_memoryviewslice_obj;
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":814
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":729
|
|
* ctypedef npy_longdouble longdouble_t
|
|
*
|
|
* ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
|
|
@@ -1278,7 +1339,7 @@ struct __pyx_memoryviewslice_obj;
|
|
*/
|
|
typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":815
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":730
|
|
*
|
|
* ctypedef npy_cfloat cfloat_t
|
|
* ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
|
|
@@ -1287,7 +1348,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
|
|
*/
|
|
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":816
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":731
|
|
* ctypedef npy_cfloat cfloat_t
|
|
* ctypedef npy_cdouble cdouble_t
|
|
* ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
|
|
@@ -1296,7 +1357,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
|
|
*/
|
|
typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":818
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":733
|
|
* ctypedef npy_clongdouble clongdouble_t
|
|
*
|
|
* ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
|
|
@@ -1305,7 +1366,7 @@ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
|
|
*/
|
|
typedef npy_cdouble __pyx_t_5numpy_complex_t;
|
|
|
|
-/* "View.MemoryView":105
|
|
+/* "View.MemoryView":106
|
|
*
|
|
* @cname("__pyx_array")
|
|
* cdef class array: # <<<<<<<<<<<<<<
|
|
@@ -1330,7 +1391,7 @@ struct __pyx_array_obj {
|
|
};
|
|
|
|
|
|
-/* "View.MemoryView":279
|
|
+/* "View.MemoryView":280
|
|
*
|
|
* @cname('__pyx_MemviewEnum')
|
|
* cdef class Enum(object): # <<<<<<<<<<<<<<
|
|
@@ -1343,7 +1404,7 @@ struct __pyx_MemviewEnum_obj {
|
|
};
|
|
|
|
|
|
-/* "View.MemoryView":330
|
|
+/* "View.MemoryView":331
|
|
*
|
|
* @cname('__pyx_memoryview')
|
|
* cdef class memoryview(object): # <<<<<<<<<<<<<<
|
|
@@ -1366,7 +1427,7 @@ struct __pyx_memoryview_obj {
|
|
};
|
|
|
|
|
|
-/* "View.MemoryView":965
|
|
+/* "View.MemoryView":967
|
|
*
|
|
* @cname('__pyx_memoryviewslice')
|
|
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
|
|
@@ -1383,7 +1444,7 @@ struct __pyx_memoryviewslice_obj {
|
|
|
|
|
|
|
|
-/* "View.MemoryView":105
|
|
+/* "View.MemoryView":106
|
|
*
|
|
* @cname("__pyx_array")
|
|
* cdef class array: # <<<<<<<<<<<<<<
|
|
@@ -1397,7 +1458,7 @@ struct __pyx_vtabstruct_array {
|
|
static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
|
|
|
|
|
|
-/* "View.MemoryView":330
|
|
+/* "View.MemoryView":331
|
|
*
|
|
* @cname('__pyx_memoryview')
|
|
* cdef class memoryview(object): # <<<<<<<<<<<<<<
|
|
@@ -1417,7 +1478,7 @@ struct __pyx_vtabstruct_memoryview {
|
|
static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
|
|
|
|
|
|
-/* "View.MemoryView":965
|
|
+/* "View.MemoryView":967
|
|
*
|
|
* @cname('__pyx_memoryviewslice')
|
|
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
|
|
@@ -1695,6 +1756,38 @@ static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
|
|
static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
|
|
static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
|
|
|
|
+/* GetTopmostException.proto */
|
|
+#if CYTHON_USE_EXC_INFO_STACK
|
|
+static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
|
|
+#endif
|
|
+
|
|
+/* SaveResetException.proto */
|
|
+#if CYTHON_FAST_THREAD_STATE
|
|
+#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
|
|
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
|
|
+#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
|
|
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
|
|
+#else
|
|
+#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
|
|
+#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
|
|
+#endif
|
|
+
|
|
+/* 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
|
|
+
|
|
+/* 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
|
|
+
|
|
/* PyCFunctionFastCall.proto */
|
|
#if CYTHON_FAST_PYCCALL
|
|
static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
|
|
@@ -1719,6 +1812,12 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
|
|
#if CYTHON_FAST_PYCALL
|
|
static size_t __pyx_pyframe_localsplus_offset = 0;
|
|
#include "frameobject.h"
|
|
+#if PY_VERSION_HEX >= 0x030b00a6
|
|
+ #ifndef Py_BUILD_CORE
|
|
+ #define Py_BUILD_CORE 1
|
|
+ #endif
|
|
+ #include "internal/pycore_frame.h"
|
|
+#endif
|
|
#define __Pxy_PyFrame_Initialize_Offsets()\
|
|
((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
|
|
(void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
|
|
@@ -1727,6 +1826,9 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
|
|
#endif // CYTHON_FAST_PYCALL
|
|
#endif
|
|
|
|
+/* PyObjectCall2Args.proto */
|
|
+static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
|
|
+
|
|
/* PyObjectCallMethO.proto */
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
|
|
@@ -1735,61 +1837,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject
|
|
/* PyObjectCallOneArg.proto */
|
|
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
|
|
|
|
-/* 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
|
|
-
|
|
-/* RaiseTooManyValuesToUnpack.proto */
|
|
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
|
|
-
|
|
-/* RaiseNeedMoreValuesToUnpack.proto */
|
|
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
|
|
-
|
|
-/* RaiseNoneIterError.proto */
|
|
-static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
|
|
-
|
|
-/* GetTopmostException.proto */
|
|
-#if CYTHON_USE_EXC_INFO_STACK
|
|
-static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
|
|
-#endif
|
|
-
|
|
-/* SaveResetException.proto */
|
|
-#if CYTHON_FAST_THREAD_STATE
|
|
-#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
|
|
-static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
|
|
-#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
|
|
-static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
|
|
-#else
|
|
-#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
|
|
-#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
|
|
-#endif
|
|
-
|
|
-/* 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
|
|
-
|
|
-/* 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
|
|
-
|
|
-/* PyObjectCall2Args.proto */
|
|
-static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
|
|
-
|
|
/* IncludeStringH.proto */
|
|
#include <string.h>
|
|
|
|
@@ -1848,6 +1895,15 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
|
|
/* GetAttr3.proto */
|
|
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
|
|
|
|
+/* RaiseTooManyValuesToUnpack.proto */
|
|
+static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
|
|
+
|
|
+/* RaiseNeedMoreValuesToUnpack.proto */
|
|
+static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
|
|
+
|
|
+/* RaiseNoneIterError.proto */
|
|
+static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
|
|
+
|
|
/* SwapException.proto */
|
|
#if CYTHON_FAST_THREAD_STATE
|
|
#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
|
|
@@ -1934,6 +1990,12 @@ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
|
|
/* DivInt[long].proto */
|
|
static CYTHON_INLINE long __Pyx_div_long(long, long);
|
|
|
|
+/* PySequenceContains.proto */
|
|
+static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
|
|
+ int result = PySequence_Contains(seq, item);
|
|
+ return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
|
|
+}
|
|
+
|
|
/* ImportFrom.proto */
|
|
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
|
|
|
|
@@ -2164,18 +2226,15 @@ __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
|
|
/* CIntFromPy.proto */
|
|
static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
|
|
|
|
-/* CIntToPy.proto */
|
|
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
|
|
-
|
|
/* CIntFromPy.proto */
|
|
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
|
|
|
|
-/* CIntToPy.proto */
|
|
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
|
|
-
|
|
/* CIntFromPy.proto */
|
|
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
|
|
|
|
+/* CIntToPy.proto */
|
|
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
|
|
+
|
|
/* CIntToPy.proto */
|
|
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
|
|
|
|
@@ -2286,8 +2345,17 @@ static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
|
|
static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
|
|
static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
|
|
static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
|
|
+static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
|
|
+static PyTypeObject *__pyx_ptype_5numpy_number = 0;
|
|
+static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
|
|
+static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
|
|
+static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
|
|
+static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
|
|
+static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
|
|
+static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
|
|
+static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
|
|
+static PyTypeObject *__pyx_ptype_5numpy_character = 0;
|
|
static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
|
|
-static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
|
|
|
|
/* Module declarations from 'cython.view' */
|
|
|
|
@@ -2348,9 +2416,8 @@ int __pyx_module_is_main_fastparquet__speedups = 0;
|
|
static PyObject *__pyx_builtin_object;
|
|
static PyObject *__pyx_builtin_range;
|
|
static PyObject *__pyx_builtin_TypeError;
|
|
-static PyObject *__pyx_builtin_ValueError;
|
|
-static PyObject *__pyx_builtin_RuntimeError;
|
|
static PyObject *__pyx_builtin_ImportError;
|
|
+static PyObject *__pyx_builtin_ValueError;
|
|
static PyObject *__pyx_builtin_MemoryError;
|
|
static PyObject *__pyx_builtin_enumerate;
|
|
static PyObject *__pyx_builtin_Ellipsis;
|
|
@@ -2429,7 +2496,6 @@ static const char __pyx_k_total_size[] = "total_size";
|
|
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_RuntimeError[] = "RuntimeError";
|
|
static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
|
|
static const char __pyx_k_stringsource[] = "stringsource";
|
|
static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
|
|
@@ -2456,30 +2522,24 @@ static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '
|
|
static const char __pyx_k_fastparquet_speedups_pyx[] = "fastparquet/speedups.pyx";
|
|
static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
|
|
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_unable_to_allocate_array_data[] = "unable to allocate array data.";
|
|
static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
|
|
static const char __pyx_k_Native_accelerators_for_Parquet[] = "\nNative accelerators for Parquet encoding and decoding.\n";
|
|
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_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
|
|
-static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
|
|
+static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (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_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_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_kp_s_Can_only_create_a_buffer_that_is;
|
|
@@ -2488,10 +2548,8 @@ 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_u_Format_string_allocated_too_shor;
|
|
-static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
|
|
static PyObject *__pyx_n_s_ImportError;
|
|
-static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
|
|
+static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
|
|
static PyObject *__pyx_n_s_IndexError;
|
|
static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
|
|
static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
|
|
@@ -2499,11 +2557,9 @@ static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
|
|
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_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;
|
|
@@ -2552,8 +2608,6 @@ 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_new;
|
|
static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
|
|
@@ -2600,7 +2654,6 @@ static PyObject *__pyx_n_s_test;
|
|
static PyObject *__pyx_n_s_total_size;
|
|
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_u_unknown_dtype_code_in_numpy_pxd;
|
|
static PyObject *__pyx_n_s_unpack;
|
|
static PyObject *__pyx_n_s_unpack_byte_array;
|
|
static PyObject *__pyx_n_s_update;
|
|
@@ -2609,8 +2662,6 @@ static PyObject *__pyx_n_s_val;
|
|
static PyObject *__pyx_pf_11fastparquet_8speedups_array_encode_utf8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_inp); /* proto */
|
|
static PyObject *__pyx_pf_11fastparquet_8speedups_2pack_byte_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_items); /* proto */
|
|
static PyObject *__pyx_pf_11fastparquet_8speedups_4unpack_byte_array(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_raw_bytes, Py_ssize_t __pyx_v_n, char __pyx_v_utf); /* 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 */
|
|
@@ -2659,6 +2710,8 @@ static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject
|
|
static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
|
|
static PyObject *__pyx_int_0;
|
|
static PyObject *__pyx_int_1;
|
|
+static PyObject *__pyx_int_112105877;
|
|
+static PyObject *__pyx_int_136983863;
|
|
static PyObject *__pyx_int_184977713;
|
|
static PyObject *__pyx_int_neg_1;
|
|
static PyObject *__pyx_tuple_;
|
|
@@ -2670,7 +2723,7 @@ static PyObject *__pyx_tuple__6;
|
|
static PyObject *__pyx_tuple__7;
|
|
static PyObject *__pyx_tuple__8;
|
|
static PyObject *__pyx_tuple__9;
|
|
-static PyObject *__pyx_slice__23;
|
|
+static PyObject *__pyx_slice__18;
|
|
static PyObject *__pyx_tuple__10;
|
|
static PyObject *__pyx_tuple__11;
|
|
static PyObject *__pyx_tuple__12;
|
|
@@ -2679,28 +2732,24 @@ 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__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_codeobj__25;
|
|
+static PyObject *__pyx_codeobj__27;
|
|
static PyObject *__pyx_codeobj__29;
|
|
-static PyObject *__pyx_codeobj__31;
|
|
-static PyObject *__pyx_codeobj__33;
|
|
-static PyObject *__pyx_codeobj__40;
|
|
+static PyObject *__pyx_codeobj__36;
|
|
/* Late includes */
|
|
|
|
/* "fastparquet/speedups.pyx":32
|
|
@@ -2902,6 +2951,7 @@ static PyObject *__pyx_pf_11fastparquet_8speedups_array_encode_utf8(CYTHON_UNUSE
|
|
__PYX_ERR(0, 50, __pyx_L1_error)
|
|
}
|
|
__pyx_t_2 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_arr.diminfo[0].strides);
|
|
+ if (unlikely(__pyx_t_2 == NULL)) __pyx_t_2 = Py_None;
|
|
__Pyx_INCREF((PyObject*)__pyx_t_2);
|
|
__pyx_t_4 = PyUnicode_AsUTF8String(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
@@ -2917,10 +2967,10 @@ static PyObject *__pyx_pf_11fastparquet_8speedups_array_encode_utf8(CYTHON_UNUSE
|
|
__PYX_ERR(0, 50, __pyx_L1_error)
|
|
}
|
|
__pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_result.diminfo[0].strides);
|
|
- __Pyx_GOTREF(*__pyx_t_15);
|
|
- __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(*__pyx_t_15);
|
|
+ __Pyx_XGOTREF(*__pyx_t_15);
|
|
+ __Pyx_INCREF(__pyx_t_4); __Pyx_XDECREF(*__pyx_t_15);
|
|
*__pyx_t_15 = __pyx_t_4;
|
|
- __Pyx_GIVEREF(*__pyx_t_15);
|
|
+ __Pyx_XGIVEREF(*__pyx_t_15);
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
}
|
|
|
|
@@ -3529,10 +3579,10 @@ static PyObject *__pyx_pf_11fastparquet_8speedups_4unpack_byte_array(CYTHON_UNUS
|
|
__pyx_t_1 = __pyx_v_i;
|
|
if (__pyx_t_1 < 0) __pyx_t_1 += __pyx_pybuffernd_out.diminfo[0].shape;
|
|
__pyx_t_9 = __Pyx_BufPtrCContig1d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_out.diminfo[0].strides);
|
|
- __Pyx_GOTREF(*__pyx_t_9);
|
|
- __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(*__pyx_t_9);
|
|
+ __Pyx_XGOTREF(*__pyx_t_9);
|
|
+ __Pyx_INCREF(__pyx_t_5); __Pyx_XDECREF(*__pyx_t_9);
|
|
*__pyx_t_9 = __pyx_t_5;
|
|
- __Pyx_GIVEREF(*__pyx_t_9);
|
|
+ __Pyx_XGIVEREF(*__pyx_t_9);
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
|
|
/* "fastparquet/speedups.pyx":110
|
|
@@ -3558,10 +3608,10 @@ static PyObject *__pyx_pf_11fastparquet_8speedups_4unpack_byte_array(CYTHON_UNUS
|
|
__pyx_t_1 = __pyx_v_i;
|
|
if (__pyx_t_1 < 0) __pyx_t_1 += __pyx_pybuffernd_out.diminfo[0].shape;
|
|
__pyx_t_9 = __Pyx_BufPtrCContig1d(PyObject **, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_out.diminfo[0].strides);
|
|
- __Pyx_GOTREF(*__pyx_t_9);
|
|
- __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(*__pyx_t_9);
|
|
+ __Pyx_XGOTREF(*__pyx_t_9);
|
|
+ __Pyx_INCREF(__pyx_t_5); __Pyx_XDECREF(*__pyx_t_9);
|
|
*__pyx_t_9 = __pyx_t_5;
|
|
- __Pyx_GIVEREF(*__pyx_t_9);
|
|
+ __Pyx_XGIVEREF(*__pyx_t_9);
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
}
|
|
__pyx_L7:;
|
|
@@ -3637,3186 +3687,2588 @@ static PyObject *__pyx_pf_11fastparquet_8speedups_4unpack_byte_array(CYTHON_UNUS
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":258
|
|
- * # experimental exception made for __getbuffer__ and __releasebuffer__
|
|
- * # -- the details of this may change.
|
|
- * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
|
|
- * # This implementation of getbuffer is geared towards Cython
|
|
- * # requirements, and does not yet fulfill the PEP.
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":735
|
|
+ * ctypedef npy_cdouble complex_t
|
|
+ *
|
|
+ * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
|
|
+ * return PyArray_MultiIterNew(1, <void*>a)
|
|
+ *
|
|
*/
|
|
|
|
-/* Python wrapper */
|
|
-static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
|
|
-static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
|
|
- int __pyx_r;
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
|
|
- __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
|
|
-
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
|
|
- int __pyx_v_i;
|
|
- int __pyx_v_ndim;
|
|
- int __pyx_v_endian_detector;
|
|
- int __pyx_v_little_endian;
|
|
- int __pyx_v_t;
|
|
- char *__pyx_v_f;
|
|
- PyArray_Descr *__pyx_v_descr = 0;
|
|
- int __pyx_v_offset;
|
|
- int __pyx_r;
|
|
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
|
|
+ PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
- int __pyx_t_1;
|
|
- int __pyx_t_2;
|
|
- PyObject *__pyx_t_3 = NULL;
|
|
- int __pyx_t_4;
|
|
- int __pyx_t_5;
|
|
- int __pyx_t_6;
|
|
- PyArray_Descr *__pyx_t_7;
|
|
- PyObject *__pyx_t_8 = NULL;
|
|
- char *__pyx_t_9;
|
|
+ PyObject *__pyx_t_1 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- if (__pyx_v_info == NULL) {
|
|
- PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
|
|
- return -1;
|
|
- }
|
|
- __Pyx_RefNannySetupContext("__getbuffer__", 0);
|
|
- __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
|
|
- __Pyx_GIVEREF(__pyx_v_info->obj);
|
|
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":265
|
|
- *
|
|
- * cdef int i, ndim
|
|
- * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
|
|
- * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":736
|
|
*
|
|
- */
|
|
- __pyx_v_endian_detector = 1;
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":266
|
|
- * cdef int i, ndim
|
|
- * cdef int endian_detector = 1
|
|
- * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
|
|
+ * cdef inline object PyArray_MultiIterNew1(a):
|
|
+ * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
|
|
*
|
|
- * ndim = PyArray_NDIM(self)
|
|
+ * cdef inline object PyArray_MultiIterNew2(a, b):
|
|
*/
|
|
- __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 736, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_r = __pyx_t_1;
|
|
+ __pyx_t_1 = 0;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":268
|
|
- * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":735
|
|
+ * ctypedef npy_cdouble complex_t
|
|
*
|
|
- * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
|
|
+ * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
|
|
+ * return PyArray_MultiIterNew(1, <void*>a)
|
|
*
|
|
- * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
|
|
*/
|
|
- __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":270
|
|
- * ndim = PyArray_NDIM(self)
|
|
- *
|
|
- * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
|
|
- * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
|
|
- * raise ValueError(u"ndarray is not C contiguous")
|
|
- */
|
|
- __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
|
|
- if (__pyx_t_2) {
|
|
- } else {
|
|
- __pyx_t_1 = __pyx_t_2;
|
|
- goto __pyx_L4_bool_binop_done;
|
|
- }
|
|
+ /* function exit code */
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_1);
|
|
+ __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = 0;
|
|
+ __pyx_L0:;
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":271
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":738
|
|
+ * return PyArray_MultiIterNew(1, <void*>a)
|
|
*
|
|
- * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
|
|
- * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
|
|
- * raise ValueError(u"ndarray is not C contiguous")
|
|
+ * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
|
|
+ * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
|
|
*
|
|
*/
|
|
- __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
|
|
- __pyx_t_1 = __pyx_t_2;
|
|
- __pyx_L4_bool_binop_done:;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":270
|
|
- * ndim = PyArray_NDIM(self)
|
|
- *
|
|
- * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
|
|
- * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
|
|
- * raise ValueError(u"ndarray is not C contiguous")
|
|
- */
|
|
- if (unlikely(__pyx_t_1)) {
|
|
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
|
|
+ PyObject *__pyx_r = NULL;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ PyObject *__pyx_t_1 = NULL;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":272
|
|
- * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
|
|
- * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
|
|
- * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":739
|
|
*
|
|
- * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
|
|
- */
|
|
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 272, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __PYX_ERR(1, 272, __pyx_L1_error)
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":270
|
|
- * ndim = PyArray_NDIM(self)
|
|
+ * cdef inline object PyArray_MultiIterNew2(a, b):
|
|
+ * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
|
|
*
|
|
- * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
|
|
- * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
|
|
- * raise ValueError(u"ndarray is not C contiguous")
|
|
+ * cdef inline object PyArray_MultiIterNew3(a, b, c):
|
|
*/
|
|
- }
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 739, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_r = __pyx_t_1;
|
|
+ __pyx_t_1 = 0;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":274
|
|
- * raise ValueError(u"ndarray is not C contiguous")
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":738
|
|
+ * return PyArray_MultiIterNew(1, <void*>a)
|
|
+ *
|
|
+ * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
|
|
+ * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
|
|
*
|
|
- * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
|
|
- * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
|
|
- * raise ValueError(u"ndarray is not Fortran contiguous")
|
|
*/
|
|
- __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
|
|
- if (__pyx_t_2) {
|
|
- } else {
|
|
- __pyx_t_1 = __pyx_t_2;
|
|
- goto __pyx_L7_bool_binop_done;
|
|
- }
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":275
|
|
+ /* function exit code */
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_1);
|
|
+ __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = 0;
|
|
+ __pyx_L0:;
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":741
|
|
+ * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
|
|
*
|
|
- * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
|
|
- * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
|
|
- * raise ValueError(u"ndarray is not Fortran contiguous")
|
|
+ * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
|
|
+ * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
|
|
*
|
|
*/
|
|
- __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
|
|
- __pyx_t_1 = __pyx_t_2;
|
|
- __pyx_L7_bool_binop_done:;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":274
|
|
- * raise ValueError(u"ndarray is not C contiguous")
|
|
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
|
|
+ PyObject *__pyx_r = NULL;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ PyObject *__pyx_t_1 = NULL;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
|
|
+
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":742
|
|
+ *
|
|
+ * cdef inline object PyArray_MultiIterNew3(a, b, c):
|
|
+ * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
|
|
*
|
|
- * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
|
|
- * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
|
|
- * raise ValueError(u"ndarray is not Fortran contiguous")
|
|
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
|
|
*/
|
|
- if (unlikely(__pyx_t_1)) {
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 742, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_r = __pyx_t_1;
|
|
+ __pyx_t_1 = 0;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":276
|
|
- * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
|
|
- * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
|
|
- * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":741
|
|
+ * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
|
|
+ *
|
|
+ * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
|
|
+ * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
|
|
*
|
|
- * info.buf = PyArray_DATA(self)
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 276, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __PYX_ERR(1, 276, __pyx_L1_error)
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":274
|
|
- * raise ValueError(u"ndarray is not C contiguous")
|
|
+ /* function exit code */
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_1);
|
|
+ __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = 0;
|
|
+ __pyx_L0:;
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":744
|
|
+ * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
|
|
+ *
|
|
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
|
|
+ * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
|
|
*
|
|
- * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
|
|
- * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
|
|
- * raise ValueError(u"ndarray is not Fortran contiguous")
|
|
*/
|
|
- }
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":278
|
|
- * raise ValueError(u"ndarray is not Fortran contiguous")
|
|
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
|
|
+ PyObject *__pyx_r = NULL;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ PyObject *__pyx_t_1 = NULL;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
|
|
+
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":745
|
|
*
|
|
- * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
|
|
- * info.ndim = ndim
|
|
- * if sizeof(npy_intp) != sizeof(Py_ssize_t):
|
|
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
|
|
+ * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
|
|
*/
|
|
- __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 745, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_r = __pyx_t_1;
|
|
+ __pyx_t_1 = 0;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":279
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":744
|
|
+ * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
|
|
+ *
|
|
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
|
|
+ * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
|
|
*
|
|
- * info.buf = PyArray_DATA(self)
|
|
- * info.ndim = ndim # <<<<<<<<<<<<<<
|
|
- * if sizeof(npy_intp) != sizeof(Py_ssize_t):
|
|
- * # Allocate new buffer for strides and shape info.
|
|
*/
|
|
- __pyx_v_info->ndim = __pyx_v_ndim;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":280
|
|
- * info.buf = PyArray_DATA(self)
|
|
- * info.ndim = ndim
|
|
- * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
|
|
- * # Allocate new buffer for strides and shape info.
|
|
- * # This is allocated as one block, strides first.
|
|
- */
|
|
- __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
|
|
- if (__pyx_t_1) {
|
|
+ /* function exit code */
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_1);
|
|
+ __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = 0;
|
|
+ __pyx_L0:;
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":283
|
|
- * # Allocate new buffer for strides and shape info.
|
|
- * # This is allocated as one block, strides first.
|
|
- * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim) # <<<<<<<<<<<<<<
|
|
- * info.shape = info.strides + ndim
|
|
- * for i in range(ndim):
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":747
|
|
+ * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
|
|
+ *
|
|
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
|
|
+ * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
|
|
+ *
|
|
*/
|
|
- __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":284
|
|
- * # This is allocated as one block, strides first.
|
|
- * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
|
|
- * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
|
|
- * for i in range(ndim):
|
|
- * info.strides[i] = PyArray_STRIDES(self)[i]
|
|
- */
|
|
- __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
|
|
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
|
|
+ PyObject *__pyx_r = NULL;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ PyObject *__pyx_t_1 = NULL;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":285
|
|
- * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
|
|
- * info.shape = info.strides + ndim
|
|
- * for i in range(ndim): # <<<<<<<<<<<<<<
|
|
- * info.strides[i] = PyArray_STRIDES(self)[i]
|
|
- * info.shape[i] = PyArray_DIMS(self)[i]
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":748
|
|
+ *
|
|
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
|
|
+ * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * cdef inline tuple PyDataType_SHAPE(dtype d):
|
|
*/
|
|
- __pyx_t_4 = __pyx_v_ndim;
|
|
- __pyx_t_5 = __pyx_t_4;
|
|
- for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
|
|
- __pyx_v_i = __pyx_t_6;
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 748, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_r = __pyx_t_1;
|
|
+ __pyx_t_1 = 0;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":286
|
|
- * info.shape = info.strides + ndim
|
|
- * for i in range(ndim):
|
|
- * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
|
|
- * info.shape[i] = PyArray_DIMS(self)[i]
|
|
- * else:
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":747
|
|
+ * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
|
|
+ *
|
|
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
|
|
+ * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
|
|
+ *
|
|
*/
|
|
- (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":287
|
|
- * for i in range(ndim):
|
|
- * info.strides[i] = PyArray_STRIDES(self)[i]
|
|
- * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
|
|
- */
|
|
- (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
|
|
- }
|
|
+ /* function exit code */
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_1);
|
|
+ __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = 0;
|
|
+ __pyx_L0:;
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":280
|
|
- * info.buf = PyArray_DATA(self)
|
|
- * info.ndim = ndim
|
|
- * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
|
|
- * # Allocate new buffer for strides and shape info.
|
|
- * # This is allocated as one block, strides first.
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":750
|
|
+ * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
|
|
+ *
|
|
+ * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
|
|
+ * if PyDataType_HASSUBARRAY(d):
|
|
+ * return <tuple>d.subarray.shape
|
|
*/
|
|
- goto __pyx_L9;
|
|
- }
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":289
|
|
- * info.shape[i] = PyArray_DIMS(self)[i]
|
|
- * else:
|
|
- * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
|
|
- * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
|
|
- * info.suboffsets = NULL
|
|
- */
|
|
- /*else*/ {
|
|
- __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
|
|
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
|
|
+ PyObject *__pyx_r = NULL;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ int __pyx_t_1;
|
|
+ __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":290
|
|
- * else:
|
|
- * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
|
|
- * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
|
|
- * info.suboffsets = NULL
|
|
- * info.itemsize = PyArray_ITEMSIZE(self)
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":751
|
|
+ *
|
|
+ * cdef inline tuple PyDataType_SHAPE(dtype d):
|
|
+ * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
|
|
+ * return <tuple>d.subarray.shape
|
|
+ * else:
|
|
*/
|
|
- __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
|
|
- }
|
|
- __pyx_L9:;
|
|
+ __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":291
|
|
- * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
|
|
- * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
|
|
- * info.suboffsets = NULL # <<<<<<<<<<<<<<
|
|
- * info.itemsize = PyArray_ITEMSIZE(self)
|
|
- * info.readonly = not PyArray_ISWRITEABLE(self)
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":752
|
|
+ * cdef inline tuple PyDataType_SHAPE(dtype d):
|
|
+ * if PyDataType_HASSUBARRAY(d):
|
|
+ * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * return ()
|
|
*/
|
|
- __pyx_v_info->suboffsets = NULL;
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
|
|
+ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":292
|
|
- * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
|
|
- * info.suboffsets = NULL
|
|
- * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
|
|
- * info.readonly = not PyArray_ISWRITEABLE(self)
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":751
|
|
*
|
|
+ * cdef inline tuple PyDataType_SHAPE(dtype d):
|
|
+ * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
|
|
+ * return <tuple>d.subarray.shape
|
|
+ * else:
|
|
*/
|
|
- __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
|
|
+ }
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":293
|
|
- * info.suboffsets = NULL
|
|
- * info.itemsize = PyArray_ITEMSIZE(self)
|
|
- * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":754
|
|
+ * return <tuple>d.subarray.shape
|
|
+ * else:
|
|
+ * return () # <<<<<<<<<<<<<<
|
|
+ *
|
|
*
|
|
- * cdef int t
|
|
*/
|
|
- __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
|
|
+ /*else*/ {
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __Pyx_INCREF(__pyx_empty_tuple);
|
|
+ __pyx_r = __pyx_empty_tuple;
|
|
+ goto __pyx_L0;
|
|
+ }
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":296
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":750
|
|
+ * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
|
|
*
|
|
- * cdef int t
|
|
- * cdef char* f = NULL # <<<<<<<<<<<<<<
|
|
- * cdef dtype descr = <dtype>PyArray_DESCR(self)
|
|
- * cdef int offset
|
|
+ * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
|
|
+ * if PyDataType_HASSUBARRAY(d):
|
|
+ * return <tuple>d.subarray.shape
|
|
*/
|
|
- __pyx_v_f = NULL;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":297
|
|
- * cdef int t
|
|
- * cdef char* f = NULL
|
|
- * cdef dtype descr = <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
|
|
- * cdef int offset
|
|
+ /* function exit code */
|
|
+ __pyx_L0:;
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":929
|
|
+ * int _import_umath() except -1
|
|
*
|
|
+ * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
|
|
+ * Py_INCREF(base) # important to do this before stealing the reference below!
|
|
+ * PyArray_SetBaseObject(arr, base)
|
|
*/
|
|
- __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
|
|
- __pyx_t_3 = ((PyObject *)__pyx_t_7);
|
|
- __Pyx_INCREF(__pyx_t_3);
|
|
- __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
|
|
- __pyx_t_3 = 0;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":300
|
|
- * cdef int offset
|
|
+static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ __Pyx_RefNannySetupContext("set_array_base", 0);
|
|
+
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":930
|
|
*
|
|
- * info.obj = self # <<<<<<<<<<<<<<
|
|
+ * cdef inline void set_array_base(ndarray arr, object base):
|
|
+ * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
|
|
+ * PyArray_SetBaseObject(arr, base)
|
|
*
|
|
- * if not PyDataType_HASFIELDS(descr):
|
|
*/
|
|
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
|
|
- __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
|
|
- __Pyx_GOTREF(__pyx_v_info->obj);
|
|
- __Pyx_DECREF(__pyx_v_info->obj);
|
|
- __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
|
|
+ Py_INCREF(__pyx_v_base);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":302
|
|
- * info.obj = self
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":931
|
|
+ * cdef inline void set_array_base(ndarray arr, object base):
|
|
+ * Py_INCREF(base) # important to do this before stealing the reference below!
|
|
+ * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
|
|
*
|
|
- * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
|
|
- * t = descr.type_num
|
|
- * if ((descr.byteorder == c'>' and little_endian) or
|
|
+ * cdef inline object get_array_base(ndarray arr):
|
|
*/
|
|
- __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
|
|
- if (__pyx_t_1) {
|
|
+ (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":303
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":929
|
|
+ * int _import_umath() except -1
|
|
*
|
|
- * if not PyDataType_HASFIELDS(descr):
|
|
- * t = descr.type_num # <<<<<<<<<<<<<<
|
|
- * if ((descr.byteorder == c'>' and little_endian) or
|
|
- * (descr.byteorder == c'<' and not little_endian)):
|
|
- */
|
|
- __pyx_t_4 = __pyx_v_descr->type_num;
|
|
- __pyx_v_t = __pyx_t_4;
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":304
|
|
- * if not PyDataType_HASFIELDS(descr):
|
|
- * t = descr.type_num
|
|
- * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
|
|
- * (descr.byteorder == c'<' and not little_endian)):
|
|
- * raise ValueError(u"Non-native byte order not supported")
|
|
+ * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
|
|
+ * Py_INCREF(base) # important to do this before stealing the reference below!
|
|
+ * PyArray_SetBaseObject(arr, base)
|
|
*/
|
|
- __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
|
|
- if (!__pyx_t_2) {
|
|
- goto __pyx_L15_next_or;
|
|
- } else {
|
|
- }
|
|
- __pyx_t_2 = (__pyx_v_little_endian != 0);
|
|
- if (!__pyx_t_2) {
|
|
- } else {
|
|
- __pyx_t_1 = __pyx_t_2;
|
|
- goto __pyx_L14_bool_binop_done;
|
|
- }
|
|
- __pyx_L15_next_or:;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":305
|
|
- * t = descr.type_num
|
|
- * if ((descr.byteorder == c'>' and little_endian) or
|
|
- * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
|
|
- * raise ValueError(u"Non-native byte order not supported")
|
|
- * if t == NPY_BYTE: f = "b"
|
|
- */
|
|
- __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
|
|
- if (__pyx_t_2) {
|
|
- } else {
|
|
- __pyx_t_1 = __pyx_t_2;
|
|
- goto __pyx_L14_bool_binop_done;
|
|
- }
|
|
- __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
|
|
- __pyx_t_1 = __pyx_t_2;
|
|
- __pyx_L14_bool_binop_done:;
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+}
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":304
|
|
- * if not PyDataType_HASFIELDS(descr):
|
|
- * t = descr.type_num
|
|
- * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
|
|
- * (descr.byteorder == c'<' and not little_endian)):
|
|
- * raise ValueError(u"Non-native byte order not supported")
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":933
|
|
+ * PyArray_SetBaseObject(arr, base)
|
|
+ *
|
|
+ * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
|
|
+ * base = PyArray_BASE(arr)
|
|
+ * if base is NULL:
|
|
*/
|
|
- if (unlikely(__pyx_t_1)) {
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":306
|
|
- * if ((descr.byteorder == c'>' and little_endian) or
|
|
- * (descr.byteorder == c'<' and not little_endian)):
|
|
- * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
|
|
- * if t == NPY_BYTE: f = "b"
|
|
- * elif t == NPY_UBYTE: f = "B"
|
|
- */
|
|
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 306, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __PYX_ERR(1, 306, __pyx_L1_error)
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":304
|
|
- * if not PyDataType_HASFIELDS(descr):
|
|
- * t = descr.type_num
|
|
- * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
|
|
- * (descr.byteorder == c'<' and not little_endian)):
|
|
- * raise ValueError(u"Non-native byte order not supported")
|
|
- */
|
|
- }
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":307
|
|
- * (descr.byteorder == c'<' and not little_endian)):
|
|
- * raise ValueError(u"Non-native byte order not supported")
|
|
- * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_UBYTE: f = "B"
|
|
- * elif t == NPY_SHORT: f = "h"
|
|
- */
|
|
- switch (__pyx_v_t) {
|
|
- case NPY_BYTE:
|
|
- __pyx_v_f = ((char *)"b");
|
|
- break;
|
|
- case NPY_UBYTE:
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":308
|
|
- * raise ValueError(u"Non-native byte order not supported")
|
|
- * if t == NPY_BYTE: f = "b"
|
|
- * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_SHORT: f = "h"
|
|
- * elif t == NPY_USHORT: f = "H"
|
|
- */
|
|
- __pyx_v_f = ((char *)"B");
|
|
- break;
|
|
- case NPY_SHORT:
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":309
|
|
- * if t == NPY_BYTE: f = "b"
|
|
- * elif t == NPY_UBYTE: f = "B"
|
|
- * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_USHORT: f = "H"
|
|
- * elif t == NPY_INT: f = "i"
|
|
- */
|
|
- __pyx_v_f = ((char *)"h");
|
|
- break;
|
|
- case NPY_USHORT:
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":310
|
|
- * elif t == NPY_UBYTE: f = "B"
|
|
- * elif t == NPY_SHORT: f = "h"
|
|
- * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_INT: f = "i"
|
|
- * elif t == NPY_UINT: f = "I"
|
|
- */
|
|
- __pyx_v_f = ((char *)"H");
|
|
- break;
|
|
- case NPY_INT:
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":311
|
|
- * elif t == NPY_SHORT: f = "h"
|
|
- * elif t == NPY_USHORT: f = "H"
|
|
- * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_UINT: f = "I"
|
|
- * elif t == NPY_LONG: f = "l"
|
|
- */
|
|
- __pyx_v_f = ((char *)"i");
|
|
- break;
|
|
- case NPY_UINT:
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":312
|
|
- * elif t == NPY_USHORT: f = "H"
|
|
- * elif t == NPY_INT: f = "i"
|
|
- * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_LONG: f = "l"
|
|
- * elif t == NPY_ULONG: f = "L"
|
|
- */
|
|
- __pyx_v_f = ((char *)"I");
|
|
- break;
|
|
- case NPY_LONG:
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":313
|
|
- * elif t == NPY_INT: f = "i"
|
|
- * elif t == NPY_UINT: f = "I"
|
|
- * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_ULONG: f = "L"
|
|
- * elif t == NPY_LONGLONG: f = "q"
|
|
- */
|
|
- __pyx_v_f = ((char *)"l");
|
|
- break;
|
|
- case NPY_ULONG:
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":314
|
|
- * elif t == NPY_UINT: f = "I"
|
|
- * elif t == NPY_LONG: f = "l"
|
|
- * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_LONGLONG: f = "q"
|
|
- * elif t == NPY_ULONGLONG: f = "Q"
|
|
- */
|
|
- __pyx_v_f = ((char *)"L");
|
|
- break;
|
|
- case NPY_LONGLONG:
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":315
|
|
- * elif t == NPY_LONG: f = "l"
|
|
- * elif t == NPY_ULONG: f = "L"
|
|
- * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_ULONGLONG: f = "Q"
|
|
- * elif t == NPY_FLOAT: f = "f"
|
|
- */
|
|
- __pyx_v_f = ((char *)"q");
|
|
- break;
|
|
- case NPY_ULONGLONG:
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":316
|
|
- * elif t == NPY_ULONG: f = "L"
|
|
- * elif t == NPY_LONGLONG: f = "q"
|
|
- * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_FLOAT: f = "f"
|
|
- * elif t == NPY_DOUBLE: f = "d"
|
|
- */
|
|
- __pyx_v_f = ((char *)"Q");
|
|
- break;
|
|
- case NPY_FLOAT:
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":317
|
|
- * elif t == NPY_LONGLONG: f = "q"
|
|
- * elif t == NPY_ULONGLONG: f = "Q"
|
|
- * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_DOUBLE: f = "d"
|
|
- * elif t == NPY_LONGDOUBLE: f = "g"
|
|
- */
|
|
- __pyx_v_f = ((char *)"f");
|
|
- break;
|
|
- case NPY_DOUBLE:
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":318
|
|
- * elif t == NPY_ULONGLONG: f = "Q"
|
|
- * elif t == NPY_FLOAT: f = "f"
|
|
- * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_LONGDOUBLE: f = "g"
|
|
- * elif t == NPY_CFLOAT: f = "Zf"
|
|
- */
|
|
- __pyx_v_f = ((char *)"d");
|
|
- break;
|
|
- case NPY_LONGDOUBLE:
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":319
|
|
- * elif t == NPY_FLOAT: f = "f"
|
|
- * elif t == NPY_DOUBLE: f = "d"
|
|
- * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_CFLOAT: f = "Zf"
|
|
- * elif t == NPY_CDOUBLE: f = "Zd"
|
|
- */
|
|
- __pyx_v_f = ((char *)"g");
|
|
- break;
|
|
- case NPY_CFLOAT:
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":320
|
|
- * elif t == NPY_DOUBLE: f = "d"
|
|
- * elif t == NPY_LONGDOUBLE: f = "g"
|
|
- * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_CDOUBLE: f = "Zd"
|
|
- * elif t == NPY_CLONGDOUBLE: f = "Zg"
|
|
- */
|
|
- __pyx_v_f = ((char *)"Zf");
|
|
- break;
|
|
- case NPY_CDOUBLE:
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":321
|
|
- * elif t == NPY_LONGDOUBLE: f = "g"
|
|
- * elif t == NPY_CFLOAT: f = "Zf"
|
|
- * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_CLONGDOUBLE: f = "Zg"
|
|
- * elif t == NPY_OBJECT: f = "O"
|
|
- */
|
|
- __pyx_v_f = ((char *)"Zd");
|
|
- break;
|
|
- case NPY_CLONGDOUBLE:
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":322
|
|
- * elif t == NPY_CFLOAT: f = "Zf"
|
|
- * elif t == NPY_CDOUBLE: f = "Zd"
|
|
- * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_OBJECT: f = "O"
|
|
- * else:
|
|
- */
|
|
- __pyx_v_f = ((char *)"Zg");
|
|
- break;
|
|
- case NPY_OBJECT:
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":323
|
|
- * elif t == NPY_CDOUBLE: f = "Zd"
|
|
- * elif t == NPY_CLONGDOUBLE: f = "Zg"
|
|
- * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
|
|
- */
|
|
- __pyx_v_f = ((char *)"O");
|
|
- break;
|
|
- default:
|
|
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
|
|
+ PyObject *__pyx_v_base;
|
|
+ PyObject *__pyx_r = NULL;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ int __pyx_t_1;
|
|
+ __Pyx_RefNannySetupContext("get_array_base", 0);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":325
|
|
- * elif t == NPY_OBJECT: f = "O"
|
|
- * else:
|
|
- * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
|
|
- * info.format = f
|
|
- * return
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":934
|
|
+ *
|
|
+ * cdef inline object get_array_base(ndarray arr):
|
|
+ * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
|
|
+ * if base is NULL:
|
|
+ * return None
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 325, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 325, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_8);
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 325, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
|
|
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __PYX_ERR(1, 325, __pyx_L1_error)
|
|
- break;
|
|
- }
|
|
+ __pyx_v_base = PyArray_BASE(__pyx_v_arr);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":326
|
|
- * else:
|
|
- * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
|
|
- * info.format = f # <<<<<<<<<<<<<<
|
|
- * return
|
|
- * else:
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":935
|
|
+ * cdef inline object get_array_base(ndarray arr):
|
|
+ * base = PyArray_BASE(arr)
|
|
+ * if base is NULL: # <<<<<<<<<<<<<<
|
|
+ * return None
|
|
+ * return <object>base
|
|
*/
|
|
- __pyx_v_info->format = __pyx_v_f;
|
|
+ __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":327
|
|
- * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
|
|
- * info.format = f
|
|
- * return # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":936
|
|
+ * base = PyArray_BASE(arr)
|
|
+ * if base is NULL:
|
|
+ * return None # <<<<<<<<<<<<<<
|
|
+ * return <object>base
|
|
+ *
|
|
*/
|
|
- __pyx_r = 0;
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":302
|
|
- * info.obj = self
|
|
- *
|
|
- * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
|
|
- * t = descr.type_num
|
|
- * if ((descr.byteorder == c'>' and little_endian) or
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":935
|
|
+ * cdef inline object get_array_base(ndarray arr):
|
|
+ * base = PyArray_BASE(arr)
|
|
+ * if base is NULL: # <<<<<<<<<<<<<<
|
|
+ * return None
|
|
+ * return <object>base
|
|
*/
|
|
}
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":329
|
|
- * return
|
|
- * else:
|
|
- * info.format = <char*>PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
|
|
- * info.format[0] = c'^' # Native data types, manual alignment
|
|
- * offset = 0
|
|
- */
|
|
- /*else*/ {
|
|
- __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":330
|
|
- * else:
|
|
- * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
|
|
- * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
|
|
- * offset = 0
|
|
- * f = _util_dtypestring(descr, info.format + 1,
|
|
- */
|
|
- (__pyx_v_info->format[0]) = '^';
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":331
|
|
- * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
|
|
- * info.format[0] = c'^' # Native data types, manual alignment
|
|
- * offset = 0 # <<<<<<<<<<<<<<
|
|
- * f = _util_dtypestring(descr, info.format + 1,
|
|
- * info.format + _buffer_format_string_len,
|
|
- */
|
|
- __pyx_v_offset = 0;
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":332
|
|
- * info.format[0] = c'^' # Native data types, manual alignment
|
|
- * offset = 0
|
|
- * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
|
|
- * info.format + _buffer_format_string_len,
|
|
- * &offset)
|
|
- */
|
|
- __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(1, 332, __pyx_L1_error)
|
|
- __pyx_v_f = __pyx_t_9;
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":335
|
|
- * info.format + _buffer_format_string_len,
|
|
- * &offset)
|
|
- * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":937
|
|
+ * if base is NULL:
|
|
+ * return None
|
|
+ * return <object>base # <<<<<<<<<<<<<<
|
|
*
|
|
- * def __releasebuffer__(ndarray self, Py_buffer* info):
|
|
+ * # Versions of the import_* functions which are more suitable for
|
|
*/
|
|
- (__pyx_v_f[0]) = '\x00';
|
|
- }
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __Pyx_INCREF(((PyObject *)__pyx_v_base));
|
|
+ __pyx_r = ((PyObject *)__pyx_v_base);
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":258
|
|
- * # experimental exception made for __getbuffer__ and __releasebuffer__
|
|
- * # -- the details of this may change.
|
|
- * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
|
|
- * # This implementation of getbuffer is geared towards Cython
|
|
- * # requirements, and does not yet fulfill the PEP.
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":933
|
|
+ * PyArray_SetBaseObject(arr, base)
|
|
+ *
|
|
+ * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
|
|
+ * base = PyArray_BASE(arr)
|
|
+ * if base is NULL:
|
|
*/
|
|
|
|
/* function exit code */
|
|
- __pyx_r = 0;
|
|
- goto __pyx_L0;
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_3);
|
|
- __Pyx_XDECREF(__pyx_t_8);
|
|
- __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = -1;
|
|
- if (__pyx_v_info->obj != NULL) {
|
|
- __Pyx_GOTREF(__pyx_v_info->obj);
|
|
- __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
|
|
- }
|
|
- goto __pyx_L2;
|
|
__pyx_L0:;
|
|
- if (__pyx_v_info->obj == Py_None) {
|
|
- __Pyx_GOTREF(__pyx_v_info->obj);
|
|
- __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
|
|
- }
|
|
- __pyx_L2:;
|
|
- __Pyx_XDECREF((PyObject *)__pyx_v_descr);
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":337
|
|
- * f[0] = c'\0' # Terminate format string
|
|
- *
|
|
- * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
|
|
- * if PyArray_HASFIELDS(self):
|
|
- * PyObject_Free(info.format)
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":941
|
|
+ * # Versions of the import_* functions which are more suitable for
|
|
+ * # Cython code.
|
|
+ * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
|
|
+ * try:
|
|
+ * __pyx_import_array()
|
|
*/
|
|
|
|
-/* Python wrapper */
|
|
-static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
|
|
-static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
|
|
- __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
|
|
-
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
-}
|
|
-
|
|
-static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
|
|
+static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
|
|
+ int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
- int __pyx_t_1;
|
|
- __Pyx_RefNannySetupContext("__releasebuffer__", 0);
|
|
+ PyObject *__pyx_t_1 = NULL;
|
|
+ PyObject *__pyx_t_2 = NULL;
|
|
+ PyObject *__pyx_t_3 = NULL;
|
|
+ int __pyx_t_4;
|
|
+ PyObject *__pyx_t_5 = NULL;
|
|
+ PyObject *__pyx_t_6 = NULL;
|
|
+ PyObject *__pyx_t_7 = NULL;
|
|
+ PyObject *__pyx_t_8 = NULL;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("import_array", 0);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":338
|
|
- *
|
|
- * def __releasebuffer__(ndarray self, Py_buffer* info):
|
|
- * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
|
|
- * PyObject_Free(info.format)
|
|
- * if sizeof(npy_intp) != sizeof(Py_ssize_t):
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":942
|
|
+ * # Cython code.
|
|
+ * cdef inline int import_array() except -1:
|
|
+ * try: # <<<<<<<<<<<<<<
|
|
+ * __pyx_import_array()
|
|
+ * except Exception:
|
|
*/
|
|
- __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
|
|
- if (__pyx_t_1) {
|
|
+ {
|
|
+ __Pyx_PyThreadState_declare
|
|
+ __Pyx_PyThreadState_assign
|
|
+ __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
|
|
+ __Pyx_XGOTREF(__pyx_t_1);
|
|
+ __Pyx_XGOTREF(__pyx_t_2);
|
|
+ __Pyx_XGOTREF(__pyx_t_3);
|
|
+ /*try:*/ {
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":339
|
|
- * def __releasebuffer__(ndarray self, Py_buffer* info):
|
|
- * if PyArray_HASFIELDS(self):
|
|
- * PyObject_Free(info.format) # <<<<<<<<<<<<<<
|
|
- * if sizeof(npy_intp) != sizeof(Py_ssize_t):
|
|
- * PyObject_Free(info.strides)
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":943
|
|
+ * cdef inline int import_array() except -1:
|
|
+ * try:
|
|
+ * __pyx_import_array() # <<<<<<<<<<<<<<
|
|
+ * except Exception:
|
|
+ * raise ImportError("numpy.core.multiarray failed to import")
|
|
*/
|
|
- PyObject_Free(__pyx_v_info->format);
|
|
+ __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 943, __pyx_L3_error)
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":338
|
|
- *
|
|
- * def __releasebuffer__(ndarray self, Py_buffer* info):
|
|
- * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
|
|
- * PyObject_Free(info.format)
|
|
- * if sizeof(npy_intp) != sizeof(Py_ssize_t):
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":942
|
|
+ * # Cython code.
|
|
+ * cdef inline int import_array() except -1:
|
|
+ * try: # <<<<<<<<<<<<<<
|
|
+ * __pyx_import_array()
|
|
+ * except Exception:
|
|
*/
|
|
- }
|
|
+ }
|
|
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
+ goto __pyx_L8_try_end;
|
|
+ __pyx_L3_error:;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":340
|
|
- * if PyArray_HASFIELDS(self):
|
|
- * PyObject_Free(info.format)
|
|
- * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
|
|
- * PyObject_Free(info.strides)
|
|
- * # info.shape was stored after info.strides in the same block
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":944
|
|
+ * try:
|
|
+ * __pyx_import_array()
|
|
+ * except Exception: # <<<<<<<<<<<<<<
|
|
+ * raise ImportError("numpy.core.multiarray failed to import")
|
|
+ *
|
|
*/
|
|
- __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
|
|
- if (__pyx_t_1) {
|
|
+ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
|
|
+ if (__pyx_t_4) {
|
|
+ __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 944, __pyx_L5_except_error)
|
|
+ __Pyx_GOTREF(__pyx_t_5);
|
|
+ __Pyx_GOTREF(__pyx_t_6);
|
|
+ __Pyx_GOTREF(__pyx_t_7);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":341
|
|
- * PyObject_Free(info.format)
|
|
- * if sizeof(npy_intp) != sizeof(Py_ssize_t):
|
|
- * PyObject_Free(info.strides) # <<<<<<<<<<<<<<
|
|
- * # info.shape was stored after info.strides in the same block
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":945
|
|
+ * __pyx_import_array()
|
|
+ * except Exception:
|
|
+ * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
|
|
*
|
|
+ * cdef inline int import_umath() except -1:
|
|
*/
|
|
- PyObject_Free(__pyx_v_info->strides);
|
|
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 945, __pyx_L5_except_error)
|
|
+ __Pyx_GOTREF(__pyx_t_8);
|
|
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
|
|
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
|
|
+ __PYX_ERR(1, 945, __pyx_L5_except_error)
|
|
+ }
|
|
+ goto __pyx_L5_except_error;
|
|
+ __pyx_L5_except_error:;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":340
|
|
- * if PyArray_HASFIELDS(self):
|
|
- * PyObject_Free(info.format)
|
|
- * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
|
|
- * PyObject_Free(info.strides)
|
|
- * # info.shape was stored after info.strides in the same block
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":942
|
|
+ * # Cython code.
|
|
+ * cdef inline int import_array() except -1:
|
|
+ * try: # <<<<<<<<<<<<<<
|
|
+ * __pyx_import_array()
|
|
+ * except Exception:
|
|
*/
|
|
+ __Pyx_XGIVEREF(__pyx_t_1);
|
|
+ __Pyx_XGIVEREF(__pyx_t_2);
|
|
+ __Pyx_XGIVEREF(__pyx_t_3);
|
|
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
|
|
+ goto __pyx_L1_error;
|
|
+ __pyx_L8_try_end:;
|
|
}
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":337
|
|
- * f[0] = c'\0' # Terminate format string
|
|
- *
|
|
- * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
|
|
- * if PyArray_HASFIELDS(self):
|
|
- * PyObject_Free(info.format)
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":941
|
|
+ * # Versions of the import_* functions which are more suitable for
|
|
+ * # Cython code.
|
|
+ * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
|
|
+ * try:
|
|
+ * __pyx_import_array()
|
|
*/
|
|
|
|
/* function exit code */
|
|
+ __pyx_r = 0;
|
|
+ goto __pyx_L0;
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_5);
|
|
+ __Pyx_XDECREF(__pyx_t_6);
|
|
+ __Pyx_XDECREF(__pyx_t_7);
|
|
+ __Pyx_XDECREF(__pyx_t_8);
|
|
+ __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = -1;
|
|
+ __pyx_L0:;
|
|
__Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
}
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":820
|
|
- * ctypedef npy_cdouble complex_t
|
|
- *
|
|
- * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
|
|
- * return PyArray_MultiIterNew(1, <void*>a)
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":947
|
|
+ * raise ImportError("numpy.core.multiarray failed to import")
|
|
*
|
|
+ * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
|
|
+ * try:
|
|
+ * _import_umath()
|
|
*/
|
|
|
|
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
|
|
- PyObject *__pyx_r = NULL;
|
|
+static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
|
|
+ int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
+ PyObject *__pyx_t_2 = NULL;
|
|
+ PyObject *__pyx_t_3 = NULL;
|
|
+ int __pyx_t_4;
|
|
+ PyObject *__pyx_t_5 = NULL;
|
|
+ PyObject *__pyx_t_6 = NULL;
|
|
+ PyObject *__pyx_t_7 = NULL;
|
|
+ PyObject *__pyx_t_8 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
|
|
+ __Pyx_RefNannySetupContext("import_umath", 0);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":821
|
|
- *
|
|
- * cdef inline object PyArray_MultiIterNew1(a):
|
|
- * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":948
|
|
*
|
|
- * cdef inline object PyArray_MultiIterNew2(a, b):
|
|
+ * cdef inline int import_umath() except -1:
|
|
+ * try: # <<<<<<<<<<<<<<
|
|
+ * _import_umath()
|
|
+ * except Exception:
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 821, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_r = __pyx_t_1;
|
|
- __pyx_t_1 = 0;
|
|
- goto __pyx_L0;
|
|
+ {
|
|
+ __Pyx_PyThreadState_declare
|
|
+ __Pyx_PyThreadState_assign
|
|
+ __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
|
|
+ __Pyx_XGOTREF(__pyx_t_1);
|
|
+ __Pyx_XGOTREF(__pyx_t_2);
|
|
+ __Pyx_XGOTREF(__pyx_t_3);
|
|
+ /*try:*/ {
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":820
|
|
- * ctypedef npy_cdouble complex_t
|
|
- *
|
|
- * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
|
|
- * return PyArray_MultiIterNew(1, <void*>a)
|
|
- *
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":949
|
|
+ * cdef inline int import_umath() except -1:
|
|
+ * try:
|
|
+ * _import_umath() # <<<<<<<<<<<<<<
|
|
+ * except Exception:
|
|
+ * raise ImportError("numpy.core.umath failed to import")
|
|
*/
|
|
+ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 949, __pyx_L3_error)
|
|
|
|
- /* function exit code */
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = 0;
|
|
- __pyx_L0:;
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":823
|
|
- * return PyArray_MultiIterNew(1, <void*>a)
|
|
- *
|
|
- * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
|
|
- * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":948
|
|
*
|
|
+ * cdef inline int import_umath() except -1:
|
|
+ * try: # <<<<<<<<<<<<<<
|
|
+ * _import_umath()
|
|
+ * except Exception:
|
|
*/
|
|
+ }
|
|
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
+ goto __pyx_L8_try_end;
|
|
+ __pyx_L3_error:;
|
|
|
|
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
|
|
- PyObject *__pyx_r = NULL;
|
|
- __Pyx_RefNannyDeclarations
|
|
- PyObject *__pyx_t_1 = NULL;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":824
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":950
|
|
+ * try:
|
|
+ * _import_umath()
|
|
+ * except Exception: # <<<<<<<<<<<<<<
|
|
+ * raise ImportError("numpy.core.umath failed to import")
|
|
*
|
|
- * cdef inline object PyArray_MultiIterNew2(a, b):
|
|
- * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
|
|
+ */
|
|
+ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
|
|
+ if (__pyx_t_4) {
|
|
+ __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 950, __pyx_L5_except_error)
|
|
+ __Pyx_GOTREF(__pyx_t_5);
|
|
+ __Pyx_GOTREF(__pyx_t_6);
|
|
+ __Pyx_GOTREF(__pyx_t_7);
|
|
+
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":951
|
|
+ * _import_umath()
|
|
+ * except Exception:
|
|
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
|
|
*
|
|
- * cdef inline object PyArray_MultiIterNew3(a, b, c):
|
|
+ * cdef inline int import_ufunc() except -1:
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 824, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_r = __pyx_t_1;
|
|
- __pyx_t_1 = 0;
|
|
- goto __pyx_L0;
|
|
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 951, __pyx_L5_except_error)
|
|
+ __Pyx_GOTREF(__pyx_t_8);
|
|
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
|
|
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
|
|
+ __PYX_ERR(1, 951, __pyx_L5_except_error)
|
|
+ }
|
|
+ goto __pyx_L5_except_error;
|
|
+ __pyx_L5_except_error:;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":823
|
|
- * return PyArray_MultiIterNew(1, <void*>a)
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":948
|
|
*
|
|
- * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
|
|
- * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
|
|
+ * cdef inline int import_umath() except -1:
|
|
+ * try: # <<<<<<<<<<<<<<
|
|
+ * _import_umath()
|
|
+ * except Exception:
|
|
+ */
|
|
+ __Pyx_XGIVEREF(__pyx_t_1);
|
|
+ __Pyx_XGIVEREF(__pyx_t_2);
|
|
+ __Pyx_XGIVEREF(__pyx_t_3);
|
|
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
|
|
+ goto __pyx_L1_error;
|
|
+ __pyx_L8_try_end:;
|
|
+ }
|
|
+
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":947
|
|
+ * raise ImportError("numpy.core.multiarray failed to import")
|
|
*
|
|
+ * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
|
|
+ * try:
|
|
+ * _import_umath()
|
|
*/
|
|
|
|
/* function exit code */
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
+ goto __pyx_L0;
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_5);
|
|
+ __Pyx_XDECREF(__pyx_t_6);
|
|
+ __Pyx_XDECREF(__pyx_t_7);
|
|
+ __Pyx_XDECREF(__pyx_t_8);
|
|
+ __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = -1;
|
|
__pyx_L0:;
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":826
|
|
- * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
|
|
- *
|
|
- * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
|
|
- * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":953
|
|
+ * raise ImportError("numpy.core.umath failed to import")
|
|
*
|
|
+ * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
|
|
+ * try:
|
|
+ * _import_umath()
|
|
*/
|
|
|
|
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
|
|
- PyObject *__pyx_r = NULL;
|
|
+static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
|
|
+ int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
+ PyObject *__pyx_t_2 = NULL;
|
|
+ PyObject *__pyx_t_3 = NULL;
|
|
+ int __pyx_t_4;
|
|
+ PyObject *__pyx_t_5 = NULL;
|
|
+ PyObject *__pyx_t_6 = NULL;
|
|
+ PyObject *__pyx_t_7 = NULL;
|
|
+ PyObject *__pyx_t_8 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
|
|
+ __Pyx_RefNannySetupContext("import_ufunc", 0);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":827
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":954
|
|
*
|
|
- * cdef inline object PyArray_MultiIterNew3(a, b, c):
|
|
- * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
|
|
+ * cdef inline int import_ufunc() except -1:
|
|
+ * try: # <<<<<<<<<<<<<<
|
|
+ * _import_umath()
|
|
+ * except Exception:
|
|
+ */
|
|
+ {
|
|
+ __Pyx_PyThreadState_declare
|
|
+ __Pyx_PyThreadState_assign
|
|
+ __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
|
|
+ __Pyx_XGOTREF(__pyx_t_1);
|
|
+ __Pyx_XGOTREF(__pyx_t_2);
|
|
+ __Pyx_XGOTREF(__pyx_t_3);
|
|
+ /*try:*/ {
|
|
+
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":955
|
|
+ * cdef inline int import_ufunc() except -1:
|
|
+ * try:
|
|
+ * _import_umath() # <<<<<<<<<<<<<<
|
|
+ * except Exception:
|
|
+ * raise ImportError("numpy.core.umath failed to import")
|
|
+ */
|
|
+ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 955, __pyx_L3_error)
|
|
+
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":954
|
|
*
|
|
- * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
|
|
+ * cdef inline int import_ufunc() except -1:
|
|
+ * try: # <<<<<<<<<<<<<<
|
|
+ * _import_umath()
|
|
+ * except Exception:
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 827, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_r = __pyx_t_1;
|
|
- __pyx_t_1 = 0;
|
|
- goto __pyx_L0;
|
|
+ }
|
|
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
+ goto __pyx_L8_try_end;
|
|
+ __pyx_L3_error:;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":826
|
|
- * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":956
|
|
+ * try:
|
|
+ * _import_umath()
|
|
+ * except Exception: # <<<<<<<<<<<<<<
|
|
+ * raise ImportError("numpy.core.umath failed to import")
|
|
*
|
|
- * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
|
|
- * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
|
|
+ */
|
|
+ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
|
|
+ if (__pyx_t_4) {
|
|
+ __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 956, __pyx_L5_except_error)
|
|
+ __Pyx_GOTREF(__pyx_t_5);
|
|
+ __Pyx_GOTREF(__pyx_t_6);
|
|
+ __Pyx_GOTREF(__pyx_t_7);
|
|
+
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":957
|
|
+ * _import_umath()
|
|
+ * except Exception:
|
|
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * cdef extern from *:
|
|
+ */
|
|
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 957, __pyx_L5_except_error)
|
|
+ __Pyx_GOTREF(__pyx_t_8);
|
|
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
|
|
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
|
|
+ __PYX_ERR(1, 957, __pyx_L5_except_error)
|
|
+ }
|
|
+ goto __pyx_L5_except_error;
|
|
+ __pyx_L5_except_error:;
|
|
+
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":954
|
|
+ *
|
|
+ * cdef inline int import_ufunc() except -1:
|
|
+ * try: # <<<<<<<<<<<<<<
|
|
+ * _import_umath()
|
|
+ * except Exception:
|
|
+ */
|
|
+ __Pyx_XGIVEREF(__pyx_t_1);
|
|
+ __Pyx_XGIVEREF(__pyx_t_2);
|
|
+ __Pyx_XGIVEREF(__pyx_t_3);
|
|
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
|
|
+ goto __pyx_L1_error;
|
|
+ __pyx_L8_try_end:;
|
|
+ }
|
|
+
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":953
|
|
+ * raise ImportError("numpy.core.umath failed to import")
|
|
*
|
|
+ * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
|
|
+ * try:
|
|
+ * _import_umath()
|
|
*/
|
|
|
|
/* function exit code */
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
+ goto __pyx_L0;
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_5);
|
|
+ __Pyx_XDECREF(__pyx_t_6);
|
|
+ __Pyx_XDECREF(__pyx_t_7);
|
|
+ __Pyx_XDECREF(__pyx_t_8);
|
|
+ __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = -1;
|
|
__pyx_L0:;
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":829
|
|
- * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":967
|
|
*
|
|
- * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
|
|
- * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
|
|
*
|
|
+ * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
|
|
+ * """
|
|
+ * Cython equivalent of `isinstance(obj, np.timedelta64)`
|
|
*/
|
|
|
|
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
|
|
- PyObject *__pyx_r = NULL;
|
|
+static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
|
|
+ int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
- PyObject *__pyx_t_1 = NULL;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
|
|
+ __Pyx_RefNannySetupContext("is_timedelta64_object", 0);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":830
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":979
|
|
+ * bool
|
|
+ * """
|
|
+ * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
|
|
*
|
|
- * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
|
|
- * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
|
|
*
|
|
- * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 830, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_r = __pyx_t_1;
|
|
- __pyx_t_1 = 0;
|
|
+ __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
|
|
goto __pyx_L0;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":829
|
|
- * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":967
|
|
*
|
|
- * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
|
|
- * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
|
|
*
|
|
+ * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
|
|
+ * """
|
|
+ * Cython equivalent of `isinstance(obj, np.timedelta64)`
|
|
*/
|
|
|
|
/* function exit code */
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = 0;
|
|
__pyx_L0:;
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":832
|
|
- * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":982
|
|
*
|
|
- * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
|
|
- * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
|
|
*
|
|
+ * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
|
|
+ * """
|
|
+ * Cython equivalent of `isinstance(obj, np.datetime64)`
|
|
*/
|
|
|
|
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
|
|
- PyObject *__pyx_r = NULL;
|
|
+static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
|
|
+ int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
- PyObject *__pyx_t_1 = NULL;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
|
|
+ __Pyx_RefNannySetupContext("is_datetime64_object", 0);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":833
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":994
|
|
+ * bool
|
|
+ * """
|
|
+ * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
|
|
*
|
|
- * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
|
|
- * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
|
|
*
|
|
- * cdef inline tuple PyDataType_SHAPE(dtype d):
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 833, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_r = __pyx_t_1;
|
|
- __pyx_t_1 = 0;
|
|
+ __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
|
|
goto __pyx_L0;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":832
|
|
- * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":982
|
|
*
|
|
- * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
|
|
- * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
|
|
*
|
|
+ * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
|
|
+ * """
|
|
+ * Cython equivalent of `isinstance(obj, np.datetime64)`
|
|
*/
|
|
|
|
/* function exit code */
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = 0;
|
|
__pyx_L0:;
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":835
|
|
- * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":997
|
|
*
|
|
- * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
|
|
- * if PyDataType_HASSUBARRAY(d):
|
|
- * return <tuple>d.subarray.shape
|
|
- */
|
|
-
|
|
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
|
|
- PyObject *__pyx_r = NULL;
|
|
- __Pyx_RefNannyDeclarations
|
|
- int __pyx_t_1;
|
|
- __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":836
|
|
*
|
|
- * cdef inline tuple PyDataType_SHAPE(dtype d):
|
|
- * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
|
|
- * return <tuple>d.subarray.shape
|
|
- * else:
|
|
+ * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
|
|
+ * """
|
|
+ * returns the int64 value underlying scalar numpy datetime64 object
|
|
*/
|
|
- __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
|
|
- if (__pyx_t_1) {
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":837
|
|
- * cdef inline tuple PyDataType_SHAPE(dtype d):
|
|
- * if PyDataType_HASSUBARRAY(d):
|
|
- * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * return ()
|
|
- */
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
|
|
- __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
|
|
- goto __pyx_L0;
|
|
+static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
|
|
+ npy_datetime __pyx_r;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":836
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":1004
|
|
+ * also needed. That can be found using `get_datetime64_unit`.
|
|
+ * """
|
|
+ * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
|
|
*
|
|
- * cdef inline tuple PyDataType_SHAPE(dtype d):
|
|
- * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
|
|
- * return <tuple>d.subarray.shape
|
|
- * else:
|
|
- */
|
|
- }
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":839
|
|
- * return <tuple>d.subarray.shape
|
|
- * else:
|
|
- * return () # <<<<<<<<<<<<<<
|
|
*
|
|
- * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
|
|
*/
|
|
- /*else*/ {
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __Pyx_INCREF(__pyx_empty_tuple);
|
|
- __pyx_r = __pyx_empty_tuple;
|
|
- goto __pyx_L0;
|
|
- }
|
|
+ __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":835
|
|
- * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":997
|
|
*
|
|
- * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
|
|
- * if PyDataType_HASSUBARRAY(d):
|
|
- * return <tuple>d.subarray.shape
|
|
+ *
|
|
+ * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
|
|
+ * """
|
|
+ * returns the int64 value underlying scalar numpy datetime64 object
|
|
*/
|
|
|
|
/* function exit code */
|
|
__pyx_L0:;
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
- __Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":841
|
|
- * return ()
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":1007
|
|
+ *
|
|
*
|
|
- * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
|
|
- * # Recursive utility function used in __getbuffer__ to get format
|
|
- * # string. The new location in the format string is returned.
|
|
+ * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
|
|
+ * """
|
|
+ * returns the int64 value underlying scalar numpy timedelta64 object
|
|
*/
|
|
|
|
-static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
|
|
- PyArray_Descr *__pyx_v_child = 0;
|
|
- int __pyx_v_endian_detector;
|
|
- int __pyx_v_little_endian;
|
|
- PyObject *__pyx_v_fields = 0;
|
|
- PyObject *__pyx_v_childname = NULL;
|
|
- PyObject *__pyx_v_new_offset = NULL;
|
|
- PyObject *__pyx_v_t = NULL;
|
|
- char *__pyx_r;
|
|
- __Pyx_RefNannyDeclarations
|
|
- PyObject *__pyx_t_1 = NULL;
|
|
- Py_ssize_t __pyx_t_2;
|
|
- PyObject *__pyx_t_3 = NULL;
|
|
- PyObject *__pyx_t_4 = NULL;
|
|
- int __pyx_t_5;
|
|
- int __pyx_t_6;
|
|
- int __pyx_t_7;
|
|
- long __pyx_t_8;
|
|
- char *__pyx_t_9;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("_util_dtypestring", 0);
|
|
+static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
|
|
+ npy_timedelta __pyx_r;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":846
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":1011
|
|
+ * returns the int64 value underlying scalar numpy timedelta64 object
|
|
+ * """
|
|
+ * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
|
|
*
|
|
- * cdef dtype child
|
|
- * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
|
|
- * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
|
|
- * cdef tuple fields
|
|
- */
|
|
- __pyx_v_endian_detector = 1;
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":847
|
|
- * cdef dtype child
|
|
- * cdef int endian_detector = 1
|
|
- * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
|
|
- * cdef tuple fields
|
|
*
|
|
*/
|
|
- __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
|
|
+ __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":850
|
|
- * cdef tuple fields
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":1007
|
|
+ *
|
|
*
|
|
- * for childname in descr.names: # <<<<<<<<<<<<<<
|
|
- * fields = descr.fields[childname]
|
|
- * child, new_offset = fields
|
|
+ * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
|
|
+ * """
|
|
+ * returns the int64 value underlying scalar numpy timedelta64 object
|
|
*/
|
|
- if (unlikely(__pyx_v_descr->names == Py_None)) {
|
|
- PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
|
|
- __PYX_ERR(1, 850, __pyx_L1_error)
|
|
- }
|
|
- __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
|
|
- for (;;) {
|
|
- if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
|
|
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 850, __pyx_L1_error)
|
|
- #else
|
|
- __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 850, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- #endif
|
|
- __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
|
|
- __pyx_t_3 = 0;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":851
|
|
+ /* function exit code */
|
|
+ __pyx_L0:;
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+/* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":1014
|
|
*
|
|
- * for childname in descr.names:
|
|
- * fields = descr.fields[childname] # <<<<<<<<<<<<<<
|
|
- * child, new_offset = fields
|
|
*
|
|
+ * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
|
|
+ * """
|
|
+ * returns the unit part of the dtype for a numpy datetime64 object.
|
|
*/
|
|
- if (unlikely(__pyx_v_descr->fields == Py_None)) {
|
|
- PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
|
|
- __PYX_ERR(1, 851, __pyx_L1_error)
|
|
- }
|
|
- __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 851, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 851, __pyx_L1_error)
|
|
- __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
|
|
- __pyx_t_3 = 0;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":852
|
|
- * for childname in descr.names:
|
|
- * fields = descr.fields[childname]
|
|
- * child, new_offset = fields # <<<<<<<<<<<<<<
|
|
- *
|
|
- * if (end - f) - <int>(new_offset - offset[0]) < 15:
|
|
- */
|
|
- if (likely(__pyx_v_fields != Py_None)) {
|
|
- PyObject* sequence = __pyx_v_fields;
|
|
- Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
|
|
- if (unlikely(size != 2)) {
|
|
- if (size > 2) __Pyx_RaiseTooManyValuesError(2);
|
|
- else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
|
|
- __PYX_ERR(1, 852, __pyx_L1_error)
|
|
- }
|
|
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
|
|
- __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
|
|
- __Pyx_INCREF(__pyx_t_3);
|
|
- __Pyx_INCREF(__pyx_t_4);
|
|
- #else
|
|
- __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 852, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 852, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- #endif
|
|
- } else {
|
|
- __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 852, __pyx_L1_error)
|
|
- }
|
|
- if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 852, __pyx_L1_error)
|
|
- __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
|
|
- __pyx_t_3 = 0;
|
|
- __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
|
|
- __pyx_t_4 = 0;
|
|
+static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
|
|
+ NPY_DATETIMEUNIT __pyx_r;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":854
|
|
- * child, new_offset = fields
|
|
- *
|
|
- * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
|
|
- * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
|
|
- *
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":1018
|
|
+ * returns the unit part of the dtype for a numpy datetime64 object.
|
|
+ * """
|
|
+ * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
|
|
*/
|
|
- __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 854, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 854, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 854, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
|
|
- if (unlikely(__pyx_t_6)) {
|
|
+ __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":855
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":1014
|
|
*
|
|
- * if (end - f) - <int>(new_offset - offset[0]) < 15:
|
|
- * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
|
|
*
|
|
- * if ((child.byteorder == c'>' and little_endian) or
|
|
+ * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
|
|
+ * """
|
|
+ * returns the unit part of the dtype for a numpy datetime64 object.
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 855, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __PYX_ERR(1, 855, __pyx_L1_error)
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":854
|
|
- * child, new_offset = fields
|
|
+ /* function exit code */
|
|
+ __pyx_L0:;
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+/* "View.MemoryView":123
|
|
+ * cdef bint dtype_is_object
|
|
*
|
|
- * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
|
|
- * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
|
|
+ * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
|
|
+ * mode="c", bint allocate_buffer=True):
|
|
*
|
|
*/
|
|
- }
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":857
|
|
- * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
|
|
- *
|
|
- * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
|
|
- * (child.byteorder == c'<' and not little_endian)):
|
|
- * raise ValueError(u"Non-native byte order not supported")
|
|
- */
|
|
- __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
|
|
- if (!__pyx_t_7) {
|
|
- goto __pyx_L8_next_or;
|
|
- } else {
|
|
- }
|
|
- __pyx_t_7 = (__pyx_v_little_endian != 0);
|
|
- if (!__pyx_t_7) {
|
|
+/* Python wrapper */
|
|
+static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
+static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
+ PyObject *__pyx_v_shape = 0;
|
|
+ Py_ssize_t __pyx_v_itemsize;
|
|
+ PyObject *__pyx_v_format = 0;
|
|
+ PyObject *__pyx_v_mode = 0;
|
|
+ int __pyx_v_allocate_buffer;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ int __pyx_r;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
|
|
+ {
|
|
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
|
|
+ PyObject* values[5] = {0,0,0,0,0};
|
|
+ values[3] = ((PyObject *)__pyx_n_s_c);
|
|
+ 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_shape)) != 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_itemsize)) != 0)) kw_args--;
|
|
+ else {
|
|
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 123, __pyx_L3_error)
|
|
+ }
|
|
+ CYTHON_FALLTHROUGH;
|
|
+ case 2:
|
|
+ if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
|
|
+ else {
|
|
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 123, __pyx_L3_error)
|
|
+ }
|
|
+ CYTHON_FALLTHROUGH;
|
|
+ case 3:
|
|
+ if (kw_args > 0) {
|
|
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
|
|
+ if (value) { values[3] = value; kw_args--; }
|
|
+ }
|
|
+ CYTHON_FALLTHROUGH;
|
|
+ case 4:
|
|
+ if (kw_args > 0) {
|
|
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
|
|
+ if (value) { values[4] = value; kw_args--; }
|
|
+ }
|
|
+ }
|
|
+ if (unlikely(kw_args > 0)) {
|
|
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 123, __pyx_L3_error)
|
|
+ }
|
|
} else {
|
|
- __pyx_t_6 = __pyx_t_7;
|
|
- goto __pyx_L7_bool_binop_done;
|
|
+ switch (PyTuple_GET_SIZE(__pyx_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);
|
|
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
|
|
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
|
|
+ break;
|
|
+ default: goto __pyx_L5_argtuple_error;
|
|
+ }
|
|
}
|
|
- __pyx_L8_next_or:;
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":858
|
|
- *
|
|
- * if ((child.byteorder == c'>' and little_endian) or
|
|
- * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
|
|
- * raise ValueError(u"Non-native byte order not supported")
|
|
- * # One could encode it in the format string and have Cython
|
|
- */
|
|
- __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
|
|
- if (__pyx_t_7) {
|
|
+ __pyx_v_shape = ((PyObject*)values[0]);
|
|
+ __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L3_error)
|
|
+ __pyx_v_format = values[2];
|
|
+ __pyx_v_mode = values[3];
|
|
+ if (values[4]) {
|
|
+ __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 124, __pyx_L3_error)
|
|
} else {
|
|
- __pyx_t_6 = __pyx_t_7;
|
|
- goto __pyx_L7_bool_binop_done;
|
|
- }
|
|
- __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
|
|
- __pyx_t_6 = __pyx_t_7;
|
|
- __pyx_L7_bool_binop_done:;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":857
|
|
- * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
|
|
+ /* "View.MemoryView":124
|
|
*
|
|
- * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
|
|
- * (child.byteorder == c'<' and not little_endian)):
|
|
- * raise ValueError(u"Non-native byte order not supported")
|
|
- */
|
|
- if (unlikely(__pyx_t_6)) {
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":859
|
|
- * if ((child.byteorder == c'>' and little_endian) or
|
|
- * (child.byteorder == c'<' and not little_endian)):
|
|
- * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
|
|
- * # One could encode it in the format string and have Cython
|
|
- * # complain instead, BUT: < and > in format strings also imply
|
|
- */
|
|
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 859, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __PYX_ERR(1, 859, __pyx_L1_error)
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":857
|
|
- * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
|
|
+ * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
|
|
+ * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
|
|
*
|
|
- * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
|
|
- * (child.byteorder == c'<' and not little_endian)):
|
|
- * raise ValueError(u"Non-native byte order not supported")
|
|
+ * cdef int idx
|
|
*/
|
|
+ __pyx_v_allocate_buffer = ((int)1);
|
|
}
|
|
+ }
|
|
+ goto __pyx_L4_argument_unpacking_done;
|
|
+ __pyx_L5_argtuple_error:;
|
|
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 123, __pyx_L3_error)
|
|
+ __pyx_L3_error:;
|
|
+ __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return -1;
|
|
+ __pyx_L4_argument_unpacking_done:;
|
|
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 123, __pyx_L1_error)
|
|
+ if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
|
|
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 123, __pyx_L1_error)
|
|
+ }
|
|
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":869
|
|
+ /* "View.MemoryView":123
|
|
+ * cdef bint dtype_is_object
|
|
*
|
|
- * # Output padding bytes
|
|
- * while offset[0] < new_offset: # <<<<<<<<<<<<<<
|
|
- * f[0] = 120 # "x"; pad byte
|
|
- * f += 1
|
|
- */
|
|
- while (1) {
|
|
- __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 869, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 869, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 869, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- if (!__pyx_t_6) break;
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":870
|
|
- * # Output padding bytes
|
|
- * while offset[0] < new_offset:
|
|
- * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
|
|
- * f += 1
|
|
- * offset[0] += 1
|
|
- */
|
|
- (__pyx_v_f[0]) = 0x78;
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":871
|
|
- * while offset[0] < new_offset:
|
|
- * f[0] = 120 # "x"; pad byte
|
|
- * f += 1 # <<<<<<<<<<<<<<
|
|
- * offset[0] += 1
|
|
+ * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
|
|
+ * mode="c", bint allocate_buffer=True):
|
|
*
|
|
*/
|
|
- __pyx_v_f = (__pyx_v_f + 1);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":872
|
|
- * f[0] = 120 # "x"; pad byte
|
|
- * f += 1
|
|
- * offset[0] += 1 # <<<<<<<<<<<<<<
|
|
- *
|
|
- * offset[0] += child.itemsize
|
|
- */
|
|
- __pyx_t_8 = 0;
|
|
- (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
|
|
- }
|
|
+ /* function exit code */
|
|
+ goto __pyx_L0;
|
|
+ __pyx_L1_error:;
|
|
+ __pyx_r = -1;
|
|
+ __pyx_L0:;
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+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) {
|
|
+ int __pyx_v_idx;
|
|
+ Py_ssize_t __pyx_v_i;
|
|
+ Py_ssize_t __pyx_v_dim;
|
|
+ PyObject **__pyx_v_p;
|
|
+ char __pyx_v_order;
|
|
+ int __pyx_r;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ Py_ssize_t __pyx_t_1;
|
|
+ int __pyx_t_2;
|
|
+ PyObject *__pyx_t_3 = NULL;
|
|
+ int __pyx_t_4;
|
|
+ PyObject *__pyx_t_5 = NULL;
|
|
+ PyObject *__pyx_t_6 = NULL;
|
|
+ char *__pyx_t_7;
|
|
+ int __pyx_t_8;
|
|
+ Py_ssize_t __pyx_t_9;
|
|
+ PyObject *__pyx_t_10 = NULL;
|
|
+ Py_ssize_t __pyx_t_11;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("__cinit__", 0);
|
|
+ __Pyx_INCREF(__pyx_v_format);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":874
|
|
- * offset[0] += 1
|
|
+ /* "View.MemoryView":130
|
|
+ * cdef PyObject **p
|
|
*
|
|
- * offset[0] += child.itemsize # <<<<<<<<<<<<<<
|
|
+ * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
|
|
+ * self.itemsize = itemsize
|
|
*
|
|
- * if not PyDataType_HASFIELDS(child):
|
|
*/
|
|
- __pyx_t_8 = 0;
|
|
- (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
|
|
+ if (unlikely(__pyx_v_shape == Py_None)) {
|
|
+ PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
|
|
+ __PYX_ERR(2, 130, __pyx_L1_error)
|
|
+ }
|
|
+ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 130, __pyx_L1_error)
|
|
+ __pyx_v_self->ndim = ((int)__pyx_t_1);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":876
|
|
- * offset[0] += child.itemsize
|
|
+ /* "View.MemoryView":131
|
|
+ *
|
|
+ * self.ndim = <int> len(shape)
|
|
+ * self.itemsize = itemsize # <<<<<<<<<<<<<<
|
|
*
|
|
- * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
|
|
- * t = child.type_num
|
|
- * if end - f < 5:
|
|
+ * if not self.ndim:
|
|
*/
|
|
- __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
|
|
- if (__pyx_t_6) {
|
|
+ __pyx_v_self->itemsize = __pyx_v_itemsize;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":877
|
|
+ /* "View.MemoryView":133
|
|
+ * self.itemsize = itemsize
|
|
+ *
|
|
+ * if not self.ndim: # <<<<<<<<<<<<<<
|
|
+ * raise ValueError("Empty shape tuple for cython.array")
|
|
*
|
|
- * if not PyDataType_HASFIELDS(child):
|
|
- * t = child.type_num # <<<<<<<<<<<<<<
|
|
- * if end - f < 5:
|
|
- * raise RuntimeError(u"Format string allocated too short.")
|
|
*/
|
|
- __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 877, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
|
|
- __pyx_t_4 = 0;
|
|
+ __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
|
|
+ if (unlikely(__pyx_t_2)) {
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":878
|
|
- * if not PyDataType_HASFIELDS(child):
|
|
- * t = child.type_num
|
|
- * if end - f < 5: # <<<<<<<<<<<<<<
|
|
- * raise RuntimeError(u"Format string allocated too short.")
|
|
+ /* "View.MemoryView":134
|
|
+ *
|
|
+ * if not self.ndim:
|
|
+ * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
|
|
*
|
|
+ * if itemsize <= 0:
|
|
*/
|
|
- __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
|
|
- if (unlikely(__pyx_t_6)) {
|
|
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 134, __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(2, 134, __pyx_L1_error)
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":879
|
|
- * t = child.type_num
|
|
- * if end - f < 5:
|
|
- * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":133
|
|
+ * self.itemsize = itemsize
|
|
+ *
|
|
+ * if not self.ndim: # <<<<<<<<<<<<<<
|
|
+ * raise ValueError("Empty shape tuple for cython.array")
|
|
*
|
|
- * # Until ticket #99 is fixed, use integers to avoid warnings
|
|
*/
|
|
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 879, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
|
|
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- __PYX_ERR(1, 879, __pyx_L1_error)
|
|
+ }
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":878
|
|
- * if not PyDataType_HASFIELDS(child):
|
|
- * t = child.type_num
|
|
- * if end - f < 5: # <<<<<<<<<<<<<<
|
|
- * raise RuntimeError(u"Format string allocated too short.")
|
|
+ /* "View.MemoryView":136
|
|
+ * raise ValueError("Empty shape tuple for cython.array")
|
|
+ *
|
|
+ * if itemsize <= 0: # <<<<<<<<<<<<<<
|
|
+ * raise ValueError("itemsize <= 0 for cython.array")
|
|
*
|
|
*/
|
|
- }
|
|
+ __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
|
|
+ if (unlikely(__pyx_t_2)) {
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":882
|
|
+ /* "View.MemoryView":137
|
|
+ *
|
|
+ * if itemsize <= 0:
|
|
+ * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
|
|
*
|
|
- * # Until ticket #99 is fixed, use integers to avoid warnings
|
|
- * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_UBYTE: f[0] = 66 #"B"
|
|
- * elif t == NPY_SHORT: f[0] = 104 #"h"
|
|
+ * if not isinstance(format, bytes):
|
|
*/
|
|
- __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 882, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 882, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 882, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- if (__pyx_t_6) {
|
|
- (__pyx_v_f[0]) = 98;
|
|
- goto __pyx_L15;
|
|
- }
|
|
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 137, __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(2, 137, __pyx_L1_error)
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":883
|
|
- * # Until ticket #99 is fixed, use integers to avoid warnings
|
|
- * if t == NPY_BYTE: f[0] = 98 #"b"
|
|
- * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_SHORT: f[0] = 104 #"h"
|
|
- * elif t == NPY_USHORT: f[0] = 72 #"H"
|
|
+ /* "View.MemoryView":136
|
|
+ * raise ValueError("Empty shape tuple for cython.array")
|
|
+ *
|
|
+ * if itemsize <= 0: # <<<<<<<<<<<<<<
|
|
+ * raise ValueError("itemsize <= 0 for cython.array")
|
|
+ *
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 883, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 883, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 883, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- if (__pyx_t_6) {
|
|
- (__pyx_v_f[0]) = 66;
|
|
- goto __pyx_L15;
|
|
- }
|
|
+ }
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":884
|
|
- * if t == NPY_BYTE: f[0] = 98 #"b"
|
|
- * elif t == NPY_UBYTE: f[0] = 66 #"B"
|
|
- * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_USHORT: f[0] = 72 #"H"
|
|
- * elif t == NPY_INT: f[0] = 105 #"i"
|
|
+ /* "View.MemoryView":139
|
|
+ * raise ValueError("itemsize <= 0 for cython.array")
|
|
+ *
|
|
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
|
|
+ * format = format.encode('ASCII')
|
|
+ * self._format = format # keep a reference to the byte string
|
|
*/
|
|
- __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 884, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 884, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 884, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- if (__pyx_t_6) {
|
|
- (__pyx_v_f[0]) = 0x68;
|
|
- goto __pyx_L15;
|
|
- }
|
|
+ __pyx_t_2 = PyBytes_Check(__pyx_v_format);
|
|
+ __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
|
|
+ if (__pyx_t_4) {
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":885
|
|
- * elif t == NPY_UBYTE: f[0] = 66 #"B"
|
|
- * elif t == NPY_SHORT: f[0] = 104 #"h"
|
|
- * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_INT: f[0] = 105 #"i"
|
|
- * elif t == NPY_UINT: f[0] = 73 #"I"
|
|
+ /* "View.MemoryView":140
|
|
+ *
|
|
+ * if not isinstance(format, bytes):
|
|
+ * format = format.encode('ASCII') # <<<<<<<<<<<<<<
|
|
+ * self._format = format # keep a reference to the byte string
|
|
+ * self.format = self._format
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 885, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 885, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 885, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- if (__pyx_t_6) {
|
|
- (__pyx_v_f[0]) = 72;
|
|
- goto __pyx_L15;
|
|
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 140, __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);
|
|
}
|
|
+ }
|
|
+ __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
|
|
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 140, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
+ __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
|
|
+ __pyx_t_3 = 0;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":886
|
|
- * elif t == NPY_SHORT: f[0] = 104 #"h"
|
|
- * elif t == NPY_USHORT: f[0] = 72 #"H"
|
|
- * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_UINT: f[0] = 73 #"I"
|
|
- * elif t == NPY_LONG: f[0] = 108 #"l"
|
|
+ /* "View.MemoryView":139
|
|
+ * raise ValueError("itemsize <= 0 for cython.array")
|
|
+ *
|
|
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
|
|
+ * format = format.encode('ASCII')
|
|
+ * self._format = format # keep a reference to the byte string
|
|
*/
|
|
- __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 886, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 886, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 886, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- if (__pyx_t_6) {
|
|
- (__pyx_v_f[0]) = 0x69;
|
|
- goto __pyx_L15;
|
|
- }
|
|
+ }
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":887
|
|
- * elif t == NPY_USHORT: f[0] = 72 #"H"
|
|
- * elif t == NPY_INT: f[0] = 105 #"i"
|
|
- * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_LONG: f[0] = 108 #"l"
|
|
- * elif t == NPY_ULONG: f[0] = 76 #"L"
|
|
+ /* "View.MemoryView":141
|
|
+ * if not isinstance(format, bytes):
|
|
+ * format = format.encode('ASCII')
|
|
+ * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
|
|
+ * self.format = self._format
|
|
+ *
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 887, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 887, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 887, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- if (__pyx_t_6) {
|
|
- (__pyx_v_f[0]) = 73;
|
|
- goto __pyx_L15;
|
|
- }
|
|
+ if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 141, __pyx_L1_error)
|
|
+ __pyx_t_3 = __pyx_v_format;
|
|
+ __Pyx_INCREF(__pyx_t_3);
|
|
+ __Pyx_GIVEREF(__pyx_t_3);
|
|
+ __Pyx_GOTREF(__pyx_v_self->_format);
|
|
+ __Pyx_DECREF(__pyx_v_self->_format);
|
|
+ __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
|
|
+ __pyx_t_3 = 0;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":888
|
|
- * elif t == NPY_INT: f[0] = 105 #"i"
|
|
- * elif t == NPY_UINT: f[0] = 73 #"I"
|
|
- * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_ULONG: f[0] = 76 #"L"
|
|
- * elif t == NPY_LONGLONG: f[0] = 113 #"q"
|
|
+ /* "View.MemoryView":142
|
|
+ * format = format.encode('ASCII')
|
|
+ * self._format = format # keep a reference to the byte string
|
|
+ * self.format = self._format # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ *
|
|
*/
|
|
- __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 888, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 888, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 888, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- if (__pyx_t_6) {
|
|
- (__pyx_v_f[0]) = 0x6C;
|
|
- goto __pyx_L15;
|
|
- }
|
|
+ if (unlikely(__pyx_v_self->_format == Py_None)) {
|
|
+ PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
|
|
+ __PYX_ERR(2, 142, __pyx_L1_error)
|
|
+ }
|
|
+ __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(2, 142, __pyx_L1_error)
|
|
+ __pyx_v_self->format = __pyx_t_7;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":889
|
|
- * elif t == NPY_UINT: f[0] = 73 #"I"
|
|
- * elif t == NPY_LONG: f[0] = 108 #"l"
|
|
- * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_LONGLONG: f[0] = 113 #"q"
|
|
- * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
|
|
+ /* "View.MemoryView":145
|
|
+ *
|
|
+ *
|
|
+ * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
|
|
+ * self._strides = self._shape + self.ndim
|
|
+ *
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 889, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 889, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 889, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- if (__pyx_t_6) {
|
|
- (__pyx_v_f[0]) = 76;
|
|
- goto __pyx_L15;
|
|
- }
|
|
+ __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":890
|
|
- * elif t == NPY_LONG: f[0] = 108 #"l"
|
|
- * elif t == NPY_ULONG: f[0] = 76 #"L"
|
|
- * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
|
|
- * elif t == NPY_FLOAT: f[0] = 102 #"f"
|
|
+ /* "View.MemoryView":146
|
|
+ *
|
|
+ * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
|
|
+ * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * if not self._shape:
|
|
*/
|
|
- __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 890, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 890, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 890, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- if (__pyx_t_6) {
|
|
- (__pyx_v_f[0]) = 0x71;
|
|
- goto __pyx_L15;
|
|
- }
|
|
+ __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":891
|
|
- * elif t == NPY_ULONG: f[0] = 76 #"L"
|
|
- * elif t == NPY_LONGLONG: f[0] = 113 #"q"
|
|
- * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_FLOAT: f[0] = 102 #"f"
|
|
- * elif t == NPY_DOUBLE: f[0] = 100 #"d"
|
|
+ /* "View.MemoryView":148
|
|
+ * self._strides = self._shape + self.ndim
|
|
+ *
|
|
+ * if not self._shape: # <<<<<<<<<<<<<<
|
|
+ * raise MemoryError("unable to allocate shape and strides.")
|
|
+ *
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 891, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 891, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 891, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- if (__pyx_t_6) {
|
|
- (__pyx_v_f[0]) = 81;
|
|
- goto __pyx_L15;
|
|
- }
|
|
+ __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
|
|
+ if (unlikely(__pyx_t_4)) {
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":892
|
|
- * elif t == NPY_LONGLONG: f[0] = 113 #"q"
|
|
- * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
|
|
- * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_DOUBLE: f[0] = 100 #"d"
|
|
- * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
|
|
+ /* "View.MemoryView":149
|
|
+ *
|
|
+ * if not self._shape:
|
|
+ * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ *
|
|
*/
|
|
- __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 892, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 892, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 892, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- if (__pyx_t_6) {
|
|
- (__pyx_v_f[0]) = 0x66;
|
|
- goto __pyx_L15;
|
|
- }
|
|
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 149, __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(2, 149, __pyx_L1_error)
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":893
|
|
- * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
|
|
- * elif t == NPY_FLOAT: f[0] = 102 #"f"
|
|
- * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
|
|
- * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
|
|
+ /* "View.MemoryView":148
|
|
+ * self._strides = self._shape + self.ndim
|
|
+ *
|
|
+ * if not self._shape: # <<<<<<<<<<<<<<
|
|
+ * raise MemoryError("unable to allocate shape and strides.")
|
|
+ *
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 893, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 893, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 893, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- if (__pyx_t_6) {
|
|
- (__pyx_v_f[0]) = 0x64;
|
|
- goto __pyx_L15;
|
|
- }
|
|
+ }
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":894
|
|
- * elif t == NPY_FLOAT: f[0] = 102 #"f"
|
|
- * elif t == NPY_DOUBLE: f[0] = 100 #"d"
|
|
- * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
|
|
- * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
|
|
+ /* "View.MemoryView":152
|
|
+ *
|
|
+ *
|
|
+ * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
|
|
+ * if dim <= 0:
|
|
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
|
|
*/
|
|
- __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 894, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 894, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 894, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- if (__pyx_t_6) {
|
|
- (__pyx_v_f[0]) = 0x67;
|
|
- goto __pyx_L15;
|
|
- }
|
|
+ __pyx_t_8 = 0;
|
|
+ __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
|
|
+ for (;;) {
|
|
+ if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
|
|
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
+ __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 152, __pyx_L1_error)
|
|
+ #else
|
|
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 152, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_5);
|
|
+ #endif
|
|
+ __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 152, __pyx_L1_error)
|
|
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
+ __pyx_v_dim = __pyx_t_9;
|
|
+ __pyx_v_idx = __pyx_t_8;
|
|
+ __pyx_t_8 = (__pyx_t_8 + 1);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":895
|
|
- * elif t == NPY_DOUBLE: f[0] = 100 #"d"
|
|
- * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
|
|
- * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
|
|
- * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
|
|
+ /* "View.MemoryView":153
|
|
+ *
|
|
+ * for idx, dim in enumerate(shape):
|
|
+ * if dim <= 0: # <<<<<<<<<<<<<<
|
|
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
|
|
+ * self._shape[idx] = dim
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 895, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 895, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 895, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- if (__pyx_t_6) {
|
|
- (__pyx_v_f[0]) = 90;
|
|
- (__pyx_v_f[1]) = 0x66;
|
|
- __pyx_v_f = (__pyx_v_f + 1);
|
|
- goto __pyx_L15;
|
|
- }
|
|
+ __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
|
|
+ if (unlikely(__pyx_t_4)) {
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":896
|
|
- * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
|
|
- * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
|
|
- * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
|
|
- * elif t == NPY_OBJECT: f[0] = 79 #"O"
|
|
+ /* "View.MemoryView":154
|
|
+ * for idx, dim in enumerate(shape):
|
|
+ * if dim <= 0:
|
|
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
|
|
+ * self._shape[idx] = dim
|
|
+ *
|
|
*/
|
|
- __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 896, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 896, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 896, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- if (__pyx_t_6) {
|
|
- (__pyx_v_f[0]) = 90;
|
|
- (__pyx_v_f[1]) = 0x64;
|
|
- __pyx_v_f = (__pyx_v_f + 1);
|
|
- goto __pyx_L15;
|
|
- }
|
|
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 154, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_5);
|
|
+ __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 154, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_6);
|
|
+ __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 154, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_10);
|
|
+ __Pyx_GIVEREF(__pyx_t_5);
|
|
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
|
|
+ __Pyx_GIVEREF(__pyx_t_6);
|
|
+ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
|
|
+ __pyx_t_5 = 0;
|
|
+ __pyx_t_6 = 0;
|
|
+ __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 154, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_6);
|
|
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
+ __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 154, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_10);
|
|
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
+ __Pyx_Raise(__pyx_t_10, 0, 0, 0);
|
|
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
+ __PYX_ERR(2, 154, __pyx_L1_error)
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":897
|
|
- * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
|
|
- * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
|
|
- * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
|
|
- * elif t == NPY_OBJECT: f[0] = 79 #"O"
|
|
- * else:
|
|
+ /* "View.MemoryView":153
|
|
+ *
|
|
+ * for idx, dim in enumerate(shape):
|
|
+ * if dim <= 0: # <<<<<<<<<<<<<<
|
|
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
|
|
+ * self._shape[idx] = dim
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 897, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 897, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 897, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- if (__pyx_t_6) {
|
|
- (__pyx_v_f[0]) = 90;
|
|
- (__pyx_v_f[1]) = 0x67;
|
|
- __pyx_v_f = (__pyx_v_f + 1);
|
|
- goto __pyx_L15;
|
|
- }
|
|
+ }
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":898
|
|
- * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
|
|
- * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
|
|
- * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
|
|
+ /* "View.MemoryView":155
|
|
+ * if dim <= 0:
|
|
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
|
|
+ * self._shape[idx] = dim # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * cdef char order
|
|
*/
|
|
- __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 898, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 898, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 898, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- if (likely(__pyx_t_6)) {
|
|
- (__pyx_v_f[0]) = 79;
|
|
- goto __pyx_L15;
|
|
- }
|
|
+ (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":900
|
|
- * elif t == NPY_OBJECT: f[0] = 79 #"O"
|
|
- * else:
|
|
- * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
|
|
- * f += 1
|
|
- * else:
|
|
+ /* "View.MemoryView":152
|
|
+ *
|
|
+ *
|
|
+ * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
|
|
+ * if dim <= 0:
|
|
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
|
|
*/
|
|
- /*else*/ {
|
|
- __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 900, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 900, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
|
|
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- __PYX_ERR(1, 900, __pyx_L1_error)
|
|
- }
|
|
- __pyx_L15:;
|
|
+ }
|
|
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":901
|
|
- * else:
|
|
- * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
|
|
- * f += 1 # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * # Cython ignores struct boundary information ("T{...}"),
|
|
+ /* "View.MemoryView":158
|
|
+ *
|
|
+ * cdef char order
|
|
+ * if mode == 'fortran': # <<<<<<<<<<<<<<
|
|
+ * order = b'F'
|
|
+ * self.mode = u'fortran'
|
|
*/
|
|
- __pyx_v_f = (__pyx_v_f + 1);
|
|
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 158, __pyx_L1_error)
|
|
+ if (__pyx_t_4) {
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":876
|
|
- * offset[0] += child.itemsize
|
|
- *
|
|
- * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
|
|
- * t = child.type_num
|
|
- * if end - f < 5:
|
|
+ /* "View.MemoryView":159
|
|
+ * cdef char order
|
|
+ * if mode == 'fortran':
|
|
+ * order = b'F' # <<<<<<<<<<<<<<
|
|
+ * self.mode = u'fortran'
|
|
+ * elif mode == 'c':
|
|
*/
|
|
- goto __pyx_L13;
|
|
- }
|
|
+ __pyx_v_order = 'F';
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":905
|
|
- * # Cython ignores struct boundary information ("T{...}"),
|
|
- * # so don't output it
|
|
- * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
|
|
- * return f
|
|
- *
|
|
+ /* "View.MemoryView":160
|
|
+ * if mode == 'fortran':
|
|
+ * order = b'F'
|
|
+ * self.mode = u'fortran' # <<<<<<<<<<<<<<
|
|
+ * elif mode == 'c':
|
|
+ * order = b'C'
|
|
*/
|
|
- /*else*/ {
|
|
- __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(1, 905, __pyx_L1_error)
|
|
- __pyx_v_f = __pyx_t_9;
|
|
- }
|
|
- __pyx_L13:;
|
|
+ __Pyx_INCREF(__pyx_n_u_fortran);
|
|
+ __Pyx_GIVEREF(__pyx_n_u_fortran);
|
|
+ __Pyx_GOTREF(__pyx_v_self->mode);
|
|
+ __Pyx_DECREF(__pyx_v_self->mode);
|
|
+ __pyx_v_self->mode = __pyx_n_u_fortran;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":850
|
|
- * cdef tuple fields
|
|
+ /* "View.MemoryView":158
|
|
*
|
|
- * for childname in descr.names: # <<<<<<<<<<<<<<
|
|
- * fields = descr.fields[childname]
|
|
- * child, new_offset = fields
|
|
+ * cdef char order
|
|
+ * if mode == 'fortran': # <<<<<<<<<<<<<<
|
|
+ * order = b'F'
|
|
+ * self.mode = u'fortran'
|
|
*/
|
|
+ goto __pyx_L10;
|
|
}
|
|
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":906
|
|
- * # so don't output it
|
|
- * f = _util_dtypestring(child, f, end, offset)
|
|
- * return f # <<<<<<<<<<<<<<
|
|
- *
|
|
- *
|
|
+ /* "View.MemoryView":161
|
|
+ * order = b'F'
|
|
+ * self.mode = u'fortran'
|
|
+ * elif mode == 'c': # <<<<<<<<<<<<<<
|
|
+ * order = b'C'
|
|
+ * self.mode = u'c'
|
|
*/
|
|
- __pyx_r = __pyx_v_f;
|
|
- goto __pyx_L0;
|
|
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 161, __pyx_L1_error)
|
|
+ if (likely(__pyx_t_4)) {
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":841
|
|
- * return ()
|
|
- *
|
|
- * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
|
|
- * # Recursive utility function used in __getbuffer__ to get format
|
|
- * # string. The new location in the format string is returned.
|
|
+ /* "View.MemoryView":162
|
|
+ * self.mode = u'fortran'
|
|
+ * elif mode == 'c':
|
|
+ * order = b'C' # <<<<<<<<<<<<<<
|
|
+ * self.mode = u'c'
|
|
+ * else:
|
|
*/
|
|
+ __pyx_v_order = 'C';
|
|
|
|
- /* function exit code */
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_XDECREF(__pyx_t_3);
|
|
- __Pyx_XDECREF(__pyx_t_4);
|
|
- __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = NULL;
|
|
- __pyx_L0:;
|
|
- __Pyx_XDECREF((PyObject *)__pyx_v_child);
|
|
- __Pyx_XDECREF(__pyx_v_fields);
|
|
- __Pyx_XDECREF(__pyx_v_childname);
|
|
- __Pyx_XDECREF(__pyx_v_new_offset);
|
|
- __Pyx_XDECREF(__pyx_v_t);
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
+ /* "View.MemoryView":163
|
|
+ * elif mode == 'c':
|
|
+ * order = b'C'
|
|
+ * self.mode = u'c' # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
|
|
+ */
|
|
+ __Pyx_INCREF(__pyx_n_u_c);
|
|
+ __Pyx_GIVEREF(__pyx_n_u_c);
|
|
+ __Pyx_GOTREF(__pyx_v_self->mode);
|
|
+ __Pyx_DECREF(__pyx_v_self->mode);
|
|
+ __pyx_v_self->mode = __pyx_n_u_c;
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1021
|
|
- * int _import_umath() except -1
|
|
- *
|
|
- * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
|
|
- * Py_INCREF(base) # important to do this before stealing the reference below!
|
|
- * PyArray_SetBaseObject(arr, base)
|
|
+ /* "View.MemoryView":161
|
|
+ * order = b'F'
|
|
+ * self.mode = u'fortran'
|
|
+ * elif mode == 'c': # <<<<<<<<<<<<<<
|
|
+ * order = b'C'
|
|
+ * self.mode = u'c'
|
|
*/
|
|
+ goto __pyx_L10;
|
|
+ }
|
|
|
|
-static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("set_array_base", 0);
|
|
+ /* "View.MemoryView":165
|
|
+ * self.mode = u'c'
|
|
+ * else:
|
|
+ * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * self.len = fill_contig_strides_array(self._shape, self._strides,
|
|
+ */
|
|
+ /*else*/ {
|
|
+ __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 165, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 165, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_10);
|
|
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
+ __Pyx_Raise(__pyx_t_10, 0, 0, 0);
|
|
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
+ __PYX_ERR(2, 165, __pyx_L1_error)
|
|
+ }
|
|
+ __pyx_L10:;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1022
|
|
+ /* "View.MemoryView":167
|
|
+ * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
|
|
*
|
|
- * cdef inline void set_array_base(ndarray arr, object base):
|
|
- * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
|
|
- * PyArray_SetBaseObject(arr, base)
|
|
+ * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
|
|
+ * itemsize, self.ndim, order)
|
|
*
|
|
*/
|
|
- Py_INCREF(__pyx_v_base);
|
|
+ __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1023
|
|
- * cdef inline void set_array_base(ndarray arr, object base):
|
|
- * Py_INCREF(base) # important to do this before stealing the reference below!
|
|
- * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":170
|
|
+ * itemsize, self.ndim, order)
|
|
*
|
|
- * cdef inline object get_array_base(ndarray arr):
|
|
+ * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
|
|
+ * self.dtype_is_object = format == b'O'
|
|
+ * if allocate_buffer:
|
|
*/
|
|
- (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
|
|
+ __pyx_v_self->free_data = __pyx_v_allocate_buffer;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1021
|
|
- * int _import_umath() except -1
|
|
+ /* "View.MemoryView":171
|
|
+ *
|
|
+ * self.free_data = allocate_buffer
|
|
+ * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
|
|
+ * if allocate_buffer:
|
|
*
|
|
- * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
|
|
- * Py_INCREF(base) # important to do this before stealing the reference below!
|
|
- * PyArray_SetBaseObject(arr, base)
|
|
*/
|
|
+ __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 171, __pyx_L1_error)
|
|
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 171, __pyx_L1_error)
|
|
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
+ __pyx_v_self->dtype_is_object = __pyx_t_4;
|
|
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
-}
|
|
-
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1025
|
|
- * PyArray_SetBaseObject(arr, base)
|
|
+ /* "View.MemoryView":172
|
|
+ * self.free_data = allocate_buffer
|
|
+ * self.dtype_is_object = format == b'O'
|
|
+ * if allocate_buffer: # <<<<<<<<<<<<<<
|
|
+ *
|
|
*
|
|
- * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
|
|
- * base = PyArray_BASE(arr)
|
|
- * if base is NULL:
|
|
*/
|
|
+ __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
|
|
+ if (__pyx_t_4) {
|
|
|
|
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
|
|
- PyObject *__pyx_v_base;
|
|
- PyObject *__pyx_r = NULL;
|
|
- __Pyx_RefNannyDeclarations
|
|
- int __pyx_t_1;
|
|
- __Pyx_RefNannySetupContext("get_array_base", 0);
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1026
|
|
+ /* "View.MemoryView":175
|
|
*
|
|
- * cdef inline object get_array_base(ndarray arr):
|
|
- * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
|
|
- * if base is NULL:
|
|
- * return None
|
|
+ *
|
|
+ * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
|
|
+ * if not self.data:
|
|
+ * raise MemoryError("unable to allocate array data.")
|
|
*/
|
|
- __pyx_v_base = PyArray_BASE(__pyx_v_arr);
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1027
|
|
- * cdef inline object get_array_base(ndarray arr):
|
|
- * base = PyArray_BASE(arr)
|
|
- * if base is NULL: # <<<<<<<<<<<<<<
|
|
- * return None
|
|
- * return <object>base
|
|
- */
|
|
- __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
|
|
- if (__pyx_t_1) {
|
|
+ __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1028
|
|
- * base = PyArray_BASE(arr)
|
|
- * if base is NULL:
|
|
- * return None # <<<<<<<<<<<<<<
|
|
- * return <object>base
|
|
+ /* "View.MemoryView":176
|
|
+ *
|
|
+ * self.data = <char *>malloc(self.len)
|
|
+ * if not self.data: # <<<<<<<<<<<<<<
|
|
+ * raise MemoryError("unable to allocate array data.")
|
|
*
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
- goto __pyx_L0;
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1027
|
|
- * cdef inline object get_array_base(ndarray arr):
|
|
- * base = PyArray_BASE(arr)
|
|
- * if base is NULL: # <<<<<<<<<<<<<<
|
|
- * return None
|
|
- * return <object>base
|
|
- */
|
|
- }
|
|
+ __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
|
|
+ if (unlikely(__pyx_t_4)) {
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1029
|
|
- * if base is NULL:
|
|
- * return None
|
|
- * return <object>base # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":177
|
|
+ * self.data = <char *>malloc(self.len)
|
|
+ * if not self.data:
|
|
+ * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
|
|
*
|
|
- * # Versions of the import_* functions which are more suitable for
|
|
+ * if self.dtype_is_object:
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __Pyx_INCREF(((PyObject *)__pyx_v_base));
|
|
- __pyx_r = ((PyObject *)__pyx_v_base);
|
|
- goto __pyx_L0;
|
|
+ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 177, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_10);
|
|
+ __Pyx_Raise(__pyx_t_10, 0, 0, 0);
|
|
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
+ __PYX_ERR(2, 177, __pyx_L1_error)
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1025
|
|
- * PyArray_SetBaseObject(arr, base)
|
|
+ /* "View.MemoryView":176
|
|
+ *
|
|
+ * self.data = <char *>malloc(self.len)
|
|
+ * if not self.data: # <<<<<<<<<<<<<<
|
|
+ * raise MemoryError("unable to allocate array data.")
|
|
*
|
|
- * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
|
|
- * base = PyArray_BASE(arr)
|
|
- * if base is NULL:
|
|
*/
|
|
+ }
|
|
|
|
- /* function exit code */
|
|
- __pyx_L0:;
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1033
|
|
- * # Versions of the import_* functions which are more suitable for
|
|
- * # Cython code.
|
|
- * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
|
|
- * try:
|
|
- * _import_array()
|
|
+ /* "View.MemoryView":179
|
|
+ * raise MemoryError("unable to allocate array data.")
|
|
+ *
|
|
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
|
|
+ * p = <PyObject **> self.data
|
|
+ * for i in range(self.len / itemsize):
|
|
*/
|
|
+ __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
|
|
+ if (__pyx_t_4) {
|
|
|
|
-static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
|
|
- int __pyx_r;
|
|
- __Pyx_RefNannyDeclarations
|
|
- PyObject *__pyx_t_1 = NULL;
|
|
- PyObject *__pyx_t_2 = NULL;
|
|
- PyObject *__pyx_t_3 = NULL;
|
|
- int __pyx_t_4;
|
|
- PyObject *__pyx_t_5 = NULL;
|
|
- PyObject *__pyx_t_6 = NULL;
|
|
- PyObject *__pyx_t_7 = NULL;
|
|
- PyObject *__pyx_t_8 = NULL;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("import_array", 0);
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1034
|
|
- * # Cython code.
|
|
- * cdef inline int import_array() except -1:
|
|
- * try: # <<<<<<<<<<<<<<
|
|
- * _import_array()
|
|
- * except Exception:
|
|
+ /* "View.MemoryView":180
|
|
+ *
|
|
+ * if self.dtype_is_object:
|
|
+ * p = <PyObject **> self.data # <<<<<<<<<<<<<<
|
|
+ * for i in range(self.len / itemsize):
|
|
+ * p[i] = Py_None
|
|
*/
|
|
- {
|
|
- __Pyx_PyThreadState_declare
|
|
- __Pyx_PyThreadState_assign
|
|
- __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
|
|
- __Pyx_XGOTREF(__pyx_t_1);
|
|
- __Pyx_XGOTREF(__pyx_t_2);
|
|
- __Pyx_XGOTREF(__pyx_t_3);
|
|
- /*try:*/ {
|
|
+ __pyx_v_p = ((PyObject **)__pyx_v_self->data);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1035
|
|
- * cdef inline int import_array() except -1:
|
|
- * try:
|
|
- * _import_array() # <<<<<<<<<<<<<<
|
|
- * except Exception:
|
|
- * raise ImportError("numpy.core.multiarray failed to import")
|
|
+ /* "View.MemoryView":181
|
|
+ * if self.dtype_is_object:
|
|
+ * p = <PyObject **> self.data
|
|
+ * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
|
|
+ * p[i] = Py_None
|
|
+ * Py_INCREF(Py_None)
|
|
*/
|
|
- __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1035, __pyx_L3_error)
|
|
+ if (unlikely(__pyx_v_itemsize == 0)) {
|
|
+ PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
|
|
+ __PYX_ERR(2, 181, __pyx_L1_error)
|
|
+ }
|
|
+ else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
|
|
+ PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
|
|
+ __PYX_ERR(2, 181, __pyx_L1_error)
|
|
+ }
|
|
+ __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
|
|
+ __pyx_t_9 = __pyx_t_1;
|
|
+ for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
|
|
+ __pyx_v_i = __pyx_t_11;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1034
|
|
- * # Cython code.
|
|
- * cdef inline int import_array() except -1:
|
|
- * try: # <<<<<<<<<<<<<<
|
|
- * _import_array()
|
|
- * except Exception:
|
|
+ /* "View.MemoryView":182
|
|
+ * p = <PyObject **> self.data
|
|
+ * for i in range(self.len / itemsize):
|
|
+ * p[i] = Py_None # <<<<<<<<<<<<<<
|
|
+ * Py_INCREF(Py_None)
|
|
+ *
|
|
*/
|
|
- }
|
|
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- goto __pyx_L8_try_end;
|
|
- __pyx_L3_error:;
|
|
+ (__pyx_v_p[__pyx_v_i]) = Py_None;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1036
|
|
- * try:
|
|
- * _import_array()
|
|
- * except Exception: # <<<<<<<<<<<<<<
|
|
- * raise ImportError("numpy.core.multiarray failed to import")
|
|
+ /* "View.MemoryView":183
|
|
+ * for i in range(self.len / itemsize):
|
|
+ * p[i] = Py_None
|
|
+ * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
|
|
*
|
|
+ * @cname('getbuffer')
|
|
*/
|
|
- __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
|
|
- if (__pyx_t_4) {
|
|
- __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1036, __pyx_L5_except_error)
|
|
- __Pyx_GOTREF(__pyx_t_5);
|
|
- __Pyx_GOTREF(__pyx_t_6);
|
|
- __Pyx_GOTREF(__pyx_t_7);
|
|
+ Py_INCREF(Py_None);
|
|
+ }
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1037
|
|
- * _import_array()
|
|
- * except Exception:
|
|
- * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":179
|
|
+ * raise MemoryError("unable to allocate array data.")
|
|
*
|
|
- * cdef inline int import_umath() except -1:
|
|
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
|
|
+ * p = <PyObject **> self.data
|
|
+ * for i in range(self.len / itemsize):
|
|
*/
|
|
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1037, __pyx_L5_except_error)
|
|
- __Pyx_GOTREF(__pyx_t_8);
|
|
- __Pyx_Raise(__pyx_t_8, 0, 0, 0);
|
|
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
|
|
- __PYX_ERR(1, 1037, __pyx_L5_except_error)
|
|
}
|
|
- goto __pyx_L5_except_error;
|
|
- __pyx_L5_except_error:;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1034
|
|
- * # Cython code.
|
|
- * cdef inline int import_array() except -1:
|
|
- * try: # <<<<<<<<<<<<<<
|
|
- * _import_array()
|
|
- * except Exception:
|
|
+ /* "View.MemoryView":172
|
|
+ * self.free_data = allocate_buffer
|
|
+ * self.dtype_is_object = format == b'O'
|
|
+ * if allocate_buffer: # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ *
|
|
*/
|
|
- __Pyx_XGIVEREF(__pyx_t_1);
|
|
- __Pyx_XGIVEREF(__pyx_t_2);
|
|
- __Pyx_XGIVEREF(__pyx_t_3);
|
|
- __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
|
|
- goto __pyx_L1_error;
|
|
- __pyx_L8_try_end:;
|
|
}
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1033
|
|
- * # Versions of the import_* functions which are more suitable for
|
|
- * # Cython code.
|
|
- * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
|
|
- * try:
|
|
- * _import_array()
|
|
+ /* "View.MemoryView":123
|
|
+ * cdef bint dtype_is_object
|
|
+ *
|
|
+ * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
|
|
+ * mode="c", bint allocate_buffer=True):
|
|
+ *
|
|
*/
|
|
|
|
/* function exit code */
|
|
__pyx_r = 0;
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_3);
|
|
__Pyx_XDECREF(__pyx_t_5);
|
|
__Pyx_XDECREF(__pyx_t_6);
|
|
- __Pyx_XDECREF(__pyx_t_7);
|
|
- __Pyx_XDECREF(__pyx_t_8);
|
|
- __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __Pyx_XDECREF(__pyx_t_10);
|
|
+ __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = -1;
|
|
__pyx_L0:;
|
|
+ __Pyx_XDECREF(__pyx_v_format);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1039
|
|
- * raise ImportError("numpy.core.multiarray failed to import")
|
|
+/* "View.MemoryView":186
|
|
*
|
|
- * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
|
|
- * try:
|
|
- * _import_umath()
|
|
+ * @cname('getbuffer')
|
|
+ * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
|
|
+ * cdef int bufmode = -1
|
|
+ * if self.mode == u"c":
|
|
*/
|
|
|
|
-static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
|
|
+/* Python wrapper */
|
|
+static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
|
|
+static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
|
|
int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
- PyObject *__pyx_t_1 = NULL;
|
|
- PyObject *__pyx_t_2 = NULL;
|
|
+ __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
|
|
+ __pyx_r = __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));
|
|
+
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+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) {
|
|
+ int __pyx_v_bufmode;
|
|
+ int __pyx_r;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ int __pyx_t_1;
|
|
+ int __pyx_t_2;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
- int __pyx_t_4;
|
|
- PyObject *__pyx_t_5 = NULL;
|
|
- PyObject *__pyx_t_6 = NULL;
|
|
- PyObject *__pyx_t_7 = NULL;
|
|
- PyObject *__pyx_t_8 = NULL;
|
|
+ char *__pyx_t_4;
|
|
+ Py_ssize_t __pyx_t_5;
|
|
+ int __pyx_t_6;
|
|
+ Py_ssize_t *__pyx_t_7;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("import_umath", 0);
|
|
+ if (__pyx_v_info == NULL) {
|
|
+ PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
|
|
+ return -1;
|
|
+ }
|
|
+ __Pyx_RefNannySetupContext("__getbuffer__", 0);
|
|
+ __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
|
|
+ __Pyx_GIVEREF(__pyx_v_info->obj);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1040
|
|
- *
|
|
- * cdef inline int import_umath() except -1:
|
|
- * try: # <<<<<<<<<<<<<<
|
|
- * _import_umath()
|
|
- * except Exception:
|
|
- */
|
|
- {
|
|
- __Pyx_PyThreadState_declare
|
|
- __Pyx_PyThreadState_assign
|
|
- __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
|
|
- __Pyx_XGOTREF(__pyx_t_1);
|
|
- __Pyx_XGOTREF(__pyx_t_2);
|
|
- __Pyx_XGOTREF(__pyx_t_3);
|
|
- /*try:*/ {
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1041
|
|
- * cdef inline int import_umath() except -1:
|
|
- * try:
|
|
- * _import_umath() # <<<<<<<<<<<<<<
|
|
- * except Exception:
|
|
- * raise ImportError("numpy.core.umath failed to import")
|
|
- */
|
|
- __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1041, __pyx_L3_error)
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1040
|
|
- *
|
|
- * cdef inline int import_umath() except -1:
|
|
- * try: # <<<<<<<<<<<<<<
|
|
- * _import_umath()
|
|
- * except Exception:
|
|
+ /* "View.MemoryView":187
|
|
+ * @cname('getbuffer')
|
|
+ * def __getbuffer__(self, Py_buffer *info, int flags):
|
|
+ * cdef int bufmode = -1 # <<<<<<<<<<<<<<
|
|
+ * if self.mode == u"c":
|
|
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
*/
|
|
- }
|
|
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- goto __pyx_L8_try_end;
|
|
- __pyx_L3_error:;
|
|
+ __pyx_v_bufmode = -1;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1042
|
|
- * try:
|
|
- * _import_umath()
|
|
- * except Exception: # <<<<<<<<<<<<<<
|
|
- * raise ImportError("numpy.core.umath failed to import")
|
|
- *
|
|
+ /* "View.MemoryView":188
|
|
+ * def __getbuffer__(self, Py_buffer *info, int flags):
|
|
+ * cdef int bufmode = -1
|
|
+ * if self.mode == u"c": # <<<<<<<<<<<<<<
|
|
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
+ * elif self.mode == u"fortran":
|
|
*/
|
|
- __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
|
|
- if (__pyx_t_4) {
|
|
- __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1042, __pyx_L5_except_error)
|
|
- __Pyx_GOTREF(__pyx_t_5);
|
|
- __Pyx_GOTREF(__pyx_t_6);
|
|
- __Pyx_GOTREF(__pyx_t_7);
|
|
+ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 188, __pyx_L1_error)
|
|
+ __pyx_t_2 = (__pyx_t_1 != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1043
|
|
- * _import_umath()
|
|
- * except Exception:
|
|
- * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
|
|
- *
|
|
- * cdef inline int import_ufunc() except -1:
|
|
+ /* "View.MemoryView":189
|
|
+ * cdef int bufmode = -1
|
|
+ * if self.mode == u"c":
|
|
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
|
|
+ * elif self.mode == u"fortran":
|
|
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
*/
|
|
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1043, __pyx_L5_except_error)
|
|
- __Pyx_GOTREF(__pyx_t_8);
|
|
- __Pyx_Raise(__pyx_t_8, 0, 0, 0);
|
|
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
|
|
- __PYX_ERR(1, 1043, __pyx_L5_except_error)
|
|
- }
|
|
- goto __pyx_L5_except_error;
|
|
- __pyx_L5_except_error:;
|
|
+ __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1040
|
|
- *
|
|
- * cdef inline int import_umath() except -1:
|
|
- * try: # <<<<<<<<<<<<<<
|
|
- * _import_umath()
|
|
- * except Exception:
|
|
+ /* "View.MemoryView":188
|
|
+ * def __getbuffer__(self, Py_buffer *info, int flags):
|
|
+ * cdef int bufmode = -1
|
|
+ * if self.mode == u"c": # <<<<<<<<<<<<<<
|
|
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
+ * elif self.mode == u"fortran":
|
|
*/
|
|
- __Pyx_XGIVEREF(__pyx_t_1);
|
|
- __Pyx_XGIVEREF(__pyx_t_2);
|
|
- __Pyx_XGIVEREF(__pyx_t_3);
|
|
- __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
|
|
- goto __pyx_L1_error;
|
|
- __pyx_L8_try_end:;
|
|
+ goto __pyx_L3;
|
|
}
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1039
|
|
- * raise ImportError("numpy.core.multiarray failed to import")
|
|
- *
|
|
- * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
|
|
- * try:
|
|
- * _import_umath()
|
|
+ /* "View.MemoryView":190
|
|
+ * if self.mode == u"c":
|
|
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
+ * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
|
|
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
+ * if not (flags & bufmode):
|
|
*/
|
|
+ __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 190, __pyx_L1_error)
|
|
+ __pyx_t_1 = (__pyx_t_2 != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* function exit code */
|
|
- __pyx_r = 0;
|
|
- goto __pyx_L0;
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_5);
|
|
- __Pyx_XDECREF(__pyx_t_6);
|
|
- __Pyx_XDECREF(__pyx_t_7);
|
|
- __Pyx_XDECREF(__pyx_t_8);
|
|
- __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = -1;
|
|
- __pyx_L0:;
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
+ /* "View.MemoryView":191
|
|
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
+ * elif self.mode == u"fortran":
|
|
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
|
|
+ * if not (flags & bufmode):
|
|
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
|
|
+ */
|
|
+ __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
|
|
|
|
-/* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1045
|
|
- * raise ImportError("numpy.core.umath failed to import")
|
|
- *
|
|
- * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
|
|
- * try:
|
|
- * _import_umath()
|
|
+ /* "View.MemoryView":190
|
|
+ * if self.mode == u"c":
|
|
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
+ * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
|
|
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
+ * if not (flags & bufmode):
|
|
*/
|
|
+ }
|
|
+ __pyx_L3:;
|
|
|
|
-static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
|
|
- int __pyx_r;
|
|
- __Pyx_RefNannyDeclarations
|
|
- PyObject *__pyx_t_1 = NULL;
|
|
- PyObject *__pyx_t_2 = NULL;
|
|
- PyObject *__pyx_t_3 = NULL;
|
|
- int __pyx_t_4;
|
|
- PyObject *__pyx_t_5 = NULL;
|
|
- PyObject *__pyx_t_6 = NULL;
|
|
- PyObject *__pyx_t_7 = NULL;
|
|
- PyObject *__pyx_t_8 = NULL;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("import_ufunc", 0);
|
|
+ /* "View.MemoryView":192
|
|
+ * elif self.mode == u"fortran":
|
|
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
+ * if not (flags & bufmode): # <<<<<<<<<<<<<<
|
|
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
|
|
+ * info.buf = self.data
|
|
+ */
|
|
+ __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
|
|
+ if (unlikely(__pyx_t_1)) {
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1046
|
|
- *
|
|
- * cdef inline int import_ufunc() except -1:
|
|
- * try: # <<<<<<<<<<<<<<
|
|
- * _import_umath()
|
|
- * except Exception:
|
|
+ /* "View.MemoryView":193
|
|
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
+ * if not (flags & bufmode):
|
|
+ * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
|
|
+ * info.buf = self.data
|
|
+ * info.len = self.len
|
|
*/
|
|
- {
|
|
- __Pyx_PyThreadState_declare
|
|
- __Pyx_PyThreadState_assign
|
|
- __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
|
|
- __Pyx_XGOTREF(__pyx_t_1);
|
|
- __Pyx_XGOTREF(__pyx_t_2);
|
|
- __Pyx_XGOTREF(__pyx_t_3);
|
|
- /*try:*/ {
|
|
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 193, __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(2, 193, __pyx_L1_error)
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1047
|
|
- * cdef inline int import_ufunc() except -1:
|
|
- * try:
|
|
- * _import_umath() # <<<<<<<<<<<<<<
|
|
- * except Exception:
|
|
- * raise ImportError("numpy.core.umath failed to import")
|
|
+ /* "View.MemoryView":192
|
|
+ * elif self.mode == u"fortran":
|
|
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
+ * if not (flags & bufmode): # <<<<<<<<<<<<<<
|
|
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
|
|
+ * info.buf = self.data
|
|
*/
|
|
- __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1047, __pyx_L3_error)
|
|
+ }
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1046
|
|
- *
|
|
- * cdef inline int import_ufunc() except -1:
|
|
- * try: # <<<<<<<<<<<<<<
|
|
- * _import_umath()
|
|
- * except Exception:
|
|
+ /* "View.MemoryView":194
|
|
+ * if not (flags & bufmode):
|
|
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
|
|
+ * info.buf = self.data # <<<<<<<<<<<<<<
|
|
+ * info.len = self.len
|
|
+ * info.ndim = self.ndim
|
|
*/
|
|
- }
|
|
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- goto __pyx_L8_try_end;
|
|
- __pyx_L3_error:;
|
|
+ __pyx_t_4 = __pyx_v_self->data;
|
|
+ __pyx_v_info->buf = __pyx_t_4;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1048
|
|
- * try:
|
|
- * _import_umath()
|
|
- * except Exception: # <<<<<<<<<<<<<<
|
|
- * raise ImportError("numpy.core.umath failed to import")
|
|
+ /* "View.MemoryView":195
|
|
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
|
|
+ * info.buf = self.data
|
|
+ * info.len = self.len # <<<<<<<<<<<<<<
|
|
+ * info.ndim = self.ndim
|
|
+ * info.shape = self._shape
|
|
*/
|
|
- __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
|
|
- if (__pyx_t_4) {
|
|
- __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1048, __pyx_L5_except_error)
|
|
- __Pyx_GOTREF(__pyx_t_5);
|
|
- __Pyx_GOTREF(__pyx_t_6);
|
|
- __Pyx_GOTREF(__pyx_t_7);
|
|
+ __pyx_t_5 = __pyx_v_self->len;
|
|
+ __pyx_v_info->len = __pyx_t_5;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1049
|
|
- * _import_umath()
|
|
- * except Exception:
|
|
- * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":196
|
|
+ * info.buf = self.data
|
|
+ * info.len = self.len
|
|
+ * info.ndim = self.ndim # <<<<<<<<<<<<<<
|
|
+ * info.shape = self._shape
|
|
+ * info.strides = self._strides
|
|
*/
|
|
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1049, __pyx_L5_except_error)
|
|
- __Pyx_GOTREF(__pyx_t_8);
|
|
- __Pyx_Raise(__pyx_t_8, 0, 0, 0);
|
|
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
|
|
- __PYX_ERR(1, 1049, __pyx_L5_except_error)
|
|
- }
|
|
- goto __pyx_L5_except_error;
|
|
- __pyx_L5_except_error:;
|
|
+ __pyx_t_6 = __pyx_v_self->ndim;
|
|
+ __pyx_v_info->ndim = __pyx_t_6;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1046
|
|
- *
|
|
- * cdef inline int import_ufunc() except -1:
|
|
- * try: # <<<<<<<<<<<<<<
|
|
- * _import_umath()
|
|
- * except Exception:
|
|
+ /* "View.MemoryView":197
|
|
+ * info.len = self.len
|
|
+ * info.ndim = self.ndim
|
|
+ * info.shape = self._shape # <<<<<<<<<<<<<<
|
|
+ * info.strides = self._strides
|
|
+ * info.suboffsets = NULL
|
|
*/
|
|
- __Pyx_XGIVEREF(__pyx_t_1);
|
|
- __Pyx_XGIVEREF(__pyx_t_2);
|
|
- __Pyx_XGIVEREF(__pyx_t_3);
|
|
- __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
|
|
- goto __pyx_L1_error;
|
|
- __pyx_L8_try_end:;
|
|
- }
|
|
+ __pyx_t_7 = __pyx_v_self->_shape;
|
|
+ __pyx_v_info->shape = __pyx_t_7;
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1045
|
|
- * raise ImportError("numpy.core.umath failed to import")
|
|
- *
|
|
- * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
|
|
- * try:
|
|
- * _import_umath()
|
|
+ /* "View.MemoryView":198
|
|
+ * info.ndim = self.ndim
|
|
+ * info.shape = self._shape
|
|
+ * info.strides = self._strides # <<<<<<<<<<<<<<
|
|
+ * info.suboffsets = NULL
|
|
+ * info.itemsize = self.itemsize
|
|
*/
|
|
+ __pyx_t_7 = __pyx_v_self->_strides;
|
|
+ __pyx_v_info->strides = __pyx_t_7;
|
|
|
|
- /* function exit code */
|
|
- __pyx_r = 0;
|
|
- goto __pyx_L0;
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_5);
|
|
- __Pyx_XDECREF(__pyx_t_6);
|
|
- __Pyx_XDECREF(__pyx_t_7);
|
|
- __Pyx_XDECREF(__pyx_t_8);
|
|
- __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = -1;
|
|
- __pyx_L0:;
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
+ /* "View.MemoryView":199
|
|
+ * info.shape = self._shape
|
|
+ * info.strides = self._strides
|
|
+ * info.suboffsets = NULL # <<<<<<<<<<<<<<
|
|
+ * info.itemsize = self.itemsize
|
|
+ * info.readonly = 0
|
|
+ */
|
|
+ __pyx_v_info->suboffsets = NULL;
|
|
|
|
-/* "View.MemoryView":122
|
|
- * cdef bint dtype_is_object
|
|
+ /* "View.MemoryView":200
|
|
+ * info.strides = self._strides
|
|
+ * info.suboffsets = NULL
|
|
+ * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
|
|
+ * info.readonly = 0
|
|
*
|
|
- * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
|
|
- * mode="c", bint allocate_buffer=True):
|
|
+ */
|
|
+ __pyx_t_5 = __pyx_v_self->itemsize;
|
|
+ __pyx_v_info->itemsize = __pyx_t_5;
|
|
+
|
|
+ /* "View.MemoryView":201
|
|
+ * info.suboffsets = NULL
|
|
+ * info.itemsize = self.itemsize
|
|
+ * info.readonly = 0 # <<<<<<<<<<<<<<
|
|
*
|
|
+ * if flags & PyBUF_FORMAT:
|
|
*/
|
|
+ __pyx_v_info->readonly = 0;
|
|
|
|
-/* Python wrapper */
|
|
-static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
-static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
- PyObject *__pyx_v_shape = 0;
|
|
- Py_ssize_t __pyx_v_itemsize;
|
|
- PyObject *__pyx_v_format = 0;
|
|
- PyObject *__pyx_v_mode = 0;
|
|
- int __pyx_v_allocate_buffer;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- int __pyx_r;
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
|
|
- {
|
|
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
|
|
- PyObject* values[5] = {0,0,0,0,0};
|
|
- values[3] = ((PyObject *)__pyx_n_s_c);
|
|
- 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_shape)) != 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_itemsize)) != 0)) kw_args--;
|
|
- else {
|
|
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 122, __pyx_L3_error)
|
|
- }
|
|
- CYTHON_FALLTHROUGH;
|
|
- case 2:
|
|
- if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
|
|
- else {
|
|
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 122, __pyx_L3_error)
|
|
- }
|
|
- CYTHON_FALLTHROUGH;
|
|
- case 3:
|
|
- if (kw_args > 0) {
|
|
- PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
|
|
- if (value) { values[3] = value; kw_args--; }
|
|
- }
|
|
- CYTHON_FALLTHROUGH;
|
|
- case 4:
|
|
- if (kw_args > 0) {
|
|
- PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
|
|
- if (value) { values[4] = value; kw_args--; }
|
|
- }
|
|
- }
|
|
- if (unlikely(kw_args > 0)) {
|
|
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 122, __pyx_L3_error)
|
|
- }
|
|
- } else {
|
|
- switch (PyTuple_GET_SIZE(__pyx_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);
|
|
- 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_shape = ((PyObject*)values[0]);
|
|
- __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 122, __pyx_L3_error)
|
|
- __pyx_v_format = values[2];
|
|
- __pyx_v_mode = values[3];
|
|
- if (values[4]) {
|
|
- __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L3_error)
|
|
- } else {
|
|
+ /* "View.MemoryView":203
|
|
+ * info.readonly = 0
|
|
+ *
|
|
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
|
|
+ * info.format = self.format
|
|
+ * else:
|
|
+ */
|
|
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":123
|
|
+ /* "View.MemoryView":204
|
|
*
|
|
- * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
|
|
- * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
|
|
+ * if flags & PyBUF_FORMAT:
|
|
+ * info.format = self.format # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * info.format = NULL
|
|
+ */
|
|
+ __pyx_t_4 = __pyx_v_self->format;
|
|
+ __pyx_v_info->format = __pyx_t_4;
|
|
+
|
|
+ /* "View.MemoryView":203
|
|
+ * info.readonly = 0
|
|
*
|
|
- * cdef int idx
|
|
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
|
|
+ * info.format = self.format
|
|
+ * else:
|
|
*/
|
|
- __pyx_v_allocate_buffer = ((int)1);
|
|
- }
|
|
+ goto __pyx_L5;
|
|
}
|
|
- goto __pyx_L4_argument_unpacking_done;
|
|
- __pyx_L5_argtuple_error:;
|
|
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 122, __pyx_L3_error)
|
|
- __pyx_L3_error:;
|
|
- __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return -1;
|
|
- __pyx_L4_argument_unpacking_done:;
|
|
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 122, __pyx_L1_error)
|
|
- if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
|
|
- PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 122, __pyx_L1_error)
|
|
+
|
|
+ /* "View.MemoryView":206
|
|
+ * info.format = self.format
|
|
+ * else:
|
|
+ * info.format = NULL # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * info.obj = self
|
|
+ */
|
|
+ /*else*/ {
|
|
+ __pyx_v_info->format = NULL;
|
|
}
|
|
- __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
|
|
+ __pyx_L5:;
|
|
|
|
- /* "View.MemoryView":122
|
|
- * cdef bint dtype_is_object
|
|
+ /* "View.MemoryView":208
|
|
+ * info.format = NULL
|
|
*
|
|
- * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
|
|
- * mode="c", bint allocate_buffer=True):
|
|
+ * info.obj = self # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
|
|
+ */
|
|
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
|
|
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
|
|
+ __Pyx_GOTREF(__pyx_v_info->obj);
|
|
+ __Pyx_DECREF(__pyx_v_info->obj);
|
|
+ __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
|
|
+
|
|
+ /* "View.MemoryView":186
|
|
*
|
|
+ * @cname('getbuffer')
|
|
+ * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
|
|
+ * cdef int bufmode = -1
|
|
+ * if self.mode == u"c":
|
|
*/
|
|
|
|
/* function exit code */
|
|
+ __pyx_r = 0;
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_3);
|
|
+ __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = -1;
|
|
+ if (__pyx_v_info->obj != NULL) {
|
|
+ __Pyx_GOTREF(__pyx_v_info->obj);
|
|
+ __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
|
|
+ }
|
|
+ goto __pyx_L2;
|
|
__pyx_L0:;
|
|
+ if (__pyx_v_info->obj == Py_None) {
|
|
+ __Pyx_GOTREF(__pyx_v_info->obj);
|
|
+ __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
|
|
+ }
|
|
+ __pyx_L2:;
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-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) {
|
|
- int __pyx_v_idx;
|
|
- Py_ssize_t __pyx_v_i;
|
|
- Py_ssize_t __pyx_v_dim;
|
|
- PyObject **__pyx_v_p;
|
|
- char __pyx_v_order;
|
|
- int __pyx_r;
|
|
- __Pyx_RefNannyDeclarations
|
|
- Py_ssize_t __pyx_t_1;
|
|
- int __pyx_t_2;
|
|
- PyObject *__pyx_t_3 = NULL;
|
|
- int __pyx_t_4;
|
|
- PyObject *__pyx_t_5 = NULL;
|
|
- PyObject *__pyx_t_6 = NULL;
|
|
- char *__pyx_t_7;
|
|
- int __pyx_t_8;
|
|
- Py_ssize_t __pyx_t_9;
|
|
- PyObject *__pyx_t_10 = NULL;
|
|
- Py_ssize_t __pyx_t_11;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__cinit__", 0);
|
|
- __Pyx_INCREF(__pyx_v_format);
|
|
-
|
|
- /* "View.MemoryView":129
|
|
- * cdef PyObject **p
|
|
- *
|
|
- * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
|
|
- * self.itemsize = itemsize
|
|
+/* "View.MemoryView":212
|
|
+ * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
|
|
*
|
|
+ * def __dealloc__(array self): # <<<<<<<<<<<<<<
|
|
+ * if self.callback_free_data != NULL:
|
|
+ * self.callback_free_data(self.data)
|
|
*/
|
|
- if (unlikely(__pyx_v_shape == Py_None)) {
|
|
- PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
|
|
- __PYX_ERR(2, 129, __pyx_L1_error)
|
|
- }
|
|
- __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 129, __pyx_L1_error)
|
|
- __pyx_v_self->ndim = ((int)__pyx_t_1);
|
|
|
|
- /* "View.MemoryView":130
|
|
- *
|
|
- * self.ndim = <int> len(shape)
|
|
- * self.itemsize = itemsize # <<<<<<<<<<<<<<
|
|
- *
|
|
- * if not self.ndim:
|
|
- */
|
|
- __pyx_v_self->itemsize = __pyx_v_itemsize;
|
|
+/* Python wrapper */
|
|
+static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
|
|
+static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
|
|
+ __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
|
|
|
|
- /* "View.MemoryView":132
|
|
- * self.itemsize = itemsize
|
|
- *
|
|
- * if not self.ndim: # <<<<<<<<<<<<<<
|
|
- * raise ValueError("Empty shape tuple for cython.array")
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+}
|
|
+
|
|
+static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ int __pyx_t_1;
|
|
+ __Pyx_RefNannySetupContext("__dealloc__", 0);
|
|
+
|
|
+ /* "View.MemoryView":213
|
|
*
|
|
+ * def __dealloc__(array self):
|
|
+ * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
|
|
+ * self.callback_free_data(self.data)
|
|
+ * elif self.free_data:
|
|
*/
|
|
- __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
|
|
- if (unlikely(__pyx_t_2)) {
|
|
+ __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":133
|
|
- *
|
|
- * if not self.ndim:
|
|
- * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
|
|
- *
|
|
- * if itemsize <= 0:
|
|
+ /* "View.MemoryView":214
|
|
+ * def __dealloc__(array self):
|
|
+ * if self.callback_free_data != NULL:
|
|
+ * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
|
|
+ * elif self.free_data:
|
|
+ * if self.dtype_is_object:
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 133, __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(2, 133, __pyx_L1_error)
|
|
+ __pyx_v_self->callback_free_data(__pyx_v_self->data);
|
|
|
|
- /* "View.MemoryView":132
|
|
- * self.itemsize = itemsize
|
|
- *
|
|
- * if not self.ndim: # <<<<<<<<<<<<<<
|
|
- * raise ValueError("Empty shape tuple for cython.array")
|
|
+ /* "View.MemoryView":213
|
|
*
|
|
+ * def __dealloc__(array self):
|
|
+ * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
|
|
+ * self.callback_free_data(self.data)
|
|
+ * elif self.free_data:
|
|
*/
|
|
+ goto __pyx_L3;
|
|
}
|
|
|
|
- /* "View.MemoryView":135
|
|
- * raise ValueError("Empty shape tuple for cython.array")
|
|
- *
|
|
- * if itemsize <= 0: # <<<<<<<<<<<<<<
|
|
- * raise ValueError("itemsize <= 0 for cython.array")
|
|
- *
|
|
+ /* "View.MemoryView":215
|
|
+ * if self.callback_free_data != NULL:
|
|
+ * self.callback_free_data(self.data)
|
|
+ * elif self.free_data: # <<<<<<<<<<<<<<
|
|
+ * if self.dtype_is_object:
|
|
+ * refcount_objects_in_slice(self.data, self._shape,
|
|
*/
|
|
- __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
|
|
- if (unlikely(__pyx_t_2)) {
|
|
+ __pyx_t_1 = (__pyx_v_self->free_data != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":136
|
|
- *
|
|
- * if itemsize <= 0:
|
|
- * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
|
|
- *
|
|
- * if not isinstance(format, bytes):
|
|
+ /* "View.MemoryView":216
|
|
+ * self.callback_free_data(self.data)
|
|
+ * elif self.free_data:
|
|
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
|
|
+ * refcount_objects_in_slice(self.data, self._shape,
|
|
+ * self._strides, self.ndim, False)
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 136, __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(2, 136, __pyx_L1_error)
|
|
+ __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":135
|
|
- * raise ValueError("Empty shape tuple for cython.array")
|
|
- *
|
|
- * if itemsize <= 0: # <<<<<<<<<<<<<<
|
|
- * raise ValueError("itemsize <= 0 for cython.array")
|
|
- *
|
|
+ /* "View.MemoryView":217
|
|
+ * elif self.free_data:
|
|
+ * if self.dtype_is_object:
|
|
+ * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
|
|
+ * self._strides, self.ndim, False)
|
|
+ * free(self.data)
|
|
*/
|
|
- }
|
|
+ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
|
|
|
|
- /* "View.MemoryView":138
|
|
- * raise ValueError("itemsize <= 0 for cython.array")
|
|
- *
|
|
- * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
|
|
- * format = format.encode('ASCII')
|
|
- * self._format = format # keep a reference to the byte string
|
|
+ /* "View.MemoryView":216
|
|
+ * self.callback_free_data(self.data)
|
|
+ * elif self.free_data:
|
|
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
|
|
+ * refcount_objects_in_slice(self.data, self._shape,
|
|
+ * self._strides, self.ndim, False)
|
|
*/
|
|
- __pyx_t_2 = PyBytes_Check(__pyx_v_format);
|
|
- __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
|
|
- if (__pyx_t_4) {
|
|
+ }
|
|
|
|
- /* "View.MemoryView":139
|
|
+ /* "View.MemoryView":219
|
|
+ * refcount_objects_in_slice(self.data, self._shape,
|
|
+ * self._strides, self.ndim, False)
|
|
+ * free(self.data) # <<<<<<<<<<<<<<
|
|
+ * PyObject_Free(self._shape)
|
|
*
|
|
- * if not isinstance(format, bytes):
|
|
- * format = format.encode('ASCII') # <<<<<<<<<<<<<<
|
|
- * self._format = format # keep a reference to the byte string
|
|
- * self.format = self._format
|
|
*/
|
|
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 139, __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);
|
|
- }
|
|
- }
|
|
- __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
|
|
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
- if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 139, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
- __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
|
|
- __pyx_t_3 = 0;
|
|
+ free(__pyx_v_self->data);
|
|
|
|
- /* "View.MemoryView":138
|
|
- * raise ValueError("itemsize <= 0 for cython.array")
|
|
- *
|
|
- * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
|
|
- * format = format.encode('ASCII')
|
|
- * self._format = format # keep a reference to the byte string
|
|
+ /* "View.MemoryView":215
|
|
+ * if self.callback_free_data != NULL:
|
|
+ * self.callback_free_data(self.data)
|
|
+ * elif self.free_data: # <<<<<<<<<<<<<<
|
|
+ * if self.dtype_is_object:
|
|
+ * refcount_objects_in_slice(self.data, self._shape,
|
|
*/
|
|
}
|
|
+ __pyx_L3:;
|
|
|
|
- /* "View.MemoryView":140
|
|
- * if not isinstance(format, bytes):
|
|
- * format = format.encode('ASCII')
|
|
- * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
|
|
- * self.format = self._format
|
|
+ /* "View.MemoryView":220
|
|
+ * self._strides, self.ndim, False)
|
|
+ * free(self.data)
|
|
+ * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
|
|
*
|
|
+ * @property
|
|
*/
|
|
- if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 140, __pyx_L1_error)
|
|
- __pyx_t_3 = __pyx_v_format;
|
|
- __Pyx_INCREF(__pyx_t_3);
|
|
- __Pyx_GIVEREF(__pyx_t_3);
|
|
- __Pyx_GOTREF(__pyx_v_self->_format);
|
|
- __Pyx_DECREF(__pyx_v_self->_format);
|
|
- __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
|
|
- __pyx_t_3 = 0;
|
|
+ PyObject_Free(__pyx_v_self->_shape);
|
|
|
|
- /* "View.MemoryView":141
|
|
- * format = format.encode('ASCII')
|
|
- * self._format = format # keep a reference to the byte string
|
|
- * self.format = self._format # <<<<<<<<<<<<<<
|
|
- *
|
|
+ /* "View.MemoryView":212
|
|
+ * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
|
|
*
|
|
+ * def __dealloc__(array self): # <<<<<<<<<<<<<<
|
|
+ * if self.callback_free_data != NULL:
|
|
+ * self.callback_free_data(self.data)
|
|
*/
|
|
- if (unlikely(__pyx_v_self->_format == Py_None)) {
|
|
- PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
|
|
- __PYX_ERR(2, 141, __pyx_L1_error)
|
|
- }
|
|
- __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(2, 141, __pyx_L1_error)
|
|
- __pyx_v_self->format = __pyx_t_7;
|
|
|
|
- /* "View.MemoryView":144
|
|
- *
|
|
- *
|
|
- * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
|
|
- * self._strides = self._shape + self.ndim
|
|
- *
|
|
- */
|
|
- __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+}
|
|
|
|
- /* "View.MemoryView":145
|
|
+/* "View.MemoryView":223
|
|
*
|
|
- * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
|
|
- * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
|
|
+ * @property
|
|
+ * def memview(self): # <<<<<<<<<<<<<<
|
|
+ * return self.get_memview()
|
|
*
|
|
- * if not self._shape:
|
|
*/
|
|
- __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
|
|
|
|
- /* "View.MemoryView":147
|
|
- * self._strides = self._shape + self.ndim
|
|
- *
|
|
- * if not self._shape: # <<<<<<<<<<<<<<
|
|
- * raise MemoryError("unable to allocate shape and strides.")
|
|
+/* Python wrapper */
|
|
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
|
|
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
|
|
+ PyObject *__pyx_r = 0;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
|
|
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
|
|
+
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
|
|
+ PyObject *__pyx_r = NULL;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ PyObject *__pyx_t_1 = NULL;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("__get__", 0);
|
|
+
|
|
+ /* "View.MemoryView":224
|
|
+ * @property
|
|
+ * def memview(self):
|
|
+ * return self.get_memview() # <<<<<<<<<<<<<<
|
|
*
|
|
+ * @cname('get_memview')
|
|
*/
|
|
- __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
|
|
- if (unlikely(__pyx_t_4)) {
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 224, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_r = __pyx_t_1;
|
|
+ __pyx_t_1 = 0;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":148
|
|
- *
|
|
- * if not self._shape:
|
|
- * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":223
|
|
*
|
|
+ * @property
|
|
+ * def memview(self): # <<<<<<<<<<<<<<
|
|
+ * return self.get_memview()
|
|
*
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 148, __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(2, 148, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":147
|
|
- * self._strides = self._shape + self.ndim
|
|
- *
|
|
- * if not self._shape: # <<<<<<<<<<<<<<
|
|
- * raise MemoryError("unable to allocate shape and strides.")
|
|
+ /* function exit code */
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_1);
|
|
+ __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = NULL;
|
|
+ __pyx_L0:;
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+/* "View.MemoryView":227
|
|
*
|
|
+ * @cname('get_memview')
|
|
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
|
|
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
|
|
+ * return memoryview(self, flags, self.dtype_is_object)
|
|
*/
|
|
- }
|
|
|
|
- /* "View.MemoryView":151
|
|
- *
|
|
+static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
|
|
+ int __pyx_v_flags;
|
|
+ PyObject *__pyx_r = NULL;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ PyObject *__pyx_t_1 = NULL;
|
|
+ PyObject *__pyx_t_2 = NULL;
|
|
+ PyObject *__pyx_t_3 = NULL;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("get_memview", 0);
|
|
+
|
|
+ /* "View.MemoryView":228
|
|
+ * @cname('get_memview')
|
|
+ * cdef get_memview(self):
|
|
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
|
|
+ * return memoryview(self, flags, self.dtype_is_object)
|
|
*
|
|
- * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
|
|
- * if dim <= 0:
|
|
- * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
|
|
*/
|
|
- __pyx_t_8 = 0;
|
|
- __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
|
|
- for (;;) {
|
|
- if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
|
|
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
- __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 151, __pyx_L1_error)
|
|
- #else
|
|
- __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 151, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_5);
|
|
- #endif
|
|
- __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 151, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
- __pyx_v_dim = __pyx_t_9;
|
|
- __pyx_v_idx = __pyx_t_8;
|
|
- __pyx_t_8 = (__pyx_t_8 + 1);
|
|
+ __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
|
|
|
|
- /* "View.MemoryView":152
|
|
+ /* "View.MemoryView":229
|
|
+ * cdef get_memview(self):
|
|
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
|
|
+ * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
|
|
*
|
|
- * for idx, dim in enumerate(shape):
|
|
- * if dim <= 0: # <<<<<<<<<<<<<<
|
|
- * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
|
|
- * self._shape[idx] = dim
|
|
+ * def __len__(self):
|
|
*/
|
|
- __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
|
|
- if (unlikely(__pyx_t_4)) {
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 229, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 229, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 229, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
|
|
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
|
|
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
|
|
+ __Pyx_GIVEREF(__pyx_t_1);
|
|
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
|
|
+ __Pyx_GIVEREF(__pyx_t_2);
|
|
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
|
|
+ __pyx_t_1 = 0;
|
|
+ __pyx_t_2 = 0;
|
|
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 229, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
+ __pyx_r = __pyx_t_2;
|
|
+ __pyx_t_2 = 0;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":153
|
|
- * for idx, dim in enumerate(shape):
|
|
- * if dim <= 0:
|
|
- * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
|
|
- * self._shape[idx] = dim
|
|
+ /* "View.MemoryView":227
|
|
*
|
|
+ * @cname('get_memview')
|
|
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
|
|
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
|
|
+ * return memoryview(self, flags, self.dtype_is_object)
|
|
*/
|
|
- __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 153, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_5);
|
|
- __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 153, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_6);
|
|
- __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_10);
|
|
- __Pyx_GIVEREF(__pyx_t_5);
|
|
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
|
|
- __Pyx_GIVEREF(__pyx_t_6);
|
|
- PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
|
|
- __pyx_t_5 = 0;
|
|
- __pyx_t_6 = 0;
|
|
- __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 153, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_6);
|
|
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
- __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_10);
|
|
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
- __Pyx_Raise(__pyx_t_10, 0, 0, 0);
|
|
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
- __PYX_ERR(2, 153, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":152
|
|
+ /* function exit code */
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_1);
|
|
+ __Pyx_XDECREF(__pyx_t_2);
|
|
+ __Pyx_XDECREF(__pyx_t_3);
|
|
+ __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = 0;
|
|
+ __pyx_L0:;
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+/* "View.MemoryView":231
|
|
+ * return memoryview(self, flags, self.dtype_is_object)
|
|
+ *
|
|
+ * def __len__(self): # <<<<<<<<<<<<<<
|
|
+ * return self._shape[0]
|
|
*
|
|
- * for idx, dim in enumerate(shape):
|
|
- * if dim <= 0: # <<<<<<<<<<<<<<
|
|
- * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
|
|
- * self._shape[idx] = dim
|
|
*/
|
|
- }
|
|
|
|
- /* "View.MemoryView":154
|
|
- * if dim <= 0:
|
|
- * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
|
|
- * self._shape[idx] = dim # <<<<<<<<<<<<<<
|
|
+/* Python wrapper */
|
|
+static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
|
|
+static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
|
|
+ Py_ssize_t __pyx_r;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
|
|
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
|
|
+
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
|
|
+ Py_ssize_t __pyx_r;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ __Pyx_RefNannySetupContext("__len__", 0);
|
|
+
|
|
+ /* "View.MemoryView":232
|
|
*
|
|
- * cdef char order
|
|
+ * def __len__(self):
|
|
+ * return self._shape[0] # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * def __getattr__(self, attr):
|
|
*/
|
|
- (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
|
|
+ __pyx_r = (__pyx_v_self->_shape[0]);
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":151
|
|
+ /* "View.MemoryView":231
|
|
+ * return memoryview(self, flags, self.dtype_is_object)
|
|
*
|
|
+ * def __len__(self): # <<<<<<<<<<<<<<
|
|
+ * return self._shape[0]
|
|
*
|
|
- * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
|
|
- * if dim <= 0:
|
|
- * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
|
|
*/
|
|
- }
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
- /* "View.MemoryView":157
|
|
+ /* function exit code */
|
|
+ __pyx_L0:;
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+/* "View.MemoryView":234
|
|
+ * return self._shape[0]
|
|
+ *
|
|
+ * def __getattr__(self, attr): # <<<<<<<<<<<<<<
|
|
+ * return getattr(self.memview, attr)
|
|
*
|
|
- * cdef char order
|
|
- * if mode == 'fortran': # <<<<<<<<<<<<<<
|
|
- * order = b'F'
|
|
- * self.mode = u'fortran'
|
|
*/
|
|
- __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 157, __pyx_L1_error)
|
|
- if (__pyx_t_4) {
|
|
|
|
- /* "View.MemoryView":158
|
|
- * cdef char order
|
|
- * if mode == 'fortran':
|
|
- * order = b'F' # <<<<<<<<<<<<<<
|
|
- * self.mode = u'fortran'
|
|
- * elif mode == 'c':
|
|
- */
|
|
- __pyx_v_order = 'F';
|
|
+/* Python wrapper */
|
|
+static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
|
|
+static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
|
|
+ PyObject *__pyx_r = 0;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
|
|
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
|
|
|
|
- /* "View.MemoryView":159
|
|
- * if mode == 'fortran':
|
|
- * order = b'F'
|
|
- * self.mode = u'fortran' # <<<<<<<<<<<<<<
|
|
- * elif mode == 'c':
|
|
- * order = b'C'
|
|
- */
|
|
- __Pyx_INCREF(__pyx_n_u_fortran);
|
|
- __Pyx_GIVEREF(__pyx_n_u_fortran);
|
|
- __Pyx_GOTREF(__pyx_v_self->mode);
|
|
- __Pyx_DECREF(__pyx_v_self->mode);
|
|
- __pyx_v_self->mode = __pyx_n_u_fortran;
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
|
|
+ PyObject *__pyx_r = NULL;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ PyObject *__pyx_t_1 = NULL;
|
|
+ PyObject *__pyx_t_2 = NULL;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("__getattr__", 0);
|
|
|
|
- /* "View.MemoryView":157
|
|
+ /* "View.MemoryView":235
|
|
*
|
|
- * cdef char order
|
|
- * if mode == 'fortran': # <<<<<<<<<<<<<<
|
|
- * order = b'F'
|
|
- * self.mode = u'fortran'
|
|
+ * def __getattr__(self, attr):
|
|
+ * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * def __getitem__(self, item):
|
|
*/
|
|
- goto __pyx_L10;
|
|
- }
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 235, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 235, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __pyx_r = __pyx_t_2;
|
|
+ __pyx_t_2 = 0;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":160
|
|
- * order = b'F'
|
|
- * self.mode = u'fortran'
|
|
- * elif mode == 'c': # <<<<<<<<<<<<<<
|
|
- * order = b'C'
|
|
- * self.mode = u'c'
|
|
+ /* "View.MemoryView":234
|
|
+ * return self._shape[0]
|
|
+ *
|
|
+ * def __getattr__(self, attr): # <<<<<<<<<<<<<<
|
|
+ * return getattr(self.memview, attr)
|
|
+ *
|
|
*/
|
|
- __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 160, __pyx_L1_error)
|
|
- if (likely(__pyx_t_4)) {
|
|
|
|
- /* "View.MemoryView":161
|
|
- * self.mode = u'fortran'
|
|
- * elif mode == 'c':
|
|
- * order = b'C' # <<<<<<<<<<<<<<
|
|
- * self.mode = u'c'
|
|
- * else:
|
|
- */
|
|
- __pyx_v_order = 'C';
|
|
-
|
|
- /* "View.MemoryView":162
|
|
- * elif mode == 'c':
|
|
- * order = b'C'
|
|
- * self.mode = u'c' # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
|
|
- */
|
|
- __Pyx_INCREF(__pyx_n_u_c);
|
|
- __Pyx_GIVEREF(__pyx_n_u_c);
|
|
- __Pyx_GOTREF(__pyx_v_self->mode);
|
|
- __Pyx_DECREF(__pyx_v_self->mode);
|
|
- __pyx_v_self->mode = __pyx_n_u_c;
|
|
-
|
|
- /* "View.MemoryView":160
|
|
- * order = b'F'
|
|
- * self.mode = u'fortran'
|
|
- * elif mode == 'c': # <<<<<<<<<<<<<<
|
|
- * order = b'C'
|
|
- * self.mode = u'c'
|
|
- */
|
|
- goto __pyx_L10;
|
|
- }
|
|
-
|
|
- /* "View.MemoryView":164
|
|
- * self.mode = u'c'
|
|
- * else:
|
|
- * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
|
|
- *
|
|
- * self.len = fill_contig_strides_array(self._shape, self._strides,
|
|
- */
|
|
- /*else*/ {
|
|
- __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 164, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 164, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_10);
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __Pyx_Raise(__pyx_t_10, 0, 0, 0);
|
|
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
- __PYX_ERR(2, 164, __pyx_L1_error)
|
|
- }
|
|
- __pyx_L10:;
|
|
+ /* function exit code */
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_1);
|
|
+ __Pyx_XDECREF(__pyx_t_2);
|
|
+ __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = NULL;
|
|
+ __pyx_L0:;
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
|
|
- /* "View.MemoryView":166
|
|
- * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
|
|
+/* "View.MemoryView":237
|
|
+ * return getattr(self.memview, attr)
|
|
*
|
|
- * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
|
|
- * itemsize, self.ndim, order)
|
|
+ * def __getitem__(self, item): # <<<<<<<<<<<<<<
|
|
+ * return self.memview[item]
|
|
*
|
|
*/
|
|
- __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
|
|
|
|
- /* "View.MemoryView":169
|
|
- * itemsize, self.ndim, order)
|
|
- *
|
|
- * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
|
|
- * self.dtype_is_object = format == b'O'
|
|
- * if allocate_buffer:
|
|
- */
|
|
- __pyx_v_self->free_data = __pyx_v_allocate_buffer;
|
|
+/* Python wrapper */
|
|
+static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
|
|
+static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
|
|
+ PyObject *__pyx_r = 0;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
|
|
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
|
|
|
|
- /* "View.MemoryView":170
|
|
- *
|
|
- * self.free_data = allocate_buffer
|
|
- * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
|
|
- * if allocate_buffer:
|
|
- *
|
|
- */
|
|
- __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 170, __pyx_L1_error)
|
|
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 170, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
- __pyx_v_self->dtype_is_object = __pyx_t_4;
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
|
|
- /* "View.MemoryView":171
|
|
- * self.free_data = allocate_buffer
|
|
- * self.dtype_is_object = format == b'O'
|
|
- * if allocate_buffer: # <<<<<<<<<<<<<<
|
|
- *
|
|
- *
|
|
- */
|
|
- __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
|
|
- if (__pyx_t_4) {
|
|
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
|
|
+ PyObject *__pyx_r = NULL;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ PyObject *__pyx_t_1 = NULL;
|
|
+ PyObject *__pyx_t_2 = NULL;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("__getitem__", 0);
|
|
|
|
- /* "View.MemoryView":174
|
|
+ /* "View.MemoryView":238
|
|
*
|
|
+ * def __getitem__(self, item):
|
|
+ * return self.memview[item] # <<<<<<<<<<<<<<
|
|
*
|
|
- * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
|
|
- * if not self.data:
|
|
- * raise MemoryError("unable to allocate array data.")
|
|
+ * def __setitem__(self, item, value):
|
|
*/
|
|
- __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 238, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 238, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __pyx_r = __pyx_t_2;
|
|
+ __pyx_t_2 = 0;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":175
|
|
- *
|
|
- * self.data = <char *>malloc(self.len)
|
|
- * if not self.data: # <<<<<<<<<<<<<<
|
|
- * raise MemoryError("unable to allocate array data.")
|
|
+ /* "View.MemoryView":237
|
|
+ * return getattr(self.memview, attr)
|
|
*
|
|
- */
|
|
- __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
|
|
- if (unlikely(__pyx_t_4)) {
|
|
-
|
|
- /* "View.MemoryView":176
|
|
- * self.data = <char *>malloc(self.len)
|
|
- * if not self.data:
|
|
- * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
|
|
+ * def __getitem__(self, item): # <<<<<<<<<<<<<<
|
|
+ * return self.memview[item]
|
|
*
|
|
- * if self.dtype_is_object:
|
|
*/
|
|
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 176, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_10);
|
|
- __Pyx_Raise(__pyx_t_10, 0, 0, 0);
|
|
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
- __PYX_ERR(2, 176, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":175
|
|
- *
|
|
- * self.data = <char *>malloc(self.len)
|
|
- * if not self.data: # <<<<<<<<<<<<<<
|
|
- * raise MemoryError("unable to allocate array data.")
|
|
- *
|
|
- */
|
|
- }
|
|
+ /* function exit code */
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_1);
|
|
+ __Pyx_XDECREF(__pyx_t_2);
|
|
+ __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = NULL;
|
|
+ __pyx_L0:;
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
|
|
- /* "View.MemoryView":178
|
|
- * raise MemoryError("unable to allocate array data.")
|
|
+/* "View.MemoryView":240
|
|
+ * return self.memview[item]
|
|
*
|
|
- * if self.dtype_is_object: # <<<<<<<<<<<<<<
|
|
- * p = <PyObject **> self.data
|
|
- * for i in range(self.len / itemsize):
|
|
- */
|
|
- __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
|
|
- if (__pyx_t_4) {
|
|
-
|
|
- /* "View.MemoryView":179
|
|
+ * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
|
|
+ * self.memview[item] = value
|
|
*
|
|
- * if self.dtype_is_object:
|
|
- * p = <PyObject **> self.data # <<<<<<<<<<<<<<
|
|
- * for i in range(self.len / itemsize):
|
|
- * p[i] = Py_None
|
|
*/
|
|
- __pyx_v_p = ((PyObject **)__pyx_v_self->data);
|
|
|
|
- /* "View.MemoryView":180
|
|
- * if self.dtype_is_object:
|
|
- * p = <PyObject **> self.data
|
|
- * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
|
|
- * p[i] = Py_None
|
|
- * Py_INCREF(Py_None)
|
|
- */
|
|
- if (unlikely(__pyx_v_itemsize == 0)) {
|
|
- PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
|
|
- __PYX_ERR(2, 180, __pyx_L1_error)
|
|
- }
|
|
- else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
|
|
- PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
|
|
- __PYX_ERR(2, 180, __pyx_L1_error)
|
|
- }
|
|
- __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
|
|
- __pyx_t_9 = __pyx_t_1;
|
|
- for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
|
|
- __pyx_v_i = __pyx_t_11;
|
|
+/* Python wrapper */
|
|
+static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
|
|
+static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
|
|
+ int __pyx_r;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
|
|
+ __pyx_r = __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));
|
|
|
|
- /* "View.MemoryView":181
|
|
- * p = <PyObject **> self.data
|
|
- * for i in range(self.len / itemsize):
|
|
- * p[i] = Py_None # <<<<<<<<<<<<<<
|
|
- * Py_INCREF(Py_None)
|
|
- *
|
|
- */
|
|
- (__pyx_v_p[__pyx_v_i]) = Py_None;
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
|
|
- /* "View.MemoryView":182
|
|
- * for i in range(self.len / itemsize):
|
|
- * p[i] = Py_None
|
|
- * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
|
|
- *
|
|
- * @cname('getbuffer')
|
|
- */
|
|
- Py_INCREF(Py_None);
|
|
- }
|
|
+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) {
|
|
+ int __pyx_r;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ PyObject *__pyx_t_1 = NULL;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("__setitem__", 0);
|
|
|
|
- /* "View.MemoryView":178
|
|
- * raise MemoryError("unable to allocate array data.")
|
|
+ /* "View.MemoryView":241
|
|
*
|
|
- * if self.dtype_is_object: # <<<<<<<<<<<<<<
|
|
- * p = <PyObject **> self.data
|
|
- * for i in range(self.len / itemsize):
|
|
- */
|
|
- }
|
|
-
|
|
- /* "View.MemoryView":171
|
|
- * self.free_data = allocate_buffer
|
|
- * self.dtype_is_object = format == b'O'
|
|
- * if allocate_buffer: # <<<<<<<<<<<<<<
|
|
+ * def __setitem__(self, item, value):
|
|
+ * self.memview[item] = value # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- }
|
|
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 241, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 241, __pyx_L1_error)
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
|
|
- /* "View.MemoryView":122
|
|
- * cdef bint dtype_is_object
|
|
+ /* "View.MemoryView":240
|
|
+ * return self.memview[item]
|
|
*
|
|
- * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
|
|
- * mode="c", bint allocate_buffer=True):
|
|
+ * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
|
|
+ * self.memview[item] = value
|
|
*
|
|
*/
|
|
|
|
@@ -6824,710 +6276,734 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __
|
|
__pyx_r = 0;
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_3);
|
|
- __Pyx_XDECREF(__pyx_t_5);
|
|
- __Pyx_XDECREF(__pyx_t_6);
|
|
- __Pyx_XDECREF(__pyx_t_10);
|
|
- __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = -1;
|
|
+ __Pyx_XDECREF(__pyx_t_1);
|
|
+ __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = -1;
|
|
__pyx_L0:;
|
|
- __Pyx_XDECREF(__pyx_v_format);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":185
|
|
- *
|
|
- * @cname('getbuffer')
|
|
- * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
|
|
- * cdef int bufmode = -1
|
|
- * if self.mode == u"c":
|
|
+/* "(tree fragment)":1
|
|
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
+ * def __setstate_cython__(self, __pyx_state):
|
|
*/
|
|
|
|
/* Python wrapper */
|
|
-static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
|
|
-static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
|
|
- int __pyx_r;
|
|
+static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
+static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
|
|
+ PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
|
|
- __pyx_r = __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));
|
|
+ __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
|
|
+ __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
|
|
|
|
/* function exit code */
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-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) {
|
|
- int __pyx_v_bufmode;
|
|
- int __pyx_r;
|
|
+static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
|
|
+ PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
- int __pyx_t_1;
|
|
- int __pyx_t_2;
|
|
- PyObject *__pyx_t_3 = NULL;
|
|
- char *__pyx_t_4;
|
|
- Py_ssize_t __pyx_t_5;
|
|
- int __pyx_t_6;
|
|
- Py_ssize_t *__pyx_t_7;
|
|
+ PyObject *__pyx_t_1 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- if (__pyx_v_info == NULL) {
|
|
- PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
|
|
- return -1;
|
|
- }
|
|
- __Pyx_RefNannySetupContext("__getbuffer__", 0);
|
|
- __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
|
|
- __Pyx_GIVEREF(__pyx_v_info->obj);
|
|
+ __Pyx_RefNannySetupContext("__reduce_cython__", 0);
|
|
|
|
- /* "View.MemoryView":186
|
|
- * @cname('getbuffer')
|
|
- * def __getbuffer__(self, Py_buffer *info, int flags):
|
|
- * cdef int bufmode = -1 # <<<<<<<<<<<<<<
|
|
- * if self.mode == u"c":
|
|
- * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
+ /* "(tree fragment)":2
|
|
+ * def __reduce_cython__(self):
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
|
|
+ * def __setstate_cython__(self, __pyx_state):
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
*/
|
|
- __pyx_v_bufmode = -1;
|
|
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __PYX_ERR(2, 2, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":187
|
|
- * def __getbuffer__(self, Py_buffer *info, int flags):
|
|
- * cdef int bufmode = -1
|
|
- * if self.mode == u"c": # <<<<<<<<<<<<<<
|
|
- * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
- * elif self.mode == u"fortran":
|
|
+ /* "(tree fragment)":1
|
|
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
+ * def __setstate_cython__(self, __pyx_state):
|
|
*/
|
|
- __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 187, __pyx_L1_error)
|
|
- __pyx_t_2 = (__pyx_t_1 != 0);
|
|
- if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":188
|
|
- * cdef int bufmode = -1
|
|
- * if self.mode == u"c":
|
|
- * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
|
|
- * elif self.mode == u"fortran":
|
|
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
- */
|
|
- __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
|
|
+ /* function exit code */
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_1);
|
|
+ __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = NULL;
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
|
|
- /* "View.MemoryView":187
|
|
- * def __getbuffer__(self, Py_buffer *info, int flags):
|
|
- * cdef int bufmode = -1
|
|
- * if self.mode == u"c": # <<<<<<<<<<<<<<
|
|
- * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
- * elif self.mode == u"fortran":
|
|
+/* "(tree fragment)":3
|
|
+ * def __reduce_cython__(self):
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
*/
|
|
- goto __pyx_L3;
|
|
- }
|
|
|
|
- /* "View.MemoryView":189
|
|
- * if self.mode == u"c":
|
|
- * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
- * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
|
|
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
- * if not (flags & bufmode):
|
|
- */
|
|
- __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 189, __pyx_L1_error)
|
|
- __pyx_t_1 = (__pyx_t_2 != 0);
|
|
- if (__pyx_t_1) {
|
|
+/* Python wrapper */
|
|
+static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
|
|
+static PyObject *__pyx_pw___pyx_array_3__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___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
|
|
|
|
- /* "View.MemoryView":190
|
|
- * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
- * elif self.mode == u"fortran":
|
|
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
|
|
- * if not (flags & bufmode):
|
|
- * raise ValueError("Can only create a buffer that is contiguous in memory.")
|
|
- */
|
|
- __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
|
|
- /* "View.MemoryView":189
|
|
- * if self.mode == u"c":
|
|
- * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
- * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
|
|
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
- * if not (flags & bufmode):
|
|
- */
|
|
- }
|
|
- __pyx_L3:;
|
|
+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) {
|
|
+ PyObject *__pyx_r = NULL;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ PyObject *__pyx_t_1 = NULL;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("__setstate_cython__", 0);
|
|
|
|
- /* "View.MemoryView":191
|
|
- * elif self.mode == u"fortran":
|
|
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
- * if not (flags & bufmode): # <<<<<<<<<<<<<<
|
|
- * raise ValueError("Can only create a buffer that is contiguous in memory.")
|
|
- * info.buf = self.data
|
|
+ /* "(tree fragment)":4
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
+ * def __setstate_cython__(self, __pyx_state):
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
|
|
*/
|
|
- __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
|
|
- if (unlikely(__pyx_t_1)) {
|
|
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __PYX_ERR(2, 4, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":192
|
|
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
- * if not (flags & bufmode):
|
|
- * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
|
|
- * info.buf = self.data
|
|
- * info.len = self.len
|
|
+ /* "(tree fragment)":3
|
|
+ * def __reduce_cython__(self):
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 192, __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(2, 192, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":191
|
|
- * elif self.mode == u"fortran":
|
|
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
- * if not (flags & bufmode): # <<<<<<<<<<<<<<
|
|
- * raise ValueError("Can only create a buffer that is contiguous in memory.")
|
|
- * info.buf = self.data
|
|
- */
|
|
- }
|
|
+ /* function exit code */
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_1);
|
|
+ __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = NULL;
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
|
|
- /* "View.MemoryView":193
|
|
- * if not (flags & bufmode):
|
|
- * raise ValueError("Can only create a buffer that is contiguous in memory.")
|
|
- * info.buf = self.data # <<<<<<<<<<<<<<
|
|
- * info.len = self.len
|
|
- * info.ndim = self.ndim
|
|
+/* "View.MemoryView":245
|
|
+ *
|
|
+ * @cname("__pyx_array_new")
|
|
+ * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
|
|
+ * char *mode, char *buf):
|
|
+ * cdef array result
|
|
*/
|
|
- __pyx_t_4 = __pyx_v_self->data;
|
|
- __pyx_v_info->buf = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":194
|
|
- * raise ValueError("Can only create a buffer that is contiguous in memory.")
|
|
- * info.buf = self.data
|
|
- * info.len = self.len # <<<<<<<<<<<<<<
|
|
- * info.ndim = self.ndim
|
|
- * info.shape = self._shape
|
|
- */
|
|
- __pyx_t_5 = __pyx_v_self->len;
|
|
- __pyx_v_info->len = __pyx_t_5;
|
|
+static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
|
|
+ struct __pyx_array_obj *__pyx_v_result = 0;
|
|
+ struct __pyx_array_obj *__pyx_r = NULL;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ int __pyx_t_1;
|
|
+ PyObject *__pyx_t_2 = NULL;
|
|
+ PyObject *__pyx_t_3 = NULL;
|
|
+ PyObject *__pyx_t_4 = NULL;
|
|
+ PyObject *__pyx_t_5 = NULL;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("array_cwrapper", 0);
|
|
|
|
- /* "View.MemoryView":195
|
|
- * info.buf = self.data
|
|
- * info.len = self.len
|
|
- * info.ndim = self.ndim # <<<<<<<<<<<<<<
|
|
- * info.shape = self._shape
|
|
- * info.strides = self._strides
|
|
+ /* "View.MemoryView":249
|
|
+ * cdef array result
|
|
+ *
|
|
+ * if buf == NULL: # <<<<<<<<<<<<<<
|
|
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
|
|
+ * else:
|
|
*/
|
|
- __pyx_t_6 = __pyx_v_self->ndim;
|
|
- __pyx_v_info->ndim = __pyx_t_6;
|
|
+ __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":196
|
|
- * info.len = self.len
|
|
- * info.ndim = self.ndim
|
|
- * info.shape = self._shape # <<<<<<<<<<<<<<
|
|
- * info.strides = self._strides
|
|
- * info.suboffsets = NULL
|
|
+ /* "View.MemoryView":250
|
|
+ *
|
|
+ * if buf == NULL:
|
|
+ * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * result = array(shape, itemsize, format, mode.decode('ASCII'),
|
|
*/
|
|
- __pyx_t_7 = __pyx_v_self->_shape;
|
|
- __pyx_v_info->shape = __pyx_t_7;
|
|
-
|
|
- /* "View.MemoryView":197
|
|
- * info.ndim = self.ndim
|
|
- * info.shape = self._shape
|
|
- * info.strides = self._strides # <<<<<<<<<<<<<<
|
|
- * info.suboffsets = NULL
|
|
- * info.itemsize = self.itemsize
|
|
- */
|
|
- __pyx_t_7 = __pyx_v_self->_strides;
|
|
- __pyx_v_info->strides = __pyx_t_7;
|
|
-
|
|
- /* "View.MemoryView":198
|
|
- * info.shape = self._shape
|
|
- * info.strides = self._strides
|
|
- * info.suboffsets = NULL # <<<<<<<<<<<<<<
|
|
- * info.itemsize = self.itemsize
|
|
- * info.readonly = 0
|
|
- */
|
|
- __pyx_v_info->suboffsets = NULL;
|
|
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 250, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 250, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 250, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 250, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_5);
|
|
+ __Pyx_INCREF(__pyx_v_shape);
|
|
+ __Pyx_GIVEREF(__pyx_v_shape);
|
|
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
|
|
+ __Pyx_GIVEREF(__pyx_t_2);
|
|
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
|
|
+ __Pyx_GIVEREF(__pyx_t_3);
|
|
+ PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
|
|
+ __Pyx_GIVEREF(__pyx_t_4);
|
|
+ PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
|
|
+ __pyx_t_2 = 0;
|
|
+ __pyx_t_3 = 0;
|
|
+ __pyx_t_4 = 0;
|
|
+ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 250, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
+ __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
|
|
+ __pyx_t_4 = 0;
|
|
|
|
- /* "View.MemoryView":199
|
|
- * info.strides = self._strides
|
|
- * info.suboffsets = NULL
|
|
- * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
|
|
- * info.readonly = 0
|
|
+ /* "View.MemoryView":249
|
|
+ * cdef array result
|
|
*
|
|
+ * if buf == NULL: # <<<<<<<<<<<<<<
|
|
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
|
|
+ * else:
|
|
*/
|
|
- __pyx_t_5 = __pyx_v_self->itemsize;
|
|
- __pyx_v_info->itemsize = __pyx_t_5;
|
|
+ goto __pyx_L3;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":200
|
|
- * info.suboffsets = NULL
|
|
- * info.itemsize = self.itemsize
|
|
- * info.readonly = 0 # <<<<<<<<<<<<<<
|
|
- *
|
|
- * if flags & PyBUF_FORMAT:
|
|
+ /* "View.MemoryView":252
|
|
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
|
|
+ * else:
|
|
+ * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
|
|
+ * allocate_buffer=False)
|
|
+ * result.data = buf
|
|
*/
|
|
- __pyx_v_info->readonly = 0;
|
|
+ /*else*/ {
|
|
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 252, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 252, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_5);
|
|
+ __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 252, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 252, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __Pyx_INCREF(__pyx_v_shape);
|
|
+ __Pyx_GIVEREF(__pyx_v_shape);
|
|
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
|
|
+ __Pyx_GIVEREF(__pyx_t_4);
|
|
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
|
|
+ __Pyx_GIVEREF(__pyx_t_5);
|
|
+ PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
|
|
+ __Pyx_GIVEREF(__pyx_t_3);
|
|
+ PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
|
|
+ __pyx_t_4 = 0;
|
|
+ __pyx_t_5 = 0;
|
|
+ __pyx_t_3 = 0;
|
|
|
|
- /* "View.MemoryView":202
|
|
- * info.readonly = 0
|
|
+ /* "View.MemoryView":253
|
|
+ * else:
|
|
+ * result = array(shape, itemsize, format, mode.decode('ASCII'),
|
|
+ * allocate_buffer=False) # <<<<<<<<<<<<<<
|
|
+ * result.data = buf
|
|
*
|
|
- * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
|
|
- * info.format = self.format
|
|
- * else:
|
|
*/
|
|
- __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
|
|
- if (__pyx_t_1) {
|
|
+ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 253, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 253, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":203
|
|
- *
|
|
- * if flags & PyBUF_FORMAT:
|
|
- * info.format = self.format # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * info.format = NULL
|
|
+ /* "View.MemoryView":252
|
|
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
|
|
+ * else:
|
|
+ * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
|
|
+ * allocate_buffer=False)
|
|
+ * result.data = buf
|
|
*/
|
|
- __pyx_t_4 = __pyx_v_self->format;
|
|
- __pyx_v_info->format = __pyx_t_4;
|
|
+ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 252, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_5);
|
|
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
+ __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
|
|
+ __pyx_t_5 = 0;
|
|
|
|
- /* "View.MemoryView":202
|
|
- * info.readonly = 0
|
|
+ /* "View.MemoryView":254
|
|
+ * result = array(shape, itemsize, format, mode.decode('ASCII'),
|
|
+ * allocate_buffer=False)
|
|
+ * result.data = buf # <<<<<<<<<<<<<<
|
|
*
|
|
- * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
|
|
- * info.format = self.format
|
|
- * else:
|
|
+ * return result
|
|
*/
|
|
- goto __pyx_L5;
|
|
+ __pyx_v_result->data = __pyx_v_buf;
|
|
}
|
|
+ __pyx_L3:;
|
|
|
|
- /* "View.MemoryView":205
|
|
- * info.format = self.format
|
|
- * else:
|
|
- * info.format = NULL # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":256
|
|
+ * result.data = buf
|
|
*
|
|
- * info.obj = self
|
|
- */
|
|
- /*else*/ {
|
|
- __pyx_v_info->format = NULL;
|
|
- }
|
|
- __pyx_L5:;
|
|
-
|
|
- /* "View.MemoryView":207
|
|
- * info.format = NULL
|
|
+ * return result # <<<<<<<<<<<<<<
|
|
*
|
|
- * info.obj = self # <<<<<<<<<<<<<<
|
|
*
|
|
- * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
|
|
*/
|
|
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
|
|
- __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
|
|
- __Pyx_GOTREF(__pyx_v_info->obj);
|
|
- __Pyx_DECREF(__pyx_v_info->obj);
|
|
- __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
|
|
+ __Pyx_XDECREF(((PyObject *)__pyx_r));
|
|
+ __Pyx_INCREF(((PyObject *)__pyx_v_result));
|
|
+ __pyx_r = __pyx_v_result;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":185
|
|
+ /* "View.MemoryView":245
|
|
*
|
|
- * @cname('getbuffer')
|
|
- * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
|
|
- * cdef int bufmode = -1
|
|
- * if self.mode == u"c":
|
|
+ * @cname("__pyx_array_new")
|
|
+ * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
|
|
+ * char *mode, char *buf):
|
|
+ * cdef array result
|
|
*/
|
|
|
|
/* function exit code */
|
|
- __pyx_r = 0;
|
|
- goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_2);
|
|
__Pyx_XDECREF(__pyx_t_3);
|
|
- __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = -1;
|
|
- if (__pyx_v_info->obj != NULL) {
|
|
- __Pyx_GOTREF(__pyx_v_info->obj);
|
|
- __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
|
|
- }
|
|
- goto __pyx_L2;
|
|
+ __Pyx_XDECREF(__pyx_t_4);
|
|
+ __Pyx_XDECREF(__pyx_t_5);
|
|
+ __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = 0;
|
|
__pyx_L0:;
|
|
- if (__pyx_v_info->obj == Py_None) {
|
|
- __Pyx_GOTREF(__pyx_v_info->obj);
|
|
- __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
|
|
- }
|
|
- __pyx_L2:;
|
|
+ __Pyx_XDECREF((PyObject *)__pyx_v_result);
|
|
+ __Pyx_XGIVEREF((PyObject *)__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":211
|
|
- * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
|
|
- *
|
|
- * def __dealloc__(array self): # <<<<<<<<<<<<<<
|
|
- * if self.callback_free_data != NULL:
|
|
- * self.callback_free_data(self.data)
|
|
+/* "View.MemoryView":282
|
|
+ * cdef class Enum(object):
|
|
+ * cdef object name
|
|
+ * def __init__(self, name): # <<<<<<<<<<<<<<
|
|
+ * self.name = name
|
|
+ * def __repr__(self):
|
|
*/
|
|
|
|
/* Python wrapper */
|
|
-static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
|
|
-static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
|
|
+static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
+static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
+ PyObject *__pyx_v_name = 0;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
|
|
- __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
|
|
+ __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
|
|
+ {
|
|
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
|
|
+ PyObject* values[1] = {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 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_name)) != 0)) kw_args--;
|
|
+ else goto __pyx_L5_argtuple_error;
|
|
+ }
|
|
+ if (unlikely(kw_args > 0)) {
|
|
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 282, __pyx_L3_error)
|
|
+ }
|
|
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
|
|
+ goto __pyx_L5_argtuple_error;
|
|
+ } else {
|
|
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
|
|
+ }
|
|
+ __pyx_v_name = values[0];
|
|
+ }
|
|
+ goto __pyx_L4_argument_unpacking_done;
|
|
+ __pyx_L5_argtuple_error:;
|
|
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 282, __pyx_L3_error)
|
|
+ __pyx_L3_error:;
|
|
+ __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return -1;
|
|
+ __pyx_L4_argument_unpacking_done:;
|
|
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
|
|
|
|
/* function exit code */
|
|
__Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
}
|
|
|
|
-static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
|
|
+static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
|
|
+ int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
- int __pyx_t_1;
|
|
- __Pyx_RefNannySetupContext("__dealloc__", 0);
|
|
+ __Pyx_RefNannySetupContext("__init__", 0);
|
|
|
|
- /* "View.MemoryView":212
|
|
- *
|
|
- * def __dealloc__(array self):
|
|
- * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
|
|
- * self.callback_free_data(self.data)
|
|
- * elif self.free_data:
|
|
+ /* "View.MemoryView":283
|
|
+ * cdef object name
|
|
+ * def __init__(self, name):
|
|
+ * self.name = name # <<<<<<<<<<<<<<
|
|
+ * def __repr__(self):
|
|
+ * return self.name
|
|
*/
|
|
- __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
|
|
- if (__pyx_t_1) {
|
|
-
|
|
- /* "View.MemoryView":213
|
|
- * def __dealloc__(array self):
|
|
- * if self.callback_free_data != NULL:
|
|
- * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
|
|
- * elif self.free_data:
|
|
- * if self.dtype_is_object:
|
|
- */
|
|
- __pyx_v_self->callback_free_data(__pyx_v_self->data);
|
|
-
|
|
- /* "View.MemoryView":212
|
|
- *
|
|
- * def __dealloc__(array self):
|
|
- * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
|
|
- * self.callback_free_data(self.data)
|
|
- * elif self.free_data:
|
|
- */
|
|
- goto __pyx_L3;
|
|
- }
|
|
-
|
|
- /* "View.MemoryView":214
|
|
- * if self.callback_free_data != NULL:
|
|
- * self.callback_free_data(self.data)
|
|
- * elif self.free_data: # <<<<<<<<<<<<<<
|
|
- * if self.dtype_is_object:
|
|
- * refcount_objects_in_slice(self.data, self._shape,
|
|
- */
|
|
- __pyx_t_1 = (__pyx_v_self->free_data != 0);
|
|
- if (__pyx_t_1) {
|
|
-
|
|
- /* "View.MemoryView":215
|
|
- * self.callback_free_data(self.data)
|
|
- * elif self.free_data:
|
|
- * if self.dtype_is_object: # <<<<<<<<<<<<<<
|
|
- * refcount_objects_in_slice(self.data, self._shape,
|
|
- * self._strides, self.ndim, False)
|
|
- */
|
|
- __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
|
|
- if (__pyx_t_1) {
|
|
-
|
|
- /* "View.MemoryView":216
|
|
- * elif self.free_data:
|
|
- * if self.dtype_is_object:
|
|
- * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
|
|
- * self._strides, self.ndim, False)
|
|
- * free(self.data)
|
|
- */
|
|
- __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
|
|
-
|
|
- /* "View.MemoryView":215
|
|
- * self.callback_free_data(self.data)
|
|
- * elif self.free_data:
|
|
- * if self.dtype_is_object: # <<<<<<<<<<<<<<
|
|
- * refcount_objects_in_slice(self.data, self._shape,
|
|
- * self._strides, self.ndim, False)
|
|
- */
|
|
- }
|
|
-
|
|
- /* "View.MemoryView":218
|
|
- * refcount_objects_in_slice(self.data, self._shape,
|
|
- * self._strides, self.ndim, False)
|
|
- * free(self.data) # <<<<<<<<<<<<<<
|
|
- * PyObject_Free(self._shape)
|
|
- *
|
|
- */
|
|
- free(__pyx_v_self->data);
|
|
-
|
|
- /* "View.MemoryView":214
|
|
- * if self.callback_free_data != NULL:
|
|
- * self.callback_free_data(self.data)
|
|
- * elif self.free_data: # <<<<<<<<<<<<<<
|
|
- * if self.dtype_is_object:
|
|
- * refcount_objects_in_slice(self.data, self._shape,
|
|
- */
|
|
- }
|
|
- __pyx_L3:;
|
|
-
|
|
- /* "View.MemoryView":219
|
|
- * self._strides, self.ndim, False)
|
|
- * free(self.data)
|
|
- * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
|
|
- *
|
|
- * @property
|
|
- */
|
|
- PyObject_Free(__pyx_v_self->_shape);
|
|
+ __Pyx_INCREF(__pyx_v_name);
|
|
+ __Pyx_GIVEREF(__pyx_v_name);
|
|
+ __Pyx_GOTREF(__pyx_v_self->name);
|
|
+ __Pyx_DECREF(__pyx_v_self->name);
|
|
+ __pyx_v_self->name = __pyx_v_name;
|
|
|
|
- /* "View.MemoryView":211
|
|
- * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
|
|
- *
|
|
- * def __dealloc__(array self): # <<<<<<<<<<<<<<
|
|
- * if self.callback_free_data != NULL:
|
|
- * self.callback_free_data(self.data)
|
|
+ /* "View.MemoryView":282
|
|
+ * cdef class Enum(object):
|
|
+ * cdef object name
|
|
+ * def __init__(self, name): # <<<<<<<<<<<<<<
|
|
+ * self.name = name
|
|
+ * def __repr__(self):
|
|
*/
|
|
|
|
/* function exit code */
|
|
+ __pyx_r = 0;
|
|
__Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":222
|
|
- *
|
|
- * @property
|
|
- * def memview(self): # <<<<<<<<<<<<<<
|
|
- * return self.get_memview()
|
|
+/* "View.MemoryView":284
|
|
+ * def __init__(self, name):
|
|
+ * self.name = name
|
|
+ * def __repr__(self): # <<<<<<<<<<<<<<
|
|
+ * return self.name
|
|
*
|
|
*/
|
|
|
|
/* Python wrapper */
|
|
-static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
|
|
-static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
|
|
+static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
|
|
+static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
|
|
- __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
|
|
+ __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
|
|
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
|
|
|
|
/* function exit code */
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
|
|
+static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
- PyObject *__pyx_t_1 = NULL;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__get__", 0);
|
|
+ __Pyx_RefNannySetupContext("__repr__", 0);
|
|
|
|
- /* "View.MemoryView":223
|
|
- * @property
|
|
- * def memview(self):
|
|
- * return self.get_memview() # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":285
|
|
+ * self.name = name
|
|
+ * def __repr__(self):
|
|
+ * return self.name # <<<<<<<<<<<<<<
|
|
*
|
|
- * @cname('get_memview')
|
|
+ * cdef generic = Enum("<strided and direct or indirect>")
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 223, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_r = __pyx_t_1;
|
|
- __pyx_t_1 = 0;
|
|
+ __Pyx_INCREF(__pyx_v_self->name);
|
|
+ __pyx_r = __pyx_v_self->name;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":222
|
|
- *
|
|
- * @property
|
|
- * def memview(self): # <<<<<<<<<<<<<<
|
|
- * return self.get_memview()
|
|
+ /* "View.MemoryView":284
|
|
+ * def __init__(self, name):
|
|
+ * self.name = name
|
|
+ * def __repr__(self): # <<<<<<<<<<<<<<
|
|
+ * return self.name
|
|
*
|
|
*/
|
|
|
|
/* function exit code */
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":226
|
|
- *
|
|
- * @cname('get_memview')
|
|
- * cdef get_memview(self): # <<<<<<<<<<<<<<
|
|
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
|
|
- * return memoryview(self, flags, self.dtype_is_object)
|
|
+/* "(tree fragment)":1
|
|
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
|
|
+ * cdef tuple state
|
|
+ * cdef object _dict
|
|
*/
|
|
|
|
-static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
|
|
- int __pyx_v_flags;
|
|
+/* Python wrapper */
|
|
+static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
+static PyObject *__pyx_pw___pyx_MemviewEnum_1__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___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
|
|
+
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
|
|
+ PyObject *__pyx_v_state = 0;
|
|
+ PyObject *__pyx_v__dict = 0;
|
|
+ int __pyx_v_use_setstate;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
- PyObject *__pyx_t_2 = NULL;
|
|
- PyObject *__pyx_t_3 = NULL;
|
|
+ int __pyx_t_2;
|
|
+ int __pyx_t_3;
|
|
+ PyObject *__pyx_t_4 = NULL;
|
|
+ PyObject *__pyx_t_5 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("get_memview", 0);
|
|
+ __Pyx_RefNannySetupContext("__reduce_cython__", 0);
|
|
|
|
- /* "View.MemoryView":227
|
|
- * @cname('get_memview')
|
|
- * cdef get_memview(self):
|
|
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
|
|
- * return memoryview(self, flags, self.dtype_is_object)
|
|
- *
|
|
+ /* "(tree fragment)":5
|
|
+ * cdef object _dict
|
|
+ * cdef bint use_setstate
|
|
+ * state = (self.name,) # <<<<<<<<<<<<<<
|
|
+ * _dict = getattr(self, '__dict__', None)
|
|
+ * if _dict is not None:
|
|
*/
|
|
- __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
|
|
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __Pyx_INCREF(__pyx_v_self->name);
|
|
+ __Pyx_GIVEREF(__pyx_v_self->name);
|
|
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
|
|
+ __pyx_v_state = ((PyObject*)__pyx_t_1);
|
|
+ __pyx_t_1 = 0;
|
|
|
|
- /* "View.MemoryView":228
|
|
- * cdef get_memview(self):
|
|
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
|
|
- * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
|
|
- *
|
|
- * def __len__(self):
|
|
+ /* "(tree fragment)":6
|
|
+ * cdef bint use_setstate
|
|
+ * state = (self.name,)
|
|
+ * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
|
|
+ * if _dict is not None:
|
|
+ * state += (_dict,)
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 228, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 228, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
|
|
- __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
|
|
- PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
|
|
- __Pyx_GIVEREF(__pyx_t_1);
|
|
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
|
|
- __Pyx_GIVEREF(__pyx_t_2);
|
|
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
|
|
+ __pyx_v__dict = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
- __pyx_t_2 = 0;
|
|
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __pyx_r = __pyx_t_2;
|
|
- __pyx_t_2 = 0;
|
|
- goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":226
|
|
- *
|
|
- * @cname('get_memview')
|
|
- * cdef get_memview(self): # <<<<<<<<<<<<<<
|
|
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
|
|
- * return memoryview(self, flags, self.dtype_is_object)
|
|
+ /* "(tree fragment)":7
|
|
+ * state = (self.name,)
|
|
+ * _dict = getattr(self, '__dict__', None)
|
|
+ * if _dict is not None: # <<<<<<<<<<<<<<
|
|
+ * state += (_dict,)
|
|
+ * use_setstate = True
|
|
*/
|
|
+ __pyx_t_2 = (__pyx_v__dict != Py_None);
|
|
+ __pyx_t_3 = (__pyx_t_2 != 0);
|
|
+ if (__pyx_t_3) {
|
|
|
|
- /* function exit code */
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_XDECREF(__pyx_t_2);
|
|
- __Pyx_XDECREF(__pyx_t_3);
|
|
- __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = 0;
|
|
- __pyx_L0:;
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
+ /* "(tree fragment)":8
|
|
+ * _dict = getattr(self, '__dict__', None)
|
|
+ * if _dict is not None:
|
|
+ * state += (_dict,) # <<<<<<<<<<<<<<
|
|
+ * use_setstate = True
|
|
+ * else:
|
|
+ */
|
|
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __Pyx_INCREF(__pyx_v__dict);
|
|
+ __Pyx_GIVEREF(__pyx_v__dict);
|
|
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
|
|
+ __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
|
|
+ __pyx_t_4 = 0;
|
|
|
|
-/* "View.MemoryView":230
|
|
- * return memoryview(self, flags, self.dtype_is_object)
|
|
- *
|
|
- * def __len__(self): # <<<<<<<<<<<<<<
|
|
- * return self._shape[0]
|
|
- *
|
|
+ /* "(tree fragment)":9
|
|
+ * if _dict is not None:
|
|
+ * state += (_dict,)
|
|
+ * use_setstate = True # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * use_setstate = self.name is not None
|
|
*/
|
|
+ __pyx_v_use_setstate = 1;
|
|
|
|
-/* Python wrapper */
|
|
-static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
|
|
-static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
|
|
- Py_ssize_t __pyx_r;
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
|
|
- __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
|
|
+ /* "(tree fragment)":7
|
|
+ * state = (self.name,)
|
|
+ * _dict = getattr(self, '__dict__', None)
|
|
+ * if _dict is not None: # <<<<<<<<<<<<<<
|
|
+ * state += (_dict,)
|
|
+ * use_setstate = True
|
|
+ */
|
|
+ goto __pyx_L3;
|
|
+ }
|
|
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
+ /* "(tree fragment)":11
|
|
+ * use_setstate = True
|
|
+ * else:
|
|
+ * use_setstate = self.name is not None # <<<<<<<<<<<<<<
|
|
+ * if use_setstate:
|
|
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
|
|
+ */
|
|
+ /*else*/ {
|
|
+ __pyx_t_3 = (__pyx_v_self->name != Py_None);
|
|
+ __pyx_v_use_setstate = __pyx_t_3;
|
|
+ }
|
|
+ __pyx_L3:;
|
|
|
|
-static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
|
|
- Py_ssize_t __pyx_r;
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__len__", 0);
|
|
+ /* "(tree fragment)":12
|
|
+ * else:
|
|
+ * use_setstate = self.name is not None
|
|
+ * if use_setstate: # <<<<<<<<<<<<<<
|
|
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
|
|
+ * else:
|
|
+ */
|
|
+ __pyx_t_3 = (__pyx_v_use_setstate != 0);
|
|
+ if (__pyx_t_3) {
|
|
|
|
- /* "View.MemoryView":231
|
|
- *
|
|
- * def __len__(self):
|
|
- * return self._shape[0] # <<<<<<<<<<<<<<
|
|
- *
|
|
- * def __getattr__(self, attr):
|
|
+ /* "(tree fragment)":13
|
|
+ * use_setstate = self.name is not None
|
|
+ * if use_setstate:
|
|
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
|
|
*/
|
|
- __pyx_r = (__pyx_v_self->_shape[0]);
|
|
- goto __pyx_L0;
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
|
|
+ __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
|
|
+ PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
|
|
+ __Pyx_INCREF(__pyx_int_184977713);
|
|
+ __Pyx_GIVEREF(__pyx_int_184977713);
|
|
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
|
|
+ __Pyx_INCREF(Py_None);
|
|
+ __Pyx_GIVEREF(Py_None);
|
|
+ PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
|
|
+ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_5);
|
|
+ __Pyx_GIVEREF(__pyx_t_4);
|
|
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
|
|
+ __Pyx_GIVEREF(__pyx_t_1);
|
|
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
|
|
+ __Pyx_INCREF(__pyx_v_state);
|
|
+ __Pyx_GIVEREF(__pyx_v_state);
|
|
+ PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
|
|
+ __pyx_t_4 = 0;
|
|
+ __pyx_t_1 = 0;
|
|
+ __pyx_r = __pyx_t_5;
|
|
+ __pyx_t_5 = 0;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":230
|
|
- * return memoryview(self, flags, self.dtype_is_object)
|
|
- *
|
|
- * def __len__(self): # <<<<<<<<<<<<<<
|
|
- * return self._shape[0]
|
|
- *
|
|
+ /* "(tree fragment)":12
|
|
+ * else:
|
|
+ * use_setstate = self.name is not None
|
|
+ * if use_setstate: # <<<<<<<<<<<<<<
|
|
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
|
|
+ * else:
|
|
+ */
|
|
+ }
|
|
+
|
|
+ /* "(tree fragment)":15
|
|
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
|
|
+ * else:
|
|
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
|
|
+ * def __setstate_cython__(self, __pyx_state):
|
|
+ * __pyx_unpickle_Enum__set_state(self, __pyx_state)
|
|
+ */
|
|
+ /*else*/ {
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_5);
|
|
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
|
|
+ __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
|
|
+ PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
|
|
+ __Pyx_INCREF(__pyx_int_184977713);
|
|
+ __Pyx_GIVEREF(__pyx_int_184977713);
|
|
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
|
|
+ __Pyx_INCREF(__pyx_v_state);
|
|
+ __Pyx_GIVEREF(__pyx_v_state);
|
|
+ PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
|
|
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __Pyx_GIVEREF(__pyx_t_5);
|
|
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
|
|
+ __Pyx_GIVEREF(__pyx_t_1);
|
|
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
|
|
+ __pyx_t_5 = 0;
|
|
+ __pyx_t_1 = 0;
|
|
+ __pyx_r = __pyx_t_4;
|
|
+ __pyx_t_4 = 0;
|
|
+ goto __pyx_L0;
|
|
+ }
|
|
+
|
|
+ /* "(tree fragment)":1
|
|
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
|
|
+ * cdef tuple state
|
|
+ * cdef object _dict
|
|
*/
|
|
|
|
/* function exit code */
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_1);
|
|
+ __Pyx_XDECREF(__pyx_t_4);
|
|
+ __Pyx_XDECREF(__pyx_t_5);
|
|
+ __Pyx_AddTraceback("View.MemoryView.Enum.__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;
|
|
}
|
|
|
|
-/* "View.MemoryView":233
|
|
- * return self._shape[0]
|
|
- *
|
|
- * def __getattr__(self, attr): # <<<<<<<<<<<<<<
|
|
- * return getattr(self.memview, attr)
|
|
- *
|
|
+/* "(tree fragment)":16
|
|
+ * else:
|
|
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
|
|
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
|
|
+ * __pyx_unpickle_Enum__set_state(self, __pyx_state)
|
|
*/
|
|
|
|
/* Python wrapper */
|
|
-static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
|
|
-static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
|
|
+static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
|
|
+static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
|
|
- __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
|
|
+ __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
|
|
+ __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
|
|
|
|
/* function exit code */
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
|
|
+static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
- PyObject *__pyx_t_2 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__getattr__", 0);
|
|
+ __Pyx_RefNannySetupContext("__setstate_cython__", 0);
|
|
|
|
- /* "View.MemoryView":234
|
|
- *
|
|
- * def __getattr__(self, attr):
|
|
- * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
|
|
- *
|
|
- * def __getitem__(self, item):
|
|
+ /* "(tree fragment)":17
|
|
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
|
|
+ * def __setstate_cython__(self, __pyx_state):
|
|
+ * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 234, __pyx_L1_error)
|
|
+ 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(2, 17, __pyx_L1_error)
|
|
+ __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 234, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
- __pyx_r = __pyx_t_2;
|
|
- __pyx_t_2 = 0;
|
|
- goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":233
|
|
- * return self._shape[0]
|
|
- *
|
|
- * def __getattr__(self, attr): # <<<<<<<<<<<<<<
|
|
- * return getattr(self.memview, attr)
|
|
- *
|
|
+ /* "(tree fragment)":16
|
|
+ * else:
|
|
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
|
|
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
|
|
+ * __pyx_unpickle_Enum__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_XDECREF(__pyx_t_2);
|
|
- __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
@@ -7535,3835 +7011,3906 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":236
|
|
- * return getattr(self.memview, attr)
|
|
- *
|
|
- * def __getitem__(self, item): # <<<<<<<<<<<<<<
|
|
- * return self.memview[item]
|
|
+/* "View.MemoryView":299
|
|
*
|
|
+ * @cname('__pyx_align_pointer')
|
|
+ * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
|
|
+ * "Align pointer memory on a given boundary"
|
|
+ * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
|
|
*/
|
|
|
|
-/* Python wrapper */
|
|
-static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
|
|
-static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
|
|
- PyObject *__pyx_r = 0;
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
|
|
- __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
|
|
+static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
|
|
+ Py_intptr_t __pyx_v_aligned_p;
|
|
+ size_t __pyx_v_offset;
|
|
+ void *__pyx_r;
|
|
+ int __pyx_t_1;
|
|
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
|
|
- PyObject *__pyx_r = NULL;
|
|
- __Pyx_RefNannyDeclarations
|
|
- PyObject *__pyx_t_1 = NULL;
|
|
- PyObject *__pyx_t_2 = NULL;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__getitem__", 0);
|
|
+ /* "View.MemoryView":301
|
|
+ * cdef void *align_pointer(void *memory, size_t alignment) nogil:
|
|
+ * "Align pointer memory on a given boundary"
|
|
+ * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
|
|
+ * cdef size_t offset
|
|
+ *
|
|
+ */
|
|
+ __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
|
|
|
|
- /* "View.MemoryView":237
|
|
+ /* "View.MemoryView":305
|
|
*
|
|
- * def __getitem__(self, item):
|
|
- * return self.memview[item] # <<<<<<<<<<<<<<
|
|
+ * with cython.cdivision(True):
|
|
+ * offset = aligned_p % alignment # <<<<<<<<<<<<<<
|
|
*
|
|
- * def __setitem__(self, item, value):
|
|
+ * if offset > 0:
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 237, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 237, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
- __pyx_r = __pyx_t_2;
|
|
- __pyx_t_2 = 0;
|
|
- goto __pyx_L0;
|
|
+ __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
|
|
|
|
- /* "View.MemoryView":236
|
|
- * return getattr(self.memview, attr)
|
|
+ /* "View.MemoryView":307
|
|
+ * offset = aligned_p % alignment
|
|
*
|
|
- * def __getitem__(self, item): # <<<<<<<<<<<<<<
|
|
- * return self.memview[item]
|
|
+ * if offset > 0: # <<<<<<<<<<<<<<
|
|
+ * aligned_p += alignment - offset
|
|
*
|
|
*/
|
|
+ __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* function exit code */
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_XDECREF(__pyx_t_2);
|
|
- __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = NULL;
|
|
- __pyx_L0:;
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-/* "View.MemoryView":239
|
|
- * return self.memview[item]
|
|
+ /* "View.MemoryView":308
|
|
*
|
|
- * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
|
|
- * self.memview[item] = value
|
|
+ * if offset > 0:
|
|
+ * aligned_p += alignment - offset # <<<<<<<<<<<<<<
|
|
*
|
|
+ * return <void *> aligned_p
|
|
*/
|
|
+ __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
|
|
|
|
-/* Python wrapper */
|
|
-static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
|
|
-static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
|
|
- int __pyx_r;
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
|
|
- __pyx_r = __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));
|
|
-
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-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) {
|
|
- int __pyx_r;
|
|
- __Pyx_RefNannyDeclarations
|
|
- PyObject *__pyx_t_1 = NULL;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__setitem__", 0);
|
|
+ /* "View.MemoryView":307
|
|
+ * offset = aligned_p % alignment
|
|
+ *
|
|
+ * if offset > 0: # <<<<<<<<<<<<<<
|
|
+ * aligned_p += alignment - offset
|
|
+ *
|
|
+ */
|
|
+ }
|
|
|
|
- /* "View.MemoryView":240
|
|
+ /* "View.MemoryView":310
|
|
+ * aligned_p += alignment - offset
|
|
*
|
|
- * def __setitem__(self, item, value):
|
|
- * self.memview[item] = value # <<<<<<<<<<<<<<
|
|
+ * return <void *> aligned_p # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 240, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 240, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __pyx_r = ((void *)__pyx_v_aligned_p);
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":239
|
|
- * return self.memview[item]
|
|
- *
|
|
- * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
|
|
- * self.memview[item] = value
|
|
+ /* "View.MemoryView":299
|
|
*
|
|
+ * @cname('__pyx_align_pointer')
|
|
+ * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
|
|
+ * "Align pointer memory on a given boundary"
|
|
+ * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
|
|
*/
|
|
|
|
/* function exit code */
|
|
- __pyx_r = 0;
|
|
- goto __pyx_L0;
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = -1;
|
|
__pyx_L0:;
|
|
- __Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "(tree fragment)":1
|
|
- * def __reduce_cython__(self): # <<<<<<<<<<<<<<
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
- * def __setstate_cython__(self, __pyx_state):
|
|
+/* "View.MemoryView":346
|
|
+ * cdef __Pyx_TypeInfo *typeinfo
|
|
+ *
|
|
+ * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
|
|
+ * self.obj = obj
|
|
+ * self.flags = flags
|
|
*/
|
|
|
|
/* Python wrapper */
|
|
-static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
-static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
|
|
- PyObject *__pyx_r = 0;
|
|
+static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
+static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
+ PyObject *__pyx_v_obj = 0;
|
|
+ int __pyx_v_flags;
|
|
+ int __pyx_v_dtype_is_object;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
|
|
- __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
|
|
+ __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
|
|
+ {
|
|
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
|
|
+ PyObject* values[3] = {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 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_obj)) != 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_flags)) != 0)) kw_args--;
|
|
+ else {
|
|
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 346, __pyx_L3_error)
|
|
+ }
|
|
+ CYTHON_FALLTHROUGH;
|
|
+ case 2:
|
|
+ if (kw_args > 0) {
|
|
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
|
|
+ if (value) { values[2] = value; kw_args--; }
|
|
+ }
|
|
+ }
|
|
+ if (unlikely(kw_args > 0)) {
|
|
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 346, __pyx_L3_error)
|
|
+ }
|
|
+ } else {
|
|
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
|
|
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
|
|
+ CYTHON_FALLTHROUGH;
|
|
+ case 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_obj = values[0];
|
|
+ __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 346, __pyx_L3_error)
|
|
+ if (values[2]) {
|
|
+ __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 346, __pyx_L3_error)
|
|
+ } else {
|
|
+ __pyx_v_dtype_is_object = ((int)0);
|
|
+ }
|
|
+ }
|
|
+ goto __pyx_L4_argument_unpacking_done;
|
|
+ __pyx_L5_argtuple_error:;
|
|
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 346, __pyx_L3_error)
|
|
+ __pyx_L3_error:;
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return -1;
|
|
+ __pyx_L4_argument_unpacking_done:;
|
|
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
|
|
|
|
/* function exit code */
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
|
|
- PyObject *__pyx_r = NULL;
|
|
+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) {
|
|
+ int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
- PyObject *__pyx_t_1 = NULL;
|
|
+ int __pyx_t_1;
|
|
+ int __pyx_t_2;
|
|
+ int __pyx_t_3;
|
|
+ int __pyx_t_4;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__reduce_cython__", 0);
|
|
+ __Pyx_RefNannySetupContext("__cinit__", 0);
|
|
|
|
- /* "(tree fragment)":2
|
|
- * def __reduce_cython__(self):
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
|
|
- * def __setstate_cython__(self, __pyx_state):
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
+ /* "View.MemoryView":347
|
|
+ *
|
|
+ * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
|
|
+ * self.obj = obj # <<<<<<<<<<<<<<
|
|
+ * self.flags = flags
|
|
+ * if type(self) is memoryview or obj is not None:
|
|
*/
|
|
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __Pyx_Raise(__pyx_t_1, 0, 0, 0);
|
|
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
- __PYX_ERR(2, 2, __pyx_L1_error)
|
|
+ __Pyx_INCREF(__pyx_v_obj);
|
|
+ __Pyx_GIVEREF(__pyx_v_obj);
|
|
+ __Pyx_GOTREF(__pyx_v_self->obj);
|
|
+ __Pyx_DECREF(__pyx_v_self->obj);
|
|
+ __pyx_v_self->obj = __pyx_v_obj;
|
|
|
|
- /* "(tree fragment)":1
|
|
- * def __reduce_cython__(self): # <<<<<<<<<<<<<<
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
- * def __setstate_cython__(self, __pyx_state):
|
|
+ /* "View.MemoryView":348
|
|
+ * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
|
|
+ * self.obj = obj
|
|
+ * self.flags = flags # <<<<<<<<<<<<<<
|
|
+ * if type(self) is memoryview or obj is not None:
|
|
+ * __Pyx_GetBuffer(obj, &self.view, flags)
|
|
*/
|
|
+ __pyx_v_self->flags = __pyx_v_flags;
|
|
|
|
- /* function exit code */
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = NULL;
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-/* "(tree fragment)":3
|
|
- * def __reduce_cython__(self):
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
- * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
- */
|
|
+ /* "View.MemoryView":349
|
|
+ * self.obj = obj
|
|
+ * self.flags = flags
|
|
+ * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
|
|
+ * __Pyx_GetBuffer(obj, &self.view, flags)
|
|
+ * if <PyObject *> self.view.obj == NULL:
|
|
+ */
|
|
+ __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
|
|
+ __pyx_t_3 = (__pyx_t_2 != 0);
|
|
+ if (!__pyx_t_3) {
|
|
+ } else {
|
|
+ __pyx_t_1 = __pyx_t_3;
|
|
+ goto __pyx_L4_bool_binop_done;
|
|
+ }
|
|
+ __pyx_t_3 = (__pyx_v_obj != Py_None);
|
|
+ __pyx_t_2 = (__pyx_t_3 != 0);
|
|
+ __pyx_t_1 = __pyx_t_2;
|
|
+ __pyx_L4_bool_binop_done:;
|
|
+ if (__pyx_t_1) {
|
|
|
|
-/* Python wrapper */
|
|
-static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
|
|
-static PyObject *__pyx_pw___pyx_array_3__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___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
|
|
+ /* "View.MemoryView":350
|
|
+ * self.flags = flags
|
|
+ * if type(self) is memoryview or obj is not None:
|
|
+ * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
|
|
+ * if <PyObject *> self.view.obj == NULL:
|
|
+ * (<__pyx_buffer *> &self.view).obj = Py_None
|
|
+ */
|
|
+ __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 350, __pyx_L1_error)
|
|
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
+ /* "View.MemoryView":351
|
|
+ * if type(self) is memoryview or obj is not None:
|
|
+ * __Pyx_GetBuffer(obj, &self.view, flags)
|
|
+ * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
|
|
+ * (<__pyx_buffer *> &self.view).obj = Py_None
|
|
+ * Py_INCREF(Py_None)
|
|
+ */
|
|
+ __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
-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) {
|
|
- PyObject *__pyx_r = NULL;
|
|
- __Pyx_RefNannyDeclarations
|
|
- PyObject *__pyx_t_1 = NULL;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__setstate_cython__", 0);
|
|
+ /* "View.MemoryView":352
|
|
+ * __Pyx_GetBuffer(obj, &self.view, flags)
|
|
+ * if <PyObject *> self.view.obj == NULL:
|
|
+ * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
|
|
+ * Py_INCREF(Py_None)
|
|
+ *
|
|
+ */
|
|
+ ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
|
|
|
|
- /* "(tree fragment)":4
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
- * def __setstate_cython__(self, __pyx_state):
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":353
|
|
+ * if <PyObject *> self.view.obj == NULL:
|
|
+ * (<__pyx_buffer *> &self.view).obj = Py_None
|
|
+ * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * if not __PYX_CYTHON_ATOMICS_ENABLED():
|
|
*/
|
|
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __Pyx_Raise(__pyx_t_1, 0, 0, 0);
|
|
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
- __PYX_ERR(2, 4, __pyx_L1_error)
|
|
+ Py_INCREF(Py_None);
|
|
|
|
- /* "(tree fragment)":3
|
|
- * def __reduce_cython__(self):
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
- * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
+ /* "View.MemoryView":351
|
|
+ * if type(self) is memoryview or obj is not None:
|
|
+ * __Pyx_GetBuffer(obj, &self.view, flags)
|
|
+ * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
|
|
+ * (<__pyx_buffer *> &self.view).obj = Py_None
|
|
+ * Py_INCREF(Py_None)
|
|
*/
|
|
+ }
|
|
|
|
- /* function exit code */
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = NULL;
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
+ /* "View.MemoryView":349
|
|
+ * self.obj = obj
|
|
+ * self.flags = flags
|
|
+ * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
|
|
+ * __Pyx_GetBuffer(obj, &self.view, flags)
|
|
+ * if <PyObject *> self.view.obj == NULL:
|
|
+ */
|
|
+ }
|
|
|
|
-/* "View.MemoryView":244
|
|
+ /* "View.MemoryView":355
|
|
+ * Py_INCREF(Py_None)
|
|
*
|
|
- * @cname("__pyx_array_new")
|
|
- * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
|
|
- * char *mode, char *buf):
|
|
- * cdef array result
|
|
+ * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
|
|
+ * global __pyx_memoryview_thread_locks_used
|
|
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
|
|
*/
|
|
+ __pyx_t_1 = ((!(__PYX_CYTHON_ATOMICS_ENABLED() != 0)) != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
-static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
|
|
- struct __pyx_array_obj *__pyx_v_result = 0;
|
|
- struct __pyx_array_obj *__pyx_r = NULL;
|
|
- __Pyx_RefNannyDeclarations
|
|
- int __pyx_t_1;
|
|
- PyObject *__pyx_t_2 = NULL;
|
|
- PyObject *__pyx_t_3 = NULL;
|
|
- PyObject *__pyx_t_4 = NULL;
|
|
- PyObject *__pyx_t_5 = NULL;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("array_cwrapper", 0);
|
|
+ /* "View.MemoryView":357
|
|
+ * if not __PYX_CYTHON_ATOMICS_ENABLED():
|
|
+ * global __pyx_memoryview_thread_locks_used
|
|
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
|
|
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
|
|
+ * __pyx_memoryview_thread_locks_used += 1
|
|
+ */
|
|
+ __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":248
|
|
- * cdef array result
|
|
- *
|
|
- * if buf == NULL: # <<<<<<<<<<<<<<
|
|
- * result = array(shape, itemsize, format, mode.decode('ASCII'))
|
|
- * else:
|
|
+ /* "View.MemoryView":358
|
|
+ * global __pyx_memoryview_thread_locks_used
|
|
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
|
|
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
|
|
+ * __pyx_memoryview_thread_locks_used += 1
|
|
+ * if self.lock is NULL:
|
|
*/
|
|
- __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
|
|
- if (__pyx_t_1) {
|
|
+ __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
|
|
|
|
- /* "View.MemoryView":249
|
|
- *
|
|
- * if buf == NULL:
|
|
- * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * result = array(shape, itemsize, format, mode.decode('ASCII'),
|
|
+ /* "View.MemoryView":359
|
|
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
|
|
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
|
|
+ * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
|
|
+ * if self.lock is NULL:
|
|
+ * self.lock = PyThread_allocate_lock()
|
|
*/
|
|
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 249, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 249, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 249, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 249, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_5);
|
|
- __Pyx_INCREF(__pyx_v_shape);
|
|
- __Pyx_GIVEREF(__pyx_v_shape);
|
|
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
|
|
- __Pyx_GIVEREF(__pyx_t_2);
|
|
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
|
|
- __Pyx_GIVEREF(__pyx_t_3);
|
|
- PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
|
|
- __Pyx_GIVEREF(__pyx_t_4);
|
|
- PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
|
|
- __pyx_t_2 = 0;
|
|
- __pyx_t_3 = 0;
|
|
- __pyx_t_4 = 0;
|
|
- __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 249, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
- __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
|
|
- __pyx_t_4 = 0;
|
|
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
|
|
|
|
- /* "View.MemoryView":248
|
|
- * cdef array result
|
|
+ /* "View.MemoryView":357
|
|
+ * if not __PYX_CYTHON_ATOMICS_ENABLED():
|
|
+ * global __pyx_memoryview_thread_locks_used
|
|
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
|
|
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
|
|
+ * __pyx_memoryview_thread_locks_used += 1
|
|
+ */
|
|
+ }
|
|
+
|
|
+ /* "View.MemoryView":360
|
|
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
|
|
+ * __pyx_memoryview_thread_locks_used += 1
|
|
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
|
|
+ * self.lock = PyThread_allocate_lock()
|
|
+ * if self.lock is NULL:
|
|
+ */
|
|
+ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
|
|
+ if (__pyx_t_1) {
|
|
+
|
|
+ /* "View.MemoryView":361
|
|
+ * __pyx_memoryview_thread_locks_used += 1
|
|
+ * if self.lock is NULL:
|
|
+ * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
|
|
+ * if self.lock is NULL:
|
|
+ * raise MemoryError
|
|
+ */
|
|
+ __pyx_v_self->lock = PyThread_allocate_lock();
|
|
+
|
|
+ /* "View.MemoryView":362
|
|
+ * if self.lock is NULL:
|
|
+ * self.lock = PyThread_allocate_lock()
|
|
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
|
|
+ * raise MemoryError
|
|
*
|
|
- * if buf == NULL: # <<<<<<<<<<<<<<
|
|
- * result = array(shape, itemsize, format, mode.decode('ASCII'))
|
|
- * else:
|
|
*/
|
|
- goto __pyx_L3;
|
|
- }
|
|
+ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
|
|
+ if (unlikely(__pyx_t_1)) {
|
|
|
|
- /* "View.MemoryView":251
|
|
- * result = array(shape, itemsize, format, mode.decode('ASCII'))
|
|
- * else:
|
|
- * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
|
|
- * allocate_buffer=False)
|
|
- * result.data = buf
|
|
+ /* "View.MemoryView":363
|
|
+ * self.lock = PyThread_allocate_lock()
|
|
+ * if self.lock is NULL:
|
|
+ * raise MemoryError # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * if flags & PyBUF_FORMAT:
|
|
*/
|
|
- /*else*/ {
|
|
- __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 251, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_5);
|
|
- __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 251, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 251, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __Pyx_INCREF(__pyx_v_shape);
|
|
- __Pyx_GIVEREF(__pyx_v_shape);
|
|
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
|
|
- __Pyx_GIVEREF(__pyx_t_4);
|
|
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
|
|
- __Pyx_GIVEREF(__pyx_t_5);
|
|
- PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
|
|
- __Pyx_GIVEREF(__pyx_t_3);
|
|
- PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
|
|
- __pyx_t_4 = 0;
|
|
- __pyx_t_5 = 0;
|
|
- __pyx_t_3 = 0;
|
|
+ PyErr_NoMemory(); __PYX_ERR(2, 363, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":252
|
|
- * else:
|
|
- * result = array(shape, itemsize, format, mode.decode('ASCII'),
|
|
- * allocate_buffer=False) # <<<<<<<<<<<<<<
|
|
- * result.data = buf
|
|
+ /* "View.MemoryView":362
|
|
+ * if self.lock is NULL:
|
|
+ * self.lock = PyThread_allocate_lock()
|
|
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
|
|
+ * raise MemoryError
|
|
*
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 252, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 252, __pyx_L1_error)
|
|
+ }
|
|
|
|
- /* "View.MemoryView":251
|
|
- * result = array(shape, itemsize, format, mode.decode('ASCII'))
|
|
- * else:
|
|
- * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
|
|
- * allocate_buffer=False)
|
|
- * result.data = buf
|
|
+ /* "View.MemoryView":360
|
|
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
|
|
+ * __pyx_memoryview_thread_locks_used += 1
|
|
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
|
|
+ * self.lock = PyThread_allocate_lock()
|
|
+ * if self.lock is NULL:
|
|
*/
|
|
- __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_5);
|
|
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
|
|
- __pyx_t_5 = 0;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":253
|
|
- * result = array(shape, itemsize, format, mode.decode('ASCII'),
|
|
- * allocate_buffer=False)
|
|
- * result.data = buf # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":355
|
|
+ * Py_INCREF(Py_None)
|
|
*
|
|
- * return result
|
|
+ * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
|
|
+ * global __pyx_memoryview_thread_locks_used
|
|
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
|
|
*/
|
|
- __pyx_v_result->data = __pyx_v_buf;
|
|
}
|
|
- __pyx_L3:;
|
|
|
|
- /* "View.MemoryView":255
|
|
- * result.data = buf
|
|
- *
|
|
- * return result # <<<<<<<<<<<<<<
|
|
- *
|
|
+ /* "View.MemoryView":365
|
|
+ * raise MemoryError
|
|
*
|
|
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
|
|
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
|
|
+ * else:
|
|
*/
|
|
- __Pyx_XDECREF(((PyObject *)__pyx_r));
|
|
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
|
|
- __pyx_r = __pyx_v_result;
|
|
- goto __pyx_L0;
|
|
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":244
|
|
+ /* "View.MemoryView":366
|
|
*
|
|
- * @cname("__pyx_array_new")
|
|
- * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
|
|
- * char *mode, char *buf):
|
|
- * cdef array result
|
|
+ * if flags & PyBUF_FORMAT:
|
|
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * self.dtype_is_object = dtype_is_object
|
|
*/
|
|
-
|
|
- /* function exit code */
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_2);
|
|
- __Pyx_XDECREF(__pyx_t_3);
|
|
- __Pyx_XDECREF(__pyx_t_4);
|
|
- __Pyx_XDECREF(__pyx_t_5);
|
|
- __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = 0;
|
|
- __pyx_L0:;
|
|
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
|
|
- __Pyx_XGIVEREF((PyObject *)__pyx_r);
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-/* "View.MemoryView":281
|
|
- * cdef class Enum(object):
|
|
- * cdef object name
|
|
- * def __init__(self, name): # <<<<<<<<<<<<<<
|
|
- * self.name = name
|
|
- * def __repr__(self):
|
|
- */
|
|
-
|
|
-/* Python wrapper */
|
|
-static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
-static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
- PyObject *__pyx_v_name = 0;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- int __pyx_r;
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
|
|
- {
|
|
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
|
|
- PyObject* values[1] = {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 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_name)) != 0)) kw_args--;
|
|
- else goto __pyx_L5_argtuple_error;
|
|
- }
|
|
- if (unlikely(kw_args > 0)) {
|
|
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 281, __pyx_L3_error)
|
|
- }
|
|
- } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
|
|
- goto __pyx_L5_argtuple_error;
|
|
+ __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
|
|
+ if (__pyx_t_2) {
|
|
} else {
|
|
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
|
|
+ __pyx_t_1 = __pyx_t_2;
|
|
+ goto __pyx_L12_bool_binop_done;
|
|
}
|
|
- __pyx_v_name = values[0];
|
|
- }
|
|
- goto __pyx_L4_argument_unpacking_done;
|
|
- __pyx_L5_argtuple_error:;
|
|
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 281, __pyx_L3_error)
|
|
- __pyx_L3_error:;
|
|
- __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return -1;
|
|
- __pyx_L4_argument_unpacking_done:;
|
|
- __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
|
|
-
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
|
|
- int __pyx_r;
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__init__", 0);
|
|
+ __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
|
|
+ __pyx_t_1 = __pyx_t_2;
|
|
+ __pyx_L12_bool_binop_done:;
|
|
+ __pyx_v_self->dtype_is_object = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":282
|
|
- * cdef object name
|
|
- * def __init__(self, name):
|
|
- * self.name = name # <<<<<<<<<<<<<<
|
|
- * def __repr__(self):
|
|
- * return self.name
|
|
+ /* "View.MemoryView":365
|
|
+ * raise MemoryError
|
|
+ *
|
|
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
|
|
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
|
|
+ * else:
|
|
*/
|
|
- __Pyx_INCREF(__pyx_v_name);
|
|
- __Pyx_GIVEREF(__pyx_v_name);
|
|
- __Pyx_GOTREF(__pyx_v_self->name);
|
|
- __Pyx_DECREF(__pyx_v_self->name);
|
|
- __pyx_v_self->name = __pyx_v_name;
|
|
+ goto __pyx_L11;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":281
|
|
- * cdef class Enum(object):
|
|
- * cdef object name
|
|
- * def __init__(self, name): # <<<<<<<<<<<<<<
|
|
- * self.name = name
|
|
- * def __repr__(self):
|
|
+ /* "View.MemoryView":368
|
|
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
|
|
+ * else:
|
|
+ * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
|
|
*/
|
|
+ /*else*/ {
|
|
+ __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
|
|
+ }
|
|
+ __pyx_L11:;
|
|
|
|
- /* function exit code */
|
|
- __pyx_r = 0;
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-/* "View.MemoryView":283
|
|
- * def __init__(self, name):
|
|
- * self.name = name
|
|
- * def __repr__(self): # <<<<<<<<<<<<<<
|
|
- * return self.name
|
|
+ /* "View.MemoryView":370
|
|
+ * self.dtype_is_object = dtype_is_object
|
|
*
|
|
+ * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
|
|
+ * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
|
|
+ * self.typeinfo = NULL
|
|
*/
|
|
+ __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
|
|
|
|
-/* Python wrapper */
|
|
-static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
|
|
-static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
|
|
- PyObject *__pyx_r = 0;
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
|
|
- __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
|
|
-
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
|
|
- PyObject *__pyx_r = NULL;
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__repr__", 0);
|
|
-
|
|
- /* "View.MemoryView":284
|
|
- * self.name = name
|
|
- * def __repr__(self):
|
|
- * return self.name # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":372
|
|
+ * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
|
|
+ * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
|
|
+ * self.typeinfo = NULL # <<<<<<<<<<<<<<
|
|
*
|
|
- * cdef generic = Enum("<strided and direct or indirect>")
|
|
+ * def __dealloc__(memoryview self):
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __Pyx_INCREF(__pyx_v_self->name);
|
|
- __pyx_r = __pyx_v_self->name;
|
|
- goto __pyx_L0;
|
|
+ __pyx_v_self->typeinfo = NULL;
|
|
|
|
- /* "View.MemoryView":283
|
|
- * def __init__(self, name):
|
|
- * self.name = name
|
|
- * def __repr__(self): # <<<<<<<<<<<<<<
|
|
- * return self.name
|
|
+ /* "View.MemoryView":346
|
|
+ * cdef __Pyx_TypeInfo *typeinfo
|
|
*
|
|
+ * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
|
|
+ * self.obj = obj
|
|
+ * self.flags = flags
|
|
*/
|
|
|
|
/* function exit code */
|
|
+ __pyx_r = 0;
|
|
+ goto __pyx_L0;
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = -1;
|
|
__pyx_L0:;
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "(tree fragment)":1
|
|
- * def __reduce_cython__(self): # <<<<<<<<<<<<<<
|
|
- * cdef tuple state
|
|
- * cdef object _dict
|
|
+/* "View.MemoryView":374
|
|
+ * self.typeinfo = NULL
|
|
+ *
|
|
+ * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
|
|
+ * if self.obj is not None:
|
|
+ * __Pyx_ReleaseBuffer(&self.view)
|
|
*/
|
|
|
|
/* Python wrapper */
|
|
-static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
-static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
|
|
- PyObject *__pyx_r = 0;
|
|
+static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
|
|
+static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
|
|
__Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
|
|
- __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
|
|
+ __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
|
|
+ __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
|
|
/* function exit code */
|
|
__Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
}
|
|
|
|
-static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
|
|
- PyObject *__pyx_v_state = 0;
|
|
- PyObject *__pyx_v__dict = 0;
|
|
- int __pyx_v_use_setstate;
|
|
- PyObject *__pyx_r = NULL;
|
|
+static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
+ int __pyx_v_i;
|
|
__Pyx_RefNannyDeclarations
|
|
- PyObject *__pyx_t_1 = NULL;
|
|
+ int __pyx_t_1;
|
|
int __pyx_t_2;
|
|
int __pyx_t_3;
|
|
- PyObject *__pyx_t_4 = NULL;
|
|
- PyObject *__pyx_t_5 = NULL;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__reduce_cython__", 0);
|
|
+ int __pyx_t_4;
|
|
+ int __pyx_t_5;
|
|
+ PyThread_type_lock __pyx_t_6;
|
|
+ PyThread_type_lock __pyx_t_7;
|
|
+ __Pyx_RefNannySetupContext("__dealloc__", 0);
|
|
|
|
- /* "(tree fragment)":5
|
|
- * cdef object _dict
|
|
- * cdef bint use_setstate
|
|
- * state = (self.name,) # <<<<<<<<<<<<<<
|
|
- * _dict = getattr(self, '__dict__', None)
|
|
- * if _dict is not None:
|
|
+ /* "View.MemoryView":375
|
|
+ *
|
|
+ * def __dealloc__(memoryview self):
|
|
+ * if self.obj is not None: # <<<<<<<<<<<<<<
|
|
+ * __Pyx_ReleaseBuffer(&self.view)
|
|
+ * elif (<__pyx_buffer *> &self.view).obj == Py_None:
|
|
*/
|
|
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __Pyx_INCREF(__pyx_v_self->name);
|
|
- __Pyx_GIVEREF(__pyx_v_self->name);
|
|
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
|
|
- __pyx_v_state = ((PyObject*)__pyx_t_1);
|
|
- __pyx_t_1 = 0;
|
|
+ __pyx_t_1 = (__pyx_v_self->obj != Py_None);
|
|
+ __pyx_t_2 = (__pyx_t_1 != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "(tree fragment)":6
|
|
- * cdef bint use_setstate
|
|
- * state = (self.name,)
|
|
- * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
|
|
- * if _dict is not None:
|
|
- * state += (_dict,)
|
|
+ /* "View.MemoryView":376
|
|
+ * def __dealloc__(memoryview self):
|
|
+ * if self.obj is not None:
|
|
+ * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
|
|
+ * elif (<__pyx_buffer *> &self.view).obj == Py_None:
|
|
+ *
|
|
*/
|
|
- __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_v__dict = __pyx_t_1;
|
|
- __pyx_t_1 = 0;
|
|
+ __Pyx_ReleaseBuffer((&__pyx_v_self->view));
|
|
|
|
- /* "(tree fragment)":7
|
|
- * state = (self.name,)
|
|
- * _dict = getattr(self, '__dict__', None)
|
|
- * if _dict is not None: # <<<<<<<<<<<<<<
|
|
- * state += (_dict,)
|
|
- * use_setstate = True
|
|
+ /* "View.MemoryView":375
|
|
+ *
|
|
+ * def __dealloc__(memoryview self):
|
|
+ * if self.obj is not None: # <<<<<<<<<<<<<<
|
|
+ * __Pyx_ReleaseBuffer(&self.view)
|
|
+ * elif (<__pyx_buffer *> &self.view).obj == Py_None:
|
|
*/
|
|
- __pyx_t_2 = (__pyx_v__dict != Py_None);
|
|
- __pyx_t_3 = (__pyx_t_2 != 0);
|
|
- if (__pyx_t_3) {
|
|
+ goto __pyx_L3;
|
|
+ }
|
|
|
|
- /* "(tree fragment)":8
|
|
- * _dict = getattr(self, '__dict__', None)
|
|
- * if _dict is not None:
|
|
- * state += (_dict,) # <<<<<<<<<<<<<<
|
|
- * use_setstate = True
|
|
- * else:
|
|
+ /* "View.MemoryView":377
|
|
+ * if self.obj is not None:
|
|
+ * __Pyx_ReleaseBuffer(&self.view)
|
|
+ * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * (<__pyx_buffer *> &self.view).obj = NULL
|
|
*/
|
|
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __Pyx_INCREF(__pyx_v__dict);
|
|
- __Pyx_GIVEREF(__pyx_v__dict);
|
|
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
|
|
- __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
- __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
|
|
- __pyx_t_4 = 0;
|
|
+ __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "(tree fragment)":9
|
|
- * if _dict is not None:
|
|
- * state += (_dict,)
|
|
- * use_setstate = True # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * use_setstate = self.name is not None
|
|
+ /* "View.MemoryView":379
|
|
+ * elif (<__pyx_buffer *> &self.view).obj == Py_None:
|
|
+ *
|
|
+ * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
|
|
+ * Py_DECREF(Py_None)
|
|
+ *
|
|
*/
|
|
- __pyx_v_use_setstate = 1;
|
|
+ ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
|
|
|
|
- /* "(tree fragment)":7
|
|
- * state = (self.name,)
|
|
- * _dict = getattr(self, '__dict__', None)
|
|
- * if _dict is not None: # <<<<<<<<<<<<<<
|
|
- * state += (_dict,)
|
|
- * use_setstate = True
|
|
+ /* "View.MemoryView":380
|
|
+ *
|
|
+ * (<__pyx_buffer *> &self.view).obj = NULL
|
|
+ * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * cdef int i
|
|
*/
|
|
- goto __pyx_L3;
|
|
- }
|
|
+ Py_DECREF(Py_None);
|
|
|
|
- /* "(tree fragment)":11
|
|
- * use_setstate = True
|
|
- * else:
|
|
- * use_setstate = self.name is not None # <<<<<<<<<<<<<<
|
|
- * if use_setstate:
|
|
- * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
|
|
+ /* "View.MemoryView":377
|
|
+ * if self.obj is not None:
|
|
+ * __Pyx_ReleaseBuffer(&self.view)
|
|
+ * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * (<__pyx_buffer *> &self.view).obj = NULL
|
|
*/
|
|
- /*else*/ {
|
|
- __pyx_t_3 = (__pyx_v_self->name != Py_None);
|
|
- __pyx_v_use_setstate = __pyx_t_3;
|
|
}
|
|
__pyx_L3:;
|
|
|
|
- /* "(tree fragment)":12
|
|
- * else:
|
|
- * use_setstate = self.name is not None
|
|
- * if use_setstate: # <<<<<<<<<<<<<<
|
|
- * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
|
|
- * else:
|
|
+ /* "View.MemoryView":384
|
|
+ * cdef int i
|
|
+ * global __pyx_memoryview_thread_locks_used
|
|
+ * if self.lock != NULL: # <<<<<<<<<<<<<<
|
|
+ * for i in range(__pyx_memoryview_thread_locks_used):
|
|
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
|
|
*/
|
|
- __pyx_t_3 = (__pyx_v_use_setstate != 0);
|
|
- if (__pyx_t_3) {
|
|
+ __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "(tree fragment)":13
|
|
- * use_setstate = self.name is not None
|
|
- * if use_setstate:
|
|
- * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
|
|
+ /* "View.MemoryView":385
|
|
+ * global __pyx_memoryview_thread_locks_used
|
|
+ * if self.lock != NULL:
|
|
+ * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
|
|
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
|
|
+ * __pyx_memoryview_thread_locks_used -= 1
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
|
|
- __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
|
|
- PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
|
|
- __Pyx_INCREF(__pyx_int_184977713);
|
|
- __Pyx_GIVEREF(__pyx_int_184977713);
|
|
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
|
|
- __Pyx_INCREF(Py_None);
|
|
- __Pyx_GIVEREF(Py_None);
|
|
- PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
|
|
- __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_5);
|
|
- __Pyx_GIVEREF(__pyx_t_4);
|
|
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
|
|
- __Pyx_GIVEREF(__pyx_t_1);
|
|
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
|
|
- __Pyx_INCREF(__pyx_v_state);
|
|
- __Pyx_GIVEREF(__pyx_v_state);
|
|
- PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
|
|
- __pyx_t_4 = 0;
|
|
- __pyx_t_1 = 0;
|
|
- __pyx_r = __pyx_t_5;
|
|
- __pyx_t_5 = 0;
|
|
- goto __pyx_L0;
|
|
+ __pyx_t_3 = __pyx_memoryview_thread_locks_used;
|
|
+ __pyx_t_4 = __pyx_t_3;
|
|
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
|
|
+ __pyx_v_i = __pyx_t_5;
|
|
|
|
- /* "(tree fragment)":12
|
|
- * else:
|
|
- * use_setstate = self.name is not None
|
|
- * if use_setstate: # <<<<<<<<<<<<<<
|
|
- * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
|
|
- * else:
|
|
+ /* "View.MemoryView":386
|
|
+ * if self.lock != NULL:
|
|
+ * for i in range(__pyx_memoryview_thread_locks_used):
|
|
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
|
|
+ * __pyx_memoryview_thread_locks_used -= 1
|
|
+ * if i != __pyx_memoryview_thread_locks_used:
|
|
*/
|
|
- }
|
|
+ __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "(tree fragment)":15
|
|
- * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
|
|
- * else:
|
|
- * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
|
|
- * def __setstate_cython__(self, __pyx_state):
|
|
- * __pyx_unpickle_Enum__set_state(self, __pyx_state)
|
|
+ /* "View.MemoryView":387
|
|
+ * for i in range(__pyx_memoryview_thread_locks_used):
|
|
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
|
|
+ * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
|
|
+ * if i != __pyx_memoryview_thread_locks_used:
|
|
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
|
|
*/
|
|
- /*else*/ {
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_5);
|
|
- __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
|
|
- __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
|
|
- PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
|
|
- __Pyx_INCREF(__pyx_int_184977713);
|
|
- __Pyx_GIVEREF(__pyx_int_184977713);
|
|
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
|
|
- __Pyx_INCREF(__pyx_v_state);
|
|
- __Pyx_GIVEREF(__pyx_v_state);
|
|
- PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
|
|
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __Pyx_GIVEREF(__pyx_t_5);
|
|
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
|
|
- __Pyx_GIVEREF(__pyx_t_1);
|
|
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
|
|
- __pyx_t_5 = 0;
|
|
- __pyx_t_1 = 0;
|
|
- __pyx_r = __pyx_t_4;
|
|
- __pyx_t_4 = 0;
|
|
- goto __pyx_L0;
|
|
- }
|
|
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
|
|
|
|
- /* "(tree fragment)":1
|
|
- * def __reduce_cython__(self): # <<<<<<<<<<<<<<
|
|
- * cdef tuple state
|
|
- * cdef object _dict
|
|
+ /* "View.MemoryView":388
|
|
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
|
|
+ * __pyx_memoryview_thread_locks_used -= 1
|
|
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
|
|
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
|
|
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
|
|
*/
|
|
+ __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* function exit code */
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_XDECREF(__pyx_t_4);
|
|
- __Pyx_XDECREF(__pyx_t_5);
|
|
- __Pyx_AddTraceback("View.MemoryView.Enum.__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)":16
|
|
- * else:
|
|
- * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
|
|
- * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
|
|
- * __pyx_unpickle_Enum__set_state(self, __pyx_state)
|
|
+ /* "View.MemoryView":390
|
|
+ * if i != __pyx_memoryview_thread_locks_used:
|
|
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
|
|
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
|
|
+ * break
|
|
+ * else:
|
|
*/
|
|
+ __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
|
|
+ __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
|
|
|
|
-/* Python wrapper */
|
|
-static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
|
|
-static PyObject *__pyx_pw___pyx_MemviewEnum_3__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___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
|
|
+ /* "View.MemoryView":389
|
|
+ * __pyx_memoryview_thread_locks_used -= 1
|
|
+ * if i != __pyx_memoryview_thread_locks_used:
|
|
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
|
|
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
|
|
+ * break
|
|
+ */
|
|
+ (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
|
|
+ (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
|
|
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
+ /* "View.MemoryView":388
|
|
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
|
|
+ * __pyx_memoryview_thread_locks_used -= 1
|
|
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
|
|
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
|
|
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
|
|
+ */
|
|
+ }
|
|
|
|
-static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
|
|
- PyObject *__pyx_r = NULL;
|
|
- __Pyx_RefNannyDeclarations
|
|
- PyObject *__pyx_t_1 = NULL;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__setstate_cython__", 0);
|
|
+ /* "View.MemoryView":391
|
|
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
|
|
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
|
|
+ * break # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * PyThread_free_lock(self.lock)
|
|
+ */
|
|
+ goto __pyx_L6_break;
|
|
|
|
- /* "(tree fragment)":17
|
|
- * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
|
|
- * def __setstate_cython__(self, __pyx_state):
|
|
- * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":386
|
|
+ * if self.lock != NULL:
|
|
+ * for i in range(__pyx_memoryview_thread_locks_used):
|
|
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
|
|
+ * __pyx_memoryview_thread_locks_used -= 1
|
|
+ * if i != __pyx_memoryview_thread_locks_used:
|
|
*/
|
|
- 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(2, 17, __pyx_L1_error)
|
|
- __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ }
|
|
+ }
|
|
+ /*else*/ {
|
|
|
|
- /* "(tree fragment)":16
|
|
- * else:
|
|
- * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
|
|
- * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
|
|
- * __pyx_unpickle_Enum__set_state(self, __pyx_state)
|
|
+ /* "View.MemoryView":393
|
|
+ * break
|
|
+ * else:
|
|
+ * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * cdef char *get_item_pointer(memoryview self, object index) except NULL:
|
|
*/
|
|
+ PyThread_free_lock(__pyx_v_self->lock);
|
|
+ }
|
|
+ __pyx_L6_break:;
|
|
|
|
- /* function exit code */
|
|
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
- goto __pyx_L0;
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = NULL;
|
|
- __pyx_L0:;
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
+ /* "View.MemoryView":384
|
|
+ * cdef int i
|
|
+ * global __pyx_memoryview_thread_locks_used
|
|
+ * if self.lock != NULL: # <<<<<<<<<<<<<<
|
|
+ * for i in range(__pyx_memoryview_thread_locks_used):
|
|
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
|
|
+ */
|
|
+ }
|
|
|
|
-/* "View.MemoryView":298
|
|
+ /* "View.MemoryView":374
|
|
+ * self.typeinfo = NULL
|
|
*
|
|
- * @cname('__pyx_align_pointer')
|
|
- * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
|
|
- * "Align pointer memory on a given boundary"
|
|
- * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
|
|
+ * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
|
|
+ * if self.obj is not None:
|
|
+ * __Pyx_ReleaseBuffer(&self.view)
|
|
*/
|
|
|
|
-static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
|
|
- Py_intptr_t __pyx_v_aligned_p;
|
|
- size_t __pyx_v_offset;
|
|
- void *__pyx_r;
|
|
- int __pyx_t_1;
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+}
|
|
|
|
- /* "View.MemoryView":300
|
|
- * cdef void *align_pointer(void *memory, size_t alignment) nogil:
|
|
- * "Align pointer memory on a given boundary"
|
|
- * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
|
|
- * cdef size_t offset
|
|
+/* "View.MemoryView":395
|
|
+ * PyThread_free_lock(self.lock)
|
|
*
|
|
+ * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
|
|
+ * cdef Py_ssize_t dim
|
|
+ * cdef char *itemp = <char *> self.view.buf
|
|
*/
|
|
- __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
|
|
|
|
- /* "View.MemoryView":304
|
|
- *
|
|
- * with cython.cdivision(True):
|
|
- * offset = aligned_p % alignment # <<<<<<<<<<<<<<
|
|
+static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
|
|
+ Py_ssize_t __pyx_v_dim;
|
|
+ char *__pyx_v_itemp;
|
|
+ PyObject *__pyx_v_idx = NULL;
|
|
+ char *__pyx_r;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ Py_ssize_t __pyx_t_1;
|
|
+ PyObject *__pyx_t_2 = NULL;
|
|
+ Py_ssize_t __pyx_t_3;
|
|
+ PyObject *(*__pyx_t_4)(PyObject *);
|
|
+ PyObject *__pyx_t_5 = NULL;
|
|
+ Py_ssize_t __pyx_t_6;
|
|
+ char *__pyx_t_7;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("get_item_pointer", 0);
|
|
+
|
|
+ /* "View.MemoryView":397
|
|
+ * cdef char *get_item_pointer(memoryview self, object index) except NULL:
|
|
+ * cdef Py_ssize_t dim
|
|
+ * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
|
|
*
|
|
- * if offset > 0:
|
|
+ * for dim, idx in enumerate(index):
|
|
*/
|
|
- __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
|
|
+ __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
|
|
|
|
- /* "View.MemoryView":306
|
|
- * offset = aligned_p % alignment
|
|
+ /* "View.MemoryView":399
|
|
+ * cdef char *itemp = <char *> self.view.buf
|
|
*
|
|
- * if offset > 0: # <<<<<<<<<<<<<<
|
|
- * aligned_p += alignment - offset
|
|
+ * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
|
|
+ * itemp = pybuffer_index(&self.view, itemp, idx, dim)
|
|
*
|
|
*/
|
|
- __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
|
|
- if (__pyx_t_1) {
|
|
+ __pyx_t_1 = 0;
|
|
+ if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
|
|
+ __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
|
|
+ __pyx_t_4 = NULL;
|
|
+ } else {
|
|
+ __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 399, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 399, __pyx_L1_error)
|
|
+ }
|
|
+ for (;;) {
|
|
+ if (likely(!__pyx_t_4)) {
|
|
+ if (likely(PyList_CheckExact(__pyx_t_2))) {
|
|
+ if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
|
|
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
+ __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 399, __pyx_L1_error)
|
|
+ #else
|
|
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_5);
|
|
+ #endif
|
|
+ } else {
|
|
+ if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
|
|
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
+ __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 399, __pyx_L1_error)
|
|
+ #else
|
|
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_5);
|
|
+ #endif
|
|
+ }
|
|
+ } else {
|
|
+ __pyx_t_5 = __pyx_t_4(__pyx_t_2);
|
|
+ if (unlikely(!__pyx_t_5)) {
|
|
+ PyObject* exc_type = PyErr_Occurred();
|
|
+ if (exc_type) {
|
|
+ if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
|
|
+ else __PYX_ERR(2, 399, __pyx_L1_error)
|
|
+ }
|
|
+ break;
|
|
+ }
|
|
+ __Pyx_GOTREF(__pyx_t_5);
|
|
+ }
|
|
+ __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
|
|
+ __pyx_t_5 = 0;
|
|
+ __pyx_v_dim = __pyx_t_1;
|
|
+ __pyx_t_1 = (__pyx_t_1 + 1);
|
|
|
|
- /* "View.MemoryView":307
|
|
+ /* "View.MemoryView":400
|
|
*
|
|
- * if offset > 0:
|
|
- * aligned_p += alignment - offset # <<<<<<<<<<<<<<
|
|
+ * for dim, idx in enumerate(index):
|
|
+ * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
|
|
*
|
|
- * return <void *> aligned_p
|
|
+ * return itemp
|
|
*/
|
|
- __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
|
|
+ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 400, __pyx_L1_error)
|
|
+ __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(2, 400, __pyx_L1_error)
|
|
+ __pyx_v_itemp = __pyx_t_7;
|
|
|
|
- /* "View.MemoryView":306
|
|
- * offset = aligned_p % alignment
|
|
+ /* "View.MemoryView":399
|
|
+ * cdef char *itemp = <char *> self.view.buf
|
|
*
|
|
- * if offset > 0: # <<<<<<<<<<<<<<
|
|
- * aligned_p += alignment - offset
|
|
+ * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
|
|
+ * itemp = pybuffer_index(&self.view, itemp, idx, dim)
|
|
*
|
|
*/
|
|
}
|
|
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
|
|
- /* "View.MemoryView":309
|
|
- * aligned_p += alignment - offset
|
|
+ /* "View.MemoryView":402
|
|
+ * itemp = pybuffer_index(&self.view, itemp, idx, dim)
|
|
*
|
|
- * return <void *> aligned_p # <<<<<<<<<<<<<<
|
|
+ * return itemp # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_r = ((void *)__pyx_v_aligned_p);
|
|
+ __pyx_r = __pyx_v_itemp;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":298
|
|
+ /* "View.MemoryView":395
|
|
+ * PyThread_free_lock(self.lock)
|
|
*
|
|
- * @cname('__pyx_align_pointer')
|
|
- * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
|
|
- * "Align pointer memory on a given boundary"
|
|
- * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
|
|
+ * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
|
|
+ * cdef Py_ssize_t dim
|
|
+ * cdef char *itemp = <char *> self.view.buf
|
|
*/
|
|
|
|
/* function exit code */
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_2);
|
|
+ __Pyx_XDECREF(__pyx_t_5);
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = NULL;
|
|
__pyx_L0:;
|
|
+ __Pyx_XDECREF(__pyx_v_idx);
|
|
+ __Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":345
|
|
- * cdef __Pyx_TypeInfo *typeinfo
|
|
+/* "View.MemoryView":405
|
|
*
|
|
- * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
|
|
- * self.obj = obj
|
|
- * self.flags = flags
|
|
+ *
|
|
+ * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
|
|
+ * if index is Ellipsis:
|
|
+ * return self
|
|
*/
|
|
|
|
/* Python wrapper */
|
|
-static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
-static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
- PyObject *__pyx_v_obj = 0;
|
|
- int __pyx_v_flags;
|
|
- int __pyx_v_dtype_is_object;
|
|
+static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
|
|
+static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
|
|
+ PyObject *__pyx_r = 0;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
|
|
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
|
|
+
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
|
|
+ PyObject *__pyx_v_have_slices = NULL;
|
|
+ PyObject *__pyx_v_indices = NULL;
|
|
+ char *__pyx_v_itemp;
|
|
+ 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;
|
|
+ char *__pyx_t_6;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- int __pyx_r;
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
|
|
- {
|
|
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
|
|
- PyObject* values[3] = {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 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_obj)) != 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_flags)) != 0)) kw_args--;
|
|
- else {
|
|
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 345, __pyx_L3_error)
|
|
- }
|
|
- CYTHON_FALLTHROUGH;
|
|
- case 2:
|
|
- if (kw_args > 0) {
|
|
- PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
|
|
- if (value) { values[2] = value; kw_args--; }
|
|
- }
|
|
- }
|
|
- if (unlikely(kw_args > 0)) {
|
|
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 345, __pyx_L3_error)
|
|
- }
|
|
- } else {
|
|
- switch (PyTuple_GET_SIZE(__pyx_args)) {
|
|
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
|
|
- CYTHON_FALLTHROUGH;
|
|
- case 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_obj = values[0];
|
|
- __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error)
|
|
- if (values[2]) {
|
|
- __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error)
|
|
- } else {
|
|
- __pyx_v_dtype_is_object = ((int)0);
|
|
- }
|
|
- }
|
|
- goto __pyx_L4_argument_unpacking_done;
|
|
- __pyx_L5_argtuple_error:;
|
|
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 345, __pyx_L3_error)
|
|
- __pyx_L3_error:;
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return -1;
|
|
- __pyx_L4_argument_unpacking_done:;
|
|
- __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
|
|
-
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-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) {
|
|
- int __pyx_r;
|
|
- __Pyx_RefNannyDeclarations
|
|
- int __pyx_t_1;
|
|
- int __pyx_t_2;
|
|
- int __pyx_t_3;
|
|
- int __pyx_t_4;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__cinit__", 0);
|
|
+ __Pyx_RefNannySetupContext("__getitem__", 0);
|
|
|
|
- /* "View.MemoryView":346
|
|
+ /* "View.MemoryView":406
|
|
+ *
|
|
+ * def __getitem__(memoryview self, object index):
|
|
+ * if index is Ellipsis: # <<<<<<<<<<<<<<
|
|
+ * return self
|
|
*
|
|
- * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
|
|
- * self.obj = obj # <<<<<<<<<<<<<<
|
|
- * self.flags = flags
|
|
- * if type(self) is memoryview or obj is not None:
|
|
*/
|
|
- __Pyx_INCREF(__pyx_v_obj);
|
|
- __Pyx_GIVEREF(__pyx_v_obj);
|
|
- __Pyx_GOTREF(__pyx_v_self->obj);
|
|
- __Pyx_DECREF(__pyx_v_self->obj);
|
|
- __pyx_v_self->obj = __pyx_v_obj;
|
|
+ __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
|
|
+ __pyx_t_2 = (__pyx_t_1 != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":347
|
|
- * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
|
|
- * self.obj = obj
|
|
- * self.flags = flags # <<<<<<<<<<<<<<
|
|
- * if type(self) is memoryview or obj is not None:
|
|
- * __Pyx_GetBuffer(obj, &self.view, flags)
|
|
+ /* "View.MemoryView":407
|
|
+ * def __getitem__(memoryview self, object index):
|
|
+ * if index is Ellipsis:
|
|
+ * return self # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * have_slices, indices = _unellipsify(index, self.view.ndim)
|
|
*/
|
|
- __pyx_v_self->flags = __pyx_v_flags;
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
|
|
+ __pyx_r = ((PyObject *)__pyx_v_self);
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":348
|
|
- * self.obj = obj
|
|
- * self.flags = flags
|
|
- * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
|
|
- * __Pyx_GetBuffer(obj, &self.view, flags)
|
|
- * if <PyObject *> self.view.obj == NULL:
|
|
+ /* "View.MemoryView":406
|
|
+ *
|
|
+ * def __getitem__(memoryview self, object index):
|
|
+ * if index is Ellipsis: # <<<<<<<<<<<<<<
|
|
+ * return self
|
|
+ *
|
|
*/
|
|
- __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
|
|
- __pyx_t_3 = (__pyx_t_2 != 0);
|
|
- if (!__pyx_t_3) {
|
|
- } else {
|
|
- __pyx_t_1 = __pyx_t_3;
|
|
- goto __pyx_L4_bool_binop_done;
|
|
}
|
|
- __pyx_t_3 = (__pyx_v_obj != Py_None);
|
|
- __pyx_t_2 = (__pyx_t_3 != 0);
|
|
- __pyx_t_1 = __pyx_t_2;
|
|
- __pyx_L4_bool_binop_done:;
|
|
- if (__pyx_t_1) {
|
|
-
|
|
- /* "View.MemoryView":349
|
|
- * self.flags = flags
|
|
- * if type(self) is memoryview or obj is not None:
|
|
- * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
|
|
- * if <PyObject *> self.view.obj == NULL:
|
|
- * (<__pyx_buffer *> &self.view).obj = Py_None
|
|
- */
|
|
- __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 349, __pyx_L1_error)
|
|
-
|
|
- /* "View.MemoryView":350
|
|
- * if type(self) is memoryview or obj is not None:
|
|
- * __Pyx_GetBuffer(obj, &self.view, flags)
|
|
- * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
|
|
- * (<__pyx_buffer *> &self.view).obj = Py_None
|
|
- * Py_INCREF(Py_None)
|
|
- */
|
|
- __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
|
|
- if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":351
|
|
- * __Pyx_GetBuffer(obj, &self.view, flags)
|
|
- * if <PyObject *> self.view.obj == NULL:
|
|
- * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
|
|
- * Py_INCREF(Py_None)
|
|
+ /* "View.MemoryView":409
|
|
+ * return self
|
|
*
|
|
- */
|
|
- ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
|
|
-
|
|
- /* "View.MemoryView":352
|
|
- * if <PyObject *> self.view.obj == NULL:
|
|
- * (<__pyx_buffer *> &self.view).obj = Py_None
|
|
- * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
|
|
+ * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
|
|
*
|
|
- * global __pyx_memoryview_thread_locks_used
|
|
- */
|
|
- Py_INCREF(Py_None);
|
|
-
|
|
- /* "View.MemoryView":350
|
|
- * if type(self) is memoryview or obj is not None:
|
|
- * __Pyx_GetBuffer(obj, &self.view, flags)
|
|
- * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
|
|
- * (<__pyx_buffer *> &self.view).obj = Py_None
|
|
- * Py_INCREF(Py_None)
|
|
+ * cdef char *itemp
|
|
*/
|
|
+ __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 409, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ if (likely(__pyx_t_3 != Py_None)) {
|
|
+ PyObject* sequence = __pyx_t_3;
|
|
+ Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
|
|
+ if (unlikely(size != 2)) {
|
|
+ if (size > 2) __Pyx_RaiseTooManyValuesError(2);
|
|
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
|
|
+ __PYX_ERR(2, 409, __pyx_L1_error)
|
|
}
|
|
-
|
|
- /* "View.MemoryView":348
|
|
- * self.obj = obj
|
|
- * self.flags = flags
|
|
- * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
|
|
- * __Pyx_GetBuffer(obj, &self.view, flags)
|
|
- * if <PyObject *> self.view.obj == NULL:
|
|
- */
|
|
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
+ __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
|
|
+ __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
|
|
+ __Pyx_INCREF(__pyx_t_4);
|
|
+ __Pyx_INCREF(__pyx_t_5);
|
|
+ #else
|
|
+ __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 409, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 409, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_5);
|
|
+ #endif
|
|
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
+ } else {
|
|
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 409, __pyx_L1_error)
|
|
}
|
|
+ __pyx_v_have_slices = __pyx_t_4;
|
|
+ __pyx_t_4 = 0;
|
|
+ __pyx_v_indices = __pyx_t_5;
|
|
+ __pyx_t_5 = 0;
|
|
|
|
- /* "View.MemoryView":355
|
|
+ /* "View.MemoryView":412
|
|
*
|
|
- * global __pyx_memoryview_thread_locks_used
|
|
- * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
|
|
- * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
|
|
- * __pyx_memoryview_thread_locks_used += 1
|
|
- */
|
|
- __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
|
|
- if (__pyx_t_1) {
|
|
-
|
|
- /* "View.MemoryView":356
|
|
- * global __pyx_memoryview_thread_locks_used
|
|
- * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
|
|
- * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
|
|
- * __pyx_memoryview_thread_locks_used += 1
|
|
- * if self.lock is NULL:
|
|
+ * cdef char *itemp
|
|
+ * if have_slices: # <<<<<<<<<<<<<<
|
|
+ * return memview_slice(self, indices)
|
|
+ * else:
|
|
*/
|
|
- __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
|
|
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 412, __pyx_L1_error)
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":357
|
|
- * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
|
|
- * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
|
|
- * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
|
|
- * if self.lock is NULL:
|
|
- * self.lock = PyThread_allocate_lock()
|
|
+ /* "View.MemoryView":413
|
|
+ * cdef char *itemp
|
|
+ * if have_slices:
|
|
+ * return memview_slice(self, indices) # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * itemp = self.get_item_pointer(indices)
|
|
*/
|
|
- __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 413, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ __pyx_r = __pyx_t_3;
|
|
+ __pyx_t_3 = 0;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":355
|
|
+ /* "View.MemoryView":412
|
|
*
|
|
- * global __pyx_memoryview_thread_locks_used
|
|
- * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
|
|
- * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
|
|
- * __pyx_memoryview_thread_locks_used += 1
|
|
+ * cdef char *itemp
|
|
+ * if have_slices: # <<<<<<<<<<<<<<
|
|
+ * return memview_slice(self, indices)
|
|
+ * else:
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":358
|
|
- * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
|
|
- * __pyx_memoryview_thread_locks_used += 1
|
|
- * if self.lock is NULL: # <<<<<<<<<<<<<<
|
|
- * self.lock = PyThread_allocate_lock()
|
|
- * if self.lock is NULL:
|
|
- */
|
|
- __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
|
|
- if (__pyx_t_1) {
|
|
-
|
|
- /* "View.MemoryView":359
|
|
- * __pyx_memoryview_thread_locks_used += 1
|
|
- * if self.lock is NULL:
|
|
- * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
|
|
- * if self.lock is NULL:
|
|
- * raise MemoryError
|
|
- */
|
|
- __pyx_v_self->lock = PyThread_allocate_lock();
|
|
-
|
|
- /* "View.MemoryView":360
|
|
- * if self.lock is NULL:
|
|
- * self.lock = PyThread_allocate_lock()
|
|
- * if self.lock is NULL: # <<<<<<<<<<<<<<
|
|
- * raise MemoryError
|
|
+ /* "View.MemoryView":415
|
|
+ * return memview_slice(self, indices)
|
|
+ * else:
|
|
+ * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
|
|
+ * return self.convert_item_to_object(itemp)
|
|
*
|
|
*/
|
|
- __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
|
|
- if (unlikely(__pyx_t_1)) {
|
|
+ /*else*/ {
|
|
+ __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(2, 415, __pyx_L1_error)
|
|
+ __pyx_v_itemp = __pyx_t_6;
|
|
|
|
- /* "View.MemoryView":361
|
|
- * self.lock = PyThread_allocate_lock()
|
|
- * if self.lock is NULL:
|
|
- * raise MemoryError # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":416
|
|
+ * else:
|
|
+ * itemp = self.get_item_pointer(indices)
|
|
+ * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
|
|
*
|
|
- * if flags & PyBUF_FORMAT:
|
|
+ * def __setitem__(memoryview self, object index, object value):
|
|
*/
|
|
- PyErr_NoMemory(); __PYX_ERR(2, 361, __pyx_L1_error)
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 416, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ __pyx_r = __pyx_t_3;
|
|
+ __pyx_t_3 = 0;
|
|
+ goto __pyx_L0;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":360
|
|
- * if self.lock is NULL:
|
|
- * self.lock = PyThread_allocate_lock()
|
|
- * if self.lock is NULL: # <<<<<<<<<<<<<<
|
|
- * raise MemoryError
|
|
+ /* "View.MemoryView":405
|
|
+ *
|
|
*
|
|
- */
|
|
- }
|
|
-
|
|
- /* "View.MemoryView":358
|
|
- * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
|
|
- * __pyx_memoryview_thread_locks_used += 1
|
|
- * if self.lock is NULL: # <<<<<<<<<<<<<<
|
|
- * self.lock = PyThread_allocate_lock()
|
|
- * if self.lock is NULL:
|
|
- */
|
|
- }
|
|
-
|
|
- /* "View.MemoryView":363
|
|
- * raise MemoryError
|
|
- *
|
|
- * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
|
|
- * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
|
|
- * else:
|
|
- */
|
|
- __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
|
|
- if (__pyx_t_1) {
|
|
-
|
|
- /* "View.MemoryView":364
|
|
- *
|
|
- * if flags & PyBUF_FORMAT:
|
|
- * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * self.dtype_is_object = dtype_is_object
|
|
- */
|
|
- __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
|
|
- if (__pyx_t_2) {
|
|
- } else {
|
|
- __pyx_t_1 = __pyx_t_2;
|
|
- goto __pyx_L11_bool_binop_done;
|
|
- }
|
|
- __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
|
|
- __pyx_t_1 = __pyx_t_2;
|
|
- __pyx_L11_bool_binop_done:;
|
|
- __pyx_v_self->dtype_is_object = __pyx_t_1;
|
|
-
|
|
- /* "View.MemoryView":363
|
|
- * raise MemoryError
|
|
- *
|
|
- * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
|
|
- * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
|
|
- * else:
|
|
- */
|
|
- goto __pyx_L10;
|
|
- }
|
|
-
|
|
- /* "View.MemoryView":366
|
|
- * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
|
|
- * else:
|
|
- * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
|
|
- *
|
|
- * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
|
|
- */
|
|
- /*else*/ {
|
|
- __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
|
|
- }
|
|
- __pyx_L10:;
|
|
-
|
|
- /* "View.MemoryView":368
|
|
- * self.dtype_is_object = dtype_is_object
|
|
- *
|
|
- * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
|
|
- * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
|
|
- * self.typeinfo = NULL
|
|
- */
|
|
- __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
|
|
-
|
|
- /* "View.MemoryView":370
|
|
- * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
|
|
- * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
|
|
- * self.typeinfo = NULL # <<<<<<<<<<<<<<
|
|
- *
|
|
- * def __dealloc__(memoryview self):
|
|
- */
|
|
- __pyx_v_self->typeinfo = NULL;
|
|
-
|
|
- /* "View.MemoryView":345
|
|
- * cdef __Pyx_TypeInfo *typeinfo
|
|
- *
|
|
- * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
|
|
- * self.obj = obj
|
|
- * self.flags = flags
|
|
+ * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
|
|
+ * if index is Ellipsis:
|
|
+ * return self
|
|
*/
|
|
|
|
/* function exit code */
|
|
- __pyx_r = 0;
|
|
- goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = -1;
|
|
+ __Pyx_XDECREF(__pyx_t_3);
|
|
+ __Pyx_XDECREF(__pyx_t_4);
|
|
+ __Pyx_XDECREF(__pyx_t_5);
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = NULL;
|
|
__pyx_L0:;
|
|
+ __Pyx_XDECREF(__pyx_v_have_slices);
|
|
+ __Pyx_XDECREF(__pyx_v_indices);
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":372
|
|
- * self.typeinfo = NULL
|
|
+/* "View.MemoryView":418
|
|
+ * return self.convert_item_to_object(itemp)
|
|
*
|
|
- * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
|
|
- * if self.obj is not None:
|
|
- * __Pyx_ReleaseBuffer(&self.view)
|
|
+ * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
|
|
+ * if self.view.readonly:
|
|
+ * raise TypeError("Cannot assign to read-only memoryview")
|
|
*/
|
|
|
|
/* Python wrapper */
|
|
-static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
|
|
-static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
|
|
+static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
|
|
+static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
|
|
+ int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
|
|
- __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
+ __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
|
|
+ __pyx_r = __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));
|
|
|
|
/* function exit code */
|
|
__Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
}
|
|
|
|
-static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
- int __pyx_v_i;
|
|
+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) {
|
|
+ PyObject *__pyx_v_have_slices = NULL;
|
|
+ PyObject *__pyx_v_obj = NULL;
|
|
+ int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
int __pyx_t_1;
|
|
- int __pyx_t_2;
|
|
- int __pyx_t_3;
|
|
- int __pyx_t_4;
|
|
- int __pyx_t_5;
|
|
- PyThread_type_lock __pyx_t_6;
|
|
- PyThread_type_lock __pyx_t_7;
|
|
- __Pyx_RefNannySetupContext("__dealloc__", 0);
|
|
+ PyObject *__pyx_t_2 = NULL;
|
|
+ PyObject *__pyx_t_3 = NULL;
|
|
+ PyObject *__pyx_t_4 = NULL;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("__setitem__", 0);
|
|
+ __Pyx_INCREF(__pyx_v_index);
|
|
|
|
- /* "View.MemoryView":373
|
|
+ /* "View.MemoryView":419
|
|
*
|
|
- * def __dealloc__(memoryview self):
|
|
- * if self.obj is not None: # <<<<<<<<<<<<<<
|
|
- * __Pyx_ReleaseBuffer(&self.view)
|
|
- * elif (<__pyx_buffer *> &self.view).obj == Py_None:
|
|
- */
|
|
- __pyx_t_1 = (__pyx_v_self->obj != Py_None);
|
|
- __pyx_t_2 = (__pyx_t_1 != 0);
|
|
- if (__pyx_t_2) {
|
|
-
|
|
- /* "View.MemoryView":374
|
|
- * def __dealloc__(memoryview self):
|
|
- * if self.obj is not None:
|
|
- * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
|
|
- * elif (<__pyx_buffer *> &self.view).obj == Py_None:
|
|
+ * def __setitem__(memoryview self, object index, object value):
|
|
+ * if self.view.readonly: # <<<<<<<<<<<<<<
|
|
+ * raise TypeError("Cannot assign to read-only memoryview")
|
|
*
|
|
*/
|
|
- __Pyx_ReleaseBuffer((&__pyx_v_self->view));
|
|
+ __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
|
|
+ if (unlikely(__pyx_t_1)) {
|
|
|
|
- /* "View.MemoryView":373
|
|
+ /* "View.MemoryView":420
|
|
+ * def __setitem__(memoryview self, object index, object value):
|
|
+ * if self.view.readonly:
|
|
+ * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
|
|
*
|
|
- * def __dealloc__(memoryview self):
|
|
- * if self.obj is not None: # <<<<<<<<<<<<<<
|
|
- * __Pyx_ReleaseBuffer(&self.view)
|
|
- * elif (<__pyx_buffer *> &self.view).obj == Py_None:
|
|
+ * have_slices, index = _unellipsify(index, self.view.ndim)
|
|
*/
|
|
- goto __pyx_L3;
|
|
- }
|
|
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 420, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
|
|
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
+ __PYX_ERR(2, 420, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":375
|
|
- * if self.obj is not None:
|
|
- * __Pyx_ReleaseBuffer(&self.view)
|
|
- * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":419
|
|
+ *
|
|
+ * def __setitem__(memoryview self, object index, object value):
|
|
+ * if self.view.readonly: # <<<<<<<<<<<<<<
|
|
+ * raise TypeError("Cannot assign to read-only memoryview")
|
|
*
|
|
- * (<__pyx_buffer *> &self.view).obj = NULL
|
|
*/
|
|
- __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
|
|
- if (__pyx_t_2) {
|
|
+ }
|
|
|
|
- /* "View.MemoryView":377
|
|
- * elif (<__pyx_buffer *> &self.view).obj == Py_None:
|
|
+ /* "View.MemoryView":422
|
|
+ * raise TypeError("Cannot assign to read-only memoryview")
|
|
*
|
|
- * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
|
|
- * Py_DECREF(Py_None)
|
|
+ * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
|
|
*
|
|
+ * if have_slices:
|
|
*/
|
|
- ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
|
|
+ __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 422, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ if (likely(__pyx_t_2 != Py_None)) {
|
|
+ PyObject* sequence = __pyx_t_2;
|
|
+ Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
|
|
+ if (unlikely(size != 2)) {
|
|
+ if (size > 2) __Pyx_RaiseTooManyValuesError(2);
|
|
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
|
|
+ __PYX_ERR(2, 422, __pyx_L1_error)
|
|
+ }
|
|
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
+ __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
|
|
+ __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
|
|
+ __Pyx_INCREF(__pyx_t_3);
|
|
+ __Pyx_INCREF(__pyx_t_4);
|
|
+ #else
|
|
+ __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 422, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 422, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ #endif
|
|
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
+ } else {
|
|
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 422, __pyx_L1_error)
|
|
+ }
|
|
+ __pyx_v_have_slices = __pyx_t_3;
|
|
+ __pyx_t_3 = 0;
|
|
+ __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
|
|
+ __pyx_t_4 = 0;
|
|
|
|
- /* "View.MemoryView":378
|
|
- *
|
|
- * (<__pyx_buffer *> &self.view).obj = NULL
|
|
- * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":424
|
|
+ * have_slices, index = _unellipsify(index, self.view.ndim)
|
|
*
|
|
- * cdef int i
|
|
+ * if have_slices: # <<<<<<<<<<<<<<
|
|
+ * obj = self.is_slice(value)
|
|
+ * if obj:
|
|
*/
|
|
- Py_DECREF(Py_None);
|
|
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 424, __pyx_L1_error)
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":375
|
|
- * if self.obj is not None:
|
|
- * __Pyx_ReleaseBuffer(&self.view)
|
|
- * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":425
|
|
*
|
|
- * (<__pyx_buffer *> &self.view).obj = NULL
|
|
+ * if have_slices:
|
|
+ * obj = self.is_slice(value) # <<<<<<<<<<<<<<
|
|
+ * if obj:
|
|
+ * self.setitem_slice_assignment(self[index], obj)
|
|
*/
|
|
- }
|
|
- __pyx_L3:;
|
|
+ __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 425, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __pyx_v_obj = __pyx_t_2;
|
|
+ __pyx_t_2 = 0;
|
|
|
|
- /* "View.MemoryView":382
|
|
- * cdef int i
|
|
- * global __pyx_memoryview_thread_locks_used
|
|
- * if self.lock != NULL: # <<<<<<<<<<<<<<
|
|
- * for i in range(__pyx_memoryview_thread_locks_used):
|
|
- * if __pyx_memoryview_thread_locks[i] is self.lock:
|
|
+ /* "View.MemoryView":426
|
|
+ * if have_slices:
|
|
+ * obj = self.is_slice(value)
|
|
+ * if obj: # <<<<<<<<<<<<<<
|
|
+ * self.setitem_slice_assignment(self[index], obj)
|
|
+ * else:
|
|
*/
|
|
- __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
|
|
- if (__pyx_t_2) {
|
|
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 426, __pyx_L1_error)
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":383
|
|
- * global __pyx_memoryview_thread_locks_used
|
|
- * if self.lock != NULL:
|
|
- * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
|
|
- * if __pyx_memoryview_thread_locks[i] is self.lock:
|
|
- * __pyx_memoryview_thread_locks_used -= 1
|
|
+ /* "View.MemoryView":427
|
|
+ * obj = self.is_slice(value)
|
|
+ * if obj:
|
|
+ * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * self.setitem_slice_assign_scalar(self[index], value)
|
|
*/
|
|
- __pyx_t_3 = __pyx_memoryview_thread_locks_used;
|
|
- __pyx_t_4 = __pyx_t_3;
|
|
- for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
|
|
- __pyx_v_i = __pyx_t_5;
|
|
+ __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 427, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 427, __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;
|
|
|
|
- /* "View.MemoryView":384
|
|
- * if self.lock != NULL:
|
|
- * for i in range(__pyx_memoryview_thread_locks_used):
|
|
- * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
|
|
- * __pyx_memoryview_thread_locks_used -= 1
|
|
- * if i != __pyx_memoryview_thread_locks_used:
|
|
- */
|
|
- __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
|
|
- if (__pyx_t_2) {
|
|
-
|
|
- /* "View.MemoryView":385
|
|
- * for i in range(__pyx_memoryview_thread_locks_used):
|
|
- * if __pyx_memoryview_thread_locks[i] is self.lock:
|
|
- * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
|
|
- * if i != __pyx_memoryview_thread_locks_used:
|
|
- * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
|
|
- */
|
|
- __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
|
|
-
|
|
- /* "View.MemoryView":386
|
|
- * if __pyx_memoryview_thread_locks[i] is self.lock:
|
|
- * __pyx_memoryview_thread_locks_used -= 1
|
|
- * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
|
|
- * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
|
|
- * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
|
|
- */
|
|
- __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
|
|
- if (__pyx_t_2) {
|
|
-
|
|
- /* "View.MemoryView":388
|
|
- * if i != __pyx_memoryview_thread_locks_used:
|
|
- * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
|
|
- * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
|
|
- * break
|
|
+ /* "View.MemoryView":426
|
|
+ * if have_slices:
|
|
+ * obj = self.is_slice(value)
|
|
+ * if obj: # <<<<<<<<<<<<<<
|
|
+ * self.setitem_slice_assignment(self[index], obj)
|
|
* else:
|
|
*/
|
|
- __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
|
|
- __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
|
|
-
|
|
- /* "View.MemoryView":387
|
|
- * __pyx_memoryview_thread_locks_used -= 1
|
|
- * if i != __pyx_memoryview_thread_locks_used:
|
|
- * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
|
|
- * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
|
|
- * break
|
|
- */
|
|
- (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
|
|
- (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
|
|
-
|
|
- /* "View.MemoryView":386
|
|
- * if __pyx_memoryview_thread_locks[i] is self.lock:
|
|
- * __pyx_memoryview_thread_locks_used -= 1
|
|
- * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
|
|
- * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
|
|
- * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
|
|
- */
|
|
- }
|
|
+ goto __pyx_L5;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":389
|
|
- * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
|
|
- * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
|
|
- * break # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":429
|
|
+ * self.setitem_slice_assignment(self[index], obj)
|
|
* else:
|
|
- * PyThread_free_lock(self.lock)
|
|
- */
|
|
- goto __pyx_L6_break;
|
|
-
|
|
- /* "View.MemoryView":384
|
|
- * if self.lock != NULL:
|
|
- * for i in range(__pyx_memoryview_thread_locks_used):
|
|
- * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
|
|
- * __pyx_memoryview_thread_locks_used -= 1
|
|
- * if i != __pyx_memoryview_thread_locks_used:
|
|
+ * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * self.setitem_indexed(index, value)
|
|
*/
|
|
- }
|
|
- }
|
|
/*else*/ {
|
|
+ __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 429, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(2, 429, __pyx_L1_error)
|
|
+ __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 429, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
+ }
|
|
+ __pyx_L5:;
|
|
|
|
- /* "View.MemoryView":391
|
|
- * break
|
|
- * else:
|
|
- * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":424
|
|
+ * have_slices, index = _unellipsify(index, self.view.ndim)
|
|
*
|
|
- * cdef char *get_item_pointer(memoryview self, object index) except NULL:
|
|
+ * if have_slices: # <<<<<<<<<<<<<<
|
|
+ * obj = self.is_slice(value)
|
|
+ * if obj:
|
|
*/
|
|
- PyThread_free_lock(__pyx_v_self->lock);
|
|
- }
|
|
- __pyx_L6_break:;
|
|
+ goto __pyx_L4;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":382
|
|
- * cdef int i
|
|
- * global __pyx_memoryview_thread_locks_used
|
|
- * if self.lock != NULL: # <<<<<<<<<<<<<<
|
|
- * for i in range(__pyx_memoryview_thread_locks_used):
|
|
- * if __pyx_memoryview_thread_locks[i] is self.lock:
|
|
+ /* "View.MemoryView":431
|
|
+ * self.setitem_slice_assign_scalar(self[index], value)
|
|
+ * else:
|
|
+ * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * cdef is_slice(self, obj):
|
|
*/
|
|
+ /*else*/ {
|
|
+ __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 431, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
}
|
|
+ __pyx_L4:;
|
|
|
|
- /* "View.MemoryView":372
|
|
- * self.typeinfo = NULL
|
|
+ /* "View.MemoryView":418
|
|
+ * return self.convert_item_to_object(itemp)
|
|
*
|
|
- * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
|
|
- * if self.obj is not None:
|
|
- * __Pyx_ReleaseBuffer(&self.view)
|
|
+ * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
|
|
+ * if self.view.readonly:
|
|
+ * raise TypeError("Cannot assign to read-only memoryview")
|
|
*/
|
|
|
|
/* 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_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = -1;
|
|
+ __pyx_L0:;
|
|
+ __Pyx_XDECREF(__pyx_v_have_slices);
|
|
+ __Pyx_XDECREF(__pyx_v_obj);
|
|
+ __Pyx_XDECREF(__pyx_v_index);
|
|
__Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":393
|
|
- * PyThread_free_lock(self.lock)
|
|
+/* "View.MemoryView":433
|
|
+ * self.setitem_indexed(index, value)
|
|
*
|
|
- * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
|
|
- * cdef Py_ssize_t dim
|
|
- * cdef char *itemp = <char *> self.view.buf
|
|
+ * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
|
|
+ * if not isinstance(obj, memoryview):
|
|
+ * try:
|
|
*/
|
|
|
|
-static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
|
|
- Py_ssize_t __pyx_v_dim;
|
|
- char *__pyx_v_itemp;
|
|
- PyObject *__pyx_v_idx = NULL;
|
|
- char *__pyx_r;
|
|
+static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
|
|
+ PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
- Py_ssize_t __pyx_t_1;
|
|
- PyObject *__pyx_t_2 = NULL;
|
|
- Py_ssize_t __pyx_t_3;
|
|
- PyObject *(*__pyx_t_4)(PyObject *);
|
|
+ int __pyx_t_1;
|
|
+ int __pyx_t_2;
|
|
+ PyObject *__pyx_t_3 = NULL;
|
|
+ PyObject *__pyx_t_4 = NULL;
|
|
PyObject *__pyx_t_5 = NULL;
|
|
- Py_ssize_t __pyx_t_6;
|
|
- char *__pyx_t_7;
|
|
+ PyObject *__pyx_t_6 = NULL;
|
|
+ PyObject *__pyx_t_7 = NULL;
|
|
+ PyObject *__pyx_t_8 = NULL;
|
|
+ int __pyx_t_9;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("get_item_pointer", 0);
|
|
-
|
|
- /* "View.MemoryView":395
|
|
- * cdef char *get_item_pointer(memoryview self, object index) except NULL:
|
|
- * cdef Py_ssize_t dim
|
|
- * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
|
|
- *
|
|
- * for dim, idx in enumerate(index):
|
|
- */
|
|
- __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
|
|
+ __Pyx_RefNannySetupContext("is_slice", 0);
|
|
+ __Pyx_INCREF(__pyx_v_obj);
|
|
|
|
- /* "View.MemoryView":397
|
|
- * cdef char *itemp = <char *> self.view.buf
|
|
- *
|
|
- * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
|
|
- * itemp = pybuffer_index(&self.view, itemp, idx, dim)
|
|
+ /* "View.MemoryView":434
|
|
*
|
|
+ * cdef is_slice(self, obj):
|
|
+ * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
|
|
+ * try:
|
|
+ * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
|
|
*/
|
|
- __pyx_t_1 = 0;
|
|
- if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
|
|
- __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
|
|
- __pyx_t_4 = NULL;
|
|
- } else {
|
|
- __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 397, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 397, __pyx_L1_error)
|
|
- }
|
|
- for (;;) {
|
|
- if (likely(!__pyx_t_4)) {
|
|
- if (likely(PyList_CheckExact(__pyx_t_2))) {
|
|
- if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
|
|
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
- __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 397, __pyx_L1_error)
|
|
- #else
|
|
- __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_5);
|
|
- #endif
|
|
- } else {
|
|
- if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
|
|
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
- __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 397, __pyx_L1_error)
|
|
- #else
|
|
- __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_5);
|
|
- #endif
|
|
- }
|
|
- } else {
|
|
- __pyx_t_5 = __pyx_t_4(__pyx_t_2);
|
|
- if (unlikely(!__pyx_t_5)) {
|
|
- PyObject* exc_type = PyErr_Occurred();
|
|
- if (exc_type) {
|
|
- if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
|
|
- else __PYX_ERR(2, 397, __pyx_L1_error)
|
|
- }
|
|
- break;
|
|
- }
|
|
- __Pyx_GOTREF(__pyx_t_5);
|
|
- }
|
|
- __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
|
|
- __pyx_t_5 = 0;
|
|
- __pyx_v_dim = __pyx_t_1;
|
|
- __pyx_t_1 = (__pyx_t_1 + 1);
|
|
+ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
|
|
+ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":398
|
|
- *
|
|
- * for dim, idx in enumerate(index):
|
|
- * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
|
|
- *
|
|
- * return itemp
|
|
+ /* "View.MemoryView":435
|
|
+ * cdef is_slice(self, obj):
|
|
+ * if not isinstance(obj, memoryview):
|
|
+ * try: # <<<<<<<<<<<<<<
|
|
+ * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
|
|
+ * self.dtype_is_object)
|
|
*/
|
|
- __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 398, __pyx_L1_error)
|
|
- __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(2, 398, __pyx_L1_error)
|
|
- __pyx_v_itemp = __pyx_t_7;
|
|
+ {
|
|
+ __Pyx_PyThreadState_declare
|
|
+ __Pyx_PyThreadState_assign
|
|
+ __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
|
|
+ __Pyx_XGOTREF(__pyx_t_3);
|
|
+ __Pyx_XGOTREF(__pyx_t_4);
|
|
+ __Pyx_XGOTREF(__pyx_t_5);
|
|
+ /*try:*/ {
|
|
|
|
- /* "View.MemoryView":397
|
|
- * cdef char *itemp = <char *> self.view.buf
|
|
- *
|
|
- * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
|
|
- * itemp = pybuffer_index(&self.view, itemp, idx, dim)
|
|
- *
|
|
+ /* "View.MemoryView":436
|
|
+ * if not isinstance(obj, memoryview):
|
|
+ * try:
|
|
+ * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
|
|
+ * self.dtype_is_object)
|
|
+ * except TypeError:
|
|
*/
|
|
- }
|
|
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
+ __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 436, __pyx_L4_error)
|
|
+ __Pyx_GOTREF(__pyx_t_6);
|
|
|
|
- /* "View.MemoryView":400
|
|
- * itemp = pybuffer_index(&self.view, itemp, idx, dim)
|
|
+ /* "View.MemoryView":437
|
|
+ * try:
|
|
+ * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
|
|
+ * self.dtype_is_object) # <<<<<<<<<<<<<<
|
|
+ * except TypeError:
|
|
+ * return None
|
|
+ */
|
|
+ __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 437, __pyx_L4_error)
|
|
+ __Pyx_GOTREF(__pyx_t_7);
|
|
+
|
|
+ /* "View.MemoryView":436
|
|
+ * if not isinstance(obj, memoryview):
|
|
+ * try:
|
|
+ * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
|
|
+ * self.dtype_is_object)
|
|
+ * except TypeError:
|
|
+ */
|
|
+ __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 436, __pyx_L4_error)
|
|
+ __Pyx_GOTREF(__pyx_t_8);
|
|
+ __Pyx_INCREF(__pyx_v_obj);
|
|
+ __Pyx_GIVEREF(__pyx_v_obj);
|
|
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
|
|
+ __Pyx_GIVEREF(__pyx_t_6);
|
|
+ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
|
|
+ __Pyx_GIVEREF(__pyx_t_7);
|
|
+ PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
|
|
+ __pyx_t_6 = 0;
|
|
+ __pyx_t_7 = 0;
|
|
+ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 436, __pyx_L4_error)
|
|
+ __Pyx_GOTREF(__pyx_t_7);
|
|
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
|
|
+ __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
|
|
+ __pyx_t_7 = 0;
|
|
+
|
|
+ /* "View.MemoryView":435
|
|
+ * cdef is_slice(self, obj):
|
|
+ * if not isinstance(obj, memoryview):
|
|
+ * try: # <<<<<<<<<<<<<<
|
|
+ * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
|
|
+ * self.dtype_is_object)
|
|
+ */
|
|
+ }
|
|
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
+ goto __pyx_L9_try_end;
|
|
+ __pyx_L4_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
|
|
+
|
|
+ /* "View.MemoryView":438
|
|
+ * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
|
|
+ * self.dtype_is_object)
|
|
+ * except TypeError: # <<<<<<<<<<<<<<
|
|
+ * return None
|
|
*
|
|
- * return itemp # <<<<<<<<<<<<<<
|
|
+ */
|
|
+ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
|
|
+ if (__pyx_t_9) {
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 438, __pyx_L6_except_error)
|
|
+ __Pyx_GOTREF(__pyx_t_7);
|
|
+ __Pyx_GOTREF(__pyx_t_8);
|
|
+ __Pyx_GOTREF(__pyx_t_6);
|
|
+
|
|
+ /* "View.MemoryView":439
|
|
+ * self.dtype_is_object)
|
|
+ * except TypeError:
|
|
+ * return None # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * return obj
|
|
+ */
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
|
|
+ goto __pyx_L7_except_return;
|
|
+ }
|
|
+ goto __pyx_L6_except_error;
|
|
+ __pyx_L6_except_error:;
|
|
+
|
|
+ /* "View.MemoryView":435
|
|
+ * cdef is_slice(self, obj):
|
|
+ * if not isinstance(obj, memoryview):
|
|
+ * try: # <<<<<<<<<<<<<<
|
|
+ * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
|
|
+ * self.dtype_is_object)
|
|
+ */
|
|
+ __Pyx_XGIVEREF(__pyx_t_3);
|
|
+ __Pyx_XGIVEREF(__pyx_t_4);
|
|
+ __Pyx_XGIVEREF(__pyx_t_5);
|
|
+ __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
|
|
+ goto __pyx_L1_error;
|
|
+ __pyx_L7_except_return:;
|
|
+ __Pyx_XGIVEREF(__pyx_t_3);
|
|
+ __Pyx_XGIVEREF(__pyx_t_4);
|
|
+ __Pyx_XGIVEREF(__pyx_t_5);
|
|
+ __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
|
|
+ goto __pyx_L0;
|
|
+ __pyx_L9_try_end:;
|
|
+ }
|
|
+
|
|
+ /* "View.MemoryView":434
|
|
*
|
|
+ * cdef is_slice(self, obj):
|
|
+ * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
|
|
+ * try:
|
|
+ * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
|
|
+ */
|
|
+ }
|
|
+
|
|
+ /* "View.MemoryView":441
|
|
+ * return None
|
|
+ *
|
|
+ * return obj # <<<<<<<<<<<<<<
|
|
*
|
|
+ * cdef setitem_slice_assignment(self, dst, src):
|
|
*/
|
|
- __pyx_r = __pyx_v_itemp;
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __Pyx_INCREF(__pyx_v_obj);
|
|
+ __pyx_r = __pyx_v_obj;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":393
|
|
- * PyThread_free_lock(self.lock)
|
|
+ /* "View.MemoryView":433
|
|
+ * self.setitem_indexed(index, value)
|
|
*
|
|
- * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
|
|
- * cdef Py_ssize_t dim
|
|
- * cdef char *itemp = <char *> self.view.buf
|
|
+ * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
|
|
+ * if not isinstance(obj, memoryview):
|
|
+ * try:
|
|
*/
|
|
|
|
/* function exit code */
|
|
__pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_2);
|
|
- __Pyx_XDECREF(__pyx_t_5);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = NULL;
|
|
+ __Pyx_XDECREF(__pyx_t_6);
|
|
+ __Pyx_XDECREF(__pyx_t_7);
|
|
+ __Pyx_XDECREF(__pyx_t_8);
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = 0;
|
|
__pyx_L0:;
|
|
- __Pyx_XDECREF(__pyx_v_idx);
|
|
+ __Pyx_XDECREF(__pyx_v_obj);
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":403
|
|
- *
|
|
+/* "View.MemoryView":443
|
|
+ * return obj
|
|
*
|
|
- * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
|
|
- * if index is Ellipsis:
|
|
- * return self
|
|
+ * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
|
|
+ * cdef __Pyx_memviewslice dst_slice
|
|
+ * cdef __Pyx_memviewslice src_slice
|
|
*/
|
|
|
|
-/* Python wrapper */
|
|
-static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
|
|
-static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
|
|
- PyObject *__pyx_r = 0;
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
|
|
- __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
|
|
-
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
|
|
- PyObject *__pyx_v_have_slices = NULL;
|
|
- PyObject *__pyx_v_indices = NULL;
|
|
- char *__pyx_v_itemp;
|
|
+static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
|
|
+ __Pyx_memviewslice __pyx_v_dst_slice;
|
|
+ __Pyx_memviewslice __pyx_v_src_slice;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
- int __pyx_t_1;
|
|
- int __pyx_t_2;
|
|
+ __Pyx_memviewslice *__pyx_t_1;
|
|
+ __Pyx_memviewslice *__pyx_t_2;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
- PyObject *__pyx_t_4 = NULL;
|
|
- PyObject *__pyx_t_5 = NULL;
|
|
- char *__pyx_t_6;
|
|
+ int __pyx_t_4;
|
|
+ int __pyx_t_5;
|
|
+ int __pyx_t_6;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__getitem__", 0);
|
|
+ __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
|
|
|
|
- /* "View.MemoryView":404
|
|
- *
|
|
- * def __getitem__(memoryview self, object index):
|
|
- * if index is Ellipsis: # <<<<<<<<<<<<<<
|
|
- * return self
|
|
+ /* "View.MemoryView":447
|
|
+ * cdef __Pyx_memviewslice src_slice
|
|
*
|
|
+ * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
|
|
+ * get_slice_from_memview(dst, &dst_slice)[0],
|
|
+ * src.ndim, dst.ndim, self.dtype_is_object)
|
|
*/
|
|
- __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
|
|
- __pyx_t_2 = (__pyx_t_1 != 0);
|
|
- if (__pyx_t_2) {
|
|
+ if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 447, __pyx_L1_error)
|
|
+ __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 447, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":405
|
|
- * def __getitem__(memoryview self, object index):
|
|
- * if index is Ellipsis:
|
|
- * return self # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":448
|
|
+ *
|
|
+ * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
|
|
+ * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
|
|
+ * src.ndim, dst.ndim, self.dtype_is_object)
|
|
*
|
|
- * have_slices, indices = _unellipsify(index, self.view.ndim)
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
|
|
- __pyx_r = ((PyObject *)__pyx_v_self);
|
|
- goto __pyx_L0;
|
|
+ if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 448, __pyx_L1_error)
|
|
+ __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 448, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":404
|
|
- *
|
|
- * def __getitem__(memoryview self, object index):
|
|
- * if index is Ellipsis: # <<<<<<<<<<<<<<
|
|
- * return self
|
|
+ /* "View.MemoryView":449
|
|
+ * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
|
|
+ * get_slice_from_memview(dst, &dst_slice)[0],
|
|
+ * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
|
|
*
|
|
+ * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
|
|
*/
|
|
- }
|
|
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 449, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 449, __pyx_L1_error)
|
|
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 449, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 449, __pyx_L1_error)
|
|
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
- /* "View.MemoryView":407
|
|
- * return self
|
|
- *
|
|
- * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":447
|
|
+ * cdef __Pyx_memviewslice src_slice
|
|
*
|
|
- * cdef char *itemp
|
|
+ * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
|
|
+ * get_slice_from_memview(dst, &dst_slice)[0],
|
|
+ * src.ndim, dst.ndim, self.dtype_is_object)
|
|
*/
|
|
- __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 407, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- if (likely(__pyx_t_3 != Py_None)) {
|
|
- PyObject* sequence = __pyx_t_3;
|
|
- Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
|
|
- if (unlikely(size != 2)) {
|
|
- if (size > 2) __Pyx_RaiseTooManyValuesError(2);
|
|
- else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
|
|
- __PYX_ERR(2, 407, __pyx_L1_error)
|
|
- }
|
|
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
- __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
|
|
- __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
|
|
- __Pyx_INCREF(__pyx_t_4);
|
|
- __Pyx_INCREF(__pyx_t_5);
|
|
- #else
|
|
- __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 407, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 407, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_5);
|
|
- #endif
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- } else {
|
|
- __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 407, __pyx_L1_error)
|
|
- }
|
|
- __pyx_v_have_slices = __pyx_t_4;
|
|
- __pyx_t_4 = 0;
|
|
- __pyx_v_indices = __pyx_t_5;
|
|
- __pyx_t_5 = 0;
|
|
+ __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 447, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":410
|
|
+ /* "View.MemoryView":443
|
|
+ * return obj
|
|
*
|
|
- * cdef char *itemp
|
|
- * if have_slices: # <<<<<<<<<<<<<<
|
|
- * return memview_slice(self, indices)
|
|
- * else:
|
|
- */
|
|
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 410, __pyx_L1_error)
|
|
- if (__pyx_t_2) {
|
|
-
|
|
- /* "View.MemoryView":411
|
|
- * cdef char *itemp
|
|
- * if have_slices:
|
|
- * return memview_slice(self, indices) # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * itemp = self.get_item_pointer(indices)
|
|
- */
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 411, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_r = __pyx_t_3;
|
|
- __pyx_t_3 = 0;
|
|
- goto __pyx_L0;
|
|
-
|
|
- /* "View.MemoryView":410
|
|
- *
|
|
- * cdef char *itemp
|
|
- * if have_slices: # <<<<<<<<<<<<<<
|
|
- * return memview_slice(self, indices)
|
|
- * else:
|
|
- */
|
|
- }
|
|
-
|
|
- /* "View.MemoryView":413
|
|
- * return memview_slice(self, indices)
|
|
- * else:
|
|
- * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
|
|
- * return self.convert_item_to_object(itemp)
|
|
- *
|
|
- */
|
|
- /*else*/ {
|
|
- __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(2, 413, __pyx_L1_error)
|
|
- __pyx_v_itemp = __pyx_t_6;
|
|
-
|
|
- /* "View.MemoryView":414
|
|
- * else:
|
|
- * itemp = self.get_item_pointer(indices)
|
|
- * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
|
|
- *
|
|
- * def __setitem__(memoryview self, object index, object value):
|
|
- */
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 414, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_r = __pyx_t_3;
|
|
- __pyx_t_3 = 0;
|
|
- goto __pyx_L0;
|
|
- }
|
|
-
|
|
- /* "View.MemoryView":403
|
|
- *
|
|
- *
|
|
- * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
|
|
- * if index is Ellipsis:
|
|
- * return self
|
|
+ * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
|
|
+ * cdef __Pyx_memviewslice dst_slice
|
|
+ * cdef __Pyx_memviewslice src_slice
|
|
*/
|
|
|
|
/* function exit code */
|
|
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
+ goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_3);
|
|
- __Pyx_XDECREF(__pyx_t_4);
|
|
- __Pyx_XDECREF(__pyx_t_5);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = NULL;
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = 0;
|
|
__pyx_L0:;
|
|
- __Pyx_XDECREF(__pyx_v_have_slices);
|
|
- __Pyx_XDECREF(__pyx_v_indices);
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":416
|
|
- * return self.convert_item_to_object(itemp)
|
|
+/* "View.MemoryView":451
|
|
+ * src.ndim, dst.ndim, self.dtype_is_object)
|
|
*
|
|
- * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
|
|
- * if self.view.readonly:
|
|
- * raise TypeError("Cannot assign to read-only memoryview")
|
|
+ * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
|
|
+ * cdef int array[128]
|
|
+ * cdef void *tmp = NULL
|
|
*/
|
|
|
|
-/* Python wrapper */
|
|
-static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
|
|
-static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
|
|
- int __pyx_r;
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
|
|
- __pyx_r = __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));
|
|
-
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-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) {
|
|
- PyObject *__pyx_v_have_slices = NULL;
|
|
- PyObject *__pyx_v_obj = NULL;
|
|
- int __pyx_r;
|
|
+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) {
|
|
+ int __pyx_v_array[0x80];
|
|
+ void *__pyx_v_tmp;
|
|
+ void *__pyx_v_item;
|
|
+ __Pyx_memviewslice *__pyx_v_dst_slice;
|
|
+ __Pyx_memviewslice __pyx_v_tmp_slice;
|
|
+ PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
- int __pyx_t_1;
|
|
- PyObject *__pyx_t_2 = NULL;
|
|
+ __Pyx_memviewslice *__pyx_t_1;
|
|
+ int __pyx_t_2;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
- PyObject *__pyx_t_4 = NULL;
|
|
+ int __pyx_t_4;
|
|
+ int __pyx_t_5;
|
|
+ char const *__pyx_t_6;
|
|
+ PyObject *__pyx_t_7 = NULL;
|
|
+ PyObject *__pyx_t_8 = NULL;
|
|
+ PyObject *__pyx_t_9 = NULL;
|
|
+ PyObject *__pyx_t_10 = NULL;
|
|
+ PyObject *__pyx_t_11 = NULL;
|
|
+ PyObject *__pyx_t_12 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__setitem__", 0);
|
|
- __Pyx_INCREF(__pyx_v_index);
|
|
+ __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
|
|
|
|
- /* "View.MemoryView":417
|
|
+ /* "View.MemoryView":453
|
|
+ * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
|
|
+ * cdef int array[128]
|
|
+ * cdef void *tmp = NULL # <<<<<<<<<<<<<<
|
|
+ * cdef void *item
|
|
*
|
|
- * def __setitem__(memoryview self, object index, object value):
|
|
- * if self.view.readonly: # <<<<<<<<<<<<<<
|
|
- * raise TypeError("Cannot assign to read-only memoryview")
|
|
+ */
|
|
+ __pyx_v_tmp = NULL;
|
|
+
|
|
+ /* "View.MemoryView":458
|
|
+ * cdef __Pyx_memviewslice *dst_slice
|
|
+ * cdef __Pyx_memviewslice tmp_slice
|
|
+ * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
|
|
*
|
|
+ * if <size_t>self.view.itemsize > sizeof(array):
|
|
*/
|
|
- __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
|
|
- if (unlikely(__pyx_t_1)) {
|
|
+ __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 458, __pyx_L1_error)
|
|
+ __pyx_v_dst_slice = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":418
|
|
- * def __setitem__(memoryview self, object index, object value):
|
|
- * if self.view.readonly:
|
|
- * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":460
|
|
+ * dst_slice = get_slice_from_memview(dst, &tmp_slice)
|
|
*
|
|
- * have_slices, index = _unellipsify(index, self.view.ndim)
|
|
+ * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
|
|
+ * tmp = PyMem_Malloc(self.view.itemsize)
|
|
+ * if tmp == NULL:
|
|
*/
|
|
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 418, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
|
|
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __PYX_ERR(2, 418, __pyx_L1_error)
|
|
+ __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":417
|
|
+ /* "View.MemoryView":461
|
|
*
|
|
- * def __setitem__(memoryview self, object index, object value):
|
|
- * if self.view.readonly: # <<<<<<<<<<<<<<
|
|
- * raise TypeError("Cannot assign to read-only memoryview")
|
|
+ * if <size_t>self.view.itemsize > sizeof(array):
|
|
+ * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
|
|
+ * if tmp == NULL:
|
|
+ * raise MemoryError
|
|
+ */
|
|
+ __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
|
|
+
|
|
+ /* "View.MemoryView":462
|
|
+ * if <size_t>self.view.itemsize > sizeof(array):
|
|
+ * tmp = PyMem_Malloc(self.view.itemsize)
|
|
+ * if tmp == NULL: # <<<<<<<<<<<<<<
|
|
+ * raise MemoryError
|
|
+ * item = tmp
|
|
+ */
|
|
+ __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
|
|
+ if (unlikely(__pyx_t_2)) {
|
|
+
|
|
+ /* "View.MemoryView":463
|
|
+ * tmp = PyMem_Malloc(self.view.itemsize)
|
|
+ * if tmp == NULL:
|
|
+ * raise MemoryError # <<<<<<<<<<<<<<
|
|
+ * item = tmp
|
|
+ * else:
|
|
+ */
|
|
+ PyErr_NoMemory(); __PYX_ERR(2, 463, __pyx_L1_error)
|
|
+
|
|
+ /* "View.MemoryView":462
|
|
+ * if <size_t>self.view.itemsize > sizeof(array):
|
|
+ * tmp = PyMem_Malloc(self.view.itemsize)
|
|
+ * if tmp == NULL: # <<<<<<<<<<<<<<
|
|
+ * raise MemoryError
|
|
+ * item = tmp
|
|
+ */
|
|
+ }
|
|
+
|
|
+ /* "View.MemoryView":464
|
|
+ * if tmp == NULL:
|
|
+ * raise MemoryError
|
|
+ * item = tmp # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * item = <void *> array
|
|
+ */
|
|
+ __pyx_v_item = __pyx_v_tmp;
|
|
+
|
|
+ /* "View.MemoryView":460
|
|
+ * dst_slice = get_slice_from_memview(dst, &tmp_slice)
|
|
*
|
|
+ * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
|
|
+ * tmp = PyMem_Malloc(self.view.itemsize)
|
|
+ * if tmp == NULL:
|
|
*/
|
|
+ goto __pyx_L3;
|
|
}
|
|
|
|
- /* "View.MemoryView":420
|
|
- * raise TypeError("Cannot assign to read-only memoryview")
|
|
- *
|
|
- * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":466
|
|
+ * item = tmp
|
|
+ * else:
|
|
+ * item = <void *> array # <<<<<<<<<<<<<<
|
|
*
|
|
- * if have_slices:
|
|
+ * try:
|
|
*/
|
|
- __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 420, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- if (likely(__pyx_t_2 != Py_None)) {
|
|
- PyObject* sequence = __pyx_t_2;
|
|
- Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
|
|
- if (unlikely(size != 2)) {
|
|
- if (size > 2) __Pyx_RaiseTooManyValuesError(2);
|
|
- else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
|
|
- __PYX_ERR(2, 420, __pyx_L1_error)
|
|
- }
|
|
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
|
|
- __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
|
|
- __Pyx_INCREF(__pyx_t_3);
|
|
- __Pyx_INCREF(__pyx_t_4);
|
|
- #else
|
|
- __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 420, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 420, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- #endif
|
|
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- } else {
|
|
- __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 420, __pyx_L1_error)
|
|
+ /*else*/ {
|
|
+ __pyx_v_item = ((void *)__pyx_v_array);
|
|
}
|
|
- __pyx_v_have_slices = __pyx_t_3;
|
|
- __pyx_t_3 = 0;
|
|
- __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
|
|
- __pyx_t_4 = 0;
|
|
+ __pyx_L3:;
|
|
|
|
- /* "View.MemoryView":422
|
|
- * have_slices, index = _unellipsify(index, self.view.ndim)
|
|
+ /* "View.MemoryView":468
|
|
+ * item = <void *> array
|
|
*
|
|
- * if have_slices: # <<<<<<<<<<<<<<
|
|
- * obj = self.is_slice(value)
|
|
- * if obj:
|
|
+ * try: # <<<<<<<<<<<<<<
|
|
+ * if self.dtype_is_object:
|
|
+ * (<PyObject **> item)[0] = <PyObject *> value
|
|
*/
|
|
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 422, __pyx_L1_error)
|
|
- if (__pyx_t_1) {
|
|
+ /*try:*/ {
|
|
|
|
- /* "View.MemoryView":423
|
|
+ /* "View.MemoryView":469
|
|
*
|
|
- * if have_slices:
|
|
- * obj = self.is_slice(value) # <<<<<<<<<<<<<<
|
|
- * if obj:
|
|
- * self.setitem_slice_assignment(self[index], obj)
|
|
+ * try:
|
|
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
|
|
+ * (<PyObject **> item)[0] = <PyObject *> value
|
|
+ * else:
|
|
*/
|
|
- __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 423, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_v_obj = __pyx_t_2;
|
|
- __pyx_t_2 = 0;
|
|
+ __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":424
|
|
- * if have_slices:
|
|
- * obj = self.is_slice(value)
|
|
- * if obj: # <<<<<<<<<<<<<<
|
|
- * self.setitem_slice_assignment(self[index], obj)
|
|
+ /* "View.MemoryView":470
|
|
+ * try:
|
|
+ * if self.dtype_is_object:
|
|
+ * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
|
|
* else:
|
|
+ * self.assign_item_from_object(<char *> item, value)
|
|
*/
|
|
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 424, __pyx_L1_error)
|
|
- if (__pyx_t_1) {
|
|
+ (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
|
|
|
|
- /* "View.MemoryView":425
|
|
- * obj = self.is_slice(value)
|
|
- * if obj:
|
|
- * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * self.setitem_slice_assign_scalar(self[index], value)
|
|
- */
|
|
- __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 425, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 425, __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;
|
|
-
|
|
- /* "View.MemoryView":424
|
|
- * if have_slices:
|
|
- * obj = self.is_slice(value)
|
|
- * if obj: # <<<<<<<<<<<<<<
|
|
- * self.setitem_slice_assignment(self[index], obj)
|
|
+ /* "View.MemoryView":469
|
|
+ *
|
|
+ * try:
|
|
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
|
|
+ * (<PyObject **> item)[0] = <PyObject *> value
|
|
* else:
|
|
*/
|
|
- goto __pyx_L5;
|
|
+ goto __pyx_L8;
|
|
}
|
|
|
|
- /* "View.MemoryView":427
|
|
- * self.setitem_slice_assignment(self[index], obj)
|
|
+ /* "View.MemoryView":472
|
|
+ * (<PyObject **> item)[0] = <PyObject *> value
|
|
* else:
|
|
- * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * self.setitem_indexed(index, value)
|
|
+ * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ *
|
|
*/
|
|
/*else*/ {
|
|
- __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 427, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(2, 427, __pyx_L1_error)
|
|
- __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 427, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
+ __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 472, __pyx_L6_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
}
|
|
- __pyx_L5:;
|
|
+ __pyx_L8:;
|
|
|
|
- /* "View.MemoryView":422
|
|
- * have_slices, index = _unellipsify(index, self.view.ndim)
|
|
+ /* "View.MemoryView":476
|
|
*
|
|
- * if have_slices: # <<<<<<<<<<<<<<
|
|
- * obj = self.is_slice(value)
|
|
- * if obj:
|
|
+ *
|
|
+ * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
|
|
+ * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
|
|
+ * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
|
|
*/
|
|
- goto __pyx_L4;
|
|
+ __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
|
|
+ if (__pyx_t_2) {
|
|
+
|
|
+ /* "View.MemoryView":477
|
|
+ *
|
|
+ * if self.view.suboffsets != NULL:
|
|
+ * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
|
|
+ * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
|
|
+ * item, self.dtype_is_object)
|
|
+ */
|
|
+ __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 477, __pyx_L6_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
+
|
|
+ /* "View.MemoryView":476
|
|
+ *
|
|
+ *
|
|
+ * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
|
|
+ * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
|
|
+ * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
|
|
+ */
|
|
+ }
|
|
+
|
|
+ /* "View.MemoryView":478
|
|
+ * if self.view.suboffsets != NULL:
|
|
+ * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
|
|
+ * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
|
|
+ * item, self.dtype_is_object)
|
|
+ * finally:
|
|
+ */
|
|
+ __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
|
|
}
|
|
|
|
- /* "View.MemoryView":429
|
|
- * self.setitem_slice_assign_scalar(self[index], value)
|
|
- * else:
|
|
- * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":481
|
|
+ * item, self.dtype_is_object)
|
|
+ * finally:
|
|
+ * PyMem_Free(tmp) # <<<<<<<<<<<<<<
|
|
*
|
|
- * cdef is_slice(self, obj):
|
|
+ * cdef setitem_indexed(self, index, value):
|
|
*/
|
|
- /*else*/ {
|
|
- __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 429, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
+ /*finally:*/ {
|
|
+ /*normal exit:*/{
|
|
+ PyMem_Free(__pyx_v_tmp);
|
|
+ goto __pyx_L7;
|
|
+ }
|
|
+ __pyx_L6_error:;
|
|
+ /*exception exit:*/{
|
|
+ __Pyx_PyThreadState_declare
|
|
+ __Pyx_PyThreadState_assign
|
|
+ __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
|
|
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
+ if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
|
|
+ if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
|
|
+ __Pyx_XGOTREF(__pyx_t_7);
|
|
+ __Pyx_XGOTREF(__pyx_t_8);
|
|
+ __Pyx_XGOTREF(__pyx_t_9);
|
|
+ __Pyx_XGOTREF(__pyx_t_10);
|
|
+ __Pyx_XGOTREF(__pyx_t_11);
|
|
+ __Pyx_XGOTREF(__pyx_t_12);
|
|
+ __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
|
|
+ {
|
|
+ PyMem_Free(__pyx_v_tmp);
|
|
+ }
|
|
+ if (PY_MAJOR_VERSION >= 3) {
|
|
+ __Pyx_XGIVEREF(__pyx_t_10);
|
|
+ __Pyx_XGIVEREF(__pyx_t_11);
|
|
+ __Pyx_XGIVEREF(__pyx_t_12);
|
|
+ __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
|
|
+ }
|
|
+ __Pyx_XGIVEREF(__pyx_t_7);
|
|
+ __Pyx_XGIVEREF(__pyx_t_8);
|
|
+ __Pyx_XGIVEREF(__pyx_t_9);
|
|
+ __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
|
|
+ __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
|
|
+ __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
|
|
+ goto __pyx_L1_error;
|
|
+ }
|
|
+ __pyx_L7:;
|
|
}
|
|
- __pyx_L4:;
|
|
|
|
- /* "View.MemoryView":416
|
|
- * return self.convert_item_to_object(itemp)
|
|
+ /* "View.MemoryView":451
|
|
+ * src.ndim, dst.ndim, self.dtype_is_object)
|
|
*
|
|
- * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
|
|
- * if self.view.readonly:
|
|
- * raise TypeError("Cannot assign to read-only memoryview")
|
|
+ * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
|
|
+ * cdef int array[128]
|
|
+ * cdef void *tmp = NULL
|
|
*/
|
|
|
|
/* function exit code */
|
|
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
+ goto __pyx_L0;
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_3);
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
+ __pyx_L0:;
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+/* "View.MemoryView":483
|
|
+ * PyMem_Free(tmp)
|
|
+ *
|
|
+ * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
|
|
+ * cdef char *itemp = self.get_item_pointer(index)
|
|
+ * self.assign_item_from_object(itemp, value)
|
|
+ */
|
|
+
|
|
+static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
|
|
+ char *__pyx_v_itemp;
|
|
+ PyObject *__pyx_r = NULL;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ char *__pyx_t_1;
|
|
+ PyObject *__pyx_t_2 = NULL;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("setitem_indexed", 0);
|
|
+
|
|
+ /* "View.MemoryView":484
|
|
+ *
|
|
+ * cdef setitem_indexed(self, index, value):
|
|
+ * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
|
|
+ * self.assign_item_from_object(itemp, value)
|
|
+ *
|
|
+ */
|
|
+ __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 484, __pyx_L1_error)
|
|
+ __pyx_v_itemp = __pyx_t_1;
|
|
+
|
|
+ /* "View.MemoryView":485
|
|
+ * cdef setitem_indexed(self, index, value):
|
|
+ * cdef char *itemp = self.get_item_pointer(index)
|
|
+ * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * cdef convert_item_to_object(self, char *itemp):
|
|
+ */
|
|
+ __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 485, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
+
|
|
+ /* "View.MemoryView":483
|
|
+ * PyMem_Free(tmp)
|
|
+ *
|
|
+ * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
|
|
+ * cdef char *itemp = self.get_item_pointer(index)
|
|
+ * self.assign_item_from_object(itemp, value)
|
|
+ */
|
|
+
|
|
+ /* function exit code */
|
|
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_2);
|
|
- __Pyx_XDECREF(__pyx_t_3);
|
|
- __Pyx_XDECREF(__pyx_t_4);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = -1;
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = 0;
|
|
__pyx_L0:;
|
|
- __Pyx_XDECREF(__pyx_v_have_slices);
|
|
- __Pyx_XDECREF(__pyx_v_obj);
|
|
- __Pyx_XDECREF(__pyx_v_index);
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":431
|
|
- * self.setitem_indexed(index, value)
|
|
+/* "View.MemoryView":487
|
|
+ * self.assign_item_from_object(itemp, value)
|
|
*
|
|
- * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
|
|
- * if not isinstance(obj, memoryview):
|
|
- * try:
|
|
+ * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
|
|
+ * """Only used if instantiated manually by the user, or if Cython doesn't
|
|
+ * know how to convert the type"""
|
|
*/
|
|
|
|
-static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
|
|
+static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
|
|
+ PyObject *__pyx_v_struct = NULL;
|
|
+ PyObject *__pyx_v_bytesitem = 0;
|
|
+ PyObject *__pyx_v_result = NULL;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
- int __pyx_t_1;
|
|
- int __pyx_t_2;
|
|
+ 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;
|
|
- int __pyx_t_9;
|
|
+ int __pyx_t_8;
|
|
+ PyObject *__pyx_t_9 = NULL;
|
|
+ size_t __pyx_t_10;
|
|
+ int __pyx_t_11;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("is_slice", 0);
|
|
- __Pyx_INCREF(__pyx_v_obj);
|
|
+ __Pyx_RefNannySetupContext("convert_item_to_object", 0);
|
|
|
|
- /* "View.MemoryView":432
|
|
+ /* "View.MemoryView":490
|
|
+ * """Only used if instantiated manually by the user, or if Cython doesn't
|
|
+ * know how to convert the type"""
|
|
+ * import struct # <<<<<<<<<<<<<<
|
|
+ * cdef bytes bytesitem
|
|
*
|
|
- * cdef is_slice(self, obj):
|
|
- * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
|
|
- * try:
|
|
- * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
|
|
*/
|
|
- __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
|
|
- __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
|
|
- if (__pyx_t_2) {
|
|
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 490, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_v_struct = __pyx_t_1;
|
|
+ __pyx_t_1 = 0;
|
|
|
|
- /* "View.MemoryView":433
|
|
- * cdef is_slice(self, obj):
|
|
- * if not isinstance(obj, memoryview):
|
|
- * try: # <<<<<<<<<<<<<<
|
|
- * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
|
|
- * self.dtype_is_object)
|
|
+ /* "View.MemoryView":493
|
|
+ * cdef bytes bytesitem
|
|
+ *
|
|
+ * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
|
|
+ * try:
|
|
+ * result = struct.unpack(self.view.format, bytesitem)
|
|
*/
|
|
- {
|
|
- __Pyx_PyThreadState_declare
|
|
- __Pyx_PyThreadState_assign
|
|
- __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
|
|
- __Pyx_XGOTREF(__pyx_t_3);
|
|
- __Pyx_XGOTREF(__pyx_t_4);
|
|
- __Pyx_XGOTREF(__pyx_t_5);
|
|
- /*try:*/ {
|
|
-
|
|
- /* "View.MemoryView":434
|
|
- * if not isinstance(obj, memoryview):
|
|
- * try:
|
|
- * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
|
|
- * self.dtype_is_object)
|
|
- * except TypeError:
|
|
- */
|
|
- __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 434, __pyx_L4_error)
|
|
- __Pyx_GOTREF(__pyx_t_6);
|
|
+ __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
|
|
+ __pyx_t_1 = 0;
|
|
|
|
- /* "View.MemoryView":435
|
|
- * try:
|
|
- * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
|
|
- * self.dtype_is_object) # <<<<<<<<<<<<<<
|
|
- * except TypeError:
|
|
- * return None
|
|
+ /* "View.MemoryView":494
|
|
+ *
|
|
+ * bytesitem = itemp[:self.view.itemsize]
|
|
+ * try: # <<<<<<<<<<<<<<
|
|
+ * result = struct.unpack(self.view.format, bytesitem)
|
|
+ * except struct.error:
|
|
*/
|
|
- __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 435, __pyx_L4_error)
|
|
- __Pyx_GOTREF(__pyx_t_7);
|
|
+ {
|
|
+ __Pyx_PyThreadState_declare
|
|
+ __Pyx_PyThreadState_assign
|
|
+ __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
|
|
+ __Pyx_XGOTREF(__pyx_t_2);
|
|
+ __Pyx_XGOTREF(__pyx_t_3);
|
|
+ __Pyx_XGOTREF(__pyx_t_4);
|
|
+ /*try:*/ {
|
|
|
|
- /* "View.MemoryView":434
|
|
- * if not isinstance(obj, memoryview):
|
|
- * try:
|
|
- * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
|
|
- * self.dtype_is_object)
|
|
- * except TypeError:
|
|
+ /* "View.MemoryView":495
|
|
+ * bytesitem = itemp[:self.view.itemsize]
|
|
+ * try:
|
|
+ * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
|
|
+ * except struct.error:
|
|
+ * raise ValueError("Unable to convert item to object")
|
|
*/
|
|
- __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 434, __pyx_L4_error)
|
|
- __Pyx_GOTREF(__pyx_t_8);
|
|
- __Pyx_INCREF(__pyx_v_obj);
|
|
- __Pyx_GIVEREF(__pyx_v_obj);
|
|
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
|
|
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 495, __pyx_L3_error)
|
|
+ __Pyx_GOTREF(__pyx_t_5);
|
|
+ __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 495, __pyx_L3_error)
|
|
+ __Pyx_GOTREF(__pyx_t_6);
|
|
+ __pyx_t_7 = NULL;
|
|
+ __pyx_t_8 = 0;
|
|
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
|
|
+ __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
|
|
+ if (likely(__pyx_t_7)) {
|
|
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
|
|
+ __Pyx_INCREF(__pyx_t_7);
|
|
+ __Pyx_INCREF(function);
|
|
+ __Pyx_DECREF_SET(__pyx_t_5, function);
|
|
+ __pyx_t_8 = 1;
|
|
+ }
|
|
+ }
|
|
+ #if CYTHON_FAST_PYCALL
|
|
+ if (PyFunction_Check(__pyx_t_5)) {
|
|
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
|
|
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 495, __pyx_L3_error)
|
|
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
+ } else
|
|
+ #endif
|
|
+ #if CYTHON_FAST_PYCCALL
|
|
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
|
|
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
|
|
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 495, __pyx_L3_error)
|
|
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
+ } else
|
|
+ #endif
|
|
+ {
|
|
+ __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 495, __pyx_L3_error)
|
|
+ __Pyx_GOTREF(__pyx_t_9);
|
|
+ if (__pyx_t_7) {
|
|
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
|
|
+ }
|
|
__Pyx_GIVEREF(__pyx_t_6);
|
|
- PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
|
|
- __Pyx_GIVEREF(__pyx_t_7);
|
|
- PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
|
|
+ PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
|
|
+ __Pyx_INCREF(__pyx_v_bytesitem);
|
|
+ __Pyx_GIVEREF(__pyx_v_bytesitem);
|
|
+ PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
|
|
__pyx_t_6 = 0;
|
|
- __pyx_t_7 = 0;
|
|
- __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 434, __pyx_L4_error)
|
|
- __Pyx_GOTREF(__pyx_t_7);
|
|
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
|
|
- __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
|
|
- __pyx_t_7 = 0;
|
|
-
|
|
- /* "View.MemoryView":433
|
|
- * cdef is_slice(self, obj):
|
|
- * if not isinstance(obj, memoryview):
|
|
- * try: # <<<<<<<<<<<<<<
|
|
- * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
|
|
- * self.dtype_is_object)
|
|
- */
|
|
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 495, __pyx_L3_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
}
|
|
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
- goto __pyx_L9_try_end;
|
|
- __pyx_L4_error:;
|
|
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
|
|
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
+ __pyx_v_result = __pyx_t_1;
|
|
+ __pyx_t_1 = 0;
|
|
|
|
- /* "View.MemoryView":436
|
|
- * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
|
|
- * self.dtype_is_object)
|
|
- * except TypeError: # <<<<<<<<<<<<<<
|
|
- * return None
|
|
+ /* "View.MemoryView":494
|
|
*
|
|
+ * bytesitem = itemp[:self.view.itemsize]
|
|
+ * try: # <<<<<<<<<<<<<<
|
|
+ * result = struct.unpack(self.view.format, bytesitem)
|
|
+ * except struct.error:
|
|
*/
|
|
- __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
|
|
- if (__pyx_t_9) {
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 436, __pyx_L6_except_error)
|
|
- __Pyx_GOTREF(__pyx_t_7);
|
|
- __Pyx_GOTREF(__pyx_t_8);
|
|
- __Pyx_GOTREF(__pyx_t_6);
|
|
+ }
|
|
|
|
- /* "View.MemoryView":437
|
|
- * self.dtype_is_object)
|
|
- * except TypeError:
|
|
- * return None # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":499
|
|
+ * raise ValueError("Unable to convert item to object")
|
|
+ * else:
|
|
+ * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
|
|
+ * return result[0]
|
|
+ * return result
|
|
+ */
|
|
+ /*else:*/ {
|
|
+ __pyx_t_10 = strlen(__pyx_v_self->view.format);
|
|
+ __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
|
|
+ if (__pyx_t_11) {
|
|
+
|
|
+ /* "View.MemoryView":500
|
|
+ * else:
|
|
+ * if len(self.view.format) == 1:
|
|
+ * return result[0] # <<<<<<<<<<<<<<
|
|
+ * return result
|
|
*
|
|
- * return obj
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
|
|
- goto __pyx_L7_except_return;
|
|
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 500, __pyx_L5_except_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_r = __pyx_t_1;
|
|
+ __pyx_t_1 = 0;
|
|
+ goto __pyx_L6_except_return;
|
|
+
|
|
+ /* "View.MemoryView":499
|
|
+ * raise ValueError("Unable to convert item to object")
|
|
+ * else:
|
|
+ * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
|
|
+ * return result[0]
|
|
+ * return result
|
|
+ */
|
|
}
|
|
- goto __pyx_L6_except_error;
|
|
- __pyx_L6_except_error:;
|
|
|
|
- /* "View.MemoryView":433
|
|
- * cdef is_slice(self, obj):
|
|
- * if not isinstance(obj, memoryview):
|
|
- * try: # <<<<<<<<<<<<<<
|
|
- * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
|
|
- * self.dtype_is_object)
|
|
+ /* "View.MemoryView":501
|
|
+ * if len(self.view.format) == 1:
|
|
+ * return result[0]
|
|
+ * return result # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * cdef assign_item_from_object(self, char *itemp, object value):
|
|
*/
|
|
- __Pyx_XGIVEREF(__pyx_t_3);
|
|
- __Pyx_XGIVEREF(__pyx_t_4);
|
|
- __Pyx_XGIVEREF(__pyx_t_5);
|
|
- __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
|
|
- goto __pyx_L1_error;
|
|
- __pyx_L7_except_return:;
|
|
- __Pyx_XGIVEREF(__pyx_t_3);
|
|
- __Pyx_XGIVEREF(__pyx_t_4);
|
|
- __Pyx_XGIVEREF(__pyx_t_5);
|
|
- __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
|
|
- goto __pyx_L0;
|
|
- __pyx_L9_try_end:;
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __Pyx_INCREF(__pyx_v_result);
|
|
+ __pyx_r = __pyx_v_result;
|
|
+ goto __pyx_L6_except_return;
|
|
}
|
|
+ __pyx_L3_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
+ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
|
|
- /* "View.MemoryView":432
|
|
- *
|
|
- * cdef is_slice(self, obj):
|
|
- * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
|
|
- * try:
|
|
- * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
|
|
+ /* "View.MemoryView":496
|
|
+ * try:
|
|
+ * result = struct.unpack(self.view.format, bytesitem)
|
|
+ * except struct.error: # <<<<<<<<<<<<<<
|
|
+ * raise ValueError("Unable to convert item to object")
|
|
+ * else:
|
|
*/
|
|
- }
|
|
+ __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
|
|
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 496, __pyx_L5_except_error)
|
|
+ __Pyx_GOTREF(__pyx_t_6);
|
|
+ __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
|
|
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
+ __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
|
|
+ __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
|
|
+ if (__pyx_t_8) {
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(2, 496, __pyx_L5_except_error)
|
|
+ __Pyx_GOTREF(__pyx_t_9);
|
|
+ __Pyx_GOTREF(__pyx_t_5);
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
|
|
- /* "View.MemoryView":439
|
|
- * return None
|
|
- *
|
|
- * return obj # <<<<<<<<<<<<<<
|
|
- *
|
|
- * cdef setitem_slice_assignment(self, dst, src):
|
|
+ /* "View.MemoryView":497
|
|
+ * result = struct.unpack(self.view.format, bytesitem)
|
|
+ * except struct.error:
|
|
+ * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * if len(self.view.format) == 1:
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __Pyx_INCREF(__pyx_v_obj);
|
|
- __pyx_r = __pyx_v_obj;
|
|
- goto __pyx_L0;
|
|
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 497, __pyx_L5_except_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(2, 497, __pyx_L5_except_error)
|
|
+ }
|
|
+ goto __pyx_L5_except_error;
|
|
+ __pyx_L5_except_error:;
|
|
|
|
- /* "View.MemoryView":431
|
|
- * self.setitem_indexed(index, value)
|
|
+ /* "View.MemoryView":494
|
|
*
|
|
- * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
|
|
- * if not isinstance(obj, memoryview):
|
|
- * try:
|
|
+ * bytesitem = itemp[:self.view.itemsize]
|
|
+ * try: # <<<<<<<<<<<<<<
|
|
+ * result = struct.unpack(self.view.format, bytesitem)
|
|
+ * except struct.error:
|
|
*/
|
|
-
|
|
- /* function exit code */
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_6);
|
|
+ __Pyx_XGIVEREF(__pyx_t_2);
|
|
+ __Pyx_XGIVEREF(__pyx_t_3);
|
|
+ __Pyx_XGIVEREF(__pyx_t_4);
|
|
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
|
|
+ goto __pyx_L1_error;
|
|
+ __pyx_L6_except_return:;
|
|
+ __Pyx_XGIVEREF(__pyx_t_2);
|
|
+ __Pyx_XGIVEREF(__pyx_t_3);
|
|
+ __Pyx_XGIVEREF(__pyx_t_4);
|
|
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
|
|
+ goto __pyx_L0;
|
|
+ }
|
|
+
|
|
+ /* "View.MemoryView":487
|
|
+ * self.assign_item_from_object(itemp, value)
|
|
+ *
|
|
+ * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
|
|
+ * """Only used if instantiated manually by the user, or if Cython doesn't
|
|
+ * know how to convert the type"""
|
|
+ */
|
|
+
|
|
+ /* function exit code */
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_1);
|
|
+ __Pyx_XDECREF(__pyx_t_5);
|
|
+ __Pyx_XDECREF(__pyx_t_6);
|
|
__Pyx_XDECREF(__pyx_t_7);
|
|
- __Pyx_XDECREF(__pyx_t_8);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __Pyx_XDECREF(__pyx_t_9);
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
- __Pyx_XDECREF(__pyx_v_obj);
|
|
+ __Pyx_XDECREF(__pyx_v_struct);
|
|
+ __Pyx_XDECREF(__pyx_v_bytesitem);
|
|
+ __Pyx_XDECREF(__pyx_v_result);
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":441
|
|
- * return obj
|
|
+/* "View.MemoryView":503
|
|
+ * return result
|
|
*
|
|
- * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
|
|
- * cdef __Pyx_memviewslice dst_slice
|
|
- * cdef __Pyx_memviewslice src_slice
|
|
+ * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
|
|
+ * """Only used if instantiated manually by the user, or if Cython doesn't
|
|
+ * know how to convert the type"""
|
|
*/
|
|
|
|
-static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
|
|
- __Pyx_memviewslice __pyx_v_dst_slice;
|
|
- __Pyx_memviewslice __pyx_v_src_slice;
|
|
+static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
|
|
+ PyObject *__pyx_v_struct = NULL;
|
|
+ char __pyx_v_c;
|
|
+ PyObject *__pyx_v_bytesvalue = 0;
|
|
+ Py_ssize_t __pyx_v_i;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
- __Pyx_memviewslice *__pyx_t_1;
|
|
- __Pyx_memviewslice *__pyx_t_2;
|
|
- PyObject *__pyx_t_3 = NULL;
|
|
- int __pyx_t_4;
|
|
- int __pyx_t_5;
|
|
- int __pyx_t_6;
|
|
+ PyObject *__pyx_t_1 = NULL;
|
|
+ int __pyx_t_2;
|
|
+ int __pyx_t_3;
|
|
+ PyObject *__pyx_t_4 = NULL;
|
|
+ PyObject *__pyx_t_5 = NULL;
|
|
+ PyObject *__pyx_t_6 = NULL;
|
|
+ int __pyx_t_7;
|
|
+ PyObject *__pyx_t_8 = NULL;
|
|
+ Py_ssize_t __pyx_t_9;
|
|
+ PyObject *__pyx_t_10 = NULL;
|
|
+ char *__pyx_t_11;
|
|
+ char *__pyx_t_12;
|
|
+ char *__pyx_t_13;
|
|
+ char *__pyx_t_14;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
|
|
+ __Pyx_RefNannySetupContext("assign_item_from_object", 0);
|
|
|
|
- /* "View.MemoryView":445
|
|
- * cdef __Pyx_memviewslice src_slice
|
|
+ /* "View.MemoryView":506
|
|
+ * """Only used if instantiated manually by the user, or if Cython doesn't
|
|
+ * know how to convert the type"""
|
|
+ * import struct # <<<<<<<<<<<<<<
|
|
+ * cdef char c
|
|
+ * cdef bytes bytesvalue
|
|
+ */
|
|
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 506, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_v_struct = __pyx_t_1;
|
|
+ __pyx_t_1 = 0;
|
|
+
|
|
+ /* "View.MemoryView":511
|
|
+ * cdef Py_ssize_t i
|
|
*
|
|
- * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
|
|
- * get_slice_from_memview(dst, &dst_slice)[0],
|
|
- * src.ndim, dst.ndim, self.dtype_is_object)
|
|
+ * if isinstance(value, tuple): # <<<<<<<<<<<<<<
|
|
+ * bytesvalue = struct.pack(self.view.format, *value)
|
|
+ * else:
|
|
*/
|
|
- if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 445, __pyx_L1_error)
|
|
- __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 445, __pyx_L1_error)
|
|
+ __pyx_t_2 = PyTuple_Check(__pyx_v_value);
|
|
+ __pyx_t_3 = (__pyx_t_2 != 0);
|
|
+ if (__pyx_t_3) {
|
|
|
|
- /* "View.MemoryView":446
|
|
+ /* "View.MemoryView":512
|
|
*
|
|
- * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
|
|
- * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
|
|
- * src.ndim, dst.ndim, self.dtype_is_object)
|
|
+ * if isinstance(value, tuple):
|
|
+ * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * bytesvalue = struct.pack(self.view.format, value)
|
|
+ */
|
|
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 512, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 512, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_5);
|
|
+ __Pyx_GIVEREF(__pyx_t_4);
|
|
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
|
|
+ __pyx_t_4 = 0;
|
|
+ __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 512, __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;
|
|
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
+ if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 512, __pyx_L1_error)
|
|
+ __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
|
|
+ __pyx_t_4 = 0;
|
|
+
|
|
+ /* "View.MemoryView":511
|
|
+ * cdef Py_ssize_t i
|
|
*
|
|
+ * if isinstance(value, tuple): # <<<<<<<<<<<<<<
|
|
+ * bytesvalue = struct.pack(self.view.format, *value)
|
|
+ * else:
|
|
*/
|
|
- if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 446, __pyx_L1_error)
|
|
- __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 446, __pyx_L1_error)
|
|
+ goto __pyx_L3;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":447
|
|
- * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
|
|
- * get_slice_from_memview(dst, &dst_slice)[0],
|
|
- * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":514
|
|
+ * bytesvalue = struct.pack(self.view.format, *value)
|
|
+ * else:
|
|
+ * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
|
|
*
|
|
- * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
|
|
+ * for i, c in enumerate(bytesvalue):
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 447, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 447, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
+ /*else*/ {
|
|
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 514, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_6);
|
|
+ __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 514, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_t_5 = NULL;
|
|
+ __pyx_t_7 = 0;
|
|
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
|
|
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
|
|
+ if (likely(__pyx_t_5)) {
|
|
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
|
|
+ __Pyx_INCREF(__pyx_t_5);
|
|
+ __Pyx_INCREF(function);
|
|
+ __Pyx_DECREF_SET(__pyx_t_6, function);
|
|
+ __pyx_t_7 = 1;
|
|
+ }
|
|
+ }
|
|
+ #if CYTHON_FAST_PYCALL
|
|
+ if (PyFunction_Check(__pyx_t_6)) {
|
|
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
|
|
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 514, __pyx_L1_error)
|
|
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ } else
|
|
+ #endif
|
|
+ #if CYTHON_FAST_PYCCALL
|
|
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
|
|
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
|
|
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 514, __pyx_L1_error)
|
|
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ } else
|
|
+ #endif
|
|
+ {
|
|
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 514, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_8);
|
|
+ if (__pyx_t_5) {
|
|
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
|
|
+ }
|
|
+ __Pyx_GIVEREF(__pyx_t_1);
|
|
+ PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
|
|
+ __Pyx_INCREF(__pyx_v_value);
|
|
+ __Pyx_GIVEREF(__pyx_v_value);
|
|
+ PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
|
|
+ __pyx_t_1 = 0;
|
|
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 514, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
|
|
+ }
|
|
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
+ if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 514, __pyx_L1_error)
|
|
+ __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
|
|
+ __pyx_t_4 = 0;
|
|
+ }
|
|
+ __pyx_L3:;
|
|
|
|
- /* "View.MemoryView":445
|
|
- * cdef __Pyx_memviewslice src_slice
|
|
+ /* "View.MemoryView":516
|
|
+ * bytesvalue = struct.pack(self.view.format, value)
|
|
+ *
|
|
+ * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
|
|
+ * itemp[i] = c
|
|
*
|
|
- * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
|
|
- * get_slice_from_memview(dst, &dst_slice)[0],
|
|
- * src.ndim, dst.ndim, self.dtype_is_object)
|
|
*/
|
|
- __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 445, __pyx_L1_error)
|
|
+ __pyx_t_9 = 0;
|
|
+ if (unlikely(__pyx_v_bytesvalue == Py_None)) {
|
|
+ PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
|
|
+ __PYX_ERR(2, 516, __pyx_L1_error)
|
|
+ }
|
|
+ __Pyx_INCREF(__pyx_v_bytesvalue);
|
|
+ __pyx_t_10 = __pyx_v_bytesvalue;
|
|
+ __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
|
|
+ __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
|
|
+ for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
|
|
+ __pyx_t_11 = __pyx_t_14;
|
|
+ __pyx_v_c = (__pyx_t_11[0]);
|
|
|
|
- /* "View.MemoryView":441
|
|
- * return obj
|
|
+ /* "View.MemoryView":517
|
|
*
|
|
- * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
|
|
- * cdef __Pyx_memviewslice dst_slice
|
|
- * cdef __Pyx_memviewslice src_slice
|
|
+ * for i, c in enumerate(bytesvalue):
|
|
+ * itemp[i] = c # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * @cname('getbuffer')
|
|
+ */
|
|
+ __pyx_v_i = __pyx_t_9;
|
|
+
|
|
+ /* "View.MemoryView":516
|
|
+ * bytesvalue = struct.pack(self.view.format, value)
|
|
+ *
|
|
+ * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
|
|
+ * itemp[i] = c
|
|
+ *
|
|
+ */
|
|
+ __pyx_t_9 = (__pyx_t_9 + 1);
|
|
+
|
|
+ /* "View.MemoryView":517
|
|
+ *
|
|
+ * for i, c in enumerate(bytesvalue):
|
|
+ * itemp[i] = c # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * @cname('getbuffer')
|
|
+ */
|
|
+ (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
|
|
+ }
|
|
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
+
|
|
+ /* "View.MemoryView":503
|
|
+ * return result
|
|
+ *
|
|
+ * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
|
|
+ * """Only used if instantiated manually by the user, or if Cython doesn't
|
|
+ * know how to convert the type"""
|
|
*/
|
|
|
|
/* function exit code */
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_3);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __Pyx_XDECREF(__pyx_t_1);
|
|
+ __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("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
+ __Pyx_XDECREF(__pyx_v_struct);
|
|
+ __Pyx_XDECREF(__pyx_v_bytesvalue);
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":449
|
|
- * src.ndim, dst.ndim, self.dtype_is_object)
|
|
+/* "View.MemoryView":520
|
|
*
|
|
- * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
|
|
- * cdef int array[128]
|
|
- * cdef void *tmp = NULL
|
|
+ * @cname('getbuffer')
|
|
+ * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
|
|
+ * if flags & PyBUF_WRITABLE and self.view.readonly:
|
|
+ * raise ValueError("Cannot create writable memory view from read-only memoryview")
|
|
*/
|
|
|
|
-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) {
|
|
- int __pyx_v_array[0x80];
|
|
- void *__pyx_v_tmp;
|
|
- void *__pyx_v_item;
|
|
- __Pyx_memviewslice *__pyx_v_dst_slice;
|
|
- __Pyx_memviewslice __pyx_v_tmp_slice;
|
|
- PyObject *__pyx_r = NULL;
|
|
+/* Python wrapper */
|
|
+static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
|
|
+static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
|
|
+ int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
- __Pyx_memviewslice *__pyx_t_1;
|
|
+ __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
|
|
+ __pyx_r = __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));
|
|
+
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+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) {
|
|
+ int __pyx_r;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ int __pyx_t_1;
|
|
int __pyx_t_2;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
- int __pyx_t_4;
|
|
- int __pyx_t_5;
|
|
- char const *__pyx_t_6;
|
|
- PyObject *__pyx_t_7 = NULL;
|
|
- PyObject *__pyx_t_8 = NULL;
|
|
- PyObject *__pyx_t_9 = NULL;
|
|
- PyObject *__pyx_t_10 = NULL;
|
|
- PyObject *__pyx_t_11 = NULL;
|
|
- PyObject *__pyx_t_12 = NULL;
|
|
+ Py_ssize_t *__pyx_t_4;
|
|
+ char *__pyx_t_5;
|
|
+ void *__pyx_t_6;
|
|
+ int __pyx_t_7;
|
|
+ Py_ssize_t __pyx_t_8;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
|
|
+ if (__pyx_v_info == NULL) {
|
|
+ PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
|
|
+ return -1;
|
|
+ }
|
|
+ __Pyx_RefNannySetupContext("__getbuffer__", 0);
|
|
+ __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
|
|
+ __Pyx_GIVEREF(__pyx_v_info->obj);
|
|
|
|
- /* "View.MemoryView":451
|
|
- * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
|
|
- * cdef int array[128]
|
|
- * cdef void *tmp = NULL # <<<<<<<<<<<<<<
|
|
- * cdef void *item
|
|
+ /* "View.MemoryView":521
|
|
+ * @cname('getbuffer')
|
|
+ * def __getbuffer__(self, Py_buffer *info, int flags):
|
|
+ * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
|
|
+ * raise ValueError("Cannot create writable memory view from read-only memoryview")
|
|
*
|
|
*/
|
|
- __pyx_v_tmp = NULL;
|
|
+ __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
|
|
+ if (__pyx_t_2) {
|
|
+ } else {
|
|
+ __pyx_t_1 = __pyx_t_2;
|
|
+ goto __pyx_L4_bool_binop_done;
|
|
+ }
|
|
+ __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
|
|
+ __pyx_t_1 = __pyx_t_2;
|
|
+ __pyx_L4_bool_binop_done:;
|
|
+ if (unlikely(__pyx_t_1)) {
|
|
|
|
- /* "View.MemoryView":456
|
|
- * cdef __Pyx_memviewslice *dst_slice
|
|
- * cdef __Pyx_memviewslice tmp_slice
|
|
- * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":522
|
|
+ * def __getbuffer__(self, Py_buffer *info, int flags):
|
|
+ * if flags & PyBUF_WRITABLE and self.view.readonly:
|
|
+ * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
|
|
*
|
|
- * if <size_t>self.view.itemsize > sizeof(array):
|
|
+ * if flags & PyBUF_ND:
|
|
*/
|
|
- __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 456, __pyx_L1_error)
|
|
- __pyx_v_dst_slice = __pyx_t_1;
|
|
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 522, __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(2, 522, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":458
|
|
- * dst_slice = get_slice_from_memview(dst, &tmp_slice)
|
|
+ /* "View.MemoryView":521
|
|
+ * @cname('getbuffer')
|
|
+ * def __getbuffer__(self, Py_buffer *info, int flags):
|
|
+ * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
|
|
+ * raise ValueError("Cannot create writable memory view from read-only memoryview")
|
|
*
|
|
- * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
|
|
- * tmp = PyMem_Malloc(self.view.itemsize)
|
|
- * if tmp == NULL:
|
|
*/
|
|
- __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
|
|
- if (__pyx_t_2) {
|
|
+ }
|
|
|
|
- /* "View.MemoryView":459
|
|
+ /* "View.MemoryView":524
|
|
+ * raise ValueError("Cannot create writable memory view from read-only memoryview")
|
|
*
|
|
- * if <size_t>self.view.itemsize > sizeof(array):
|
|
- * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
|
|
- * if tmp == NULL:
|
|
- * raise MemoryError
|
|
+ * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
|
|
+ * info.shape = self.view.shape
|
|
+ * else:
|
|
*/
|
|
- __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
|
|
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":460
|
|
- * if <size_t>self.view.itemsize > sizeof(array):
|
|
- * tmp = PyMem_Malloc(self.view.itemsize)
|
|
- * if tmp == NULL: # <<<<<<<<<<<<<<
|
|
- * raise MemoryError
|
|
- * item = tmp
|
|
+ /* "View.MemoryView":525
|
|
+ *
|
|
+ * if flags & PyBUF_ND:
|
|
+ * info.shape = self.view.shape # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * info.shape = NULL
|
|
*/
|
|
- __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
|
|
- if (unlikely(__pyx_t_2)) {
|
|
+ __pyx_t_4 = __pyx_v_self->view.shape;
|
|
+ __pyx_v_info->shape = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":461
|
|
- * tmp = PyMem_Malloc(self.view.itemsize)
|
|
- * if tmp == NULL:
|
|
- * raise MemoryError # <<<<<<<<<<<<<<
|
|
- * item = tmp
|
|
+ /* "View.MemoryView":524
|
|
+ * raise ValueError("Cannot create writable memory view from read-only memoryview")
|
|
+ *
|
|
+ * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
|
|
+ * info.shape = self.view.shape
|
|
* else:
|
|
*/
|
|
- PyErr_NoMemory(); __PYX_ERR(2, 461, __pyx_L1_error)
|
|
+ goto __pyx_L6;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":460
|
|
- * if <size_t>self.view.itemsize > sizeof(array):
|
|
- * tmp = PyMem_Malloc(self.view.itemsize)
|
|
- * if tmp == NULL: # <<<<<<<<<<<<<<
|
|
- * raise MemoryError
|
|
- * item = tmp
|
|
+ /* "View.MemoryView":527
|
|
+ * info.shape = self.view.shape
|
|
+ * else:
|
|
+ * info.shape = NULL # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * if flags & PyBUF_STRIDES:
|
|
*/
|
|
- }
|
|
+ /*else*/ {
|
|
+ __pyx_v_info->shape = NULL;
|
|
+ }
|
|
+ __pyx_L6:;
|
|
|
|
- /* "View.MemoryView":462
|
|
- * if tmp == NULL:
|
|
- * raise MemoryError
|
|
- * item = tmp # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":529
|
|
+ * info.shape = NULL
|
|
+ *
|
|
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
|
|
+ * info.strides = self.view.strides
|
|
* else:
|
|
- * item = <void *> array
|
|
*/
|
|
- __pyx_v_item = __pyx_v_tmp;
|
|
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":458
|
|
- * dst_slice = get_slice_from_memview(dst, &tmp_slice)
|
|
+ /* "View.MemoryView":530
|
|
*
|
|
- * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
|
|
- * tmp = PyMem_Malloc(self.view.itemsize)
|
|
- * if tmp == NULL:
|
|
+ * if flags & PyBUF_STRIDES:
|
|
+ * info.strides = self.view.strides # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * info.strides = NULL
|
|
*/
|
|
- goto __pyx_L3;
|
|
+ __pyx_t_4 = __pyx_v_self->view.strides;
|
|
+ __pyx_v_info->strides = __pyx_t_4;
|
|
+
|
|
+ /* "View.MemoryView":529
|
|
+ * info.shape = NULL
|
|
+ *
|
|
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
|
|
+ * info.strides = self.view.strides
|
|
+ * else:
|
|
+ */
|
|
+ goto __pyx_L7;
|
|
}
|
|
|
|
- /* "View.MemoryView":464
|
|
- * item = tmp
|
|
+ /* "View.MemoryView":532
|
|
+ * info.strides = self.view.strides
|
|
* else:
|
|
- * item = <void *> array # <<<<<<<<<<<<<<
|
|
+ * info.strides = NULL # <<<<<<<<<<<<<<
|
|
*
|
|
- * try:
|
|
+ * if flags & PyBUF_INDIRECT:
|
|
*/
|
|
/*else*/ {
|
|
- __pyx_v_item = ((void *)__pyx_v_array);
|
|
+ __pyx_v_info->strides = NULL;
|
|
}
|
|
- __pyx_L3:;
|
|
+ __pyx_L7:;
|
|
|
|
- /* "View.MemoryView":466
|
|
- * item = <void *> array
|
|
+ /* "View.MemoryView":534
|
|
+ * info.strides = NULL
|
|
*
|
|
- * try: # <<<<<<<<<<<<<<
|
|
- * if self.dtype_is_object:
|
|
- * (<PyObject **> item)[0] = <PyObject *> value
|
|
+ * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
|
|
+ * info.suboffsets = self.view.suboffsets
|
|
+ * else:
|
|
*/
|
|
- /*try:*/ {
|
|
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":467
|
|
+ /* "View.MemoryView":535
|
|
*
|
|
- * try:
|
|
- * if self.dtype_is_object: # <<<<<<<<<<<<<<
|
|
- * (<PyObject **> item)[0] = <PyObject *> value
|
|
- * else:
|
|
+ * if flags & PyBUF_INDIRECT:
|
|
+ * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * info.suboffsets = NULL
|
|
*/
|
|
- __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
|
|
- if (__pyx_t_2) {
|
|
+ __pyx_t_4 = __pyx_v_self->view.suboffsets;
|
|
+ __pyx_v_info->suboffsets = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":468
|
|
- * try:
|
|
- * if self.dtype_is_object:
|
|
- * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * self.assign_item_from_object(<char *> item, value)
|
|
+ /* "View.MemoryView":534
|
|
+ * info.strides = NULL
|
|
+ *
|
|
+ * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
|
|
+ * info.suboffsets = self.view.suboffsets
|
|
+ * else:
|
|
*/
|
|
- (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
|
|
+ goto __pyx_L8;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":467
|
|
+ /* "View.MemoryView":537
|
|
+ * info.suboffsets = self.view.suboffsets
|
|
+ * else:
|
|
+ * info.suboffsets = NULL # <<<<<<<<<<<<<<
|
|
*
|
|
- * try:
|
|
- * if self.dtype_is_object: # <<<<<<<<<<<<<<
|
|
- * (<PyObject **> item)[0] = <PyObject *> value
|
|
- * else:
|
|
+ * if flags & PyBUF_FORMAT:
|
|
*/
|
|
- goto __pyx_L8;
|
|
- }
|
|
+ /*else*/ {
|
|
+ __pyx_v_info->suboffsets = NULL;
|
|
+ }
|
|
+ __pyx_L8:;
|
|
|
|
- /* "View.MemoryView":470
|
|
- * (<PyObject **> item)[0] = <PyObject *> value
|
|
- * else:
|
|
- * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
|
|
- *
|
|
+ /* "View.MemoryView":539
|
|
+ * info.suboffsets = NULL
|
|
*
|
|
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
|
|
+ * info.format = self.view.format
|
|
+ * else:
|
|
*/
|
|
- /*else*/ {
|
|
- __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 470, __pyx_L6_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- }
|
|
- __pyx_L8:;
|
|
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":474
|
|
+ /* "View.MemoryView":540
|
|
*
|
|
+ * if flags & PyBUF_FORMAT:
|
|
+ * info.format = self.view.format # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * info.format = NULL
|
|
+ */
|
|
+ __pyx_t_5 = __pyx_v_self->view.format;
|
|
+ __pyx_v_info->format = __pyx_t_5;
|
|
+
|
|
+ /* "View.MemoryView":539
|
|
+ * info.suboffsets = NULL
|
|
*
|
|
- * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
|
|
- * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
|
|
- * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
|
|
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
|
|
+ * info.format = self.view.format
|
|
+ * else:
|
|
*/
|
|
- __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
|
|
- if (__pyx_t_2) {
|
|
+ goto __pyx_L9;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":475
|
|
+ /* "View.MemoryView":542
|
|
+ * info.format = self.view.format
|
|
+ * else:
|
|
+ * info.format = NULL # <<<<<<<<<<<<<<
|
|
*
|
|
- * if self.view.suboffsets != NULL:
|
|
- * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
|
|
- * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
|
|
- * item, self.dtype_is_object)
|
|
+ * info.buf = self.view.buf
|
|
*/
|
|
- __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 475, __pyx_L6_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
+ /*else*/ {
|
|
+ __pyx_v_info->format = NULL;
|
|
+ }
|
|
+ __pyx_L9:;
|
|
|
|
- /* "View.MemoryView":474
|
|
+ /* "View.MemoryView":544
|
|
+ * info.format = NULL
|
|
*
|
|
+ * info.buf = self.view.buf # <<<<<<<<<<<<<<
|
|
+ * info.ndim = self.view.ndim
|
|
+ * info.itemsize = self.view.itemsize
|
|
+ */
|
|
+ __pyx_t_6 = __pyx_v_self->view.buf;
|
|
+ __pyx_v_info->buf = __pyx_t_6;
|
|
+
|
|
+ /* "View.MemoryView":545
|
|
*
|
|
- * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
|
|
- * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
|
|
- * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
|
|
+ * info.buf = self.view.buf
|
|
+ * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
|
|
+ * info.itemsize = self.view.itemsize
|
|
+ * info.len = self.view.len
|
|
*/
|
|
- }
|
|
+ __pyx_t_7 = __pyx_v_self->view.ndim;
|
|
+ __pyx_v_info->ndim = __pyx_t_7;
|
|
|
|
- /* "View.MemoryView":476
|
|
- * if self.view.suboffsets != NULL:
|
|
- * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
|
|
- * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
|
|
- * item, self.dtype_is_object)
|
|
- * finally:
|
|
+ /* "View.MemoryView":546
|
|
+ * info.buf = self.view.buf
|
|
+ * info.ndim = self.view.ndim
|
|
+ * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
|
|
+ * info.len = self.view.len
|
|
+ * info.readonly = self.view.readonly
|
|
*/
|
|
- __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
|
|
- }
|
|
+ __pyx_t_8 = __pyx_v_self->view.itemsize;
|
|
+ __pyx_v_info->itemsize = __pyx_t_8;
|
|
|
|
- /* "View.MemoryView":479
|
|
- * item, self.dtype_is_object)
|
|
- * finally:
|
|
- * PyMem_Free(tmp) # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":547
|
|
+ * info.ndim = self.view.ndim
|
|
+ * info.itemsize = self.view.itemsize
|
|
+ * info.len = self.view.len # <<<<<<<<<<<<<<
|
|
+ * info.readonly = self.view.readonly
|
|
+ * info.obj = self
|
|
+ */
|
|
+ __pyx_t_8 = __pyx_v_self->view.len;
|
|
+ __pyx_v_info->len = __pyx_t_8;
|
|
+
|
|
+ /* "View.MemoryView":548
|
|
+ * info.itemsize = self.view.itemsize
|
|
+ * info.len = self.view.len
|
|
+ * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
|
|
+ * info.obj = self
|
|
*
|
|
- * cdef setitem_indexed(self, index, value):
|
|
*/
|
|
- /*finally:*/ {
|
|
- /*normal exit:*/{
|
|
- PyMem_Free(__pyx_v_tmp);
|
|
- goto __pyx_L7;
|
|
- }
|
|
- __pyx_L6_error:;
|
|
- /*exception exit:*/{
|
|
- __Pyx_PyThreadState_declare
|
|
- __Pyx_PyThreadState_assign
|
|
- __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
|
|
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
|
|
- if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
|
|
- __Pyx_XGOTREF(__pyx_t_7);
|
|
- __Pyx_XGOTREF(__pyx_t_8);
|
|
- __Pyx_XGOTREF(__pyx_t_9);
|
|
- __Pyx_XGOTREF(__pyx_t_10);
|
|
- __Pyx_XGOTREF(__pyx_t_11);
|
|
- __Pyx_XGOTREF(__pyx_t_12);
|
|
- __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
|
|
- {
|
|
- PyMem_Free(__pyx_v_tmp);
|
|
- }
|
|
- if (PY_MAJOR_VERSION >= 3) {
|
|
- __Pyx_XGIVEREF(__pyx_t_10);
|
|
- __Pyx_XGIVEREF(__pyx_t_11);
|
|
- __Pyx_XGIVEREF(__pyx_t_12);
|
|
- __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
|
|
- }
|
|
- __Pyx_XGIVEREF(__pyx_t_7);
|
|
- __Pyx_XGIVEREF(__pyx_t_8);
|
|
- __Pyx_XGIVEREF(__pyx_t_9);
|
|
- __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
|
|
- __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
|
|
- __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
|
|
- goto __pyx_L1_error;
|
|
- }
|
|
- __pyx_L7:;
|
|
- }
|
|
+ __pyx_t_1 = __pyx_v_self->view.readonly;
|
|
+ __pyx_v_info->readonly = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":449
|
|
- * src.ndim, dst.ndim, self.dtype_is_object)
|
|
+ /* "View.MemoryView":549
|
|
+ * info.len = self.view.len
|
|
+ * info.readonly = self.view.readonly
|
|
+ * info.obj = self # <<<<<<<<<<<<<<
|
|
*
|
|
- * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
|
|
- * cdef int array[128]
|
|
- * cdef void *tmp = NULL
|
|
+ * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
|
|
+ */
|
|
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
|
|
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
|
|
+ __Pyx_GOTREF(__pyx_v_info->obj);
|
|
+ __Pyx_DECREF(__pyx_v_info->obj);
|
|
+ __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
|
|
+
|
|
+ /* "View.MemoryView":520
|
|
+ *
|
|
+ * @cname('getbuffer')
|
|
+ * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
|
|
+ * if flags & PyBUF_WRITABLE and self.view.readonly:
|
|
+ * raise ValueError("Cannot create writable memory view from read-only memoryview")
|
|
*/
|
|
|
|
/* function exit code */
|
|
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
+ __pyx_r = 0;
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_3);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = 0;
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = -1;
|
|
+ if (__pyx_v_info->obj != NULL) {
|
|
+ __Pyx_GOTREF(__pyx_v_info->obj);
|
|
+ __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
|
|
+ }
|
|
+ goto __pyx_L2;
|
|
__pyx_L0:;
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
+ if (__pyx_v_info->obj == Py_None) {
|
|
+ __Pyx_GOTREF(__pyx_v_info->obj);
|
|
+ __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
|
|
+ }
|
|
+ __pyx_L2:;
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":481
|
|
- * PyMem_Free(tmp)
|
|
+/* "View.MemoryView":555
|
|
*
|
|
- * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
|
|
- * cdef char *itemp = self.get_item_pointer(index)
|
|
- * self.assign_item_from_object(itemp, value)
|
|
+ * @property
|
|
+ * def T(self): # <<<<<<<<<<<<<<
|
|
+ * cdef _memoryviewslice result = memoryview_copy(self)
|
|
+ * transpose_memslice(&result.from_slice)
|
|
*/
|
|
|
|
-static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
|
|
- char *__pyx_v_itemp;
|
|
+/* Python wrapper */
|
|
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
|
|
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
|
|
+ PyObject *__pyx_r = 0;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
|
|
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
+
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
+ struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
- char *__pyx_t_1;
|
|
- PyObject *__pyx_t_2 = NULL;
|
|
+ PyObject *__pyx_t_1 = NULL;
|
|
+ int __pyx_t_2;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("setitem_indexed", 0);
|
|
+ __Pyx_RefNannySetupContext("__get__", 0);
|
|
|
|
- /* "View.MemoryView":482
|
|
- *
|
|
- * cdef setitem_indexed(self, index, value):
|
|
- * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
|
|
- * self.assign_item_from_object(itemp, value)
|
|
+ /* "View.MemoryView":556
|
|
+ * @property
|
|
+ * def T(self):
|
|
+ * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
|
|
+ * transpose_memslice(&result.from_slice)
|
|
+ * return result
|
|
+ */
|
|
+ __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 556, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 556, __pyx_L1_error)
|
|
+ __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
|
|
+ __pyx_t_1 = 0;
|
|
+
|
|
+ /* "View.MemoryView":557
|
|
+ * def T(self):
|
|
+ * cdef _memoryviewslice result = memoryview_copy(self)
|
|
+ * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
|
|
+ * return result
|
|
*
|
|
*/
|
|
- __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 482, __pyx_L1_error)
|
|
- __pyx_v_itemp = __pyx_t_1;
|
|
+ __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 557, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":483
|
|
- * cdef setitem_indexed(self, index, value):
|
|
- * cdef char *itemp = self.get_item_pointer(index)
|
|
- * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":558
|
|
+ * cdef _memoryviewslice result = memoryview_copy(self)
|
|
+ * transpose_memslice(&result.from_slice)
|
|
+ * return result # <<<<<<<<<<<<<<
|
|
*
|
|
- * cdef convert_item_to_object(self, char *itemp):
|
|
+ * @property
|
|
*/
|
|
- __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 483, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __Pyx_INCREF(((PyObject *)__pyx_v_result));
|
|
+ __pyx_r = ((PyObject *)__pyx_v_result);
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":481
|
|
- * PyMem_Free(tmp)
|
|
+ /* "View.MemoryView":555
|
|
*
|
|
- * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
|
|
- * cdef char *itemp = self.get_item_pointer(index)
|
|
- * self.assign_item_from_object(itemp, value)
|
|
+ * @property
|
|
+ * def T(self): # <<<<<<<<<<<<<<
|
|
+ * cdef _memoryviewslice result = memoryview_copy(self)
|
|
+ * transpose_memslice(&result.from_slice)
|
|
*/
|
|
|
|
/* function exit code */
|
|
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
- goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_2);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = 0;
|
|
+ __Pyx_XDECREF(__pyx_t_1);
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = NULL;
|
|
__pyx_L0:;
|
|
+ __Pyx_XDECREF((PyObject *)__pyx_v_result);
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":485
|
|
- * self.assign_item_from_object(itemp, value)
|
|
+/* "View.MemoryView":561
|
|
+ *
|
|
+ * @property
|
|
+ * def base(self): # <<<<<<<<<<<<<<
|
|
+ * return self.obj
|
|
*
|
|
- * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
|
|
- * """Only used if instantiated manually by the user, or if Cython doesn't
|
|
- * know how to convert the type"""
|
|
*/
|
|
|
|
-static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
|
|
- PyObject *__pyx_v_struct = NULL;
|
|
- PyObject *__pyx_v_bytesitem = 0;
|
|
- PyObject *__pyx_v_result = NULL;
|
|
+/* Python wrapper */
|
|
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
|
|
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
|
|
+ PyObject *__pyx_r = 0;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
|
|
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
+
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__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;
|
|
- PyObject *__pyx_t_6 = NULL;
|
|
- PyObject *__pyx_t_7 = NULL;
|
|
- int __pyx_t_8;
|
|
- PyObject *__pyx_t_9 = NULL;
|
|
- size_t __pyx_t_10;
|
|
- int __pyx_t_11;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("convert_item_to_object", 0);
|
|
+ __Pyx_RefNannySetupContext("__get__", 0);
|
|
|
|
- /* "View.MemoryView":488
|
|
- * """Only used if instantiated manually by the user, or if Cython doesn't
|
|
- * know how to convert the type"""
|
|
- * import struct # <<<<<<<<<<<<<<
|
|
- * cdef bytes bytesitem
|
|
+ /* "View.MemoryView":562
|
|
+ * @property
|
|
+ * def base(self):
|
|
+ * return self.obj # <<<<<<<<<<<<<<
|
|
*
|
|
+ * @property
|
|
*/
|
|
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 488, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_v_struct = __pyx_t_1;
|
|
- __pyx_t_1 = 0;
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __Pyx_INCREF(__pyx_v_self->obj);
|
|
+ __pyx_r = __pyx_v_self->obj;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":491
|
|
- * cdef bytes bytesitem
|
|
+ /* "View.MemoryView":561
|
|
*
|
|
- * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
|
|
- * try:
|
|
- * result = struct.unpack(self.view.format, bytesitem)
|
|
- */
|
|
- __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 491, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
|
|
- __pyx_t_1 = 0;
|
|
-
|
|
- /* "View.MemoryView":492
|
|
+ * @property
|
|
+ * def base(self): # <<<<<<<<<<<<<<
|
|
+ * return self.obj
|
|
*
|
|
- * bytesitem = itemp[:self.view.itemsize]
|
|
- * try: # <<<<<<<<<<<<<<
|
|
- * result = struct.unpack(self.view.format, bytesitem)
|
|
- * except struct.error:
|
|
*/
|
|
- {
|
|
- __Pyx_PyThreadState_declare
|
|
- __Pyx_PyThreadState_assign
|
|
- __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
|
|
- __Pyx_XGOTREF(__pyx_t_2);
|
|
- __Pyx_XGOTREF(__pyx_t_3);
|
|
- __Pyx_XGOTREF(__pyx_t_4);
|
|
- /*try:*/ {
|
|
|
|
- /* "View.MemoryView":493
|
|
- * bytesitem = itemp[:self.view.itemsize]
|
|
- * try:
|
|
- * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
|
|
- * except struct.error:
|
|
- * raise ValueError("Unable to convert item to object")
|
|
- */
|
|
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 493, __pyx_L3_error)
|
|
- __Pyx_GOTREF(__pyx_t_5);
|
|
- __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 493, __pyx_L3_error)
|
|
- __Pyx_GOTREF(__pyx_t_6);
|
|
- __pyx_t_7 = NULL;
|
|
- __pyx_t_8 = 0;
|
|
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
|
|
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
|
|
- if (likely(__pyx_t_7)) {
|
|
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
|
|
- __Pyx_INCREF(__pyx_t_7);
|
|
- __Pyx_INCREF(function);
|
|
- __Pyx_DECREF_SET(__pyx_t_5, function);
|
|
- __pyx_t_8 = 1;
|
|
- }
|
|
- }
|
|
- #if CYTHON_FAST_PYCALL
|
|
- if (PyFunction_Check(__pyx_t_5)) {
|
|
- PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
|
|
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error)
|
|
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
- } else
|
|
- #endif
|
|
- #if CYTHON_FAST_PYCCALL
|
|
- if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
|
|
- PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
|
|
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error)
|
|
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
- } else
|
|
- #endif
|
|
- {
|
|
- __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 493, __pyx_L3_error)
|
|
- __Pyx_GOTREF(__pyx_t_9);
|
|
- if (__pyx_t_7) {
|
|
- __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
|
|
- }
|
|
- __Pyx_GIVEREF(__pyx_t_6);
|
|
- PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
|
|
- __Pyx_INCREF(__pyx_v_bytesitem);
|
|
- __Pyx_GIVEREF(__pyx_v_bytesitem);
|
|
- PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
|
|
- __pyx_t_6 = 0;
|
|
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
- }
|
|
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
- __pyx_v_result = __pyx_t_1;
|
|
- __pyx_t_1 = 0;
|
|
+ /* function exit code */
|
|
+ __pyx_L0:;
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
|
|
- /* "View.MemoryView":492
|
|
+/* "View.MemoryView":565
|
|
+ *
|
|
+ * @property
|
|
+ * def shape(self): # <<<<<<<<<<<<<<
|
|
+ * return tuple([length for length in self.view.shape[:self.view.ndim]])
|
|
*
|
|
- * bytesitem = itemp[:self.view.itemsize]
|
|
- * try: # <<<<<<<<<<<<<<
|
|
- * result = struct.unpack(self.view.format, bytesitem)
|
|
- * except struct.error:
|
|
*/
|
|
- }
|
|
|
|
- /* "View.MemoryView":497
|
|
- * raise ValueError("Unable to convert item to object")
|
|
- * else:
|
|
- * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
|
|
- * return result[0]
|
|
- * return result
|
|
- */
|
|
- /*else:*/ {
|
|
- __pyx_t_10 = strlen(__pyx_v_self->view.format);
|
|
- __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
|
|
- if (__pyx_t_11) {
|
|
+/* Python wrapper */
|
|
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
|
|
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
|
|
+ PyObject *__pyx_r = 0;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
|
|
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
|
|
- /* "View.MemoryView":498
|
|
- * else:
|
|
- * if len(self.view.format) == 1:
|
|
- * return result[0] # <<<<<<<<<<<<<<
|
|
- * return result
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
+ Py_ssize_t __pyx_v_length;
|
|
+ PyObject *__pyx_r = NULL;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ PyObject *__pyx_t_1 = NULL;
|
|
+ Py_ssize_t *__pyx_t_2;
|
|
+ Py_ssize_t *__pyx_t_3;
|
|
+ Py_ssize_t *__pyx_t_4;
|
|
+ PyObject *__pyx_t_5 = NULL;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("__get__", 0);
|
|
+
|
|
+ /* "View.MemoryView":566
|
|
+ * @property
|
|
+ * def shape(self):
|
|
+ * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
|
|
*
|
|
+ * @property
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 498, __pyx_L5_except_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_r = __pyx_t_1;
|
|
- __pyx_t_1 = 0;
|
|
- goto __pyx_L6_except_return;
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 566, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
|
|
+ for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
|
|
+ __pyx_t_2 = __pyx_t_4;
|
|
+ __pyx_v_length = (__pyx_t_2[0]);
|
|
+ __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 566, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_5);
|
|
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 566, __pyx_L1_error)
|
|
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
+ }
|
|
+ __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 566, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_5);
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __pyx_r = __pyx_t_5;
|
|
+ __pyx_t_5 = 0;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":497
|
|
- * raise ValueError("Unable to convert item to object")
|
|
- * else:
|
|
- * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
|
|
- * return result[0]
|
|
- * return result
|
|
+ /* "View.MemoryView":565
|
|
+ *
|
|
+ * @property
|
|
+ * def shape(self): # <<<<<<<<<<<<<<
|
|
+ * return tuple([length for length in self.view.shape[:self.view.ndim]])
|
|
+ *
|
|
*/
|
|
- }
|
|
|
|
- /* "View.MemoryView":499
|
|
- * if len(self.view.format) == 1:
|
|
- * return result[0]
|
|
- * return result # <<<<<<<<<<<<<<
|
|
+ /* function exit code */
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_1);
|
|
+ __Pyx_XDECREF(__pyx_t_5);
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = NULL;
|
|
+ __pyx_L0:;
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+/* "View.MemoryView":569
|
|
+ *
|
|
+ * @property
|
|
+ * def strides(self): # <<<<<<<<<<<<<<
|
|
+ * if self.view.strides == NULL:
|
|
*
|
|
- * cdef assign_item_from_object(self, char *itemp, object value):
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __Pyx_INCREF(__pyx_v_result);
|
|
- __pyx_r = __pyx_v_result;
|
|
- goto __pyx_L6_except_return;
|
|
- }
|
|
- __pyx_L3_error:;
|
|
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
- __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
|
|
- /* "View.MemoryView":494
|
|
- * try:
|
|
- * result = struct.unpack(self.view.format, bytesitem)
|
|
- * except struct.error: # <<<<<<<<<<<<<<
|
|
- * raise ValueError("Unable to convert item to object")
|
|
- * else:
|
|
+/* Python wrapper */
|
|
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
|
|
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
|
|
+ PyObject *__pyx_r = 0;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
|
|
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
+
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
+ Py_ssize_t __pyx_v_stride;
|
|
+ PyObject *__pyx_r = NULL;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ int __pyx_t_1;
|
|
+ PyObject *__pyx_t_2 = NULL;
|
|
+ Py_ssize_t *__pyx_t_3;
|
|
+ Py_ssize_t *__pyx_t_4;
|
|
+ Py_ssize_t *__pyx_t_5;
|
|
+ PyObject *__pyx_t_6 = NULL;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("__get__", 0);
|
|
+
|
|
+ /* "View.MemoryView":570
|
|
+ * @property
|
|
+ * def strides(self):
|
|
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * raise ValueError("Buffer view does not expose strides")
|
|
*/
|
|
- __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
|
|
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 494, __pyx_L5_except_error)
|
|
- __Pyx_GOTREF(__pyx_t_6);
|
|
- __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
|
|
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
- __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
|
|
- __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
|
|
- if (__pyx_t_8) {
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(2, 494, __pyx_L5_except_error)
|
|
- __Pyx_GOTREF(__pyx_t_9);
|
|
- __Pyx_GOTREF(__pyx_t_5);
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
|
|
+ if (unlikely(__pyx_t_1)) {
|
|
|
|
- /* "View.MemoryView":495
|
|
- * result = struct.unpack(self.view.format, bytesitem)
|
|
- * except struct.error:
|
|
- * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * if len(self.view.format) == 1:
|
|
+ /* "View.MemoryView":572
|
|
+ * if self.view.strides == NULL:
|
|
+ *
|
|
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
|
|
*/
|
|
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 495, __pyx_L5_except_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(2, 495, __pyx_L5_except_error)
|
|
- }
|
|
- goto __pyx_L5_except_error;
|
|
- __pyx_L5_except_error:;
|
|
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 572, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
|
|
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
+ __PYX_ERR(2, 572, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":492
|
|
+ /* "View.MemoryView":570
|
|
+ * @property
|
|
+ * def strides(self):
|
|
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
|
|
*
|
|
- * bytesitem = itemp[:self.view.itemsize]
|
|
- * try: # <<<<<<<<<<<<<<
|
|
- * result = struct.unpack(self.view.format, bytesitem)
|
|
- * except struct.error:
|
|
+ * raise ValueError("Buffer view does not expose strides")
|
|
*/
|
|
- __Pyx_XGIVEREF(__pyx_t_2);
|
|
- __Pyx_XGIVEREF(__pyx_t_3);
|
|
- __Pyx_XGIVEREF(__pyx_t_4);
|
|
- __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
|
|
- goto __pyx_L1_error;
|
|
- __pyx_L6_except_return:;
|
|
- __Pyx_XGIVEREF(__pyx_t_2);
|
|
- __Pyx_XGIVEREF(__pyx_t_3);
|
|
- __Pyx_XGIVEREF(__pyx_t_4);
|
|
- __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
|
|
- goto __pyx_L0;
|
|
}
|
|
|
|
- /* "View.MemoryView":485
|
|
- * self.assign_item_from_object(itemp, value)
|
|
+ /* "View.MemoryView":574
|
|
+ * raise ValueError("Buffer view does not expose strides")
|
|
+ *
|
|
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * @property
|
|
+ */
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 574, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
|
|
+ for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
|
|
+ __pyx_t_3 = __pyx_t_5;
|
|
+ __pyx_v_stride = (__pyx_t_3[0]);
|
|
+ __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 574, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_6);
|
|
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 574, __pyx_L1_error)
|
|
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
+ }
|
|
+ __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 574, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_6);
|
|
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
+ __pyx_r = __pyx_t_6;
|
|
+ __pyx_t_6 = 0;
|
|
+ goto __pyx_L0;
|
|
+
|
|
+ /* "View.MemoryView":569
|
|
+ *
|
|
+ * @property
|
|
+ * def strides(self): # <<<<<<<<<<<<<<
|
|
+ * if self.view.strides == NULL:
|
|
*
|
|
- * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
|
|
- * """Only used if instantiated manually by the user, or if Cython doesn't
|
|
- * know how to convert the type"""
|
|
*/
|
|
|
|
/* function exit code */
|
|
__pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_XDECREF(__pyx_t_5);
|
|
+ __Pyx_XDECREF(__pyx_t_2);
|
|
__Pyx_XDECREF(__pyx_t_6);
|
|
- __Pyx_XDECREF(__pyx_t_7);
|
|
- __Pyx_XDECREF(__pyx_t_9);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = 0;
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = NULL;
|
|
__pyx_L0:;
|
|
- __Pyx_XDECREF(__pyx_v_struct);
|
|
- __Pyx_XDECREF(__pyx_v_bytesitem);
|
|
- __Pyx_XDECREF(__pyx_v_result);
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":501
|
|
- * return result
|
|
+/* "View.MemoryView":577
|
|
*
|
|
- * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
|
|
- * """Only used if instantiated manually by the user, or if Cython doesn't
|
|
- * know how to convert the type"""
|
|
+ * @property
|
|
+ * def suboffsets(self): # <<<<<<<<<<<<<<
|
|
+ * if self.view.suboffsets == NULL:
|
|
+ * return (-1,) * self.view.ndim
|
|
*/
|
|
|
|
-static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
|
|
- PyObject *__pyx_v_struct = NULL;
|
|
- char __pyx_v_c;
|
|
- PyObject *__pyx_v_bytesvalue = 0;
|
|
- Py_ssize_t __pyx_v_i;
|
|
+/* Python wrapper */
|
|
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
|
|
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
|
|
+ PyObject *__pyx_r = 0;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
|
|
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
+
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
+ Py_ssize_t __pyx_v_suboffset;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
- PyObject *__pyx_t_1 = NULL;
|
|
- int __pyx_t_2;
|
|
- int __pyx_t_3;
|
|
- PyObject *__pyx_t_4 = NULL;
|
|
- PyObject *__pyx_t_5 = NULL;
|
|
- PyObject *__pyx_t_6 = NULL;
|
|
- int __pyx_t_7;
|
|
- PyObject *__pyx_t_8 = NULL;
|
|
- Py_ssize_t __pyx_t_9;
|
|
- PyObject *__pyx_t_10 = NULL;
|
|
- char *__pyx_t_11;
|
|
- char *__pyx_t_12;
|
|
- char *__pyx_t_13;
|
|
- char *__pyx_t_14;
|
|
+ int __pyx_t_1;
|
|
+ PyObject *__pyx_t_2 = NULL;
|
|
+ PyObject *__pyx_t_3 = NULL;
|
|
+ Py_ssize_t *__pyx_t_4;
|
|
+ Py_ssize_t *__pyx_t_5;
|
|
+ Py_ssize_t *__pyx_t_6;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("assign_item_from_object", 0);
|
|
-
|
|
- /* "View.MemoryView":504
|
|
- * """Only used if instantiated manually by the user, or if Cython doesn't
|
|
- * know how to convert the type"""
|
|
- * import struct # <<<<<<<<<<<<<<
|
|
- * cdef char c
|
|
- * cdef bytes bytesvalue
|
|
- */
|
|
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 504, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_v_struct = __pyx_t_1;
|
|
- __pyx_t_1 = 0;
|
|
+ __Pyx_RefNannySetupContext("__get__", 0);
|
|
|
|
- /* "View.MemoryView":509
|
|
- * cdef Py_ssize_t i
|
|
+ /* "View.MemoryView":578
|
|
+ * @property
|
|
+ * def suboffsets(self):
|
|
+ * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
|
|
+ * return (-1,) * self.view.ndim
|
|
*
|
|
- * if isinstance(value, tuple): # <<<<<<<<<<<<<<
|
|
- * bytesvalue = struct.pack(self.view.format, *value)
|
|
- * else:
|
|
*/
|
|
- __pyx_t_2 = PyTuple_Check(__pyx_v_value);
|
|
- __pyx_t_3 = (__pyx_t_2 != 0);
|
|
- if (__pyx_t_3) {
|
|
+ __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":510
|
|
+ /* "View.MemoryView":579
|
|
+ * def suboffsets(self):
|
|
+ * if self.view.suboffsets == NULL:
|
|
+ * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
|
|
*
|
|
- * if isinstance(value, tuple):
|
|
- * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * bytesvalue = struct.pack(self.view.format, value)
|
|
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
|
|
*/
|
|
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 510, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 510, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_5);
|
|
- __Pyx_GIVEREF(__pyx_t_4);
|
|
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
|
|
- __pyx_t_4 = 0;
|
|
- __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 510, __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;
|
|
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
- if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 510, __pyx_L1_error)
|
|
- __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
|
|
- __pyx_t_4 = 0;
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__15, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 579, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
+ __pyx_r = __pyx_t_3;
|
|
+ __pyx_t_3 = 0;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":509
|
|
- * cdef Py_ssize_t i
|
|
+ /* "View.MemoryView":578
|
|
+ * @property
|
|
+ * def suboffsets(self):
|
|
+ * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
|
|
+ * return (-1,) * self.view.ndim
|
|
*
|
|
- * if isinstance(value, tuple): # <<<<<<<<<<<<<<
|
|
- * bytesvalue = struct.pack(self.view.format, *value)
|
|
- * else:
|
|
*/
|
|
- goto __pyx_L3;
|
|
}
|
|
|
|
- /* "View.MemoryView":512
|
|
- * bytesvalue = struct.pack(self.view.format, *value)
|
|
- * else:
|
|
- * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":581
|
|
+ * return (-1,) * self.view.ndim
|
|
*
|
|
- * for i, c in enumerate(bytesvalue):
|
|
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * @property
|
|
*/
|
|
- /*else*/ {
|
|
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 512, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_6);
|
|
- __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 512, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_t_5 = NULL;
|
|
- __pyx_t_7 = 0;
|
|
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
|
|
- __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
|
|
- if (likely(__pyx_t_5)) {
|
|
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
|
|
- __Pyx_INCREF(__pyx_t_5);
|
|
- __Pyx_INCREF(function);
|
|
- __Pyx_DECREF_SET(__pyx_t_6, function);
|
|
- __pyx_t_7 = 1;
|
|
- }
|
|
- }
|
|
- #if CYTHON_FAST_PYCALL
|
|
- if (PyFunction_Check(__pyx_t_6)) {
|
|
- PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
|
|
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
|
|
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
- } else
|
|
- #endif
|
|
- #if CYTHON_FAST_PYCCALL
|
|
- if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
|
|
- PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
|
|
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
|
|
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
- } else
|
|
- #endif
|
|
- {
|
|
- __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 512, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_8);
|
|
- if (__pyx_t_5) {
|
|
- __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
|
|
- }
|
|
- __Pyx_GIVEREF(__pyx_t_1);
|
|
- PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
|
|
- __Pyx_INCREF(__pyx_v_value);
|
|
- __Pyx_GIVEREF(__pyx_v_value);
|
|
- PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
|
|
- __pyx_t_1 = 0;
|
|
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
|
|
- }
|
|
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
- if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 512, __pyx_L1_error)
|
|
- __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
|
|
- __pyx_t_4 = 0;
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 581, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
|
|
+ for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
|
|
+ __pyx_t_4 = __pyx_t_6;
|
|
+ __pyx_v_suboffset = (__pyx_t_4[0]);
|
|
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 581, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 581, __pyx_L1_error)
|
|
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
}
|
|
- __pyx_L3:;
|
|
+ __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 581, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
+ __pyx_r = __pyx_t_2;
|
|
+ __pyx_t_2 = 0;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":514
|
|
- * bytesvalue = struct.pack(self.view.format, value)
|
|
- *
|
|
- * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
|
|
- * itemp[i] = c
|
|
+ /* "View.MemoryView":577
|
|
*
|
|
+ * @property
|
|
+ * def suboffsets(self): # <<<<<<<<<<<<<<
|
|
+ * if self.view.suboffsets == NULL:
|
|
+ * return (-1,) * self.view.ndim
|
|
*/
|
|
- __pyx_t_9 = 0;
|
|
- if (unlikely(__pyx_v_bytesvalue == Py_None)) {
|
|
- PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
|
|
- __PYX_ERR(2, 514, __pyx_L1_error)
|
|
- }
|
|
- __Pyx_INCREF(__pyx_v_bytesvalue);
|
|
- __pyx_t_10 = __pyx_v_bytesvalue;
|
|
- __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
|
|
- __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
|
|
- for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
|
|
- __pyx_t_11 = __pyx_t_14;
|
|
- __pyx_v_c = (__pyx_t_11[0]);
|
|
|
|
- /* "View.MemoryView":515
|
|
- *
|
|
- * for i, c in enumerate(bytesvalue):
|
|
- * itemp[i] = c # <<<<<<<<<<<<<<
|
|
- *
|
|
- * @cname('getbuffer')
|
|
- */
|
|
- __pyx_v_i = __pyx_t_9;
|
|
+ /* function exit code */
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_2);
|
|
+ __Pyx_XDECREF(__pyx_t_3);
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = NULL;
|
|
+ __pyx_L0:;
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
|
|
- /* "View.MemoryView":514
|
|
- * bytesvalue = struct.pack(self.view.format, value)
|
|
+/* "View.MemoryView":584
|
|
*
|
|
- * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
|
|
- * itemp[i] = c
|
|
+ * @property
|
|
+ * def ndim(self): # <<<<<<<<<<<<<<
|
|
+ * return self.view.ndim
|
|
*
|
|
*/
|
|
- __pyx_t_9 = (__pyx_t_9 + 1);
|
|
|
|
- /* "View.MemoryView":515
|
|
- *
|
|
- * for i, c in enumerate(bytesvalue):
|
|
- * itemp[i] = c # <<<<<<<<<<<<<<
|
|
+/* Python wrapper */
|
|
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
|
|
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
|
|
+ PyObject *__pyx_r = 0;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
|
|
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
+
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
+ PyObject *__pyx_r = NULL;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ PyObject *__pyx_t_1 = NULL;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("__get__", 0);
|
|
+
|
|
+ /* "View.MemoryView":585
|
|
+ * @property
|
|
+ * def ndim(self):
|
|
+ * return self.view.ndim # <<<<<<<<<<<<<<
|
|
*
|
|
- * @cname('getbuffer')
|
|
+ * @property
|
|
*/
|
|
- (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
|
|
- }
|
|
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 585, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_r = __pyx_t_1;
|
|
+ __pyx_t_1 = 0;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":501
|
|
- * return result
|
|
+ /* "View.MemoryView":584
|
|
+ *
|
|
+ * @property
|
|
+ * def ndim(self): # <<<<<<<<<<<<<<
|
|
+ * return self.view.ndim
|
|
*
|
|
- * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
|
|
- * """Only used if instantiated manually by the user, or if Cython doesn't
|
|
- * know how to convert the type"""
|
|
*/
|
|
|
|
/* function exit code */
|
|
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
- goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_1);
|
|
- __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("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = 0;
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = NULL;
|
|
__pyx_L0:;
|
|
- __Pyx_XDECREF(__pyx_v_struct);
|
|
- __Pyx_XDECREF(__pyx_v_bytesvalue);
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":518
|
|
+/* "View.MemoryView":588
|
|
+ *
|
|
+ * @property
|
|
+ * def itemsize(self): # <<<<<<<<<<<<<<
|
|
+ * return self.view.itemsize
|
|
*
|
|
- * @cname('getbuffer')
|
|
- * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
|
|
- * if flags & PyBUF_WRITABLE and self.view.readonly:
|
|
- * raise ValueError("Cannot create writable memory view from read-only memoryview")
|
|
*/
|
|
|
|
/* Python wrapper */
|
|
-static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
|
|
-static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
|
|
- int __pyx_r;
|
|
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
|
|
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
|
|
+ PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
|
|
- __pyx_r = __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));
|
|
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
|
|
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
|
|
/* function exit code */
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-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) {
|
|
- int __pyx_r;
|
|
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
+ PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
- int __pyx_t_1;
|
|
- int __pyx_t_2;
|
|
- PyObject *__pyx_t_3 = NULL;
|
|
- Py_ssize_t *__pyx_t_4;
|
|
- char *__pyx_t_5;
|
|
- void *__pyx_t_6;
|
|
- int __pyx_t_7;
|
|
- Py_ssize_t __pyx_t_8;
|
|
+ PyObject *__pyx_t_1 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- if (__pyx_v_info == NULL) {
|
|
- PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
|
|
- return -1;
|
|
- }
|
|
- __Pyx_RefNannySetupContext("__getbuffer__", 0);
|
|
- __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
|
|
- __Pyx_GIVEREF(__pyx_v_info->obj);
|
|
+ __Pyx_RefNannySetupContext("__get__", 0);
|
|
|
|
- /* "View.MemoryView":519
|
|
- * @cname('getbuffer')
|
|
- * def __getbuffer__(self, Py_buffer *info, int flags):
|
|
- * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
|
|
- * raise ValueError("Cannot create writable memory view from read-only memoryview")
|
|
+ /* "View.MemoryView":589
|
|
+ * @property
|
|
+ * def itemsize(self):
|
|
+ * return self.view.itemsize # <<<<<<<<<<<<<<
|
|
*
|
|
+ * @property
|
|
*/
|
|
- __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
|
|
- if (__pyx_t_2) {
|
|
- } else {
|
|
- __pyx_t_1 = __pyx_t_2;
|
|
- goto __pyx_L4_bool_binop_done;
|
|
- }
|
|
- __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
|
|
- __pyx_t_1 = __pyx_t_2;
|
|
- __pyx_L4_bool_binop_done:;
|
|
- if (unlikely(__pyx_t_1)) {
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 589, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_r = __pyx_t_1;
|
|
+ __pyx_t_1 = 0;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":520
|
|
- * def __getbuffer__(self, Py_buffer *info, int flags):
|
|
- * if flags & PyBUF_WRITABLE and self.view.readonly:
|
|
- * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":588
|
|
+ *
|
|
+ * @property
|
|
+ * def itemsize(self): # <<<<<<<<<<<<<<
|
|
+ * return self.view.itemsize
|
|
*
|
|
- * if flags & PyBUF_ND:
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 520, __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(2, 520, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":519
|
|
- * @cname('getbuffer')
|
|
- * def __getbuffer__(self, Py_buffer *info, int flags):
|
|
- * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
|
|
- * raise ValueError("Cannot create writable memory view from read-only memoryview")
|
|
+ /* function exit code */
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_1);
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = NULL;
|
|
+ __pyx_L0:;
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+/* "View.MemoryView":592
|
|
+ *
|
|
+ * @property
|
|
+ * def nbytes(self): # <<<<<<<<<<<<<<
|
|
+ * return self.size * self.view.itemsize
|
|
*
|
|
*/
|
|
- }
|
|
|
|
- /* "View.MemoryView":522
|
|
- * raise ValueError("Cannot create writable memory view from read-only memoryview")
|
|
- *
|
|
- * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
|
|
- * info.shape = self.view.shape
|
|
- * else:
|
|
- */
|
|
- __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
|
|
- if (__pyx_t_1) {
|
|
+/* Python wrapper */
|
|
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
|
|
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
|
|
+ PyObject *__pyx_r = 0;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
|
|
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
|
|
- /* "View.MemoryView":523
|
|
- *
|
|
- * if flags & PyBUF_ND:
|
|
- * info.shape = self.view.shape # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * info.shape = NULL
|
|
- */
|
|
- __pyx_t_4 = __pyx_v_self->view.shape;
|
|
- __pyx_v_info->shape = __pyx_t_4;
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
|
|
- /* "View.MemoryView":522
|
|
- * raise ValueError("Cannot create writable memory view from read-only memoryview")
|
|
- *
|
|
- * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
|
|
- * info.shape = self.view.shape
|
|
- * else:
|
|
- */
|
|
- goto __pyx_L6;
|
|
- }
|
|
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
+ PyObject *__pyx_r = NULL;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ PyObject *__pyx_t_1 = NULL;
|
|
+ PyObject *__pyx_t_2 = NULL;
|
|
+ PyObject *__pyx_t_3 = NULL;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("__get__", 0);
|
|
|
|
- /* "View.MemoryView":525
|
|
- * info.shape = self.view.shape
|
|
- * else:
|
|
- * info.shape = NULL # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":593
|
|
+ * @property
|
|
+ * def nbytes(self):
|
|
+ * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
|
|
*
|
|
- * if flags & PyBUF_STRIDES:
|
|
+ * @property
|
|
*/
|
|
- /*else*/ {
|
|
- __pyx_v_info->shape = NULL;
|
|
- }
|
|
- __pyx_L6:;
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 593, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 593, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 593, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
+ __pyx_r = __pyx_t_3;
|
|
+ __pyx_t_3 = 0;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":527
|
|
- * info.shape = NULL
|
|
+ /* "View.MemoryView":592
|
|
+ *
|
|
+ * @property
|
|
+ * def nbytes(self): # <<<<<<<<<<<<<<
|
|
+ * return self.size * self.view.itemsize
|
|
*
|
|
- * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
|
|
- * info.strides = self.view.strides
|
|
- * else:
|
|
*/
|
|
- __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
|
|
- if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":528
|
|
+ /* function exit code */
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_1);
|
|
+ __Pyx_XDECREF(__pyx_t_2);
|
|
+ __Pyx_XDECREF(__pyx_t_3);
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = NULL;
|
|
+ __pyx_L0:;
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+/* "View.MemoryView":596
|
|
*
|
|
- * if flags & PyBUF_STRIDES:
|
|
- * info.strides = self.view.strides # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * info.strides = NULL
|
|
+ * @property
|
|
+ * def size(self): # <<<<<<<<<<<<<<
|
|
+ * if self._size is None:
|
|
+ * result = 1
|
|
*/
|
|
- __pyx_t_4 = __pyx_v_self->view.strides;
|
|
- __pyx_v_info->strides = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":527
|
|
- * info.shape = NULL
|
|
+/* Python wrapper */
|
|
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
|
|
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
|
|
+ PyObject *__pyx_r = 0;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
|
|
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
+
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
+ PyObject *__pyx_v_result = NULL;
|
|
+ PyObject *__pyx_v_length = NULL;
|
|
+ PyObject *__pyx_r = NULL;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ int __pyx_t_1;
|
|
+ int __pyx_t_2;
|
|
+ Py_ssize_t *__pyx_t_3;
|
|
+ Py_ssize_t *__pyx_t_4;
|
|
+ Py_ssize_t *__pyx_t_5;
|
|
+ PyObject *__pyx_t_6 = NULL;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("__get__", 0);
|
|
+
|
|
+ /* "View.MemoryView":597
|
|
+ * @property
|
|
+ * def size(self):
|
|
+ * if self._size is None: # <<<<<<<<<<<<<<
|
|
+ * result = 1
|
|
*
|
|
- * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
|
|
- * info.strides = self.view.strides
|
|
- * else:
|
|
*/
|
|
- goto __pyx_L7;
|
|
- }
|
|
+ __pyx_t_1 = (__pyx_v_self->_size == Py_None);
|
|
+ __pyx_t_2 = (__pyx_t_1 != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":530
|
|
- * info.strides = self.view.strides
|
|
- * else:
|
|
- * info.strides = NULL # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":598
|
|
+ * def size(self):
|
|
+ * if self._size is None:
|
|
+ * result = 1 # <<<<<<<<<<<<<<
|
|
*
|
|
- * if flags & PyBUF_INDIRECT:
|
|
+ * for length in self.view.shape[:self.view.ndim]:
|
|
*/
|
|
- /*else*/ {
|
|
- __pyx_v_info->strides = NULL;
|
|
- }
|
|
- __pyx_L7:;
|
|
+ __Pyx_INCREF(__pyx_int_1);
|
|
+ __pyx_v_result = __pyx_int_1;
|
|
|
|
- /* "View.MemoryView":532
|
|
- * info.strides = NULL
|
|
+ /* "View.MemoryView":600
|
|
+ * result = 1
|
|
+ *
|
|
+ * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
|
|
+ * result *= length
|
|
*
|
|
- * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
|
|
- * info.suboffsets = self.view.suboffsets
|
|
- * else:
|
|
*/
|
|
- __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
|
|
- if (__pyx_t_1) {
|
|
+ __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
|
|
+ for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
|
|
+ __pyx_t_3 = __pyx_t_5;
|
|
+ __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 600, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_6);
|
|
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
|
|
+ __pyx_t_6 = 0;
|
|
|
|
- /* "View.MemoryView":533
|
|
+ /* "View.MemoryView":601
|
|
*
|
|
- * if flags & PyBUF_INDIRECT:
|
|
- * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * info.suboffsets = NULL
|
|
+ * for length in self.view.shape[:self.view.ndim]:
|
|
+ * result *= length # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * self._size = result
|
|
*/
|
|
- __pyx_t_4 = __pyx_v_self->view.suboffsets;
|
|
- __pyx_v_info->suboffsets = __pyx_t_4;
|
|
+ __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 601, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_6);
|
|
+ __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
|
|
+ __pyx_t_6 = 0;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":532
|
|
- * info.strides = NULL
|
|
+ /* "View.MemoryView":603
|
|
+ * result *= length
|
|
*
|
|
- * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
|
|
- * info.suboffsets = self.view.suboffsets
|
|
- * else:
|
|
+ * self._size = result # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * return self._size
|
|
*/
|
|
- goto __pyx_L8;
|
|
- }
|
|
+ __Pyx_INCREF(__pyx_v_result);
|
|
+ __Pyx_GIVEREF(__pyx_v_result);
|
|
+ __Pyx_GOTREF(__pyx_v_self->_size);
|
|
+ __Pyx_DECREF(__pyx_v_self->_size);
|
|
+ __pyx_v_self->_size = __pyx_v_result;
|
|
|
|
- /* "View.MemoryView":535
|
|
- * info.suboffsets = self.view.suboffsets
|
|
- * else:
|
|
- * info.suboffsets = NULL # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":597
|
|
+ * @property
|
|
+ * def size(self):
|
|
+ * if self._size is None: # <<<<<<<<<<<<<<
|
|
+ * result = 1
|
|
*
|
|
- * if flags & PyBUF_FORMAT:
|
|
*/
|
|
- /*else*/ {
|
|
- __pyx_v_info->suboffsets = NULL;
|
|
}
|
|
- __pyx_L8:;
|
|
|
|
- /* "View.MemoryView":537
|
|
- * info.suboffsets = NULL
|
|
+ /* "View.MemoryView":605
|
|
+ * self._size = result
|
|
*
|
|
- * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
|
|
- * info.format = self.view.format
|
|
- * else:
|
|
- */
|
|
- __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
|
|
- if (__pyx_t_1) {
|
|
-
|
|
- /* "View.MemoryView":538
|
|
+ * return self._size # <<<<<<<<<<<<<<
|
|
*
|
|
- * if flags & PyBUF_FORMAT:
|
|
- * info.format = self.view.format # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * info.format = NULL
|
|
+ * def __len__(self):
|
|
*/
|
|
- __pyx_t_5 = __pyx_v_self->view.format;
|
|
- __pyx_v_info->format = __pyx_t_5;
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __Pyx_INCREF(__pyx_v_self->_size);
|
|
+ __pyx_r = __pyx_v_self->_size;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":537
|
|
- * info.suboffsets = NULL
|
|
+ /* "View.MemoryView":596
|
|
*
|
|
- * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
|
|
- * info.format = self.view.format
|
|
- * else:
|
|
+ * @property
|
|
+ * def size(self): # <<<<<<<<<<<<<<
|
|
+ * if self._size is None:
|
|
+ * result = 1
|
|
*/
|
|
- goto __pyx_L9;
|
|
- }
|
|
|
|
- /* "View.MemoryView":540
|
|
- * info.format = self.view.format
|
|
- * else:
|
|
- * info.format = NULL # <<<<<<<<<<<<<<
|
|
- *
|
|
- * info.buf = self.view.buf
|
|
- */
|
|
- /*else*/ {
|
|
- __pyx_v_info->format = NULL;
|
|
- }
|
|
- __pyx_L9:;
|
|
+ /* function exit code */
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_6);
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = NULL;
|
|
+ __pyx_L0:;
|
|
+ __Pyx_XDECREF(__pyx_v_result);
|
|
+ __Pyx_XDECREF(__pyx_v_length);
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
|
|
- /* "View.MemoryView":542
|
|
- * info.format = NULL
|
|
+/* "View.MemoryView":607
|
|
+ * return self._size
|
|
*
|
|
- * info.buf = self.view.buf # <<<<<<<<<<<<<<
|
|
- * info.ndim = self.view.ndim
|
|
- * info.itemsize = self.view.itemsize
|
|
+ * def __len__(self): # <<<<<<<<<<<<<<
|
|
+ * if self.view.ndim >= 1:
|
|
+ * return self.view.shape[0]
|
|
*/
|
|
- __pyx_t_6 = __pyx_v_self->view.buf;
|
|
- __pyx_v_info->buf = __pyx_t_6;
|
|
|
|
- /* "View.MemoryView":543
|
|
- *
|
|
- * info.buf = self.view.buf
|
|
- * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
|
|
- * info.itemsize = self.view.itemsize
|
|
- * info.len = self.view.len
|
|
- */
|
|
- __pyx_t_7 = __pyx_v_self->view.ndim;
|
|
- __pyx_v_info->ndim = __pyx_t_7;
|
|
+/* Python wrapper */
|
|
+static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
|
|
+static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
|
|
+ Py_ssize_t __pyx_r;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
|
|
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
|
|
- /* "View.MemoryView":544
|
|
- * info.buf = self.view.buf
|
|
- * info.ndim = self.view.ndim
|
|
- * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
|
|
- * info.len = self.view.len
|
|
- * info.readonly = self.view.readonly
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
+ Py_ssize_t __pyx_r;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ int __pyx_t_1;
|
|
+ __Pyx_RefNannySetupContext("__len__", 0);
|
|
+
|
|
+ /* "View.MemoryView":608
|
|
+ *
|
|
+ * def __len__(self):
|
|
+ * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
|
|
+ * return self.view.shape[0]
|
|
+ *
|
|
*/
|
|
- __pyx_t_8 = __pyx_v_self->view.itemsize;
|
|
- __pyx_v_info->itemsize = __pyx_t_8;
|
|
+ __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":545
|
|
- * info.ndim = self.view.ndim
|
|
- * info.itemsize = self.view.itemsize
|
|
- * info.len = self.view.len # <<<<<<<<<<<<<<
|
|
- * info.readonly = self.view.readonly
|
|
- * info.obj = self
|
|
+ /* "View.MemoryView":609
|
|
+ * def __len__(self):
|
|
+ * if self.view.ndim >= 1:
|
|
+ * return self.view.shape[0] # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * return 0
|
|
*/
|
|
- __pyx_t_8 = __pyx_v_self->view.len;
|
|
- __pyx_v_info->len = __pyx_t_8;
|
|
+ __pyx_r = (__pyx_v_self->view.shape[0]);
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":546
|
|
- * info.itemsize = self.view.itemsize
|
|
- * info.len = self.view.len
|
|
- * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
|
|
- * info.obj = self
|
|
+ /* "View.MemoryView":608
|
|
+ *
|
|
+ * def __len__(self):
|
|
+ * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
|
|
+ * return self.view.shape[0]
|
|
*
|
|
*/
|
|
- __pyx_t_1 = __pyx_v_self->view.readonly;
|
|
- __pyx_v_info->readonly = __pyx_t_1;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":547
|
|
- * info.len = self.view.len
|
|
- * info.readonly = self.view.readonly
|
|
- * info.obj = self # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":611
|
|
+ * return self.view.shape[0]
|
|
*
|
|
- * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
|
|
+ * return 0 # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * def __repr__(self):
|
|
*/
|
|
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
|
|
- __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
|
|
- __Pyx_GOTREF(__pyx_v_info->obj);
|
|
- __Pyx_DECREF(__pyx_v_info->obj);
|
|
- __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
|
|
+ __pyx_r = 0;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":518
|
|
+ /* "View.MemoryView":607
|
|
+ * return self._size
|
|
*
|
|
- * @cname('getbuffer')
|
|
- * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
|
|
- * if flags & PyBUF_WRITABLE and self.view.readonly:
|
|
- * raise ValueError("Cannot create writable memory view from read-only memoryview")
|
|
+ * def __len__(self): # <<<<<<<<<<<<<<
|
|
+ * if self.view.ndim >= 1:
|
|
+ * return self.view.shape[0]
|
|
*/
|
|
|
|
/* function exit code */
|
|
- __pyx_r = 0;
|
|
- goto __pyx_L0;
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_3);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = -1;
|
|
- if (__pyx_v_info->obj != NULL) {
|
|
- __Pyx_GOTREF(__pyx_v_info->obj);
|
|
- __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
|
|
- }
|
|
- goto __pyx_L2;
|
|
__pyx_L0:;
|
|
- if (__pyx_v_info->obj == Py_None) {
|
|
- __Pyx_GOTREF(__pyx_v_info->obj);
|
|
- __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
|
|
- }
|
|
- __pyx_L2:;
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":553
|
|
+/* "View.MemoryView":613
|
|
+ * return 0
|
|
*
|
|
- * @property
|
|
- * def T(self): # <<<<<<<<<<<<<<
|
|
- * cdef _memoryviewslice result = memoryview_copy(self)
|
|
- * transpose_memslice(&result.from_slice)
|
|
+ * def __repr__(self): # <<<<<<<<<<<<<<
|
|
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
|
|
+ * id(self))
|
|
*/
|
|
|
|
/* Python wrapper */
|
|
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
|
|
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
|
|
+static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
|
|
+static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
|
|
- __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
+ __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
|
|
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
|
|
/* function exit code */
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
- struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
|
|
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
- int __pyx_t_2;
|
|
+ PyObject *__pyx_t_2 = NULL;
|
|
+ PyObject *__pyx_t_3 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__get__", 0);
|
|
+ __Pyx_RefNannySetupContext("__repr__", 0);
|
|
|
|
- /* "View.MemoryView":554
|
|
- * @property
|
|
- * def T(self):
|
|
- * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
|
|
- * transpose_memslice(&result.from_slice)
|
|
- * return result
|
|
+ /* "View.MemoryView":614
|
|
+ *
|
|
+ * def __repr__(self):
|
|
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
|
|
+ * id(self))
|
|
+ *
|
|
*/
|
|
- __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 554, __pyx_L1_error)
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 614, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
- if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 554, __pyx_L1_error)
|
|
- __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
|
|
- __pyx_t_1 = 0;
|
|
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 614, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 614, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
|
|
- /* "View.MemoryView":555
|
|
- * def T(self):
|
|
- * cdef _memoryviewslice result = memoryview_copy(self)
|
|
- * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
|
|
- * return result
|
|
+ /* "View.MemoryView":615
|
|
+ * def __repr__(self):
|
|
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
|
|
+ * id(self)) # <<<<<<<<<<<<<<
|
|
*
|
|
+ * def __str__(self):
|
|
*/
|
|
- __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 555, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 615, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
|
|
- /* "View.MemoryView":556
|
|
- * cdef _memoryviewslice result = memoryview_copy(self)
|
|
- * transpose_memslice(&result.from_slice)
|
|
- * return result # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":614
|
|
+ *
|
|
+ * def __repr__(self):
|
|
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
|
|
+ * id(self))
|
|
*
|
|
- * @property
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
|
|
- __pyx_r = ((PyObject *)__pyx_v_result);
|
|
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 614, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ __Pyx_GIVEREF(__pyx_t_1);
|
|
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
|
|
+ __Pyx_GIVEREF(__pyx_t_2);
|
|
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
|
|
+ __pyx_t_1 = 0;
|
|
+ __pyx_t_2 = 0;
|
|
+ __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 614, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
+ __pyx_r = __pyx_t_2;
|
|
+ __pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":553
|
|
+ /* "View.MemoryView":613
|
|
+ * return 0
|
|
*
|
|
- * @property
|
|
- * def T(self): # <<<<<<<<<<<<<<
|
|
- * cdef _memoryviewslice result = memoryview_copy(self)
|
|
- * transpose_memslice(&result.from_slice)
|
|
+ * def __repr__(self): # <<<<<<<<<<<<<<
|
|
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
|
|
+ * id(self))
|
|
*/
|
|
|
|
/* function exit code */
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __Pyx_XDECREF(__pyx_t_2);
|
|
+ __Pyx_XDECREF(__pyx_t_3);
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":559
|
|
+/* "View.MemoryView":617
|
|
+ * id(self))
|
|
*
|
|
- * @property
|
|
- * def base(self): # <<<<<<<<<<<<<<
|
|
- * return self.obj
|
|
+ * def __str__(self): # <<<<<<<<<<<<<<
|
|
+ * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
|
|
*
|
|
*/
|
|
|
|
/* Python wrapper */
|
|
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
|
|
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
|
|
+static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
|
|
+static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
|
|
- __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
+ __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
|
|
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
|
|
/* function exit code */
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__get__", 0);
|
|
+ PyObject *__pyx_t_1 = NULL;
|
|
+ PyObject *__pyx_t_2 = NULL;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("__str__", 0);
|
|
|
|
- /* "View.MemoryView":560
|
|
- * @property
|
|
- * def base(self):
|
|
- * return self.obj # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":618
|
|
+ *
|
|
+ * def __str__(self):
|
|
+ * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
|
|
+ *
|
|
*
|
|
- * @property
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __Pyx_INCREF(__pyx_v_self->obj);
|
|
- __pyx_r = __pyx_v_self->obj;
|
|
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 618, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 618, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 618, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 618, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __Pyx_GIVEREF(__pyx_t_1);
|
|
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
|
|
+ __pyx_t_1 = 0;
|
|
+ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 618, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
+ __pyx_r = __pyx_t_1;
|
|
+ __pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":559
|
|
+ /* "View.MemoryView":617
|
|
+ * id(self))
|
|
*
|
|
- * @property
|
|
- * def base(self): # <<<<<<<<<<<<<<
|
|
- * return self.obj
|
|
+ * def __str__(self): # <<<<<<<<<<<<<<
|
|
+ * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
|
|
*
|
|
*/
|
|
|
|
/* function exit code */
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_1);
|
|
+ __Pyx_XDECREF(__pyx_t_2);
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":563
|
|
+/* "View.MemoryView":621
|
|
*
|
|
- * @property
|
|
- * def shape(self): # <<<<<<<<<<<<<<
|
|
- * return tuple([length for length in self.view.shape[:self.view.ndim]])
|
|
*
|
|
+ * def is_c_contig(self): # <<<<<<<<<<<<<<
|
|
+ * cdef __Pyx_memviewslice *mslice
|
|
+ * cdef __Pyx_memviewslice tmp
|
|
*/
|
|
|
|
/* Python wrapper */
|
|
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
|
|
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
|
|
+static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
+static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
|
|
- __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
+ __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
|
|
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
|
|
/* function exit code */
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
- Py_ssize_t __pyx_v_length;
|
|
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
+ __Pyx_memviewslice *__pyx_v_mslice;
|
|
+ __Pyx_memviewslice __pyx_v_tmp;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
- PyObject *__pyx_t_1 = NULL;
|
|
- Py_ssize_t *__pyx_t_2;
|
|
- Py_ssize_t *__pyx_t_3;
|
|
- Py_ssize_t *__pyx_t_4;
|
|
- PyObject *__pyx_t_5 = NULL;
|
|
+ __Pyx_memviewslice *__pyx_t_1;
|
|
+ PyObject *__pyx_t_2 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__get__", 0);
|
|
+ __Pyx_RefNannySetupContext("is_c_contig", 0);
|
|
|
|
- /* "View.MemoryView":564
|
|
- * @property
|
|
- * def shape(self):
|
|
- * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":624
|
|
+ * cdef __Pyx_memviewslice *mslice
|
|
+ * cdef __Pyx_memviewslice tmp
|
|
+ * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
|
|
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
|
|
*
|
|
- * @property
|
|
+ */
|
|
+ __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 624, __pyx_L1_error)
|
|
+ __pyx_v_mslice = __pyx_t_1;
|
|
+
|
|
+ /* "View.MemoryView":625
|
|
+ * cdef __Pyx_memviewslice tmp
|
|
+ * mslice = get_slice_from_memview(self, &tmp)
|
|
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * def is_f_contig(self):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 564, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
|
|
- for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
|
|
- __pyx_t_2 = __pyx_t_4;
|
|
- __pyx_v_length = (__pyx_t_2[0]);
|
|
- __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_5);
|
|
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 564, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
- }
|
|
- __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_5);
|
|
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
- __pyx_r = __pyx_t_5;
|
|
- __pyx_t_5 = 0;
|
|
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 625, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __pyx_r = __pyx_t_2;
|
|
+ __pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":563
|
|
+ /* "View.MemoryView":621
|
|
*
|
|
- * @property
|
|
- * def shape(self): # <<<<<<<<<<<<<<
|
|
- * return tuple([length for length in self.view.shape[:self.view.ndim]])
|
|
*
|
|
+ * def is_c_contig(self): # <<<<<<<<<<<<<<
|
|
+ * cdef __Pyx_memviewslice *mslice
|
|
+ * cdef __Pyx_memviewslice tmp
|
|
*/
|
|
|
|
/* function exit code */
|
|
__pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_XDECREF(__pyx_t_5);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __Pyx_XDECREF(__pyx_t_2);
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
@@ -11371,113 +10918,75 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(stru
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":567
|
|
- *
|
|
- * @property
|
|
- * def strides(self): # <<<<<<<<<<<<<<
|
|
- * if self.view.strides == NULL:
|
|
+/* "View.MemoryView":627
|
|
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
|
|
*
|
|
+ * def is_f_contig(self): # <<<<<<<<<<<<<<
|
|
+ * cdef __Pyx_memviewslice *mslice
|
|
+ * cdef __Pyx_memviewslice tmp
|
|
*/
|
|
|
|
/* Python wrapper */
|
|
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
|
|
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
|
|
+static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
+static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
|
|
- __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
+ __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
|
|
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
|
|
/* function exit code */
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
- Py_ssize_t __pyx_v_stride;
|
|
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
+ __Pyx_memviewslice *__pyx_v_mslice;
|
|
+ __Pyx_memviewslice __pyx_v_tmp;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
- int __pyx_t_1;
|
|
+ __Pyx_memviewslice *__pyx_t_1;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
- Py_ssize_t *__pyx_t_3;
|
|
- Py_ssize_t *__pyx_t_4;
|
|
- Py_ssize_t *__pyx_t_5;
|
|
- PyObject *__pyx_t_6 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__get__", 0);
|
|
-
|
|
- /* "View.MemoryView":568
|
|
- * @property
|
|
- * def strides(self):
|
|
- * if self.view.strides == NULL: # <<<<<<<<<<<<<<
|
|
- *
|
|
- * raise ValueError("Buffer view does not expose strides")
|
|
- */
|
|
- __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
|
|
- if (unlikely(__pyx_t_1)) {
|
|
-
|
|
- /* "View.MemoryView":570
|
|
- * if self.view.strides == NULL:
|
|
- *
|
|
- * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
|
|
- *
|
|
- * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
|
|
- */
|
|
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 570, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
|
|
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __PYX_ERR(2, 570, __pyx_L1_error)
|
|
+ __Pyx_RefNannySetupContext("is_f_contig", 0);
|
|
|
|
- /* "View.MemoryView":568
|
|
- * @property
|
|
- * def strides(self):
|
|
- * if self.view.strides == NULL: # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":630
|
|
+ * cdef __Pyx_memviewslice *mslice
|
|
+ * cdef __Pyx_memviewslice tmp
|
|
+ * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
|
|
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
|
|
*
|
|
- * raise ValueError("Buffer view does not expose strides")
|
|
*/
|
|
- }
|
|
+ __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 630, __pyx_L1_error)
|
|
+ __pyx_v_mslice = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":572
|
|
- * raise ValueError("Buffer view does not expose strides")
|
|
- *
|
|
- * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":631
|
|
+ * cdef __Pyx_memviewslice tmp
|
|
+ * mslice = get_slice_from_memview(self, &tmp)
|
|
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
|
|
*
|
|
- * @property
|
|
+ * def copy(self):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 572, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 631, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
|
|
- for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
|
|
- __pyx_t_3 = __pyx_t_5;
|
|
- __pyx_v_stride = (__pyx_t_3[0]);
|
|
- __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_6);
|
|
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 572, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
- }
|
|
- __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_6);
|
|
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __pyx_r = __pyx_t_6;
|
|
- __pyx_t_6 = 0;
|
|
+ __pyx_r = __pyx_t_2;
|
|
+ __pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":567
|
|
- *
|
|
- * @property
|
|
- * def strides(self): # <<<<<<<<<<<<<<
|
|
- * if self.view.strides == NULL:
|
|
+ /* "View.MemoryView":627
|
|
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
|
|
*
|
|
+ * def is_f_contig(self): # <<<<<<<<<<<<<<
|
|
+ * cdef __Pyx_memviewslice *mslice
|
|
+ * cdef __Pyx_memviewslice tmp
|
|
*/
|
|
|
|
/* function exit code */
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_2);
|
|
- __Pyx_XDECREF(__pyx_t_6);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
@@ -11485,117 +10994,93 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":575
|
|
+/* "View.MemoryView":633
|
|
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
|
|
*
|
|
- * @property
|
|
- * def suboffsets(self): # <<<<<<<<<<<<<<
|
|
- * if self.view.suboffsets == NULL:
|
|
- * return (-1,) * self.view.ndim
|
|
+ * def copy(self): # <<<<<<<<<<<<<<
|
|
+ * cdef __Pyx_memviewslice mslice
|
|
+ * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
|
|
*/
|
|
|
|
/* Python wrapper */
|
|
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
|
|
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
|
|
+static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
+static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
|
|
- __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
+ __Pyx_RefNannySetupContext("copy (wrapper)", 0);
|
|
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
|
|
/* function exit code */
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
- Py_ssize_t __pyx_v_suboffset;
|
|
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
+ __Pyx_memviewslice __pyx_v_mslice;
|
|
+ int __pyx_v_flags;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
- int __pyx_t_1;
|
|
+ __Pyx_memviewslice __pyx_t_1;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
- PyObject *__pyx_t_3 = NULL;
|
|
- Py_ssize_t *__pyx_t_4;
|
|
- Py_ssize_t *__pyx_t_5;
|
|
- Py_ssize_t *__pyx_t_6;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__get__", 0);
|
|
+ __Pyx_RefNannySetupContext("copy", 0);
|
|
|
|
- /* "View.MemoryView":576
|
|
- * @property
|
|
- * def suboffsets(self):
|
|
- * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
|
|
- * return (-1,) * self.view.ndim
|
|
+ /* "View.MemoryView":635
|
|
+ * def copy(self):
|
|
+ * cdef __Pyx_memviewslice mslice
|
|
+ * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
|
|
*
|
|
+ * slice_copy(self, &mslice)
|
|
*/
|
|
- __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
|
|
- if (__pyx_t_1) {
|
|
+ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
|
|
|
|
- /* "View.MemoryView":577
|
|
- * def suboffsets(self):
|
|
- * if self.view.suboffsets == NULL:
|
|
- * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":637
|
|
+ * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
|
|
*
|
|
- * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
|
|
+ * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
|
|
+ * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
|
|
+ * self.view.itemsize,
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__20, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __pyx_r = __pyx_t_3;
|
|
- __pyx_t_3 = 0;
|
|
- goto __pyx_L0;
|
|
+ __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
|
|
|
|
- /* "View.MemoryView":576
|
|
- * @property
|
|
- * def suboffsets(self):
|
|
- * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
|
|
- * return (-1,) * self.view.ndim
|
|
+ /* "View.MemoryView":638
|
|
*
|
|
+ * slice_copy(self, &mslice)
|
|
+ * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
|
|
+ * self.view.itemsize,
|
|
+ * flags|PyBUF_C_CONTIGUOUS,
|
|
*/
|
|
- }
|
|
+ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 638, __pyx_L1_error)
|
|
+ __pyx_v_mslice = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":579
|
|
- * return (-1,) * self.view.ndim
|
|
+ /* "View.MemoryView":643
|
|
+ * self.dtype_is_object)
|
|
*
|
|
- * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
|
|
+ * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
|
|
*
|
|
- * @property
|
|
+ * def copy_fortran(self):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 579, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
|
|
- for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
|
|
- __pyx_t_4 = __pyx_t_6;
|
|
- __pyx_v_suboffset = (__pyx_t_4[0]);
|
|
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 579, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- }
|
|
- __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error)
|
|
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 643, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":575
|
|
+ /* "View.MemoryView":633
|
|
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
|
|
*
|
|
- * @property
|
|
- * def suboffsets(self): # <<<<<<<<<<<<<<
|
|
- * if self.view.suboffsets == NULL:
|
|
- * return (-1,) * self.view.ndim
|
|
+ * def copy(self): # <<<<<<<<<<<<<<
|
|
+ * cdef __Pyx_memviewslice mslice
|
|
+ * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
|
|
*/
|
|
|
|
/* function exit code */
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_2);
|
|
- __Pyx_XDECREF(__pyx_t_3);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
@@ -11603,62 +11088,94 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":582
|
|
- *
|
|
- * @property
|
|
- * def ndim(self): # <<<<<<<<<<<<<<
|
|
- * return self.view.ndim
|
|
+/* "View.MemoryView":645
|
|
+ * return memoryview_copy_from_slice(self, &mslice)
|
|
*
|
|
+ * def copy_fortran(self): # <<<<<<<<<<<<<<
|
|
+ * cdef __Pyx_memviewslice src, dst
|
|
+ * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
|
|
*/
|
|
|
|
/* Python wrapper */
|
|
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
|
|
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
|
|
+static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
+static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
|
|
- __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
+ __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
|
|
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
|
|
/* function exit code */
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
+ __Pyx_memviewslice __pyx_v_src;
|
|
+ __Pyx_memviewslice __pyx_v_dst;
|
|
+ int __pyx_v_flags;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
- PyObject *__pyx_t_1 = NULL;
|
|
+ __Pyx_memviewslice __pyx_t_1;
|
|
+ PyObject *__pyx_t_2 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__get__", 0);
|
|
+ __Pyx_RefNannySetupContext("copy_fortran", 0);
|
|
|
|
- /* "View.MemoryView":583
|
|
- * @property
|
|
- * def ndim(self):
|
|
- * return self.view.ndim # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":647
|
|
+ * def copy_fortran(self):
|
|
+ * cdef __Pyx_memviewslice src, dst
|
|
+ * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * slice_copy(self, &src)
|
|
+ */
|
|
+ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
|
|
+
|
|
+ /* "View.MemoryView":649
|
|
+ * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
|
|
+ *
|
|
+ * slice_copy(self, &src) # <<<<<<<<<<<<<<
|
|
+ * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
|
|
+ * self.view.itemsize,
|
|
+ */
|
|
+ __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
|
|
+
|
|
+ /* "View.MemoryView":650
|
|
+ *
|
|
+ * slice_copy(self, &src)
|
|
+ * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
|
|
+ * self.view.itemsize,
|
|
+ * flags|PyBUF_F_CONTIGUOUS,
|
|
+ */
|
|
+ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 650, __pyx_L1_error)
|
|
+ __pyx_v_dst = __pyx_t_1;
|
|
+
|
|
+ /* "View.MemoryView":655
|
|
+ * self.dtype_is_object)
|
|
+ *
|
|
+ * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
|
|
+ *
|
|
*
|
|
- * @property
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 583, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_r = __pyx_t_1;
|
|
- __pyx_t_1 = 0;
|
|
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 655, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __pyx_r = __pyx_t_2;
|
|
+ __pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":582
|
|
- *
|
|
- * @property
|
|
- * def ndim(self): # <<<<<<<<<<<<<<
|
|
- * return self.view.ndim
|
|
+ /* "View.MemoryView":645
|
|
+ * return memoryview_copy_from_slice(self, &mslice)
|
|
*
|
|
+ * def copy_fortran(self): # <<<<<<<<<<<<<<
|
|
+ * cdef __Pyx_memviewslice src, dst
|
|
+ * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
|
|
*/
|
|
|
|
/* function exit code */
|
|
__pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __Pyx_XDECREF(__pyx_t_2);
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
@@ -11666,355 +11183,241 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struc
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":586
|
|
- *
|
|
- * @property
|
|
- * def itemsize(self): # <<<<<<<<<<<<<<
|
|
- * return self.view.itemsize
|
|
- *
|
|
+/* "(tree fragment)":1
|
|
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
+ * def __setstate_cython__(self, __pyx_state):
|
|
*/
|
|
|
|
/* Python wrapper */
|
|
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
|
|
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
|
|
+static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
+static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
|
|
- __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
+ __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
|
|
+ __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
|
|
/* function exit code */
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
+static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__get__", 0);
|
|
+ __Pyx_RefNannySetupContext("__reduce_cython__", 0);
|
|
|
|
- /* "View.MemoryView":587
|
|
- * @property
|
|
- * def itemsize(self):
|
|
- * return self.view.itemsize # <<<<<<<<<<<<<<
|
|
- *
|
|
- * @property
|
|
+ /* "(tree fragment)":2
|
|
+ * def __reduce_cython__(self):
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
|
|
+ * def __setstate_cython__(self, __pyx_state):
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 587, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_r = __pyx_t_1;
|
|
- __pyx_t_1 = 0;
|
|
- goto __pyx_L0;
|
|
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __PYX_ERR(2, 2, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":586
|
|
- *
|
|
- * @property
|
|
- * def itemsize(self): # <<<<<<<<<<<<<<
|
|
- * return self.view.itemsize
|
|
- *
|
|
+ /* "(tree fragment)":1
|
|
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
+ * def __setstate_cython__(self, __pyx_state):
|
|
*/
|
|
|
|
/* function exit code */
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
- __pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":590
|
|
- *
|
|
- * @property
|
|
- * def nbytes(self): # <<<<<<<<<<<<<<
|
|
- * return self.size * self.view.itemsize
|
|
- *
|
|
+/* "(tree fragment)":3
|
|
+ * def __reduce_cython__(self):
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
*/
|
|
|
|
/* Python wrapper */
|
|
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
|
|
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
|
|
+static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
|
|
+static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
|
|
- __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
+ __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
|
|
+ __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
|
|
|
|
/* function exit code */
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
+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) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
- PyObject *__pyx_t_2 = NULL;
|
|
- PyObject *__pyx_t_3 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__get__", 0);
|
|
+ __Pyx_RefNannySetupContext("__setstate_cython__", 0);
|
|
|
|
- /* "View.MemoryView":591
|
|
- * @property
|
|
- * def nbytes(self):
|
|
- * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
|
|
- *
|
|
- * @property
|
|
+ /* "(tree fragment)":4
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
+ * def __setstate_cython__(self, __pyx_state):
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 591, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 591, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 591, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __pyx_r = __pyx_t_3;
|
|
- __pyx_t_3 = 0;
|
|
- goto __pyx_L0;
|
|
+ __PYX_ERR(2, 4, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":590
|
|
- *
|
|
- * @property
|
|
- * def nbytes(self): # <<<<<<<<<<<<<<
|
|
- * return self.size * self.view.itemsize
|
|
- *
|
|
+ /* "(tree fragment)":3
|
|
+ * def __reduce_cython__(self):
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
*/
|
|
|
|
/* function exit code */
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_XDECREF(__pyx_t_2);
|
|
- __Pyx_XDECREF(__pyx_t_3);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
- __pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":594
|
|
+/* "View.MemoryView":659
|
|
*
|
|
- * @property
|
|
- * def size(self): # <<<<<<<<<<<<<<
|
|
- * if self._size is None:
|
|
- * result = 1
|
|
+ * @cname('__pyx_memoryview_new')
|
|
+ * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
|
|
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object)
|
|
+ * result.typeinfo = typeinfo
|
|
*/
|
|
|
|
-/* Python wrapper */
|
|
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
|
|
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
|
|
- PyObject *__pyx_r = 0;
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
|
|
- __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
-
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
- PyObject *__pyx_v_result = NULL;
|
|
- PyObject *__pyx_v_length = NULL;
|
|
+static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
|
|
+ struct __pyx_memoryview_obj *__pyx_v_result = 0;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
- int __pyx_t_1;
|
|
- int __pyx_t_2;
|
|
- Py_ssize_t *__pyx_t_3;
|
|
- Py_ssize_t *__pyx_t_4;
|
|
- Py_ssize_t *__pyx_t_5;
|
|
- PyObject *__pyx_t_6 = NULL;
|
|
+ PyObject *__pyx_t_1 = NULL;
|
|
+ PyObject *__pyx_t_2 = NULL;
|
|
+ PyObject *__pyx_t_3 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__get__", 0);
|
|
+ __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
|
|
|
|
- /* "View.MemoryView":595
|
|
- * @property
|
|
- * def size(self):
|
|
- * if self._size is None: # <<<<<<<<<<<<<<
|
|
- * result = 1
|
|
- *
|
|
- */
|
|
- __pyx_t_1 = (__pyx_v_self->_size == Py_None);
|
|
- __pyx_t_2 = (__pyx_t_1 != 0);
|
|
- if (__pyx_t_2) {
|
|
-
|
|
- /* "View.MemoryView":596
|
|
- * def size(self):
|
|
- * if self._size is None:
|
|
- * result = 1 # <<<<<<<<<<<<<<
|
|
- *
|
|
- * for length in self.view.shape[:self.view.ndim]:
|
|
- */
|
|
- __Pyx_INCREF(__pyx_int_1);
|
|
- __pyx_v_result = __pyx_int_1;
|
|
-
|
|
- /* "View.MemoryView":598
|
|
- * result = 1
|
|
- *
|
|
- * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
|
|
- * result *= length
|
|
- *
|
|
- */
|
|
- __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
|
|
- for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
|
|
- __pyx_t_3 = __pyx_t_5;
|
|
- __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 598, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_6);
|
|
- __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
|
|
- __pyx_t_6 = 0;
|
|
-
|
|
- /* "View.MemoryView":599
|
|
- *
|
|
- * for length in self.view.shape[:self.view.ndim]:
|
|
- * result *= length # <<<<<<<<<<<<<<
|
|
- *
|
|
- * self._size = result
|
|
- */
|
|
- __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 599, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_6);
|
|
- __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
|
|
- __pyx_t_6 = 0;
|
|
- }
|
|
-
|
|
- /* "View.MemoryView":601
|
|
- * result *= length
|
|
- *
|
|
- * self._size = result # <<<<<<<<<<<<<<
|
|
- *
|
|
- * return self._size
|
|
+ /* "View.MemoryView":660
|
|
+ * @cname('__pyx_memoryview_new')
|
|
+ * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
|
|
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
|
|
+ * result.typeinfo = typeinfo
|
|
+ * return result
|
|
*/
|
|
- __Pyx_INCREF(__pyx_v_result);
|
|
- __Pyx_GIVEREF(__pyx_v_result);
|
|
- __Pyx_GOTREF(__pyx_v_self->_size);
|
|
- __Pyx_DECREF(__pyx_v_self->_size);
|
|
- __pyx_v_self->_size = __pyx_v_result;
|
|
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 660, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 660, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 660, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ __Pyx_INCREF(__pyx_v_o);
|
|
+ __Pyx_GIVEREF(__pyx_v_o);
|
|
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
|
|
+ __Pyx_GIVEREF(__pyx_t_1);
|
|
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
|
|
+ __Pyx_GIVEREF(__pyx_t_2);
|
|
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
|
|
+ __pyx_t_1 = 0;
|
|
+ __pyx_t_2 = 0;
|
|
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 660, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
+ __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
|
|
+ __pyx_t_2 = 0;
|
|
|
|
- /* "View.MemoryView":595
|
|
- * @property
|
|
- * def size(self):
|
|
- * if self._size is None: # <<<<<<<<<<<<<<
|
|
- * result = 1
|
|
+ /* "View.MemoryView":661
|
|
+ * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
|
|
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object)
|
|
+ * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
|
|
+ * return result
|
|
*
|
|
*/
|
|
- }
|
|
+ __pyx_v_result->typeinfo = __pyx_v_typeinfo;
|
|
|
|
- /* "View.MemoryView":603
|
|
- * self._size = result
|
|
- *
|
|
- * return self._size # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":662
|
|
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object)
|
|
+ * result.typeinfo = typeinfo
|
|
+ * return result # <<<<<<<<<<<<<<
|
|
*
|
|
- * def __len__(self):
|
|
+ * @cname('__pyx_memoryview_check')
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __Pyx_INCREF(__pyx_v_self->_size);
|
|
- __pyx_r = __pyx_v_self->_size;
|
|
+ __Pyx_INCREF(((PyObject *)__pyx_v_result));
|
|
+ __pyx_r = ((PyObject *)__pyx_v_result);
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":594
|
|
+ /* "View.MemoryView":659
|
|
*
|
|
- * @property
|
|
- * def size(self): # <<<<<<<<<<<<<<
|
|
- * if self._size is None:
|
|
- * result = 1
|
|
+ * @cname('__pyx_memoryview_new')
|
|
+ * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
|
|
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object)
|
|
+ * result.typeinfo = typeinfo
|
|
*/
|
|
|
|
/* function exit code */
|
|
__pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_6);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = NULL;
|
|
+ __Pyx_XDECREF(__pyx_t_1);
|
|
+ __Pyx_XDECREF(__pyx_t_2);
|
|
+ __Pyx_XDECREF(__pyx_t_3);
|
|
+ __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = 0;
|
|
__pyx_L0:;
|
|
- __Pyx_XDECREF(__pyx_v_result);
|
|
- __Pyx_XDECREF(__pyx_v_length);
|
|
+ __Pyx_XDECREF((PyObject *)__pyx_v_result);
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":605
|
|
- * return self._size
|
|
+/* "View.MemoryView":665
|
|
+ *
|
|
+ * @cname('__pyx_memoryview_check')
|
|
+ * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
|
|
+ * return isinstance(o, memoryview)
|
|
*
|
|
- * def __len__(self): # <<<<<<<<<<<<<<
|
|
- * if self.view.ndim >= 1:
|
|
- * return self.view.shape[0]
|
|
*/
|
|
|
|
-/* Python wrapper */
|
|
-static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
|
|
-static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
|
|
- Py_ssize_t __pyx_r;
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
|
|
- __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
-
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
- Py_ssize_t __pyx_r;
|
|
+static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
|
|
+ int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
int __pyx_t_1;
|
|
- __Pyx_RefNannySetupContext("__len__", 0);
|
|
-
|
|
- /* "View.MemoryView":606
|
|
- *
|
|
- * def __len__(self):
|
|
- * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
|
|
- * return self.view.shape[0]
|
|
- *
|
|
- */
|
|
- __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
|
|
- if (__pyx_t_1) {
|
|
-
|
|
- /* "View.MemoryView":607
|
|
- * def __len__(self):
|
|
- * if self.view.ndim >= 1:
|
|
- * return self.view.shape[0] # <<<<<<<<<<<<<<
|
|
- *
|
|
- * return 0
|
|
- */
|
|
- __pyx_r = (__pyx_v_self->view.shape[0]);
|
|
- goto __pyx_L0;
|
|
-
|
|
- /* "View.MemoryView":606
|
|
- *
|
|
- * def __len__(self):
|
|
- * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
|
|
- * return self.view.shape[0]
|
|
- *
|
|
- */
|
|
- }
|
|
+ __Pyx_RefNannySetupContext("memoryview_check", 0);
|
|
|
|
- /* "View.MemoryView":609
|
|
- * return self.view.shape[0]
|
|
- *
|
|
- * return 0 # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":666
|
|
+ * @cname('__pyx_memoryview_check')
|
|
+ * cdef inline bint memoryview_check(object o):
|
|
+ * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
|
|
*
|
|
- * def __repr__(self):
|
|
+ * cdef tuple _unellipsify(object index, int ndim):
|
|
*/
|
|
- __pyx_r = 0;
|
|
+ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
|
|
+ __pyx_r = __pyx_t_1;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":605
|
|
- * return self._size
|
|
+ /* "View.MemoryView":665
|
|
+ *
|
|
+ * @cname('__pyx_memoryview_check')
|
|
+ * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
|
|
+ * return isinstance(o, memoryview)
|
|
*
|
|
- * def __len__(self): # <<<<<<<<<<<<<<
|
|
- * if self.view.ndim >= 1:
|
|
- * return self.view.shape[0]
|
|
*/
|
|
|
|
/* function exit code */
|
|
@@ -12023,3593 +11426,2828 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":611
|
|
- * return 0
|
|
+/* "View.MemoryView":668
|
|
+ * return isinstance(o, memoryview)
|
|
*
|
|
- * def __repr__(self): # <<<<<<<<<<<<<<
|
|
- * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
|
|
- * id(self))
|
|
+ * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
|
|
+ * """
|
|
+ * Replace all ellipses with full slices and fill incomplete indices with
|
|
*/
|
|
|
|
-/* Python wrapper */
|
|
-static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
|
|
-static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
|
|
- PyObject *__pyx_r = 0;
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
|
|
- __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
-
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
+static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
+ PyObject *__pyx_v_tup = NULL;
|
|
+ PyObject *__pyx_v_result = NULL;
|
|
+ int __pyx_v_have_slices;
|
|
+ int __pyx_v_seen_ellipsis;
|
|
+ CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
|
|
+ PyObject *__pyx_v_item = NULL;
|
|
+ Py_ssize_t __pyx_v_nslices;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
- PyObject *__pyx_t_1 = NULL;
|
|
- PyObject *__pyx_t_2 = NULL;
|
|
+ int __pyx_t_1;
|
|
+ int __pyx_t_2;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
+ PyObject *__pyx_t_4 = NULL;
|
|
+ Py_ssize_t __pyx_t_5;
|
|
+ PyObject *(*__pyx_t_6)(PyObject *);
|
|
+ PyObject *__pyx_t_7 = NULL;
|
|
+ Py_ssize_t __pyx_t_8;
|
|
+ int __pyx_t_9;
|
|
+ int __pyx_t_10;
|
|
+ PyObject *__pyx_t_11 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__repr__", 0);
|
|
+ __Pyx_RefNannySetupContext("_unellipsify", 0);
|
|
|
|
- /* "View.MemoryView":612
|
|
- *
|
|
- * def __repr__(self):
|
|
- * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
|
|
- * id(self))
|
|
- *
|
|
+ /* "View.MemoryView":673
|
|
+ * full slices.
|
|
+ * """
|
|
+ * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
|
|
+ * tup = (index,)
|
|
+ * else:
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
+ __pyx_t_1 = PyTuple_Check(__pyx_v_index);
|
|
+ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":613
|
|
- * def __repr__(self):
|
|
- * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
|
|
- * id(self)) # <<<<<<<<<<<<<<
|
|
- *
|
|
- * def __str__(self):
|
|
+ /* "View.MemoryView":674
|
|
+ * """
|
|
+ * if not isinstance(index, tuple):
|
|
+ * tup = (index,) # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * tup = index
|
|
*/
|
|
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 613, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 674, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ __Pyx_INCREF(__pyx_v_index);
|
|
+ __Pyx_GIVEREF(__pyx_v_index);
|
|
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
|
|
+ __pyx_v_tup = __pyx_t_3;
|
|
+ __pyx_t_3 = 0;
|
|
+
|
|
+ /* "View.MemoryView":673
|
|
+ * full slices.
|
|
+ * """
|
|
+ * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
|
|
+ * tup = (index,)
|
|
+ * else:
|
|
+ */
|
|
+ goto __pyx_L3;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":612
|
|
+ /* "View.MemoryView":676
|
|
+ * tup = (index,)
|
|
+ * else:
|
|
+ * tup = index # <<<<<<<<<<<<<<
|
|
*
|
|
- * def __repr__(self):
|
|
- * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
|
|
- * id(self))
|
|
+ * result = []
|
|
+ */
|
|
+ /*else*/ {
|
|
+ __Pyx_INCREF(__pyx_v_index);
|
|
+ __pyx_v_tup = __pyx_v_index;
|
|
+ }
|
|
+ __pyx_L3:;
|
|
+
|
|
+ /* "View.MemoryView":678
|
|
+ * tup = index
|
|
*
|
|
+ * result = [] # <<<<<<<<<<<<<<
|
|
+ * have_slices = False
|
|
+ * seen_ellipsis = False
|
|
*/
|
|
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 612, __pyx_L1_error)
|
|
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 678, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
- __Pyx_GIVEREF(__pyx_t_1);
|
|
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
|
|
- __Pyx_GIVEREF(__pyx_t_2);
|
|
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
|
|
- __pyx_t_1 = 0;
|
|
- __pyx_t_2 = 0;
|
|
- __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __pyx_r = __pyx_t_2;
|
|
- __pyx_t_2 = 0;
|
|
- goto __pyx_L0;
|
|
+ __pyx_v_result = ((PyObject*)__pyx_t_3);
|
|
+ __pyx_t_3 = 0;
|
|
|
|
- /* "View.MemoryView":611
|
|
- * return 0
|
|
+ /* "View.MemoryView":679
|
|
*
|
|
- * def __repr__(self): # <<<<<<<<<<<<<<
|
|
- * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
|
|
- * id(self))
|
|
+ * result = []
|
|
+ * have_slices = False # <<<<<<<<<<<<<<
|
|
+ * seen_ellipsis = False
|
|
+ * for idx, item in enumerate(tup):
|
|
*/
|
|
+ __pyx_v_have_slices = 0;
|
|
|
|
- /* function exit code */
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_XDECREF(__pyx_t_2);
|
|
- __Pyx_XDECREF(__pyx_t_3);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = NULL;
|
|
- __pyx_L0:;
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
+ /* "View.MemoryView":680
|
|
+ * result = []
|
|
+ * have_slices = False
|
|
+ * seen_ellipsis = False # <<<<<<<<<<<<<<
|
|
+ * for idx, item in enumerate(tup):
|
|
+ * if item is Ellipsis:
|
|
+ */
|
|
+ __pyx_v_seen_ellipsis = 0;
|
|
|
|
-/* "View.MemoryView":615
|
|
- * id(self))
|
|
- *
|
|
- * def __str__(self): # <<<<<<<<<<<<<<
|
|
- * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
|
|
- *
|
|
+ /* "View.MemoryView":681
|
|
+ * have_slices = False
|
|
+ * seen_ellipsis = False
|
|
+ * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
|
|
+ * if item is Ellipsis:
|
|
+ * if not seen_ellipsis:
|
|
*/
|
|
+ __Pyx_INCREF(__pyx_int_0);
|
|
+ __pyx_t_3 = __pyx_int_0;
|
|
+ if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
|
|
+ __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
|
|
+ __pyx_t_6 = NULL;
|
|
+ } else {
|
|
+ __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 681, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 681, __pyx_L1_error)
|
|
+ }
|
|
+ for (;;) {
|
|
+ if (likely(!__pyx_t_6)) {
|
|
+ if (likely(PyList_CheckExact(__pyx_t_4))) {
|
|
+ if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
|
|
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
+ __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 681, __pyx_L1_error)
|
|
+ #else
|
|
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 681, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_7);
|
|
+ #endif
|
|
+ } else {
|
|
+ if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
|
|
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
+ __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 681, __pyx_L1_error)
|
|
+ #else
|
|
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 681, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_7);
|
|
+ #endif
|
|
+ }
|
|
+ } else {
|
|
+ __pyx_t_7 = __pyx_t_6(__pyx_t_4);
|
|
+ if (unlikely(!__pyx_t_7)) {
|
|
+ PyObject* exc_type = PyErr_Occurred();
|
|
+ if (exc_type) {
|
|
+ if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
|
|
+ else __PYX_ERR(2, 681, __pyx_L1_error)
|
|
+ }
|
|
+ break;
|
|
+ }
|
|
+ __Pyx_GOTREF(__pyx_t_7);
|
|
+ }
|
|
+ __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
|
|
+ __pyx_t_7 = 0;
|
|
+ __Pyx_INCREF(__pyx_t_3);
|
|
+ __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
|
|
+ __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 681, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_7);
|
|
+ __Pyx_DECREF(__pyx_t_3);
|
|
+ __pyx_t_3 = __pyx_t_7;
|
|
+ __pyx_t_7 = 0;
|
|
|
|
-/* Python wrapper */
|
|
-static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
|
|
-static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
|
|
- PyObject *__pyx_r = 0;
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
|
|
- __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
+ /* "View.MemoryView":682
|
|
+ * seen_ellipsis = False
|
|
+ * for idx, item in enumerate(tup):
|
|
+ * if item is Ellipsis: # <<<<<<<<<<<<<<
|
|
+ * if not seen_ellipsis:
|
|
+ * result.extend([slice(None)] * (ndim - len(tup) + 1))
|
|
+ */
|
|
+ __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
|
|
+ __pyx_t_1 = (__pyx_t_2 != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
+ /* "View.MemoryView":683
|
|
+ * for idx, item in enumerate(tup):
|
|
+ * if item is Ellipsis:
|
|
+ * if not seen_ellipsis: # <<<<<<<<<<<<<<
|
|
+ * result.extend([slice(None)] * (ndim - len(tup) + 1))
|
|
+ * seen_ellipsis = True
|
|
+ */
|
|
+ __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
-static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
- PyObject *__pyx_r = NULL;
|
|
- __Pyx_RefNannyDeclarations
|
|
- PyObject *__pyx_t_1 = NULL;
|
|
- PyObject *__pyx_t_2 = NULL;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__str__", 0);
|
|
+ /* "View.MemoryView":684
|
|
+ * if item is Ellipsis:
|
|
+ * if not seen_ellipsis:
|
|
+ * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
|
|
+ * seen_ellipsis = True
|
|
+ * else:
|
|
+ */
|
|
+ __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 684, __pyx_L1_error)
|
|
+ __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 684, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_7);
|
|
+ { Py_ssize_t __pyx_temp;
|
|
+ for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
|
|
+ __Pyx_INCREF(__pyx_slice__18);
|
|
+ __Pyx_GIVEREF(__pyx_slice__18);
|
|
+ PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__18);
|
|
+ }
|
|
+ }
|
|
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 684, __pyx_L1_error)
|
|
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
|
|
- /* "View.MemoryView":616
|
|
- *
|
|
- * def __str__(self):
|
|
- * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
|
|
- *
|
|
- *
|
|
+ /* "View.MemoryView":685
|
|
+ * if not seen_ellipsis:
|
|
+ * result.extend([slice(None)] * (ndim - len(tup) + 1))
|
|
+ * seen_ellipsis = True # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * result.append(slice(None))
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __Pyx_GIVEREF(__pyx_t_1);
|
|
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
|
|
- __pyx_t_1 = 0;
|
|
- __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __pyx_r = __pyx_t_1;
|
|
- __pyx_t_1 = 0;
|
|
- goto __pyx_L0;
|
|
+ __pyx_v_seen_ellipsis = 1;
|
|
|
|
- /* "View.MemoryView":615
|
|
- * id(self))
|
|
- *
|
|
- * def __str__(self): # <<<<<<<<<<<<<<
|
|
- * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
|
|
- *
|
|
+ /* "View.MemoryView":683
|
|
+ * for idx, item in enumerate(tup):
|
|
+ * if item is Ellipsis:
|
|
+ * if not seen_ellipsis: # <<<<<<<<<<<<<<
|
|
+ * result.extend([slice(None)] * (ndim - len(tup) + 1))
|
|
+ * seen_ellipsis = True
|
|
*/
|
|
+ goto __pyx_L7;
|
|
+ }
|
|
|
|
- /* function exit code */
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_XDECREF(__pyx_t_2);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = NULL;
|
|
- __pyx_L0:;
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
+ /* "View.MemoryView":687
|
|
+ * seen_ellipsis = True
|
|
+ * else:
|
|
+ * result.append(slice(None)) # <<<<<<<<<<<<<<
|
|
+ * have_slices = True
|
|
+ * else:
|
|
+ */
|
|
+ /*else*/ {
|
|
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__18); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 687, __pyx_L1_error)
|
|
+ }
|
|
+ __pyx_L7:;
|
|
|
|
-/* "View.MemoryView":619
|
|
- *
|
|
- *
|
|
- * def is_c_contig(self): # <<<<<<<<<<<<<<
|
|
- * cdef __Pyx_memviewslice *mslice
|
|
- * cdef __Pyx_memviewslice tmp
|
|
+ /* "View.MemoryView":688
|
|
+ * else:
|
|
+ * result.append(slice(None))
|
|
+ * have_slices = True # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * if not isinstance(item, slice) and not PyIndex_Check(item):
|
|
*/
|
|
+ __pyx_v_have_slices = 1;
|
|
|
|
-/* Python wrapper */
|
|
-static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
-static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
|
|
- PyObject *__pyx_r = 0;
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
|
|
- __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
+ /* "View.MemoryView":682
|
|
+ * seen_ellipsis = False
|
|
+ * for idx, item in enumerate(tup):
|
|
+ * if item is Ellipsis: # <<<<<<<<<<<<<<
|
|
+ * if not seen_ellipsis:
|
|
+ * result.extend([slice(None)] * (ndim - len(tup) + 1))
|
|
+ */
|
|
+ goto __pyx_L6;
|
|
+ }
|
|
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
+ /* "View.MemoryView":690
|
|
+ * have_slices = True
|
|
+ * else:
|
|
+ * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
|
|
+ * raise TypeError("Cannot index with type '%s'" % type(item))
|
|
+ *
|
|
+ */
|
|
+ /*else*/ {
|
|
+ __pyx_t_2 = PySlice_Check(__pyx_v_item);
|
|
+ __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
|
|
+ if (__pyx_t_10) {
|
|
+ } else {
|
|
+ __pyx_t_1 = __pyx_t_10;
|
|
+ goto __pyx_L9_bool_binop_done;
|
|
+ }
|
|
+ __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
|
|
+ __pyx_t_1 = __pyx_t_10;
|
|
+ __pyx_L9_bool_binop_done:;
|
|
+ if (unlikely(__pyx_t_1)) {
|
|
|
|
-static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
- __Pyx_memviewslice *__pyx_v_mslice;
|
|
- __Pyx_memviewslice __pyx_v_tmp;
|
|
- PyObject *__pyx_r = NULL;
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_memviewslice *__pyx_t_1;
|
|
- PyObject *__pyx_t_2 = NULL;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("is_c_contig", 0);
|
|
+ /* "View.MemoryView":691
|
|
+ * else:
|
|
+ * if not isinstance(item, slice) and not PyIndex_Check(item):
|
|
+ * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * have_slices = have_slices or isinstance(item, slice)
|
|
+ */
|
|
+ __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 691, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_7);
|
|
+ __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 691, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_11);
|
|
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
+ __Pyx_Raise(__pyx_t_11, 0, 0, 0);
|
|
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
|
|
+ __PYX_ERR(2, 691, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":622
|
|
- * cdef __Pyx_memviewslice *mslice
|
|
- * cdef __Pyx_memviewslice tmp
|
|
- * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
|
|
- * return slice_is_contig(mslice[0], 'C', self.view.ndim)
|
|
+ /* "View.MemoryView":690
|
|
+ * have_slices = True
|
|
+ * else:
|
|
+ * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
|
|
+ * raise TypeError("Cannot index with type '%s'" % type(item))
|
|
*
|
|
*/
|
|
- __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 622, __pyx_L1_error)
|
|
- __pyx_v_mslice = __pyx_t_1;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":623
|
|
- * cdef __Pyx_memviewslice tmp
|
|
- * mslice = get_slice_from_memview(self, &tmp)
|
|
- * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":693
|
|
+ * raise TypeError("Cannot index with type '%s'" % type(item))
|
|
+ *
|
|
+ * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
|
|
+ * result.append(item)
|
|
*
|
|
- * def is_f_contig(self):
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 623, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_r = __pyx_t_2;
|
|
- __pyx_t_2 = 0;
|
|
- goto __pyx_L0;
|
|
+ __pyx_t_10 = (__pyx_v_have_slices != 0);
|
|
+ if (!__pyx_t_10) {
|
|
+ } else {
|
|
+ __pyx_t_1 = __pyx_t_10;
|
|
+ goto __pyx_L11_bool_binop_done;
|
|
+ }
|
|
+ __pyx_t_10 = PySlice_Check(__pyx_v_item);
|
|
+ __pyx_t_2 = (__pyx_t_10 != 0);
|
|
+ __pyx_t_1 = __pyx_t_2;
|
|
+ __pyx_L11_bool_binop_done:;
|
|
+ __pyx_v_have_slices = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":619
|
|
+ /* "View.MemoryView":694
|
|
*
|
|
+ * have_slices = have_slices or isinstance(item, slice)
|
|
+ * result.append(item) # <<<<<<<<<<<<<<
|
|
*
|
|
- * def is_c_contig(self): # <<<<<<<<<<<<<<
|
|
- * cdef __Pyx_memviewslice *mslice
|
|
- * cdef __Pyx_memviewslice tmp
|
|
+ * nslices = ndim - len(result)
|
|
*/
|
|
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 694, __pyx_L1_error)
|
|
+ }
|
|
+ __pyx_L6:;
|
|
|
|
- /* function exit code */
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_2);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = NULL;
|
|
- __pyx_L0:;
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
+ /* "View.MemoryView":681
|
|
+ * have_slices = False
|
|
+ * seen_ellipsis = False
|
|
+ * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
|
|
+ * if item is Ellipsis:
|
|
+ * if not seen_ellipsis:
|
|
+ */
|
|
+ }
|
|
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
-/* "View.MemoryView":625
|
|
- * return slice_is_contig(mslice[0], 'C', self.view.ndim)
|
|
+ /* "View.MemoryView":696
|
|
+ * result.append(item)
|
|
*
|
|
- * def is_f_contig(self): # <<<<<<<<<<<<<<
|
|
- * cdef __Pyx_memviewslice *mslice
|
|
- * cdef __Pyx_memviewslice tmp
|
|
+ * nslices = ndim - len(result) # <<<<<<<<<<<<<<
|
|
+ * if nslices:
|
|
+ * result.extend([slice(None)] * nslices)
|
|
*/
|
|
+ __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 696, __pyx_L1_error)
|
|
+ __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
|
|
|
|
-/* Python wrapper */
|
|
-static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
-static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
|
|
- PyObject *__pyx_r = 0;
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
|
|
- __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
-
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
+ /* "View.MemoryView":697
|
|
+ *
|
|
+ * nslices = ndim - len(result)
|
|
+ * if nslices: # <<<<<<<<<<<<<<
|
|
+ * result.extend([slice(None)] * nslices)
|
|
+ *
|
|
+ */
|
|
+ __pyx_t_1 = (__pyx_v_nslices != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
-static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
- __Pyx_memviewslice *__pyx_v_mslice;
|
|
- __Pyx_memviewslice __pyx_v_tmp;
|
|
- PyObject *__pyx_r = NULL;
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_memviewslice *__pyx_t_1;
|
|
- PyObject *__pyx_t_2 = NULL;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("is_f_contig", 0);
|
|
+ /* "View.MemoryView":698
|
|
+ * nslices = ndim - len(result)
|
|
+ * if nslices:
|
|
+ * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * return have_slices or nslices, tuple(result)
|
|
+ */
|
|
+ __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 698, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ { Py_ssize_t __pyx_temp;
|
|
+ for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
|
|
+ __Pyx_INCREF(__pyx_slice__18);
|
|
+ __Pyx_GIVEREF(__pyx_slice__18);
|
|
+ PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__18);
|
|
+ }
|
|
+ }
|
|
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 698, __pyx_L1_error)
|
|
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
- /* "View.MemoryView":628
|
|
- * cdef __Pyx_memviewslice *mslice
|
|
- * cdef __Pyx_memviewslice tmp
|
|
- * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
|
|
- * return slice_is_contig(mslice[0], 'F', self.view.ndim)
|
|
+ /* "View.MemoryView":697
|
|
+ *
|
|
+ * nslices = ndim - len(result)
|
|
+ * if nslices: # <<<<<<<<<<<<<<
|
|
+ * result.extend([slice(None)] * nslices)
|
|
*
|
|
*/
|
|
- __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 628, __pyx_L1_error)
|
|
- __pyx_v_mslice = __pyx_t_1;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":629
|
|
- * cdef __Pyx_memviewslice tmp
|
|
- * mslice = get_slice_from_memview(self, &tmp)
|
|
- * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":700
|
|
+ * result.extend([slice(None)] * nslices)
|
|
*
|
|
- * def copy(self):
|
|
+ * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 629, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_r = __pyx_t_2;
|
|
- __pyx_t_2 = 0;
|
|
+ if (!__pyx_v_have_slices) {
|
|
+ } else {
|
|
+ __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 700, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __pyx_t_3 = __pyx_t_4;
|
|
+ __pyx_t_4 = 0;
|
|
+ goto __pyx_L14_bool_binop_done;
|
|
+ }
|
|
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 700, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __pyx_t_3 = __pyx_t_4;
|
|
+ __pyx_t_4 = 0;
|
|
+ __pyx_L14_bool_binop_done:;
|
|
+ __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 700, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 700, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_11);
|
|
+ __Pyx_GIVEREF(__pyx_t_3);
|
|
+ PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
|
|
+ __Pyx_GIVEREF(__pyx_t_4);
|
|
+ PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
|
|
+ __pyx_t_3 = 0;
|
|
+ __pyx_t_4 = 0;
|
|
+ __pyx_r = ((PyObject*)__pyx_t_11);
|
|
+ __pyx_t_11 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":625
|
|
- * return slice_is_contig(mslice[0], 'C', self.view.ndim)
|
|
+ /* "View.MemoryView":668
|
|
+ * return isinstance(o, memoryview)
|
|
*
|
|
- * def is_f_contig(self): # <<<<<<<<<<<<<<
|
|
- * cdef __Pyx_memviewslice *mslice
|
|
- * cdef __Pyx_memviewslice tmp
|
|
+ * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
|
|
+ * """
|
|
+ * Replace all ellipses with full slices and fill incomplete indices with
|
|
*/
|
|
|
|
/* function exit code */
|
|
__pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_2);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = NULL;
|
|
+ __Pyx_XDECREF(__pyx_t_3);
|
|
+ __Pyx_XDECREF(__pyx_t_4);
|
|
+ __Pyx_XDECREF(__pyx_t_7);
|
|
+ __Pyx_XDECREF(__pyx_t_11);
|
|
+ __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = 0;
|
|
__pyx_L0:;
|
|
+ __Pyx_XDECREF(__pyx_v_tup);
|
|
+ __Pyx_XDECREF(__pyx_v_result);
|
|
+ __Pyx_XDECREF(__pyx_v_idx);
|
|
+ __Pyx_XDECREF(__pyx_v_item);
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":631
|
|
- * return slice_is_contig(mslice[0], 'F', self.view.ndim)
|
|
+/* "View.MemoryView":702
|
|
+ * return have_slices or nslices, tuple(result)
|
|
*
|
|
- * def copy(self): # <<<<<<<<<<<<<<
|
|
- * cdef __Pyx_memviewslice mslice
|
|
- * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
|
|
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
|
|
+ * for suboffset in suboffsets[:ndim]:
|
|
+ * if suboffset >= 0:
|
|
*/
|
|
|
|
-/* Python wrapper */
|
|
-static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
-static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
|
|
- PyObject *__pyx_r = 0;
|
|
+static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
|
|
+ Py_ssize_t __pyx_v_suboffset;
|
|
+ PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("copy (wrapper)", 0);
|
|
- __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
-
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
- __Pyx_memviewslice __pyx_v_mslice;
|
|
- int __pyx_v_flags;
|
|
- PyObject *__pyx_r = NULL;
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_memviewslice __pyx_t_1;
|
|
- PyObject *__pyx_t_2 = NULL;
|
|
+ Py_ssize_t *__pyx_t_1;
|
|
+ Py_ssize_t *__pyx_t_2;
|
|
+ Py_ssize_t *__pyx_t_3;
|
|
+ int __pyx_t_4;
|
|
+ PyObject *__pyx_t_5 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("copy", 0);
|
|
+ __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
|
|
|
|
- /* "View.MemoryView":633
|
|
- * def copy(self):
|
|
- * cdef __Pyx_memviewslice mslice
|
|
- * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":703
|
|
*
|
|
- * slice_copy(self, &mslice)
|
|
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
|
|
+ * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
|
|
+ * if suboffset >= 0:
|
|
+ * raise ValueError("Indirect dimensions not supported")
|
|
*/
|
|
- __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
|
|
+ __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
|
|
+ for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
|
|
+ __pyx_t_1 = __pyx_t_3;
|
|
+ __pyx_v_suboffset = (__pyx_t_1[0]);
|
|
|
|
- /* "View.MemoryView":635
|
|
- * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
|
|
+ /* "View.MemoryView":704
|
|
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
|
|
+ * for suboffset in suboffsets[:ndim]:
|
|
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
|
|
+ * raise ValueError("Indirect dimensions not supported")
|
|
*
|
|
- * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
|
|
- * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
|
|
- * self.view.itemsize,
|
|
*/
|
|
- __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
|
|
+ __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
|
|
+ if (unlikely(__pyx_t_4)) {
|
|
|
|
- /* "View.MemoryView":636
|
|
+ /* "View.MemoryView":705
|
|
+ * for suboffset in suboffsets[:ndim]:
|
|
+ * if suboffset >= 0:
|
|
+ * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
|
|
+ *
|
|
*
|
|
- * slice_copy(self, &mslice)
|
|
- * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
|
|
- * self.view.itemsize,
|
|
- * flags|PyBUF_C_CONTIGUOUS,
|
|
*/
|
|
- __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 636, __pyx_L1_error)
|
|
- __pyx_v_mslice = __pyx_t_1;
|
|
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 705, __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(2, 705, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":641
|
|
- * self.dtype_is_object)
|
|
- *
|
|
- * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":704
|
|
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
|
|
+ * for suboffset in suboffsets[:ndim]:
|
|
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
|
|
+ * raise ValueError("Indirect dimensions not supported")
|
|
*
|
|
- * def copy_fortran(self):
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 641, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_r = __pyx_t_2;
|
|
- __pyx_t_2 = 0;
|
|
- goto __pyx_L0;
|
|
+ }
|
|
+ }
|
|
|
|
- /* "View.MemoryView":631
|
|
- * return slice_is_contig(mslice[0], 'F', self.view.ndim)
|
|
+ /* "View.MemoryView":702
|
|
+ * return have_slices or nslices, tuple(result)
|
|
*
|
|
- * def copy(self): # <<<<<<<<<<<<<<
|
|
- * cdef __Pyx_memviewslice mslice
|
|
- * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
|
|
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
|
|
+ * for suboffset in suboffsets[:ndim]:
|
|
+ * if suboffset >= 0:
|
|
*/
|
|
|
|
/* function exit code */
|
|
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
+ goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_2);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = NULL;
|
|
+ __Pyx_XDECREF(__pyx_t_5);
|
|
+ __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":643
|
|
- * return memoryview_copy_from_slice(self, &mslice)
|
|
+/* "View.MemoryView":712
|
|
*
|
|
- * def copy_fortran(self): # <<<<<<<<<<<<<<
|
|
- * cdef __Pyx_memviewslice src, dst
|
|
- * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
|
|
+ * @cname('__pyx_memview_slice')
|
|
+ * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
|
|
+ * cdef int new_ndim = 0, suboffset_dim = -1, dim
|
|
+ * cdef bint negative_step
|
|
*/
|
|
|
|
-/* Python wrapper */
|
|
-static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
-static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
|
|
- PyObject *__pyx_r = 0;
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
|
|
- __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
-
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
+static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
|
|
+ int __pyx_v_new_ndim;
|
|
+ int __pyx_v_suboffset_dim;
|
|
+ int __pyx_v_dim;
|
|
__Pyx_memviewslice __pyx_v_src;
|
|
__Pyx_memviewslice __pyx_v_dst;
|
|
- int __pyx_v_flags;
|
|
- PyObject *__pyx_r = NULL;
|
|
+ __Pyx_memviewslice *__pyx_v_p_src;
|
|
+ struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
|
|
+ __Pyx_memviewslice *__pyx_v_p_dst;
|
|
+ int *__pyx_v_p_suboffset_dim;
|
|
+ Py_ssize_t __pyx_v_start;
|
|
+ Py_ssize_t __pyx_v_stop;
|
|
+ Py_ssize_t __pyx_v_step;
|
|
+ int __pyx_v_have_start;
|
|
+ int __pyx_v_have_stop;
|
|
+ int __pyx_v_have_step;
|
|
+ PyObject *__pyx_v_index = NULL;
|
|
+ struct __pyx_memoryview_obj *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
- __Pyx_memviewslice __pyx_t_1;
|
|
- PyObject *__pyx_t_2 = NULL;
|
|
+ int __pyx_t_1;
|
|
+ int __pyx_t_2;
|
|
+ PyObject *__pyx_t_3 = NULL;
|
|
+ struct __pyx_memoryview_obj *__pyx_t_4;
|
|
+ char *__pyx_t_5;
|
|
+ int __pyx_t_6;
|
|
+ Py_ssize_t __pyx_t_7;
|
|
+ PyObject *(*__pyx_t_8)(PyObject *);
|
|
+ PyObject *__pyx_t_9 = NULL;
|
|
+ Py_ssize_t __pyx_t_10;
|
|
+ int __pyx_t_11;
|
|
+ Py_ssize_t __pyx_t_12;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("copy_fortran", 0);
|
|
+ __Pyx_RefNannySetupContext("memview_slice", 0);
|
|
|
|
- /* "View.MemoryView":645
|
|
- * def copy_fortran(self):
|
|
- * cdef __Pyx_memviewslice src, dst
|
|
- * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
|
|
- *
|
|
- * slice_copy(self, &src)
|
|
+ /* "View.MemoryView":713
|
|
+ * @cname('__pyx_memview_slice')
|
|
+ * cdef memoryview memview_slice(memoryview memview, object indices):
|
|
+ * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
|
|
+ * cdef bint negative_step
|
|
+ * cdef __Pyx_memviewslice src, dst
|
|
*/
|
|
- __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
|
|
+ __pyx_v_new_ndim = 0;
|
|
+ __pyx_v_suboffset_dim = -1;
|
|
|
|
- /* "View.MemoryView":647
|
|
- * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
|
|
+ /* "View.MemoryView":720
|
|
*
|
|
- * slice_copy(self, &src) # <<<<<<<<<<<<<<
|
|
- * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
|
|
- * self.view.itemsize,
|
|
- */
|
|
- __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
|
|
-
|
|
- /* "View.MemoryView":648
|
|
*
|
|
- * slice_copy(self, &src)
|
|
- * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
|
|
- * self.view.itemsize,
|
|
- * flags|PyBUF_F_CONTIGUOUS,
|
|
+ * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * cdef _memoryviewslice memviewsliceobj
|
|
*/
|
|
- __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 648, __pyx_L1_error)
|
|
- __pyx_v_dst = __pyx_t_1;
|
|
+ (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
|
|
|
|
- /* "View.MemoryView":653
|
|
- * self.dtype_is_object)
|
|
- *
|
|
- * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":724
|
|
+ * cdef _memoryviewslice memviewsliceobj
|
|
*
|
|
+ * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
|
|
*
|
|
+ * if isinstance(memview, _memoryviewslice):
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 653, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_r = __pyx_t_2;
|
|
- __pyx_t_2 = 0;
|
|
- goto __pyx_L0;
|
|
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
|
|
+ if (unlikely(!Py_OptimizeFlag)) {
|
|
+ if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
|
|
+ PyErr_SetNone(PyExc_AssertionError);
|
|
+ __PYX_ERR(2, 724, __pyx_L1_error)
|
|
+ }
|
|
+ }
|
|
+ #endif
|
|
|
|
- /* "View.MemoryView":643
|
|
- * return memoryview_copy_from_slice(self, &mslice)
|
|
+ /* "View.MemoryView":726
|
|
+ * assert memview.view.ndim > 0
|
|
*
|
|
- * def copy_fortran(self): # <<<<<<<<<<<<<<
|
|
- * cdef __Pyx_memviewslice src, dst
|
|
- * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
|
|
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
|
|
+ * memviewsliceobj = memview
|
|
+ * p_src = &memviewsliceobj.from_slice
|
|
*/
|
|
+ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
|
|
+ __pyx_t_2 = (__pyx_t_1 != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* function exit code */
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_2);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = NULL;
|
|
- __pyx_L0:;
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
+ /* "View.MemoryView":727
|
|
+ *
|
|
+ * if isinstance(memview, _memoryviewslice):
|
|
+ * memviewsliceobj = memview # <<<<<<<<<<<<<<
|
|
+ * p_src = &memviewsliceobj.from_slice
|
|
+ * else:
|
|
+ */
|
|
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 727, __pyx_L1_error)
|
|
+ __pyx_t_3 = ((PyObject *)__pyx_v_memview);
|
|
+ __Pyx_INCREF(__pyx_t_3);
|
|
+ __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
|
|
+ __pyx_t_3 = 0;
|
|
|
|
-/* "(tree fragment)":1
|
|
- * def __reduce_cython__(self): # <<<<<<<<<<<<<<
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
- * def __setstate_cython__(self, __pyx_state):
|
|
+ /* "View.MemoryView":728
|
|
+ * if isinstance(memview, _memoryviewslice):
|
|
+ * memviewsliceobj = memview
|
|
+ * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * slice_copy(memview, &src)
|
|
*/
|
|
+ __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
|
|
|
|
-/* Python wrapper */
|
|
-static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
-static PyObject *__pyx_pw___pyx_memoryview_1__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___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
|
|
+ /* "View.MemoryView":726
|
|
+ * assert memview.view.ndim > 0
|
|
+ *
|
|
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
|
|
+ * memviewsliceobj = memview
|
|
+ * p_src = &memviewsliceobj.from_slice
|
|
+ */
|
|
+ goto __pyx_L3;
|
|
+ }
|
|
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
|
|
- PyObject *__pyx_r = NULL;
|
|
- __Pyx_RefNannyDeclarations
|
|
- PyObject *__pyx_t_1 = NULL;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__reduce_cython__", 0);
|
|
-
|
|
- /* "(tree fragment)":2
|
|
- * def __reduce_cython__(self):
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
|
|
- * def __setstate_cython__(self, __pyx_state):
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
+ /* "View.MemoryView":730
|
|
+ * p_src = &memviewsliceobj.from_slice
|
|
+ * else:
|
|
+ * slice_copy(memview, &src) # <<<<<<<<<<<<<<
|
|
+ * p_src = &src
|
|
+ *
|
|
*/
|
|
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __Pyx_Raise(__pyx_t_1, 0, 0, 0);
|
|
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
- __PYX_ERR(2, 2, __pyx_L1_error)
|
|
+ /*else*/ {
|
|
+ __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
|
|
|
|
- /* "(tree fragment)":1
|
|
- * def __reduce_cython__(self): # <<<<<<<<<<<<<<
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
- * def __setstate_cython__(self, __pyx_state):
|
|
+ /* "View.MemoryView":731
|
|
+ * else:
|
|
+ * slice_copy(memview, &src)
|
|
+ * p_src = &src # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ *
|
|
*/
|
|
+ __pyx_v_p_src = (&__pyx_v_src);
|
|
+ }
|
|
+ __pyx_L3:;
|
|
|
|
- /* function exit code */
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = NULL;
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-/* "(tree fragment)":3
|
|
- * def __reduce_cython__(self):
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
- * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
+ /* "View.MemoryView":737
|
|
+ *
|
|
+ *
|
|
+ * dst.memview = p_src.memview # <<<<<<<<<<<<<<
|
|
+ * dst.data = p_src.data
|
|
+ *
|
|
*/
|
|
+ __pyx_t_4 = __pyx_v_p_src->memview;
|
|
+ __pyx_v_dst.memview = __pyx_t_4;
|
|
|
|
-/* Python wrapper */
|
|
-static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
|
|
-static PyObject *__pyx_pw___pyx_memoryview_3__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___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
|
|
-
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-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) {
|
|
- PyObject *__pyx_r = NULL;
|
|
- __Pyx_RefNannyDeclarations
|
|
- PyObject *__pyx_t_1 = NULL;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__setstate_cython__", 0);
|
|
-
|
|
- /* "(tree fragment)":4
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
- * def __setstate_cython__(self, __pyx_state):
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":738
|
|
+ *
|
|
+ * dst.memview = p_src.memview
|
|
+ * dst.data = p_src.data # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ *
|
|
*/
|
|
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __Pyx_Raise(__pyx_t_1, 0, 0, 0);
|
|
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
- __PYX_ERR(2, 4, __pyx_L1_error)
|
|
+ __pyx_t_5 = __pyx_v_p_src->data;
|
|
+ __pyx_v_dst.data = __pyx_t_5;
|
|
|
|
- /* "(tree fragment)":3
|
|
- * def __reduce_cython__(self):
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
- * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
+ /* "View.MemoryView":743
|
|
+ *
|
|
+ *
|
|
+ * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
|
|
+ * cdef int *p_suboffset_dim = &suboffset_dim
|
|
+ * cdef Py_ssize_t start, stop, step
|
|
*/
|
|
+ __pyx_v_p_dst = (&__pyx_v_dst);
|
|
|
|
- /* function exit code */
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = NULL;
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
+ /* "View.MemoryView":744
|
|
+ *
|
|
+ * cdef __Pyx_memviewslice *p_dst = &dst
|
|
+ * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
|
|
+ * cdef Py_ssize_t start, stop, step
|
|
+ * cdef bint have_start, have_stop, have_step
|
|
+ */
|
|
+ __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
|
|
|
|
-/* "View.MemoryView":657
|
|
+ /* "View.MemoryView":748
|
|
+ * cdef bint have_start, have_stop, have_step
|
|
*
|
|
- * @cname('__pyx_memoryview_new')
|
|
- * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
|
|
- * cdef memoryview result = memoryview(o, flags, dtype_is_object)
|
|
- * result.typeinfo = typeinfo
|
|
+ * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
|
|
+ * if PyIndex_Check(index):
|
|
+ * slice_memviewslice(
|
|
*/
|
|
+ __pyx_t_6 = 0;
|
|
+ if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
|
|
+ __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
|
|
+ __pyx_t_8 = NULL;
|
|
+ } else {
|
|
+ __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 748, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 748, __pyx_L1_error)
|
|
+ }
|
|
+ for (;;) {
|
|
+ if (likely(!__pyx_t_8)) {
|
|
+ if (likely(PyList_CheckExact(__pyx_t_3))) {
|
|
+ if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
|
|
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
+ __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 748, __pyx_L1_error)
|
|
+ #else
|
|
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 748, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_9);
|
|
+ #endif
|
|
+ } else {
|
|
+ if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
|
|
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
+ __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 748, __pyx_L1_error)
|
|
+ #else
|
|
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 748, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_9);
|
|
+ #endif
|
|
+ }
|
|
+ } else {
|
|
+ __pyx_t_9 = __pyx_t_8(__pyx_t_3);
|
|
+ if (unlikely(!__pyx_t_9)) {
|
|
+ PyObject* exc_type = PyErr_Occurred();
|
|
+ if (exc_type) {
|
|
+ if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
|
|
+ else __PYX_ERR(2, 748, __pyx_L1_error)
|
|
+ }
|
|
+ break;
|
|
+ }
|
|
+ __Pyx_GOTREF(__pyx_t_9);
|
|
+ }
|
|
+ __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
|
|
+ __pyx_t_9 = 0;
|
|
+ __pyx_v_dim = __pyx_t_6;
|
|
+ __pyx_t_6 = (__pyx_t_6 + 1);
|
|
|
|
-static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
|
|
- struct __pyx_memoryview_obj *__pyx_v_result = 0;
|
|
- PyObject *__pyx_r = NULL;
|
|
- __Pyx_RefNannyDeclarations
|
|
- PyObject *__pyx_t_1 = NULL;
|
|
- PyObject *__pyx_t_2 = NULL;
|
|
- PyObject *__pyx_t_3 = NULL;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
|
|
+ /* "View.MemoryView":749
|
|
+ *
|
|
+ * for dim, index in enumerate(indices):
|
|
+ * if PyIndex_Check(index): # <<<<<<<<<<<<<<
|
|
+ * slice_memviewslice(
|
|
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
|
|
+ */
|
|
+ __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":658
|
|
- * @cname('__pyx_memoryview_new')
|
|
- * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
|
|
- * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
|
|
- * result.typeinfo = typeinfo
|
|
- * return result
|
|
+ /* "View.MemoryView":753
|
|
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
|
|
+ * dim, new_ndim, p_suboffset_dim,
|
|
+ * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
|
|
+ * 0, 0, 0, # have_{start,stop,step}
|
|
+ * False)
|
|
*/
|
|
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 658, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __Pyx_INCREF(__pyx_v_o);
|
|
- __Pyx_GIVEREF(__pyx_v_o);
|
|
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
|
|
- __Pyx_GIVEREF(__pyx_t_1);
|
|
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
|
|
- __Pyx_GIVEREF(__pyx_t_2);
|
|
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
|
|
- __pyx_t_1 = 0;
|
|
- __pyx_t_2 = 0;
|
|
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
|
|
- __pyx_t_2 = 0;
|
|
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 753, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":659
|
|
- * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
|
|
- * cdef memoryview result = memoryview(o, flags, dtype_is_object)
|
|
- * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
|
|
- * return result
|
|
- *
|
|
+ /* "View.MemoryView":750
|
|
+ * for dim, index in enumerate(indices):
|
|
+ * if PyIndex_Check(index):
|
|
+ * slice_memviewslice( # <<<<<<<<<<<<<<
|
|
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
|
|
+ * dim, new_ndim, p_suboffset_dim,
|
|
*/
|
|
- __pyx_v_result->typeinfo = __pyx_v_typeinfo;
|
|
+ __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 750, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":660
|
|
- * cdef memoryview result = memoryview(o, flags, dtype_is_object)
|
|
- * result.typeinfo = typeinfo
|
|
- * return result # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":749
|
|
*
|
|
- * @cname('__pyx_memoryview_check')
|
|
+ * for dim, index in enumerate(indices):
|
|
+ * if PyIndex_Check(index): # <<<<<<<<<<<<<<
|
|
+ * slice_memviewslice(
|
|
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
|
|
*/
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
|
|
- __pyx_r = ((PyObject *)__pyx_v_result);
|
|
- goto __pyx_L0;
|
|
+ goto __pyx_L6;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":657
|
|
- *
|
|
- * @cname('__pyx_memoryview_new')
|
|
- * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
|
|
- * cdef memoryview result = memoryview(o, flags, dtype_is_object)
|
|
- * result.typeinfo = typeinfo
|
|
+ /* "View.MemoryView":756
|
|
+ * 0, 0, 0, # have_{start,stop,step}
|
|
+ * False)
|
|
+ * elif index is None: # <<<<<<<<<<<<<<
|
|
+ * p_dst.shape[new_ndim] = 1
|
|
+ * p_dst.strides[new_ndim] = 0
|
|
*/
|
|
+ __pyx_t_2 = (__pyx_v_index == Py_None);
|
|
+ __pyx_t_1 = (__pyx_t_2 != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* function exit code */
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_XDECREF(__pyx_t_2);
|
|
- __Pyx_XDECREF(__pyx_t_3);
|
|
- __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = 0;
|
|
- __pyx_L0:;
|
|
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
+ /* "View.MemoryView":757
|
|
+ * False)
|
|
+ * elif index is None:
|
|
+ * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
|
|
+ * p_dst.strides[new_ndim] = 0
|
|
+ * p_dst.suboffsets[new_ndim] = -1
|
|
+ */
|
|
+ (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
|
|
|
|
-/* "View.MemoryView":663
|
|
- *
|
|
- * @cname('__pyx_memoryview_check')
|
|
- * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
|
|
- * return isinstance(o, memoryview)
|
|
- *
|
|
+ /* "View.MemoryView":758
|
|
+ * elif index is None:
|
|
+ * p_dst.shape[new_ndim] = 1
|
|
+ * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
|
|
+ * p_dst.suboffsets[new_ndim] = -1
|
|
+ * new_ndim += 1
|
|
*/
|
|
+ (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
|
|
|
|
-static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
|
|
- int __pyx_r;
|
|
- __Pyx_RefNannyDeclarations
|
|
- int __pyx_t_1;
|
|
- __Pyx_RefNannySetupContext("memoryview_check", 0);
|
|
+ /* "View.MemoryView":759
|
|
+ * p_dst.shape[new_ndim] = 1
|
|
+ * p_dst.strides[new_ndim] = 0
|
|
+ * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
|
|
+ * new_ndim += 1
|
|
+ * else:
|
|
+ */
|
|
+ (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
|
|
|
|
- /* "View.MemoryView":664
|
|
- * @cname('__pyx_memoryview_check')
|
|
- * cdef inline bint memoryview_check(object o):
|
|
- * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
|
|
- *
|
|
- * cdef tuple _unellipsify(object index, int ndim):
|
|
+ /* "View.MemoryView":760
|
|
+ * p_dst.strides[new_ndim] = 0
|
|
+ * p_dst.suboffsets[new_ndim] = -1
|
|
+ * new_ndim += 1 # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * start = index.start or 0
|
|
*/
|
|
- __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
|
|
- __pyx_r = __pyx_t_1;
|
|
- goto __pyx_L0;
|
|
+ __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
|
|
|
|
- /* "View.MemoryView":663
|
|
- *
|
|
- * @cname('__pyx_memoryview_check')
|
|
- * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
|
|
- * return isinstance(o, memoryview)
|
|
- *
|
|
+ /* "View.MemoryView":756
|
|
+ * 0, 0, 0, # have_{start,stop,step}
|
|
+ * False)
|
|
+ * elif index is None: # <<<<<<<<<<<<<<
|
|
+ * p_dst.shape[new_ndim] = 1
|
|
+ * p_dst.strides[new_ndim] = 0
|
|
*/
|
|
+ goto __pyx_L6;
|
|
+ }
|
|
|
|
- /* function exit code */
|
|
- __pyx_L0:;
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
+ /* "View.MemoryView":762
|
|
+ * new_ndim += 1
|
|
+ * else:
|
|
+ * start = index.start or 0 # <<<<<<<<<<<<<<
|
|
+ * stop = index.stop or 0
|
|
+ * step = index.step or 0
|
|
+ */
|
|
+ /*else*/ {
|
|
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 762, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_9);
|
|
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 762, __pyx_L1_error)
|
|
+ if (!__pyx_t_1) {
|
|
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
+ } else {
|
|
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 762, __pyx_L1_error)
|
|
+ __pyx_t_10 = __pyx_t_12;
|
|
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
+ goto __pyx_L7_bool_binop_done;
|
|
+ }
|
|
+ __pyx_t_10 = 0;
|
|
+ __pyx_L7_bool_binop_done:;
|
|
+ __pyx_v_start = __pyx_t_10;
|
|
|
|
-/* "View.MemoryView":666
|
|
- * return isinstance(o, memoryview)
|
|
+ /* "View.MemoryView":763
|
|
+ * else:
|
|
+ * start = index.start or 0
|
|
+ * stop = index.stop or 0 # <<<<<<<<<<<<<<
|
|
+ * step = index.step or 0
|
|
*
|
|
- * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
|
|
- * """
|
|
- * Replace all ellipses with full slices and fill incomplete indices with
|
|
*/
|
|
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 763, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_9);
|
|
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 763, __pyx_L1_error)
|
|
+ if (!__pyx_t_1) {
|
|
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
+ } else {
|
|
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 763, __pyx_L1_error)
|
|
+ __pyx_t_10 = __pyx_t_12;
|
|
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
+ goto __pyx_L9_bool_binop_done;
|
|
+ }
|
|
+ __pyx_t_10 = 0;
|
|
+ __pyx_L9_bool_binop_done:;
|
|
+ __pyx_v_stop = __pyx_t_10;
|
|
|
|
-static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
|
|
- PyObject *__pyx_v_tup = NULL;
|
|
- PyObject *__pyx_v_result = NULL;
|
|
- int __pyx_v_have_slices;
|
|
- int __pyx_v_seen_ellipsis;
|
|
- CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
|
|
- PyObject *__pyx_v_item = NULL;
|
|
- Py_ssize_t __pyx_v_nslices;
|
|
- PyObject *__pyx_r = NULL;
|
|
- __Pyx_RefNannyDeclarations
|
|
- int __pyx_t_1;
|
|
- int __pyx_t_2;
|
|
- PyObject *__pyx_t_3 = NULL;
|
|
- PyObject *__pyx_t_4 = NULL;
|
|
- Py_ssize_t __pyx_t_5;
|
|
- PyObject *(*__pyx_t_6)(PyObject *);
|
|
- PyObject *__pyx_t_7 = NULL;
|
|
- Py_ssize_t __pyx_t_8;
|
|
- int __pyx_t_9;
|
|
- int __pyx_t_10;
|
|
- PyObject *__pyx_t_11 = NULL;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("_unellipsify", 0);
|
|
-
|
|
- /* "View.MemoryView":671
|
|
- * full slices.
|
|
- * """
|
|
- * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
|
|
- * tup = (index,)
|
|
- * else:
|
|
+ /* "View.MemoryView":764
|
|
+ * start = index.start or 0
|
|
+ * stop = index.stop or 0
|
|
+ * step = index.step or 0 # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * have_start = index.start is not None
|
|
*/
|
|
- __pyx_t_1 = PyTuple_Check(__pyx_v_index);
|
|
- __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
|
|
- if (__pyx_t_2) {
|
|
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 764, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_9);
|
|
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 764, __pyx_L1_error)
|
|
+ if (!__pyx_t_1) {
|
|
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
+ } else {
|
|
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 764, __pyx_L1_error)
|
|
+ __pyx_t_10 = __pyx_t_12;
|
|
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
+ goto __pyx_L11_bool_binop_done;
|
|
+ }
|
|
+ __pyx_t_10 = 0;
|
|
+ __pyx_L11_bool_binop_done:;
|
|
+ __pyx_v_step = __pyx_t_10;
|
|
|
|
- /* "View.MemoryView":672
|
|
- * """
|
|
- * if not isinstance(index, tuple):
|
|
- * tup = (index,) # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * tup = index
|
|
+ /* "View.MemoryView":766
|
|
+ * step = index.step or 0
|
|
+ *
|
|
+ * have_start = index.start is not None # <<<<<<<<<<<<<<
|
|
+ * have_stop = index.stop is not None
|
|
+ * have_step = index.step is not None
|
|
*/
|
|
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 672, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __Pyx_INCREF(__pyx_v_index);
|
|
- __Pyx_GIVEREF(__pyx_v_index);
|
|
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
|
|
- __pyx_v_tup = __pyx_t_3;
|
|
- __pyx_t_3 = 0;
|
|
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 766, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_9);
|
|
+ __pyx_t_1 = (__pyx_t_9 != Py_None);
|
|
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
+ __pyx_v_have_start = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":671
|
|
- * full slices.
|
|
- * """
|
|
- * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
|
|
- * tup = (index,)
|
|
- * else:
|
|
+ /* "View.MemoryView":767
|
|
+ *
|
|
+ * have_start = index.start is not None
|
|
+ * have_stop = index.stop is not None # <<<<<<<<<<<<<<
|
|
+ * have_step = index.step is not None
|
|
+ *
|
|
*/
|
|
- goto __pyx_L3;
|
|
- }
|
|
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 767, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_9);
|
|
+ __pyx_t_1 = (__pyx_t_9 != Py_None);
|
|
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
+ __pyx_v_have_stop = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":674
|
|
- * tup = (index,)
|
|
- * else:
|
|
- * tup = index # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":768
|
|
+ * have_start = index.start is not None
|
|
+ * have_stop = index.stop is not None
|
|
+ * have_step = index.step is not None # <<<<<<<<<<<<<<
|
|
*
|
|
- * result = []
|
|
+ * slice_memviewslice(
|
|
*/
|
|
- /*else*/ {
|
|
- __Pyx_INCREF(__pyx_v_index);
|
|
- __pyx_v_tup = __pyx_v_index;
|
|
- }
|
|
- __pyx_L3:;
|
|
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 768, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_9);
|
|
+ __pyx_t_1 = (__pyx_t_9 != Py_None);
|
|
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
+ __pyx_v_have_step = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":676
|
|
- * tup = index
|
|
+ /* "View.MemoryView":770
|
|
+ * have_step = index.step is not None
|
|
*
|
|
- * result = [] # <<<<<<<<<<<<<<
|
|
- * have_slices = False
|
|
- * seen_ellipsis = False
|
|
+ * slice_memviewslice( # <<<<<<<<<<<<<<
|
|
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
|
|
+ * dim, new_ndim, p_suboffset_dim,
|
|
*/
|
|
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 676, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_v_result = ((PyObject*)__pyx_t_3);
|
|
- __pyx_t_3 = 0;
|
|
+ __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 770, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":677
|
|
+ /* "View.MemoryView":776
|
|
+ * have_start, have_stop, have_step,
|
|
+ * True)
|
|
+ * new_ndim += 1 # <<<<<<<<<<<<<<
|
|
*
|
|
- * result = []
|
|
- * have_slices = False # <<<<<<<<<<<<<<
|
|
- * seen_ellipsis = False
|
|
- * for idx, item in enumerate(tup):
|
|
+ * if isinstance(memview, _memoryviewslice):
|
|
*/
|
|
- __pyx_v_have_slices = 0;
|
|
+ __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
|
|
+ }
|
|
+ __pyx_L6:;
|
|
|
|
- /* "View.MemoryView":678
|
|
- * result = []
|
|
- * have_slices = False
|
|
- * seen_ellipsis = False # <<<<<<<<<<<<<<
|
|
- * for idx, item in enumerate(tup):
|
|
- * if item is Ellipsis:
|
|
+ /* "View.MemoryView":748
|
|
+ * cdef bint have_start, have_stop, have_step
|
|
+ *
|
|
+ * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
|
|
+ * if PyIndex_Check(index):
|
|
+ * slice_memviewslice(
|
|
*/
|
|
- __pyx_v_seen_ellipsis = 0;
|
|
-
|
|
- /* "View.MemoryView":679
|
|
- * have_slices = False
|
|
- * seen_ellipsis = False
|
|
- * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
|
|
- * if item is Ellipsis:
|
|
- * if not seen_ellipsis:
|
|
- */
|
|
- __Pyx_INCREF(__pyx_int_0);
|
|
- __pyx_t_3 = __pyx_int_0;
|
|
- if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
|
|
- __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
|
|
- __pyx_t_6 = NULL;
|
|
- } else {
|
|
- __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 679, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 679, __pyx_L1_error)
|
|
}
|
|
- for (;;) {
|
|
- if (likely(!__pyx_t_6)) {
|
|
- if (likely(PyList_CheckExact(__pyx_t_4))) {
|
|
- if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
|
|
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
- __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 679, __pyx_L1_error)
|
|
- #else
|
|
- __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_7);
|
|
- #endif
|
|
- } else {
|
|
- if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
|
|
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
- __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 679, __pyx_L1_error)
|
|
- #else
|
|
- __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_7);
|
|
- #endif
|
|
- }
|
|
- } else {
|
|
- __pyx_t_7 = __pyx_t_6(__pyx_t_4);
|
|
- if (unlikely(!__pyx_t_7)) {
|
|
- PyObject* exc_type = PyErr_Occurred();
|
|
- if (exc_type) {
|
|
- if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
|
|
- else __PYX_ERR(2, 679, __pyx_L1_error)
|
|
- }
|
|
- break;
|
|
- }
|
|
- __Pyx_GOTREF(__pyx_t_7);
|
|
- }
|
|
- __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
|
|
- __pyx_t_7 = 0;
|
|
- __Pyx_INCREF(__pyx_t_3);
|
|
- __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
|
|
- __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_7);
|
|
- __Pyx_DECREF(__pyx_t_3);
|
|
- __pyx_t_3 = __pyx_t_7;
|
|
- __pyx_t_7 = 0;
|
|
-
|
|
- /* "View.MemoryView":680
|
|
- * seen_ellipsis = False
|
|
- * for idx, item in enumerate(tup):
|
|
- * if item is Ellipsis: # <<<<<<<<<<<<<<
|
|
- * if not seen_ellipsis:
|
|
- * result.extend([slice(None)] * (ndim - len(tup) + 1))
|
|
- */
|
|
- __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
|
|
- __pyx_t_1 = (__pyx_t_2 != 0);
|
|
- if (__pyx_t_1) {
|
|
-
|
|
- /* "View.MemoryView":681
|
|
- * for idx, item in enumerate(tup):
|
|
- * if item is Ellipsis:
|
|
- * if not seen_ellipsis: # <<<<<<<<<<<<<<
|
|
- * result.extend([slice(None)] * (ndim - len(tup) + 1))
|
|
- * seen_ellipsis = True
|
|
- */
|
|
- __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
|
|
- if (__pyx_t_1) {
|
|
-
|
|
- /* "View.MemoryView":682
|
|
- * if item is Ellipsis:
|
|
- * if not seen_ellipsis:
|
|
- * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
|
|
- * seen_ellipsis = True
|
|
- * else:
|
|
- */
|
|
- __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 682, __pyx_L1_error)
|
|
- __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 682, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_7);
|
|
- { Py_ssize_t __pyx_temp;
|
|
- for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
|
|
- __Pyx_INCREF(__pyx_slice__23);
|
|
- __Pyx_GIVEREF(__pyx_slice__23);
|
|
- PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__23);
|
|
- }
|
|
- }
|
|
- __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 682, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
-
|
|
- /* "View.MemoryView":683
|
|
- * if not seen_ellipsis:
|
|
- * result.extend([slice(None)] * (ndim - len(tup) + 1))
|
|
- * seen_ellipsis = True # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * result.append(slice(None))
|
|
- */
|
|
- __pyx_v_seen_ellipsis = 1;
|
|
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
- /* "View.MemoryView":681
|
|
- * for idx, item in enumerate(tup):
|
|
- * if item is Ellipsis:
|
|
- * if not seen_ellipsis: # <<<<<<<<<<<<<<
|
|
- * result.extend([slice(None)] * (ndim - len(tup) + 1))
|
|
- * seen_ellipsis = True
|
|
+ /* "View.MemoryView":778
|
|
+ * new_ndim += 1
|
|
+ *
|
|
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
|
|
+ * return memoryview_fromslice(dst, new_ndim,
|
|
+ * memviewsliceobj.to_object_func,
|
|
*/
|
|
- goto __pyx_L7;
|
|
- }
|
|
+ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
|
|
+ __pyx_t_2 = (__pyx_t_1 != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":685
|
|
- * seen_ellipsis = True
|
|
- * else:
|
|
- * result.append(slice(None)) # <<<<<<<<<<<<<<
|
|
- * have_slices = True
|
|
- * else:
|
|
+ /* "View.MemoryView":779
|
|
+ *
|
|
+ * if isinstance(memview, _memoryviewslice):
|
|
+ * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
|
|
+ * memviewsliceobj.to_object_func,
|
|
+ * memviewsliceobj.to_dtype_func,
|
|
*/
|
|
- /*else*/ {
|
|
- __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__23); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 685, __pyx_L1_error)
|
|
- }
|
|
- __pyx_L7:;
|
|
+ __Pyx_XDECREF(((PyObject *)__pyx_r));
|
|
|
|
- /* "View.MemoryView":686
|
|
- * else:
|
|
- * result.append(slice(None))
|
|
- * have_slices = True # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * if not isinstance(item, slice) and not PyIndex_Check(item):
|
|
+ /* "View.MemoryView":780
|
|
+ * if isinstance(memview, _memoryviewslice):
|
|
+ * return memoryview_fromslice(dst, new_ndim,
|
|
+ * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
|
|
+ * memviewsliceobj.to_dtype_func,
|
|
+ * memview.dtype_is_object)
|
|
*/
|
|
- __pyx_v_have_slices = 1;
|
|
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 780, __pyx_L1_error) }
|
|
|
|
- /* "View.MemoryView":680
|
|
- * seen_ellipsis = False
|
|
- * for idx, item in enumerate(tup):
|
|
- * if item is Ellipsis: # <<<<<<<<<<<<<<
|
|
- * if not seen_ellipsis:
|
|
- * result.extend([slice(None)] * (ndim - len(tup) + 1))
|
|
+ /* "View.MemoryView":781
|
|
+ * return memoryview_fromslice(dst, new_ndim,
|
|
+ * memviewsliceobj.to_object_func,
|
|
+ * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
|
|
+ * memview.dtype_is_object)
|
|
+ * else:
|
|
*/
|
|
- goto __pyx_L6;
|
|
- }
|
|
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 781, __pyx_L1_error) }
|
|
|
|
- /* "View.MemoryView":688
|
|
- * have_slices = True
|
|
- * else:
|
|
- * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
|
|
- * raise TypeError("Cannot index with type '%s'" % type(item))
|
|
+ /* "View.MemoryView":779
|
|
*
|
|
+ * if isinstance(memview, _memoryviewslice):
|
|
+ * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
|
|
+ * memviewsliceobj.to_object_func,
|
|
+ * memviewsliceobj.to_dtype_func,
|
|
*/
|
|
- /*else*/ {
|
|
- __pyx_t_2 = PySlice_Check(__pyx_v_item);
|
|
- __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
|
|
- if (__pyx_t_10) {
|
|
- } else {
|
|
- __pyx_t_1 = __pyx_t_10;
|
|
- goto __pyx_L9_bool_binop_done;
|
|
- }
|
|
- __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
|
|
- __pyx_t_1 = __pyx_t_10;
|
|
- __pyx_L9_bool_binop_done:;
|
|
- if (unlikely(__pyx_t_1)) {
|
|
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 779, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 779, __pyx_L1_error)
|
|
+ __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
|
|
+ __pyx_t_3 = 0;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":689
|
|
- * else:
|
|
- * if not isinstance(item, slice) and not PyIndex_Check(item):
|
|
- * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":778
|
|
+ * new_ndim += 1
|
|
*
|
|
- * have_slices = have_slices or isinstance(item, slice)
|
|
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
|
|
+ * return memoryview_fromslice(dst, new_ndim,
|
|
+ * memviewsliceobj.to_object_func,
|
|
*/
|
|
- __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 689, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_7);
|
|
- __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 689, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_11);
|
|
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
- __Pyx_Raise(__pyx_t_11, 0, 0, 0);
|
|
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
|
|
- __PYX_ERR(2, 689, __pyx_L1_error)
|
|
+ }
|
|
|
|
- /* "View.MemoryView":688
|
|
- * have_slices = True
|
|
- * else:
|
|
- * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
|
|
- * raise TypeError("Cannot index with type '%s'" % type(item))
|
|
+ /* "View.MemoryView":784
|
|
+ * memview.dtype_is_object)
|
|
+ * else:
|
|
+ * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
|
|
+ * memview.dtype_is_object)
|
|
*
|
|
*/
|
|
- }
|
|
+ /*else*/ {
|
|
+ __Pyx_XDECREF(((PyObject *)__pyx_r));
|
|
|
|
- /* "View.MemoryView":691
|
|
- * raise TypeError("Cannot index with type '%s'" % type(item))
|
|
+ /* "View.MemoryView":785
|
|
+ * else:
|
|
+ * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
|
|
+ * memview.dtype_is_object) # <<<<<<<<<<<<<<
|
|
*
|
|
- * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
|
|
- * result.append(item)
|
|
*
|
|
*/
|
|
- __pyx_t_10 = (__pyx_v_have_slices != 0);
|
|
- if (!__pyx_t_10) {
|
|
- } else {
|
|
- __pyx_t_1 = __pyx_t_10;
|
|
- goto __pyx_L11_bool_binop_done;
|
|
- }
|
|
- __pyx_t_10 = PySlice_Check(__pyx_v_item);
|
|
- __pyx_t_2 = (__pyx_t_10 != 0);
|
|
- __pyx_t_1 = __pyx_t_2;
|
|
- __pyx_L11_bool_binop_done:;
|
|
- __pyx_v_have_slices = __pyx_t_1;
|
|
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 784, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
|
|
- /* "View.MemoryView":692
|
|
- *
|
|
- * have_slices = have_slices or isinstance(item, slice)
|
|
- * result.append(item) # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":784
|
|
+ * memview.dtype_is_object)
|
|
+ * else:
|
|
+ * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
|
|
+ * memview.dtype_is_object)
|
|
*
|
|
- * nslices = ndim - len(result)
|
|
- */
|
|
- __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 692, __pyx_L1_error)
|
|
- }
|
|
- __pyx_L6:;
|
|
-
|
|
- /* "View.MemoryView":679
|
|
- * have_slices = False
|
|
- * seen_ellipsis = False
|
|
- * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
|
|
- * if item is Ellipsis:
|
|
- * if not seen_ellipsis:
|
|
*/
|
|
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 784, __pyx_L1_error)
|
|
+ __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
|
|
+ __pyx_t_3 = 0;
|
|
+ goto __pyx_L0;
|
|
}
|
|
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
-
|
|
- /* "View.MemoryView":694
|
|
- * result.append(item)
|
|
- *
|
|
- * nslices = ndim - len(result) # <<<<<<<<<<<<<<
|
|
- * if nslices:
|
|
- * result.extend([slice(None)] * nslices)
|
|
- */
|
|
- __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 694, __pyx_L1_error)
|
|
- __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
|
|
|
|
- /* "View.MemoryView":695
|
|
- *
|
|
- * nslices = ndim - len(result)
|
|
- * if nslices: # <<<<<<<<<<<<<<
|
|
- * result.extend([slice(None)] * nslices)
|
|
+ /* "View.MemoryView":712
|
|
*
|
|
- */
|
|
- __pyx_t_1 = (__pyx_v_nslices != 0);
|
|
- if (__pyx_t_1) {
|
|
-
|
|
- /* "View.MemoryView":696
|
|
- * nslices = ndim - len(result)
|
|
- * if nslices:
|
|
- * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
|
|
- *
|
|
- * return have_slices or nslices, tuple(result)
|
|
- */
|
|
- __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 696, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- { Py_ssize_t __pyx_temp;
|
|
- for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
|
|
- __Pyx_INCREF(__pyx_slice__23);
|
|
- __Pyx_GIVEREF(__pyx_slice__23);
|
|
- PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__23);
|
|
- }
|
|
- }
|
|
- __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 696, __pyx_L1_error)
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
-
|
|
- /* "View.MemoryView":695
|
|
- *
|
|
- * nslices = ndim - len(result)
|
|
- * if nslices: # <<<<<<<<<<<<<<
|
|
- * result.extend([slice(None)] * nslices)
|
|
- *
|
|
- */
|
|
- }
|
|
-
|
|
- /* "View.MemoryView":698
|
|
- * result.extend([slice(None)] * nslices)
|
|
- *
|
|
- * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
|
|
- *
|
|
- * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
|
|
- */
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- if (!__pyx_v_have_slices) {
|
|
- } else {
|
|
- __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_3 = __pyx_t_4;
|
|
- __pyx_t_4 = 0;
|
|
- goto __pyx_L14_bool_binop_done;
|
|
- }
|
|
- __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_3 = __pyx_t_4;
|
|
- __pyx_t_4 = 0;
|
|
- __pyx_L14_bool_binop_done:;
|
|
- __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 698, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_11);
|
|
- __Pyx_GIVEREF(__pyx_t_3);
|
|
- PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
|
|
- __Pyx_GIVEREF(__pyx_t_4);
|
|
- PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
|
|
- __pyx_t_3 = 0;
|
|
- __pyx_t_4 = 0;
|
|
- __pyx_r = ((PyObject*)__pyx_t_11);
|
|
- __pyx_t_11 = 0;
|
|
- goto __pyx_L0;
|
|
-
|
|
- /* "View.MemoryView":666
|
|
- * return isinstance(o, memoryview)
|
|
- *
|
|
- * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
|
|
- * """
|
|
- * Replace all ellipses with full slices and fill incomplete indices with
|
|
+ * @cname('__pyx_memview_slice')
|
|
+ * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
|
|
+ * cdef int new_ndim = 0, suboffset_dim = -1, dim
|
|
+ * cdef bint negative_step
|
|
*/
|
|
|
|
/* function exit code */
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_3);
|
|
- __Pyx_XDECREF(__pyx_t_4);
|
|
- __Pyx_XDECREF(__pyx_t_7);
|
|
- __Pyx_XDECREF(__pyx_t_11);
|
|
- __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __Pyx_XDECREF(__pyx_t_9);
|
|
+ __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
- __Pyx_XDECREF(__pyx_v_tup);
|
|
- __Pyx_XDECREF(__pyx_v_result);
|
|
- __Pyx_XDECREF(__pyx_v_idx);
|
|
- __Pyx_XDECREF(__pyx_v_item);
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
+ __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
|
|
+ __Pyx_XDECREF(__pyx_v_index);
|
|
+ __Pyx_XGIVEREF((PyObject *)__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":700
|
|
- * return have_slices or nslices, tuple(result)
|
|
+/* "View.MemoryView":809
|
|
*
|
|
- * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
|
|
- * for suboffset in suboffsets[:ndim]:
|
|
- * if suboffset >= 0:
|
|
+ * @cname('__pyx_memoryview_slice_memviewslice')
|
|
+ * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
|
|
+ * __Pyx_memviewslice *dst,
|
|
+ * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
|
|
*/
|
|
|
|
-static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
|
|
- Py_ssize_t __pyx_v_suboffset;
|
|
- PyObject *__pyx_r = NULL;
|
|
- __Pyx_RefNannyDeclarations
|
|
- Py_ssize_t *__pyx_t_1;
|
|
- Py_ssize_t *__pyx_t_2;
|
|
- Py_ssize_t *__pyx_t_3;
|
|
- int __pyx_t_4;
|
|
- PyObject *__pyx_t_5 = NULL;
|
|
+static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
|
|
+ Py_ssize_t __pyx_v_new_shape;
|
|
+ int __pyx_v_negative_step;
|
|
+ int __pyx_r;
|
|
+ int __pyx_t_1;
|
|
+ int __pyx_t_2;
|
|
+ int __pyx_t_3;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
|
|
|
|
- /* "View.MemoryView":701
|
|
+ /* "View.MemoryView":829
|
|
+ * cdef bint negative_step
|
|
*
|
|
- * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
|
|
- * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
|
|
- * if suboffset >= 0:
|
|
- * raise ValueError("Indirect dimensions not supported")
|
|
+ * if not is_slice: # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * if start < 0:
|
|
*/
|
|
- __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
|
|
- for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
|
|
- __pyx_t_1 = __pyx_t_3;
|
|
- __pyx_v_suboffset = (__pyx_t_1[0]);
|
|
+ __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":702
|
|
- * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
|
|
- * for suboffset in suboffsets[:ndim]:
|
|
- * if suboffset >= 0: # <<<<<<<<<<<<<<
|
|
- * raise ValueError("Indirect dimensions not supported")
|
|
+ /* "View.MemoryView":831
|
|
+ * if not is_slice:
|
|
*
|
|
+ * if start < 0: # <<<<<<<<<<<<<<
|
|
+ * start += shape
|
|
+ * if not 0 <= start < shape:
|
|
*/
|
|
- __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
|
|
- if (unlikely(__pyx_t_4)) {
|
|
+ __pyx_t_1 = ((__pyx_v_start < 0) != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":703
|
|
- * for suboffset in suboffsets[:ndim]:
|
|
- * if suboffset >= 0:
|
|
- * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
|
|
- *
|
|
+ /* "View.MemoryView":832
|
|
*
|
|
+ * if start < 0:
|
|
+ * start += shape # <<<<<<<<<<<<<<
|
|
+ * if not 0 <= start < shape:
|
|
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
|
|
*/
|
|
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 703, __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(2, 703, __pyx_L1_error)
|
|
+ __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
|
|
|
|
- /* "View.MemoryView":702
|
|
- * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
|
|
- * for suboffset in suboffsets[:ndim]:
|
|
- * if suboffset >= 0: # <<<<<<<<<<<<<<
|
|
- * raise ValueError("Indirect dimensions not supported")
|
|
+ /* "View.MemoryView":831
|
|
+ * if not is_slice:
|
|
*
|
|
+ * if start < 0: # <<<<<<<<<<<<<<
|
|
+ * start += shape
|
|
+ * if not 0 <= start < shape:
|
|
*/
|
|
}
|
|
- }
|
|
|
|
- /* "View.MemoryView":700
|
|
- * return have_slices or nslices, tuple(result)
|
|
- *
|
|
- * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
|
|
- * for suboffset in suboffsets[:ndim]:
|
|
- * if suboffset >= 0:
|
|
+ /* "View.MemoryView":833
|
|
+ * if start < 0:
|
|
+ * start += shape
|
|
+ * if not 0 <= start < shape: # <<<<<<<<<<<<<<
|
|
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
|
|
+ * else:
|
|
*/
|
|
+ __pyx_t_1 = (0 <= __pyx_v_start);
|
|
+ if (__pyx_t_1) {
|
|
+ __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
|
|
+ }
|
|
+ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* function exit code */
|
|
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
- goto __pyx_L0;
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_5);
|
|
- __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = 0;
|
|
- __pyx_L0:;
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-/* "View.MemoryView":710
|
|
+ /* "View.MemoryView":834
|
|
+ * start += shape
|
|
+ * if not 0 <= start < shape:
|
|
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
*
|
|
- * @cname('__pyx_memview_slice')
|
|
- * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
|
|
- * cdef int new_ndim = 0, suboffset_dim = -1, dim
|
|
- * cdef bint negative_step
|
|
*/
|
|
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 834, __pyx_L1_error)
|
|
|
|
-static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
|
|
- int __pyx_v_new_ndim;
|
|
- int __pyx_v_suboffset_dim;
|
|
- int __pyx_v_dim;
|
|
- __Pyx_memviewslice __pyx_v_src;
|
|
- __Pyx_memviewslice __pyx_v_dst;
|
|
- __Pyx_memviewslice *__pyx_v_p_src;
|
|
- struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
|
|
- __Pyx_memviewslice *__pyx_v_p_dst;
|
|
- int *__pyx_v_p_suboffset_dim;
|
|
- Py_ssize_t __pyx_v_start;
|
|
- Py_ssize_t __pyx_v_stop;
|
|
- Py_ssize_t __pyx_v_step;
|
|
- int __pyx_v_have_start;
|
|
- int __pyx_v_have_stop;
|
|
- int __pyx_v_have_step;
|
|
- PyObject *__pyx_v_index = NULL;
|
|
- struct __pyx_memoryview_obj *__pyx_r = NULL;
|
|
- __Pyx_RefNannyDeclarations
|
|
- int __pyx_t_1;
|
|
- int __pyx_t_2;
|
|
- PyObject *__pyx_t_3 = NULL;
|
|
- struct __pyx_memoryview_obj *__pyx_t_4;
|
|
- char *__pyx_t_5;
|
|
- int __pyx_t_6;
|
|
- Py_ssize_t __pyx_t_7;
|
|
- PyObject *(*__pyx_t_8)(PyObject *);
|
|
- PyObject *__pyx_t_9 = NULL;
|
|
- Py_ssize_t __pyx_t_10;
|
|
- int __pyx_t_11;
|
|
- Py_ssize_t __pyx_t_12;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("memview_slice", 0);
|
|
-
|
|
- /* "View.MemoryView":711
|
|
- * @cname('__pyx_memview_slice')
|
|
- * cdef memoryview memview_slice(memoryview memview, object indices):
|
|
- * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
|
|
- * cdef bint negative_step
|
|
- * cdef __Pyx_memviewslice src, dst
|
|
+ /* "View.MemoryView":833
|
|
+ * if start < 0:
|
|
+ * start += shape
|
|
+ * if not 0 <= start < shape: # <<<<<<<<<<<<<<
|
|
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
|
|
+ * else:
|
|
*/
|
|
- __pyx_v_new_ndim = 0;
|
|
- __pyx_v_suboffset_dim = -1;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":718
|
|
- *
|
|
+ /* "View.MemoryView":829
|
|
+ * cdef bint negative_step
|
|
*
|
|
- * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
|
|
+ * if not is_slice: # <<<<<<<<<<<<<<
|
|
*
|
|
- * cdef _memoryviewslice memviewsliceobj
|
|
+ * if start < 0:
|
|
*/
|
|
- (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
|
|
+ goto __pyx_L3;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":722
|
|
- * cdef _memoryviewslice memviewsliceobj
|
|
+ /* "View.MemoryView":837
|
|
+ * else:
|
|
*
|
|
- * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
|
|
- *
|
|
- * if isinstance(memview, _memoryviewslice):
|
|
- */
|
|
- #ifndef CYTHON_WITHOUT_ASSERTIONS
|
|
- if (unlikely(!Py_OptimizeFlag)) {
|
|
- if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
|
|
- PyErr_SetNone(PyExc_AssertionError);
|
|
- __PYX_ERR(2, 722, __pyx_L1_error)
|
|
- }
|
|
- }
|
|
- #endif
|
|
-
|
|
- /* "View.MemoryView":724
|
|
- * assert memview.view.ndim > 0
|
|
- *
|
|
- * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
|
|
- * memviewsliceobj = memview
|
|
- * p_src = &memviewsliceobj.from_slice
|
|
- */
|
|
- __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
|
|
- __pyx_t_2 = (__pyx_t_1 != 0);
|
|
- if (__pyx_t_2) {
|
|
-
|
|
- /* "View.MemoryView":725
|
|
- *
|
|
- * if isinstance(memview, _memoryviewslice):
|
|
- * memviewsliceobj = memview # <<<<<<<<<<<<<<
|
|
- * p_src = &memviewsliceobj.from_slice
|
|
- * else:
|
|
- */
|
|
- if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 725, __pyx_L1_error)
|
|
- __pyx_t_3 = ((PyObject *)__pyx_v_memview);
|
|
- __Pyx_INCREF(__pyx_t_3);
|
|
- __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
|
|
- __pyx_t_3 = 0;
|
|
-
|
|
- /* "View.MemoryView":726
|
|
- * if isinstance(memview, _memoryviewslice):
|
|
- * memviewsliceobj = memview
|
|
- * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * slice_copy(memview, &src)
|
|
- */
|
|
- __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
|
|
-
|
|
- /* "View.MemoryView":724
|
|
- * assert memview.view.ndim > 0
|
|
- *
|
|
- * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
|
|
- * memviewsliceobj = memview
|
|
- * p_src = &memviewsliceobj.from_slice
|
|
- */
|
|
- goto __pyx_L3;
|
|
- }
|
|
-
|
|
- /* "View.MemoryView":728
|
|
- * p_src = &memviewsliceobj.from_slice
|
|
- * else:
|
|
- * slice_copy(memview, &src) # <<<<<<<<<<<<<<
|
|
- * p_src = &src
|
|
+ * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
|
|
*
|
|
+ * if have_step and step == 0:
|
|
*/
|
|
/*else*/ {
|
|
- __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
|
|
+ __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
|
|
+ if (__pyx_t_1) {
|
|
+ } else {
|
|
+ __pyx_t_2 = __pyx_t_1;
|
|
+ goto __pyx_L6_bool_binop_done;
|
|
+ }
|
|
+ __pyx_t_1 = ((__pyx_v_step < 0) != 0);
|
|
+ __pyx_t_2 = __pyx_t_1;
|
|
+ __pyx_L6_bool_binop_done:;
|
|
+ __pyx_v_negative_step = __pyx_t_2;
|
|
|
|
- /* "View.MemoryView":729
|
|
- * else:
|
|
- * slice_copy(memview, &src)
|
|
- * p_src = &src # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":839
|
|
+ * negative_step = have_step != 0 and step < 0
|
|
*
|
|
+ * if have_step and step == 0: # <<<<<<<<<<<<<<
|
|
+ * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
|
|
*
|
|
*/
|
|
- __pyx_v_p_src = (&__pyx_v_src);
|
|
- }
|
|
- __pyx_L3:;
|
|
+ __pyx_t_1 = (__pyx_v_have_step != 0);
|
|
+ if (__pyx_t_1) {
|
|
+ } else {
|
|
+ __pyx_t_2 = __pyx_t_1;
|
|
+ goto __pyx_L9_bool_binop_done;
|
|
+ }
|
|
+ __pyx_t_1 = ((__pyx_v_step == 0) != 0);
|
|
+ __pyx_t_2 = __pyx_t_1;
|
|
+ __pyx_L9_bool_binop_done:;
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":735
|
|
+ /* "View.MemoryView":840
|
|
*
|
|
+ * if have_step and step == 0:
|
|
+ * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
|
|
*
|
|
- * dst.memview = p_src.memview # <<<<<<<<<<<<<<
|
|
- * dst.data = p_src.data
|
|
*
|
|
*/
|
|
- __pyx_t_4 = __pyx_v_p_src->memview;
|
|
- __pyx_v_dst.memview = __pyx_t_4;
|
|
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 840, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":736
|
|
- *
|
|
- * dst.memview = p_src.memview
|
|
- * dst.data = p_src.data # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":839
|
|
+ * negative_step = have_step != 0 and step < 0
|
|
*
|
|
+ * if have_step and step == 0: # <<<<<<<<<<<<<<
|
|
+ * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
|
|
*
|
|
*/
|
|
- __pyx_t_5 = __pyx_v_p_src->data;
|
|
- __pyx_v_dst.data = __pyx_t_5;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":741
|
|
+ /* "View.MemoryView":843
|
|
*
|
|
*
|
|
- * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
|
|
- * cdef int *p_suboffset_dim = &suboffset_dim
|
|
- * cdef Py_ssize_t start, stop, step
|
|
+ * if have_start: # <<<<<<<<<<<<<<
|
|
+ * if start < 0:
|
|
+ * start += shape
|
|
*/
|
|
- __pyx_v_p_dst = (&__pyx_v_dst);
|
|
+ __pyx_t_2 = (__pyx_v_have_start != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":742
|
|
+ /* "View.MemoryView":844
|
|
*
|
|
- * cdef __Pyx_memviewslice *p_dst = &dst
|
|
- * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
|
|
- * cdef Py_ssize_t start, stop, step
|
|
- * cdef bint have_start, have_stop, have_step
|
|
+ * if have_start:
|
|
+ * if start < 0: # <<<<<<<<<<<<<<
|
|
+ * start += shape
|
|
+ * if start < 0:
|
|
*/
|
|
- __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
|
|
+ __pyx_t_2 = ((__pyx_v_start < 0) != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":746
|
|
- * cdef bint have_start, have_stop, have_step
|
|
- *
|
|
- * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
|
|
- * if PyIndex_Check(index):
|
|
- * slice_memviewslice(
|
|
+ /* "View.MemoryView":845
|
|
+ * if have_start:
|
|
+ * if start < 0:
|
|
+ * start += shape # <<<<<<<<<<<<<<
|
|
+ * if start < 0:
|
|
+ * start = 0
|
|
*/
|
|
- __pyx_t_6 = 0;
|
|
- if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
|
|
- __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
|
|
- __pyx_t_8 = NULL;
|
|
- } else {
|
|
- __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 746, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 746, __pyx_L1_error)
|
|
- }
|
|
- for (;;) {
|
|
- if (likely(!__pyx_t_8)) {
|
|
- if (likely(PyList_CheckExact(__pyx_t_3))) {
|
|
- if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
|
|
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
- __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 746, __pyx_L1_error)
|
|
- #else
|
|
- __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_9);
|
|
- #endif
|
|
- } else {
|
|
- if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
|
|
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
|
- __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 746, __pyx_L1_error)
|
|
- #else
|
|
- __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_9);
|
|
- #endif
|
|
- }
|
|
- } else {
|
|
- __pyx_t_9 = __pyx_t_8(__pyx_t_3);
|
|
- if (unlikely(!__pyx_t_9)) {
|
|
- PyObject* exc_type = PyErr_Occurred();
|
|
- if (exc_type) {
|
|
- if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
|
|
- else __PYX_ERR(2, 746, __pyx_L1_error)
|
|
- }
|
|
- break;
|
|
- }
|
|
- __Pyx_GOTREF(__pyx_t_9);
|
|
- }
|
|
- __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
|
|
- __pyx_t_9 = 0;
|
|
- __pyx_v_dim = __pyx_t_6;
|
|
- __pyx_t_6 = (__pyx_t_6 + 1);
|
|
+ __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
|
|
|
|
- /* "View.MemoryView":747
|
|
- *
|
|
- * for dim, index in enumerate(indices):
|
|
- * if PyIndex_Check(index): # <<<<<<<<<<<<<<
|
|
- * slice_memviewslice(
|
|
- * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
|
|
+ /* "View.MemoryView":846
|
|
+ * if start < 0:
|
|
+ * start += shape
|
|
+ * if start < 0: # <<<<<<<<<<<<<<
|
|
+ * start = 0
|
|
+ * elif start >= shape:
|
|
*/
|
|
- __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
|
|
- if (__pyx_t_2) {
|
|
+ __pyx_t_2 = ((__pyx_v_start < 0) != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":751
|
|
- * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
|
|
- * dim, new_ndim, p_suboffset_dim,
|
|
- * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
|
|
- * 0, 0, 0, # have_{start,stop,step}
|
|
- * False)
|
|
+ /* "View.MemoryView":847
|
|
+ * start += shape
|
|
+ * if start < 0:
|
|
+ * start = 0 # <<<<<<<<<<<<<<
|
|
+ * elif start >= shape:
|
|
+ * if negative_step:
|
|
*/
|
|
- __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 751, __pyx_L1_error)
|
|
+ __pyx_v_start = 0;
|
|
|
|
- /* "View.MemoryView":748
|
|
- * for dim, index in enumerate(indices):
|
|
- * if PyIndex_Check(index):
|
|
- * slice_memviewslice( # <<<<<<<<<<<<<<
|
|
- * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
|
|
- * dim, new_ndim, p_suboffset_dim,
|
|
+ /* "View.MemoryView":846
|
|
+ * if start < 0:
|
|
+ * start += shape
|
|
+ * if start < 0: # <<<<<<<<<<<<<<
|
|
+ * start = 0
|
|
+ * elif start >= shape:
|
|
*/
|
|
- __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 748, __pyx_L1_error)
|
|
+ }
|
|
|
|
- /* "View.MemoryView":747
|
|
+ /* "View.MemoryView":844
|
|
*
|
|
- * for dim, index in enumerate(indices):
|
|
- * if PyIndex_Check(index): # <<<<<<<<<<<<<<
|
|
- * slice_memviewslice(
|
|
- * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
|
|
+ * if have_start:
|
|
+ * if start < 0: # <<<<<<<<<<<<<<
|
|
+ * start += shape
|
|
+ * if start < 0:
|
|
*/
|
|
- goto __pyx_L6;
|
|
- }
|
|
+ goto __pyx_L12;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":754
|
|
- * 0, 0, 0, # have_{start,stop,step}
|
|
- * False)
|
|
- * elif index is None: # <<<<<<<<<<<<<<
|
|
- * p_dst.shape[new_ndim] = 1
|
|
- * p_dst.strides[new_ndim] = 0
|
|
+ /* "View.MemoryView":848
|
|
+ * if start < 0:
|
|
+ * start = 0
|
|
+ * elif start >= shape: # <<<<<<<<<<<<<<
|
|
+ * if negative_step:
|
|
+ * start = shape - 1
|
|
*/
|
|
- __pyx_t_2 = (__pyx_v_index == Py_None);
|
|
- __pyx_t_1 = (__pyx_t_2 != 0);
|
|
- if (__pyx_t_1) {
|
|
+ __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":755
|
|
- * False)
|
|
- * elif index is None:
|
|
- * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
|
|
- * p_dst.strides[new_ndim] = 0
|
|
- * p_dst.suboffsets[new_ndim] = -1
|
|
+ /* "View.MemoryView":849
|
|
+ * start = 0
|
|
+ * elif start >= shape:
|
|
+ * if negative_step: # <<<<<<<<<<<<<<
|
|
+ * start = shape - 1
|
|
+ * else:
|
|
*/
|
|
- (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
|
|
+ __pyx_t_2 = (__pyx_v_negative_step != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":756
|
|
- * elif index is None:
|
|
- * p_dst.shape[new_ndim] = 1
|
|
- * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
|
|
- * p_dst.suboffsets[new_ndim] = -1
|
|
- * new_ndim += 1
|
|
+ /* "View.MemoryView":850
|
|
+ * elif start >= shape:
|
|
+ * if negative_step:
|
|
+ * start = shape - 1 # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * start = shape
|
|
*/
|
|
- (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
|
|
+ __pyx_v_start = (__pyx_v_shape - 1);
|
|
|
|
- /* "View.MemoryView":757
|
|
- * p_dst.shape[new_ndim] = 1
|
|
- * p_dst.strides[new_ndim] = 0
|
|
- * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
|
|
- * new_ndim += 1
|
|
- * else:
|
|
+ /* "View.MemoryView":849
|
|
+ * start = 0
|
|
+ * elif start >= shape:
|
|
+ * if negative_step: # <<<<<<<<<<<<<<
|
|
+ * start = shape - 1
|
|
+ * else:
|
|
*/
|
|
- (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
|
|
+ goto __pyx_L14;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":758
|
|
- * p_dst.strides[new_ndim] = 0
|
|
- * p_dst.suboffsets[new_ndim] = -1
|
|
- * new_ndim += 1 # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":852
|
|
+ * start = shape - 1
|
|
+ * else:
|
|
+ * start = shape # <<<<<<<<<<<<<<
|
|
* else:
|
|
- * start = index.start or 0
|
|
+ * if negative_step:
|
|
*/
|
|
- __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
|
|
+ /*else*/ {
|
|
+ __pyx_v_start = __pyx_v_shape;
|
|
+ }
|
|
+ __pyx_L14:;
|
|
|
|
- /* "View.MemoryView":754
|
|
- * 0, 0, 0, # have_{start,stop,step}
|
|
- * False)
|
|
- * elif index is None: # <<<<<<<<<<<<<<
|
|
- * p_dst.shape[new_ndim] = 1
|
|
- * p_dst.strides[new_ndim] = 0
|
|
+ /* "View.MemoryView":848
|
|
+ * if start < 0:
|
|
+ * start = 0
|
|
+ * elif start >= shape: # <<<<<<<<<<<<<<
|
|
+ * if negative_step:
|
|
+ * start = shape - 1
|
|
*/
|
|
- goto __pyx_L6;
|
|
+ }
|
|
+ __pyx_L12:;
|
|
+
|
|
+ /* "View.MemoryView":843
|
|
+ *
|
|
+ *
|
|
+ * if have_start: # <<<<<<<<<<<<<<
|
|
+ * if start < 0:
|
|
+ * start += shape
|
|
+ */
|
|
+ goto __pyx_L11;
|
|
}
|
|
|
|
- /* "View.MemoryView":760
|
|
- * new_ndim += 1
|
|
+ /* "View.MemoryView":854
|
|
+ * start = shape
|
|
* else:
|
|
- * start = index.start or 0 # <<<<<<<<<<<<<<
|
|
- * stop = index.stop or 0
|
|
- * step = index.step or 0
|
|
+ * if negative_step: # <<<<<<<<<<<<<<
|
|
+ * start = shape - 1
|
|
+ * else:
|
|
*/
|
|
/*else*/ {
|
|
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 760, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_9);
|
|
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 760, __pyx_L1_error)
|
|
- if (!__pyx_t_1) {
|
|
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
- } else {
|
|
- __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 760, __pyx_L1_error)
|
|
- __pyx_t_10 = __pyx_t_12;
|
|
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
- goto __pyx_L7_bool_binop_done;
|
|
- }
|
|
- __pyx_t_10 = 0;
|
|
- __pyx_L7_bool_binop_done:;
|
|
- __pyx_v_start = __pyx_t_10;
|
|
+ __pyx_t_2 = (__pyx_v_negative_step != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":761
|
|
+ /* "View.MemoryView":855
|
|
* else:
|
|
- * start = index.start or 0
|
|
- * stop = index.stop or 0 # <<<<<<<<<<<<<<
|
|
- * step = index.step or 0
|
|
- *
|
|
+ * if negative_step:
|
|
+ * start = shape - 1 # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * start = 0
|
|
*/
|
|
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 761, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_9);
|
|
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 761, __pyx_L1_error)
|
|
- if (!__pyx_t_1) {
|
|
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
- } else {
|
|
- __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 761, __pyx_L1_error)
|
|
- __pyx_t_10 = __pyx_t_12;
|
|
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
- goto __pyx_L9_bool_binop_done;
|
|
- }
|
|
- __pyx_t_10 = 0;
|
|
- __pyx_L9_bool_binop_done:;
|
|
- __pyx_v_stop = __pyx_t_10;
|
|
+ __pyx_v_start = (__pyx_v_shape - 1);
|
|
|
|
- /* "View.MemoryView":762
|
|
- * start = index.start or 0
|
|
- * stop = index.stop or 0
|
|
- * step = index.step or 0 # <<<<<<<<<<<<<<
|
|
- *
|
|
- * have_start = index.start is not None
|
|
+ /* "View.MemoryView":854
|
|
+ * start = shape
|
|
+ * else:
|
|
+ * if negative_step: # <<<<<<<<<<<<<<
|
|
+ * start = shape - 1
|
|
+ * else:
|
|
*/
|
|
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 762, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_9);
|
|
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 762, __pyx_L1_error)
|
|
- if (!__pyx_t_1) {
|
|
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
- } else {
|
|
- __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 762, __pyx_L1_error)
|
|
- __pyx_t_10 = __pyx_t_12;
|
|
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
- goto __pyx_L11_bool_binop_done;
|
|
+ goto __pyx_L15;
|
|
}
|
|
- __pyx_t_10 = 0;
|
|
- __pyx_L11_bool_binop_done:;
|
|
- __pyx_v_step = __pyx_t_10;
|
|
|
|
- /* "View.MemoryView":764
|
|
- * step = index.step or 0
|
|
+ /* "View.MemoryView":857
|
|
+ * start = shape - 1
|
|
+ * else:
|
|
+ * start = 0 # <<<<<<<<<<<<<<
|
|
*
|
|
- * have_start = index.start is not None # <<<<<<<<<<<<<<
|
|
- * have_stop = index.stop is not None
|
|
- * have_step = index.step is not None
|
|
+ * if have_stop:
|
|
*/
|
|
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 764, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_9);
|
|
- __pyx_t_1 = (__pyx_t_9 != Py_None);
|
|
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
- __pyx_v_have_start = __pyx_t_1;
|
|
+ /*else*/ {
|
|
+ __pyx_v_start = 0;
|
|
+ }
|
|
+ __pyx_L15:;
|
|
+ }
|
|
+ __pyx_L11:;
|
|
|
|
- /* "View.MemoryView":765
|
|
- *
|
|
- * have_start = index.start is not None
|
|
- * have_stop = index.stop is not None # <<<<<<<<<<<<<<
|
|
- * have_step = index.step is not None
|
|
+ /* "View.MemoryView":859
|
|
+ * start = 0
|
|
*
|
|
+ * if have_stop: # <<<<<<<<<<<<<<
|
|
+ * if stop < 0:
|
|
+ * stop += shape
|
|
*/
|
|
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 765, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_9);
|
|
- __pyx_t_1 = (__pyx_t_9 != Py_None);
|
|
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
- __pyx_v_have_stop = __pyx_t_1;
|
|
+ __pyx_t_2 = (__pyx_v_have_stop != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":766
|
|
- * have_start = index.start is not None
|
|
- * have_stop = index.stop is not None
|
|
- * have_step = index.step is not None # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":860
|
|
*
|
|
- * slice_memviewslice(
|
|
+ * if have_stop:
|
|
+ * if stop < 0: # <<<<<<<<<<<<<<
|
|
+ * stop += shape
|
|
+ * if stop < 0:
|
|
*/
|
|
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 766, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_9);
|
|
- __pyx_t_1 = (__pyx_t_9 != Py_None);
|
|
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
- __pyx_v_have_step = __pyx_t_1;
|
|
+ __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":768
|
|
- * have_step = index.step is not None
|
|
- *
|
|
- * slice_memviewslice( # <<<<<<<<<<<<<<
|
|
- * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
|
|
- * dim, new_ndim, p_suboffset_dim,
|
|
+ /* "View.MemoryView":861
|
|
+ * if have_stop:
|
|
+ * if stop < 0:
|
|
+ * stop += shape # <<<<<<<<<<<<<<
|
|
+ * if stop < 0:
|
|
+ * stop = 0
|
|
*/
|
|
- __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 768, __pyx_L1_error)
|
|
+ __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
|
|
|
|
- /* "View.MemoryView":774
|
|
- * have_start, have_stop, have_step,
|
|
- * True)
|
|
- * new_ndim += 1 # <<<<<<<<<<<<<<
|
|
- *
|
|
- * if isinstance(memview, _memoryviewslice):
|
|
+ /* "View.MemoryView":862
|
|
+ * if stop < 0:
|
|
+ * stop += shape
|
|
+ * if stop < 0: # <<<<<<<<<<<<<<
|
|
+ * stop = 0
|
|
+ * elif stop > shape:
|
|
*/
|
|
- __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
|
|
- }
|
|
- __pyx_L6:;
|
|
+ __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":746
|
|
- * cdef bint have_start, have_stop, have_step
|
|
- *
|
|
- * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
|
|
- * if PyIndex_Check(index):
|
|
- * slice_memviewslice(
|
|
+ /* "View.MemoryView":863
|
|
+ * stop += shape
|
|
+ * if stop < 0:
|
|
+ * stop = 0 # <<<<<<<<<<<<<<
|
|
+ * elif stop > shape:
|
|
+ * stop = shape
|
|
*/
|
|
- }
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
+ __pyx_v_stop = 0;
|
|
|
|
- /* "View.MemoryView":776
|
|
- * new_ndim += 1
|
|
- *
|
|
- * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
|
|
- * return memoryview_fromslice(dst, new_ndim,
|
|
- * memviewsliceobj.to_object_func,
|
|
+ /* "View.MemoryView":862
|
|
+ * if stop < 0:
|
|
+ * stop += shape
|
|
+ * if stop < 0: # <<<<<<<<<<<<<<
|
|
+ * stop = 0
|
|
+ * elif stop > shape:
|
|
*/
|
|
- __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
|
|
- __pyx_t_2 = (__pyx_t_1 != 0);
|
|
- if (__pyx_t_2) {
|
|
+ }
|
|
|
|
- /* "View.MemoryView":777
|
|
+ /* "View.MemoryView":860
|
|
*
|
|
- * if isinstance(memview, _memoryviewslice):
|
|
- * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
|
|
- * memviewsliceobj.to_object_func,
|
|
- * memviewsliceobj.to_dtype_func,
|
|
+ * if have_stop:
|
|
+ * if stop < 0: # <<<<<<<<<<<<<<
|
|
+ * stop += shape
|
|
+ * if stop < 0:
|
|
*/
|
|
- __Pyx_XDECREF(((PyObject *)__pyx_r));
|
|
+ goto __pyx_L17;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":778
|
|
- * if isinstance(memview, _memoryviewslice):
|
|
- * return memoryview_fromslice(dst, new_ndim,
|
|
- * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
|
|
- * memviewsliceobj.to_dtype_func,
|
|
- * memview.dtype_is_object)
|
|
+ /* "View.MemoryView":864
|
|
+ * if stop < 0:
|
|
+ * stop = 0
|
|
+ * elif stop > shape: # <<<<<<<<<<<<<<
|
|
+ * stop = shape
|
|
+ * else:
|
|
*/
|
|
- if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 778, __pyx_L1_error) }
|
|
+ __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":779
|
|
- * return memoryview_fromslice(dst, new_ndim,
|
|
- * memviewsliceobj.to_object_func,
|
|
- * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
|
|
- * memview.dtype_is_object)
|
|
- * else:
|
|
+ /* "View.MemoryView":865
|
|
+ * stop = 0
|
|
+ * elif stop > shape:
|
|
+ * stop = shape # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * if negative_step:
|
|
*/
|
|
- if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 779, __pyx_L1_error) }
|
|
+ __pyx_v_stop = __pyx_v_shape;
|
|
|
|
- /* "View.MemoryView":777
|
|
- *
|
|
- * if isinstance(memview, _memoryviewslice):
|
|
- * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
|
|
- * memviewsliceobj.to_object_func,
|
|
- * memviewsliceobj.to_dtype_func,
|
|
+ /* "View.MemoryView":864
|
|
+ * if stop < 0:
|
|
+ * stop = 0
|
|
+ * elif stop > shape: # <<<<<<<<<<<<<<
|
|
+ * stop = shape
|
|
+ * else:
|
|
*/
|
|
- __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 777, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 777, __pyx_L1_error)
|
|
- __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
|
|
- __pyx_t_3 = 0;
|
|
- goto __pyx_L0;
|
|
+ }
|
|
+ __pyx_L17:;
|
|
|
|
- /* "View.MemoryView":776
|
|
- * new_ndim += 1
|
|
+ /* "View.MemoryView":859
|
|
+ * start = 0
|
|
*
|
|
- * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
|
|
- * return memoryview_fromslice(dst, new_ndim,
|
|
- * memviewsliceobj.to_object_func,
|
|
+ * if have_stop: # <<<<<<<<<<<<<<
|
|
+ * if stop < 0:
|
|
+ * stop += shape
|
|
*/
|
|
- }
|
|
+ goto __pyx_L16;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":782
|
|
- * memview.dtype_is_object)
|
|
- * else:
|
|
- * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
|
|
- * memview.dtype_is_object)
|
|
- *
|
|
+ /* "View.MemoryView":867
|
|
+ * stop = shape
|
|
+ * else:
|
|
+ * if negative_step: # <<<<<<<<<<<<<<
|
|
+ * stop = -1
|
|
+ * else:
|
|
*/
|
|
- /*else*/ {
|
|
- __Pyx_XDECREF(((PyObject *)__pyx_r));
|
|
+ /*else*/ {
|
|
+ __pyx_t_2 = (__pyx_v_negative_step != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":783
|
|
- * else:
|
|
- * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
|
|
- * memview.dtype_is_object) # <<<<<<<<<<<<<<
|
|
- *
|
|
- *
|
|
+ /* "View.MemoryView":868
|
|
+ * else:
|
|
+ * if negative_step:
|
|
+ * stop = -1 # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * stop = shape
|
|
*/
|
|
- __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 782, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
+ __pyx_v_stop = -1L;
|
|
|
|
- /* "View.MemoryView":782
|
|
- * memview.dtype_is_object)
|
|
- * else:
|
|
- * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
|
|
- * memview.dtype_is_object)
|
|
- *
|
|
+ /* "View.MemoryView":867
|
|
+ * stop = shape
|
|
+ * else:
|
|
+ * if negative_step: # <<<<<<<<<<<<<<
|
|
+ * stop = -1
|
|
+ * else:
|
|
*/
|
|
- if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 782, __pyx_L1_error)
|
|
- __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
|
|
- __pyx_t_3 = 0;
|
|
- goto __pyx_L0;
|
|
- }
|
|
+ goto __pyx_L19;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":710
|
|
+ /* "View.MemoryView":870
|
|
+ * stop = -1
|
|
+ * else:
|
|
+ * stop = shape # <<<<<<<<<<<<<<
|
|
*
|
|
- * @cname('__pyx_memview_slice')
|
|
- * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
|
|
- * cdef int new_ndim = 0, suboffset_dim = -1, dim
|
|
- * cdef bint negative_step
|
|
+ * if not have_step:
|
|
*/
|
|
+ /*else*/ {
|
|
+ __pyx_v_stop = __pyx_v_shape;
|
|
+ }
|
|
+ __pyx_L19:;
|
|
+ }
|
|
+ __pyx_L16:;
|
|
|
|
- /* function exit code */
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_3);
|
|
- __Pyx_XDECREF(__pyx_t_9);
|
|
- __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = 0;
|
|
- __pyx_L0:;
|
|
- __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
|
|
- __Pyx_XDECREF(__pyx_v_index);
|
|
- __Pyx_XGIVEREF((PyObject *)__pyx_r);
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-/* "View.MemoryView":807
|
|
+ /* "View.MemoryView":872
|
|
+ * stop = shape
|
|
+ *
|
|
+ * if not have_step: # <<<<<<<<<<<<<<
|
|
+ * step = 1
|
|
*
|
|
- * @cname('__pyx_memoryview_slice_memviewslice')
|
|
- * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
|
|
- * __Pyx_memviewslice *dst,
|
|
- * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
|
|
*/
|
|
+ __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
-static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
|
|
- Py_ssize_t __pyx_v_new_shape;
|
|
- int __pyx_v_negative_step;
|
|
- int __pyx_r;
|
|
- int __pyx_t_1;
|
|
- int __pyx_t_2;
|
|
- int __pyx_t_3;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
-
|
|
- /* "View.MemoryView":827
|
|
- * cdef bint negative_step
|
|
+ /* "View.MemoryView":873
|
|
*
|
|
- * if not is_slice: # <<<<<<<<<<<<<<
|
|
+ * if not have_step:
|
|
+ * step = 1 # <<<<<<<<<<<<<<
|
|
*
|
|
- * if start < 0:
|
|
- */
|
|
- __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
|
|
- if (__pyx_t_1) {
|
|
-
|
|
- /* "View.MemoryView":829
|
|
- * if not is_slice:
|
|
*
|
|
- * if start < 0: # <<<<<<<<<<<<<<
|
|
- * start += shape
|
|
- * if not 0 <= start < shape:
|
|
*/
|
|
- __pyx_t_1 = ((__pyx_v_start < 0) != 0);
|
|
- if (__pyx_t_1) {
|
|
+ __pyx_v_step = 1;
|
|
|
|
- /* "View.MemoryView":830
|
|
+ /* "View.MemoryView":872
|
|
+ * stop = shape
|
|
*
|
|
- * if start < 0:
|
|
- * start += shape # <<<<<<<<<<<<<<
|
|
- * if not 0 <= start < shape:
|
|
- * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
|
|
- */
|
|
- __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
|
|
-
|
|
- /* "View.MemoryView":829
|
|
- * if not is_slice:
|
|
+ * if not have_step: # <<<<<<<<<<<<<<
|
|
+ * step = 1
|
|
*
|
|
- * if start < 0: # <<<<<<<<<<<<<<
|
|
- * start += shape
|
|
- * if not 0 <= start < shape:
|
|
- */
|
|
- }
|
|
-
|
|
- /* "View.MemoryView":831
|
|
- * if start < 0:
|
|
- * start += shape
|
|
- * if not 0 <= start < shape: # <<<<<<<<<<<<<<
|
|
- * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
|
|
- * else:
|
|
*/
|
|
- __pyx_t_1 = (0 <= __pyx_v_start);
|
|
- if (__pyx_t_1) {
|
|
- __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
|
|
}
|
|
- __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
|
|
- if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":832
|
|
- * start += shape
|
|
- * if not 0 <= start < shape:
|
|
- * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
|
|
- * else:
|
|
+ /* "View.MemoryView":877
|
|
+ *
|
|
+ * with cython.cdivision(True):
|
|
+ * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
|
|
*
|
|
+ * if (stop - start) - step * new_shape:
|
|
*/
|
|
- __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 832, __pyx_L1_error)
|
|
+ __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
|
|
|
|
- /* "View.MemoryView":831
|
|
- * if start < 0:
|
|
- * start += shape
|
|
- * if not 0 <= start < shape: # <<<<<<<<<<<<<<
|
|
- * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
|
|
- * else:
|
|
+ /* "View.MemoryView":879
|
|
+ * new_shape = (stop - start) // step
|
|
+ *
|
|
+ * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
|
|
+ * new_shape += 1
|
|
+ *
|
|
*/
|
|
- }
|
|
+ __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":827
|
|
- * cdef bint negative_step
|
|
+ /* "View.MemoryView":880
|
|
*
|
|
- * if not is_slice: # <<<<<<<<<<<<<<
|
|
+ * if (stop - start) - step * new_shape:
|
|
+ * new_shape += 1 # <<<<<<<<<<<<<<
|
|
*
|
|
- * if start < 0:
|
|
+ * if new_shape < 0:
|
|
*/
|
|
- goto __pyx_L3;
|
|
- }
|
|
+ __pyx_v_new_shape = (__pyx_v_new_shape + 1);
|
|
|
|
- /* "View.MemoryView":835
|
|
- * else:
|
|
+ /* "View.MemoryView":879
|
|
+ * new_shape = (stop - start) // step
|
|
*
|
|
- * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
|
|
+ * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
|
|
+ * new_shape += 1
|
|
*
|
|
- * if have_step and step == 0:
|
|
*/
|
|
- /*else*/ {
|
|
- __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
|
|
- if (__pyx_t_1) {
|
|
- } else {
|
|
- __pyx_t_2 = __pyx_t_1;
|
|
- goto __pyx_L6_bool_binop_done;
|
|
}
|
|
- __pyx_t_1 = ((__pyx_v_step < 0) != 0);
|
|
- __pyx_t_2 = __pyx_t_1;
|
|
- __pyx_L6_bool_binop_done:;
|
|
- __pyx_v_negative_step = __pyx_t_2;
|
|
|
|
- /* "View.MemoryView":837
|
|
- * negative_step = have_step != 0 and step < 0
|
|
+ /* "View.MemoryView":882
|
|
+ * new_shape += 1
|
|
*
|
|
- * if have_step and step == 0: # <<<<<<<<<<<<<<
|
|
- * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
|
|
+ * if new_shape < 0: # <<<<<<<<<<<<<<
|
|
+ * new_shape = 0
|
|
*
|
|
*/
|
|
- __pyx_t_1 = (__pyx_v_have_step != 0);
|
|
- if (__pyx_t_1) {
|
|
- } else {
|
|
- __pyx_t_2 = __pyx_t_1;
|
|
- goto __pyx_L9_bool_binop_done;
|
|
- }
|
|
- __pyx_t_1 = ((__pyx_v_step == 0) != 0);
|
|
- __pyx_t_2 = __pyx_t_1;
|
|
- __pyx_L9_bool_binop_done:;
|
|
+ __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":838
|
|
+ /* "View.MemoryView":883
|
|
*
|
|
- * if have_step and step == 0:
|
|
- * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
|
|
+ * if new_shape < 0:
|
|
+ * new_shape = 0 # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 838, __pyx_L1_error)
|
|
+ __pyx_v_new_shape = 0;
|
|
|
|
- /* "View.MemoryView":837
|
|
- * negative_step = have_step != 0 and step < 0
|
|
+ /* "View.MemoryView":882
|
|
+ * new_shape += 1
|
|
*
|
|
- * if have_step and step == 0: # <<<<<<<<<<<<<<
|
|
- * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
|
|
+ * if new_shape < 0: # <<<<<<<<<<<<<<
|
|
+ * new_shape = 0
|
|
*
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":841
|
|
+ /* "View.MemoryView":886
|
|
*
|
|
*
|
|
- * if have_start: # <<<<<<<<<<<<<<
|
|
- * if start < 0:
|
|
- * start += shape
|
|
+ * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
|
|
+ * dst.shape[new_ndim] = new_shape
|
|
+ * dst.suboffsets[new_ndim] = suboffset
|
|
*/
|
|
- __pyx_t_2 = (__pyx_v_have_start != 0);
|
|
- if (__pyx_t_2) {
|
|
+ (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
|
|
|
|
- /* "View.MemoryView":842
|
|
+ /* "View.MemoryView":887
|
|
+ *
|
|
+ * dst.strides[new_ndim] = stride * step
|
|
+ * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
|
|
+ * dst.suboffsets[new_ndim] = suboffset
|
|
*
|
|
- * if have_start:
|
|
- * if start < 0: # <<<<<<<<<<<<<<
|
|
- * start += shape
|
|
- * if start < 0:
|
|
- */
|
|
- __pyx_t_2 = ((__pyx_v_start < 0) != 0);
|
|
- if (__pyx_t_2) {
|
|
-
|
|
- /* "View.MemoryView":843
|
|
- * if have_start:
|
|
- * if start < 0:
|
|
- * start += shape # <<<<<<<<<<<<<<
|
|
- * if start < 0:
|
|
- * start = 0
|
|
*/
|
|
- __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
|
|
+ (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
|
|
|
|
- /* "View.MemoryView":844
|
|
- * if start < 0:
|
|
- * start += shape
|
|
- * if start < 0: # <<<<<<<<<<<<<<
|
|
- * start = 0
|
|
- * elif start >= shape:
|
|
+ /* "View.MemoryView":888
|
|
+ * dst.strides[new_ndim] = stride * step
|
|
+ * dst.shape[new_ndim] = new_shape
|
|
+ * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ *
|
|
*/
|
|
- __pyx_t_2 = ((__pyx_v_start < 0) != 0);
|
|
- if (__pyx_t_2) {
|
|
+ (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
|
|
+ }
|
|
+ __pyx_L3:;
|
|
|
|
- /* "View.MemoryView":845
|
|
- * start += shape
|
|
- * if start < 0:
|
|
- * start = 0 # <<<<<<<<<<<<<<
|
|
- * elif start >= shape:
|
|
- * if negative_step:
|
|
+ /* "View.MemoryView":891
|
|
+ *
|
|
+ *
|
|
+ * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
|
|
+ * dst.data += start * stride
|
|
+ * else:
|
|
*/
|
|
- __pyx_v_start = 0;
|
|
+ __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":844
|
|
- * if start < 0:
|
|
- * start += shape
|
|
- * if start < 0: # <<<<<<<<<<<<<<
|
|
- * start = 0
|
|
- * elif start >= shape:
|
|
+ /* "View.MemoryView":892
|
|
+ *
|
|
+ * if suboffset_dim[0] < 0:
|
|
+ * dst.data += start * stride # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * dst.suboffsets[suboffset_dim[0]] += start * stride
|
|
*/
|
|
- }
|
|
+ __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
|
|
|
|
- /* "View.MemoryView":842
|
|
+ /* "View.MemoryView":891
|
|
*
|
|
- * if have_start:
|
|
- * if start < 0: # <<<<<<<<<<<<<<
|
|
- * start += shape
|
|
- * if start < 0:
|
|
+ *
|
|
+ * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
|
|
+ * dst.data += start * stride
|
|
+ * else:
|
|
*/
|
|
- goto __pyx_L12;
|
|
- }
|
|
+ goto __pyx_L23;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":846
|
|
- * if start < 0:
|
|
- * start = 0
|
|
- * elif start >= shape: # <<<<<<<<<<<<<<
|
|
- * if negative_step:
|
|
- * start = shape - 1
|
|
+ /* "View.MemoryView":894
|
|
+ * dst.data += start * stride
|
|
+ * else:
|
|
+ * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * if suboffset >= 0:
|
|
*/
|
|
- __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
|
|
- if (__pyx_t_2) {
|
|
+ /*else*/ {
|
|
+ __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
|
|
+ (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
|
|
+ }
|
|
+ __pyx_L23:;
|
|
|
|
- /* "View.MemoryView":847
|
|
- * start = 0
|
|
- * elif start >= shape:
|
|
- * if negative_step: # <<<<<<<<<<<<<<
|
|
- * start = shape - 1
|
|
- * else:
|
|
+ /* "View.MemoryView":896
|
|
+ * dst.suboffsets[suboffset_dim[0]] += start * stride
|
|
+ *
|
|
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
|
|
+ * if not is_slice:
|
|
+ * if new_ndim == 0:
|
|
*/
|
|
- __pyx_t_2 = (__pyx_v_negative_step != 0);
|
|
- if (__pyx_t_2) {
|
|
+ __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":848
|
|
- * elif start >= shape:
|
|
- * if negative_step:
|
|
- * start = shape - 1 # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * start = shape
|
|
+ /* "View.MemoryView":897
|
|
+ *
|
|
+ * if suboffset >= 0:
|
|
+ * if not is_slice: # <<<<<<<<<<<<<<
|
|
+ * if new_ndim == 0:
|
|
+ * dst.data = (<char **> dst.data)[0] + suboffset
|
|
*/
|
|
- __pyx_v_start = (__pyx_v_shape - 1);
|
|
+ __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":847
|
|
- * start = 0
|
|
- * elif start >= shape:
|
|
- * if negative_step: # <<<<<<<<<<<<<<
|
|
- * start = shape - 1
|
|
- * else:
|
|
+ /* "View.MemoryView":898
|
|
+ * if suboffset >= 0:
|
|
+ * if not is_slice:
|
|
+ * if new_ndim == 0: # <<<<<<<<<<<<<<
|
|
+ * dst.data = (<char **> dst.data)[0] + suboffset
|
|
+ * else:
|
|
*/
|
|
- goto __pyx_L14;
|
|
- }
|
|
+ __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":850
|
|
- * start = shape - 1
|
|
- * else:
|
|
- * start = shape # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * if negative_step:
|
|
+ /* "View.MemoryView":899
|
|
+ * if not is_slice:
|
|
+ * if new_ndim == 0:
|
|
+ * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * _err_dim(IndexError, "All dimensions preceding dimension %d "
|
|
*/
|
|
- /*else*/ {
|
|
- __pyx_v_start = __pyx_v_shape;
|
|
- }
|
|
- __pyx_L14:;
|
|
+ __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
|
|
|
|
- /* "View.MemoryView":846
|
|
- * if start < 0:
|
|
- * start = 0
|
|
- * elif start >= shape: # <<<<<<<<<<<<<<
|
|
- * if negative_step:
|
|
- * start = shape - 1
|
|
+ /* "View.MemoryView":898
|
|
+ * if suboffset >= 0:
|
|
+ * if not is_slice:
|
|
+ * if new_ndim == 0: # <<<<<<<<<<<<<<
|
|
+ * dst.data = (<char **> dst.data)[0] + suboffset
|
|
+ * else:
|
|
*/
|
|
+ goto __pyx_L26;
|
|
}
|
|
- __pyx_L12:;
|
|
-
|
|
- /* "View.MemoryView":841
|
|
- *
|
|
- *
|
|
- * if have_start: # <<<<<<<<<<<<<<
|
|
- * if start < 0:
|
|
- * start += shape
|
|
- */
|
|
- goto __pyx_L11;
|
|
- }
|
|
|
|
- /* "View.MemoryView":852
|
|
- * start = shape
|
|
- * else:
|
|
- * if negative_step: # <<<<<<<<<<<<<<
|
|
- * start = shape - 1
|
|
+ /* "View.MemoryView":901
|
|
+ * dst.data = (<char **> dst.data)[0] + suboffset
|
|
* else:
|
|
- */
|
|
- /*else*/ {
|
|
- __pyx_t_2 = (__pyx_v_negative_step != 0);
|
|
- if (__pyx_t_2) {
|
|
-
|
|
- /* "View.MemoryView":853
|
|
+ * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
|
|
+ * "must be indexed and not sliced", dim)
|
|
* else:
|
|
- * if negative_step:
|
|
- * start = shape - 1 # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * start = 0
|
|
*/
|
|
- __pyx_v_start = (__pyx_v_shape - 1);
|
|
+ /*else*/ {
|
|
|
|
- /* "View.MemoryView":852
|
|
- * start = shape
|
|
- * else:
|
|
- * if negative_step: # <<<<<<<<<<<<<<
|
|
- * start = shape - 1
|
|
+ /* "View.MemoryView":902
|
|
* else:
|
|
+ * _err_dim(IndexError, "All dimensions preceding dimension %d "
|
|
+ * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * suboffset_dim[0] = new_ndim
|
|
*/
|
|
- goto __pyx_L15;
|
|
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 901, __pyx_L1_error)
|
|
}
|
|
+ __pyx_L26:;
|
|
|
|
- /* "View.MemoryView":855
|
|
- * start = shape - 1
|
|
- * else:
|
|
- * start = 0 # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":897
|
|
*
|
|
- * if have_stop:
|
|
+ * if suboffset >= 0:
|
|
+ * if not is_slice: # <<<<<<<<<<<<<<
|
|
+ * if new_ndim == 0:
|
|
+ * dst.data = (<char **> dst.data)[0] + suboffset
|
|
*/
|
|
- /*else*/ {
|
|
- __pyx_v_start = 0;
|
|
- }
|
|
- __pyx_L15:;
|
|
+ goto __pyx_L25;
|
|
}
|
|
- __pyx_L11:;
|
|
|
|
- /* "View.MemoryView":857
|
|
- * start = 0
|
|
+ /* "View.MemoryView":904
|
|
+ * "must be indexed and not sliced", dim)
|
|
+ * else:
|
|
+ * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
|
|
*
|
|
- * if have_stop: # <<<<<<<<<<<<<<
|
|
- * if stop < 0:
|
|
- * stop += shape
|
|
+ * return 0
|
|
*/
|
|
- __pyx_t_2 = (__pyx_v_have_stop != 0);
|
|
- if (__pyx_t_2) {
|
|
+ /*else*/ {
|
|
+ (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
|
|
+ }
|
|
+ __pyx_L25:;
|
|
|
|
- /* "View.MemoryView":858
|
|
+ /* "View.MemoryView":896
|
|
+ * dst.suboffsets[suboffset_dim[0]] += start * stride
|
|
*
|
|
- * if have_stop:
|
|
- * if stop < 0: # <<<<<<<<<<<<<<
|
|
- * stop += shape
|
|
- * if stop < 0:
|
|
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
|
|
+ * if not is_slice:
|
|
+ * if new_ndim == 0:
|
|
*/
|
|
- __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
|
|
- if (__pyx_t_2) {
|
|
+ }
|
|
|
|
- /* "View.MemoryView":859
|
|
- * if have_stop:
|
|
- * if stop < 0:
|
|
- * stop += shape # <<<<<<<<<<<<<<
|
|
- * if stop < 0:
|
|
- * stop = 0
|
|
+ /* "View.MemoryView":906
|
|
+ * suboffset_dim[0] = new_ndim
|
|
+ *
|
|
+ * return 0 # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ *
|
|
*/
|
|
- __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
|
|
+ __pyx_r = 0;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":860
|
|
- * if stop < 0:
|
|
- * stop += shape
|
|
- * if stop < 0: # <<<<<<<<<<<<<<
|
|
- * stop = 0
|
|
- * elif stop > shape:
|
|
+ /* "View.MemoryView":809
|
|
+ *
|
|
+ * @cname('__pyx_memoryview_slice_memviewslice')
|
|
+ * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
|
|
+ * __Pyx_memviewslice *dst,
|
|
+ * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
|
|
*/
|
|
- __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
|
|
- if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":861
|
|
- * stop += shape
|
|
- * if stop < 0:
|
|
- * stop = 0 # <<<<<<<<<<<<<<
|
|
- * elif stop > shape:
|
|
- * stop = shape
|
|
- */
|
|
- __pyx_v_stop = 0;
|
|
-
|
|
- /* "View.MemoryView":860
|
|
- * if stop < 0:
|
|
- * stop += shape
|
|
- * if stop < 0: # <<<<<<<<<<<<<<
|
|
- * stop = 0
|
|
- * elif stop > shape:
|
|
- */
|
|
- }
|
|
+ /* function exit code */
|
|
+ __pyx_L1_error:;
|
|
+ {
|
|
+ #ifdef WITH_THREAD
|
|
+ PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
|
|
+ #endif
|
|
+ __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ #ifdef WITH_THREAD
|
|
+ __Pyx_PyGILState_Release(__pyx_gilstate_save);
|
|
+ #endif
|
|
+ }
|
|
+ __pyx_r = -1;
|
|
+ __pyx_L0:;
|
|
+ return __pyx_r;
|
|
+}
|
|
|
|
- /* "View.MemoryView":858
|
|
+/* "View.MemoryView":912
|
|
*
|
|
- * if have_stop:
|
|
- * if stop < 0: # <<<<<<<<<<<<<<
|
|
- * stop += shape
|
|
- * if stop < 0:
|
|
+ * @cname('__pyx_pybuffer_index')
|
|
+ * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
|
|
+ * Py_ssize_t dim) except NULL:
|
|
+ * cdef Py_ssize_t shape, stride, suboffset = -1
|
|
*/
|
|
- goto __pyx_L17;
|
|
- }
|
|
|
|
- /* "View.MemoryView":862
|
|
- * if stop < 0:
|
|
- * stop = 0
|
|
- * elif stop > shape: # <<<<<<<<<<<<<<
|
|
- * stop = shape
|
|
- * else:
|
|
+static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
|
|
+ Py_ssize_t __pyx_v_shape;
|
|
+ Py_ssize_t __pyx_v_stride;
|
|
+ Py_ssize_t __pyx_v_suboffset;
|
|
+ Py_ssize_t __pyx_v_itemsize;
|
|
+ char *__pyx_v_resultp;
|
|
+ char *__pyx_r;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ Py_ssize_t __pyx_t_1;
|
|
+ int __pyx_t_2;
|
|
+ PyObject *__pyx_t_3 = NULL;
|
|
+ PyObject *__pyx_t_4 = NULL;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("pybuffer_index", 0);
|
|
+
|
|
+ /* "View.MemoryView":914
|
|
+ * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
|
|
+ * Py_ssize_t dim) except NULL:
|
|
+ * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
|
|
+ * cdef Py_ssize_t itemsize = view.itemsize
|
|
+ * cdef char *resultp
|
|
*/
|
|
- __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
|
|
- if (__pyx_t_2) {
|
|
+ __pyx_v_suboffset = -1L;
|
|
|
|
- /* "View.MemoryView":863
|
|
- * stop = 0
|
|
- * elif stop > shape:
|
|
- * stop = shape # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * if negative_step:
|
|
+ /* "View.MemoryView":915
|
|
+ * Py_ssize_t dim) except NULL:
|
|
+ * cdef Py_ssize_t shape, stride, suboffset = -1
|
|
+ * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
|
|
+ * cdef char *resultp
|
|
+ *
|
|
*/
|
|
- __pyx_v_stop = __pyx_v_shape;
|
|
+ __pyx_t_1 = __pyx_v_view->itemsize;
|
|
+ __pyx_v_itemsize = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":862
|
|
- * if stop < 0:
|
|
- * stop = 0
|
|
- * elif stop > shape: # <<<<<<<<<<<<<<
|
|
- * stop = shape
|
|
- * else:
|
|
+ /* "View.MemoryView":918
|
|
+ * cdef char *resultp
|
|
+ *
|
|
+ * if view.ndim == 0: # <<<<<<<<<<<<<<
|
|
+ * shape = view.len / itemsize
|
|
+ * stride = itemsize
|
|
*/
|
|
- }
|
|
- __pyx_L17:;
|
|
+ __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":857
|
|
- * start = 0
|
|
+ /* "View.MemoryView":919
|
|
*
|
|
- * if have_stop: # <<<<<<<<<<<<<<
|
|
- * if stop < 0:
|
|
- * stop += shape
|
|
+ * if view.ndim == 0:
|
|
+ * shape = view.len / itemsize # <<<<<<<<<<<<<<
|
|
+ * stride = itemsize
|
|
+ * else:
|
|
*/
|
|
- goto __pyx_L16;
|
|
+ if (unlikely(__pyx_v_itemsize == 0)) {
|
|
+ PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
|
|
+ __PYX_ERR(2, 919, __pyx_L1_error)
|
|
+ }
|
|
+ else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
|
|
+ PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
|
|
+ __PYX_ERR(2, 919, __pyx_L1_error)
|
|
}
|
|
+ __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
|
|
|
|
- /* "View.MemoryView":865
|
|
- * stop = shape
|
|
- * else:
|
|
- * if negative_step: # <<<<<<<<<<<<<<
|
|
- * stop = -1
|
|
- * else:
|
|
+ /* "View.MemoryView":920
|
|
+ * if view.ndim == 0:
|
|
+ * shape = view.len / itemsize
|
|
+ * stride = itemsize # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * shape = view.shape[dim]
|
|
*/
|
|
- /*else*/ {
|
|
- __pyx_t_2 = (__pyx_v_negative_step != 0);
|
|
- if (__pyx_t_2) {
|
|
+ __pyx_v_stride = __pyx_v_itemsize;
|
|
|
|
- /* "View.MemoryView":866
|
|
- * else:
|
|
- * if negative_step:
|
|
- * stop = -1 # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * stop = shape
|
|
+ /* "View.MemoryView":918
|
|
+ * cdef char *resultp
|
|
+ *
|
|
+ * if view.ndim == 0: # <<<<<<<<<<<<<<
|
|
+ * shape = view.len / itemsize
|
|
+ * stride = itemsize
|
|
*/
|
|
- __pyx_v_stop = -1L;
|
|
+ goto __pyx_L3;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":865
|
|
- * stop = shape
|
|
- * else:
|
|
- * if negative_step: # <<<<<<<<<<<<<<
|
|
- * stop = -1
|
|
- * else:
|
|
+ /* "View.MemoryView":922
|
|
+ * stride = itemsize
|
|
+ * else:
|
|
+ * shape = view.shape[dim] # <<<<<<<<<<<<<<
|
|
+ * stride = view.strides[dim]
|
|
+ * if view.suboffsets != NULL:
|
|
*/
|
|
- goto __pyx_L19;
|
|
- }
|
|
+ /*else*/ {
|
|
+ __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
|
|
|
|
- /* "View.MemoryView":868
|
|
- * stop = -1
|
|
- * else:
|
|
- * stop = shape # <<<<<<<<<<<<<<
|
|
- *
|
|
- * if not have_step:
|
|
+ /* "View.MemoryView":923
|
|
+ * else:
|
|
+ * shape = view.shape[dim]
|
|
+ * stride = view.strides[dim] # <<<<<<<<<<<<<<
|
|
+ * if view.suboffsets != NULL:
|
|
+ * suboffset = view.suboffsets[dim]
|
|
*/
|
|
- /*else*/ {
|
|
- __pyx_v_stop = __pyx_v_shape;
|
|
- }
|
|
- __pyx_L19:;
|
|
- }
|
|
- __pyx_L16:;
|
|
+ __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
|
|
|
|
- /* "View.MemoryView":870
|
|
- * stop = shape
|
|
- *
|
|
- * if not have_step: # <<<<<<<<<<<<<<
|
|
- * step = 1
|
|
+ /* "View.MemoryView":924
|
|
+ * shape = view.shape[dim]
|
|
+ * stride = view.strides[dim]
|
|
+ * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
|
|
+ * suboffset = view.suboffsets[dim]
|
|
*
|
|
*/
|
|
- __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
|
|
+ __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":871
|
|
- *
|
|
- * if not have_step:
|
|
- * step = 1 # <<<<<<<<<<<<<<
|
|
- *
|
|
+ /* "View.MemoryView":925
|
|
+ * stride = view.strides[dim]
|
|
+ * if view.suboffsets != NULL:
|
|
+ * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
|
|
*
|
|
+ * if index < 0:
|
|
*/
|
|
- __pyx_v_step = 1;
|
|
+ __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
|
|
|
|
- /* "View.MemoryView":870
|
|
- * stop = shape
|
|
- *
|
|
- * if not have_step: # <<<<<<<<<<<<<<
|
|
- * step = 1
|
|
+ /* "View.MemoryView":924
|
|
+ * shape = view.shape[dim]
|
|
+ * stride = view.strides[dim]
|
|
+ * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
|
|
+ * suboffset = view.suboffsets[dim]
|
|
*
|
|
*/
|
|
}
|
|
+ }
|
|
+ __pyx_L3:;
|
|
|
|
- /* "View.MemoryView":875
|
|
- *
|
|
- * with cython.cdivision(True):
|
|
- * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":927
|
|
+ * suboffset = view.suboffsets[dim]
|
|
*
|
|
- * if (stop - start) - step * new_shape:
|
|
+ * if index < 0: # <<<<<<<<<<<<<<
|
|
+ * index += view.shape[dim]
|
|
+ * if index < 0:
|
|
*/
|
|
- __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
|
|
+ __pyx_t_2 = ((__pyx_v_index < 0) != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":877
|
|
- * new_shape = (stop - start) // step
|
|
- *
|
|
- * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
|
|
- * new_shape += 1
|
|
+ /* "View.MemoryView":928
|
|
*
|
|
+ * if index < 0:
|
|
+ * index += view.shape[dim] # <<<<<<<<<<<<<<
|
|
+ * if index < 0:
|
|
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
|
|
*/
|
|
- __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
|
|
- if (__pyx_t_2) {
|
|
+ __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
|
|
|
|
- /* "View.MemoryView":878
|
|
- *
|
|
- * if (stop - start) - step * new_shape:
|
|
- * new_shape += 1 # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":929
|
|
+ * if index < 0:
|
|
+ * index += view.shape[dim]
|
|
+ * if index < 0: # <<<<<<<<<<<<<<
|
|
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
|
|
*
|
|
- * if new_shape < 0:
|
|
*/
|
|
- __pyx_v_new_shape = (__pyx_v_new_shape + 1);
|
|
+ __pyx_t_2 = ((__pyx_v_index < 0) != 0);
|
|
+ if (unlikely(__pyx_t_2)) {
|
|
|
|
- /* "View.MemoryView":877
|
|
- * new_shape = (stop - start) // step
|
|
- *
|
|
- * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
|
|
- * new_shape += 1
|
|
+ /* "View.MemoryView":930
|
|
+ * index += view.shape[dim]
|
|
+ * if index < 0:
|
|
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
|
|
*
|
|
+ * if index >= shape:
|
|
*/
|
|
- }
|
|
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 930, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 930, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 930, __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(2, 930, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":880
|
|
- * new_shape += 1
|
|
- *
|
|
- * if new_shape < 0: # <<<<<<<<<<<<<<
|
|
- * new_shape = 0
|
|
- *
|
|
- */
|
|
- __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
|
|
- if (__pyx_t_2) {
|
|
-
|
|
- /* "View.MemoryView":881
|
|
- *
|
|
- * if new_shape < 0:
|
|
- * new_shape = 0 # <<<<<<<<<<<<<<
|
|
- *
|
|
- *
|
|
- */
|
|
- __pyx_v_new_shape = 0;
|
|
-
|
|
- /* "View.MemoryView":880
|
|
- * new_shape += 1
|
|
- *
|
|
- * if new_shape < 0: # <<<<<<<<<<<<<<
|
|
- * new_shape = 0
|
|
+ /* "View.MemoryView":929
|
|
+ * if index < 0:
|
|
+ * index += view.shape[dim]
|
|
+ * if index < 0: # <<<<<<<<<<<<<<
|
|
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
|
|
*
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":884
|
|
- *
|
|
- *
|
|
- * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
|
|
- * dst.shape[new_ndim] = new_shape
|
|
- * dst.suboffsets[new_ndim] = suboffset
|
|
- */
|
|
- (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
|
|
-
|
|
- /* "View.MemoryView":885
|
|
- *
|
|
- * dst.strides[new_ndim] = stride * step
|
|
- * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
|
|
- * dst.suboffsets[new_ndim] = suboffset
|
|
- *
|
|
- */
|
|
- (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
|
|
-
|
|
- /* "View.MemoryView":886
|
|
- * dst.strides[new_ndim] = stride * step
|
|
- * dst.shape[new_ndim] = new_shape
|
|
- * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
|
|
- *
|
|
+ /* "View.MemoryView":927
|
|
+ * suboffset = view.suboffsets[dim]
|
|
*
|
|
+ * if index < 0: # <<<<<<<<<<<<<<
|
|
+ * index += view.shape[dim]
|
|
+ * if index < 0:
|
|
*/
|
|
- (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
|
|
}
|
|
- __pyx_L3:;
|
|
|
|
- /* "View.MemoryView":889
|
|
+ /* "View.MemoryView":932
|
|
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
|
|
*
|
|
+ * if index >= shape: # <<<<<<<<<<<<<<
|
|
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
|
|
*
|
|
- * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
|
|
- * dst.data += start * stride
|
|
- * else:
|
|
*/
|
|
- __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
|
|
- if (__pyx_t_2) {
|
|
+ __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
|
|
+ if (unlikely(__pyx_t_2)) {
|
|
|
|
- /* "View.MemoryView":890
|
|
+ /* "View.MemoryView":933
|
|
*
|
|
- * if suboffset_dim[0] < 0:
|
|
- * dst.data += start * stride # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * dst.suboffsets[suboffset_dim[0]] += start * stride
|
|
+ * if index >= shape:
|
|
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * resultp = bufp + index * stride
|
|
*/
|
|
- __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
|
|
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 933, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 933, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 933, __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(2, 933, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":889
|
|
+ /* "View.MemoryView":932
|
|
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
|
|
*
|
|
+ * if index >= shape: # <<<<<<<<<<<<<<
|
|
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
|
|
*
|
|
- * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
|
|
- * dst.data += start * stride
|
|
- * else:
|
|
*/
|
|
- goto __pyx_L23;
|
|
}
|
|
|
|
- /* "View.MemoryView":892
|
|
- * dst.data += start * stride
|
|
- * else:
|
|
- * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":935
|
|
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
|
|
*
|
|
+ * resultp = bufp + index * stride # <<<<<<<<<<<<<<
|
|
* if suboffset >= 0:
|
|
+ * resultp = (<char **> resultp)[0] + suboffset
|
|
*/
|
|
- /*else*/ {
|
|
- __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
|
|
- (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
|
|
- }
|
|
- __pyx_L23:;
|
|
+ __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
|
|
|
|
- /* "View.MemoryView":894
|
|
- * dst.suboffsets[suboffset_dim[0]] += start * stride
|
|
+ /* "View.MemoryView":936
|
|
*
|
|
+ * resultp = bufp + index * stride
|
|
* if suboffset >= 0: # <<<<<<<<<<<<<<
|
|
- * if not is_slice:
|
|
- * if new_ndim == 0:
|
|
+ * resultp = (<char **> resultp)[0] + suboffset
|
|
+ *
|
|
*/
|
|
__pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":895
|
|
- *
|
|
- * if suboffset >= 0:
|
|
- * if not is_slice: # <<<<<<<<<<<<<<
|
|
- * if new_ndim == 0:
|
|
- * dst.data = (<char **> dst.data)[0] + suboffset
|
|
- */
|
|
- __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
|
|
- if (__pyx_t_2) {
|
|
-
|
|
- /* "View.MemoryView":896
|
|
- * if suboffset >= 0:
|
|
- * if not is_slice:
|
|
- * if new_ndim == 0: # <<<<<<<<<<<<<<
|
|
- * dst.data = (<char **> dst.data)[0] + suboffset
|
|
- * else:
|
|
- */
|
|
- __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
|
|
- if (__pyx_t_2) {
|
|
-
|
|
- /* "View.MemoryView":897
|
|
- * if not is_slice:
|
|
- * if new_ndim == 0:
|
|
- * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * _err_dim(IndexError, "All dimensions preceding dimension %d "
|
|
- */
|
|
- __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
|
|
-
|
|
- /* "View.MemoryView":896
|
|
- * if suboffset >= 0:
|
|
- * if not is_slice:
|
|
- * if new_ndim == 0: # <<<<<<<<<<<<<<
|
|
- * dst.data = (<char **> dst.data)[0] + suboffset
|
|
- * else:
|
|
- */
|
|
- goto __pyx_L26;
|
|
- }
|
|
-
|
|
- /* "View.MemoryView":899
|
|
- * dst.data = (<char **> dst.data)[0] + suboffset
|
|
- * else:
|
|
- * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
|
|
- * "must be indexed and not sliced", dim)
|
|
- * else:
|
|
- */
|
|
- /*else*/ {
|
|
-
|
|
- /* "View.MemoryView":900
|
|
- * else:
|
|
- * _err_dim(IndexError, "All dimensions preceding dimension %d "
|
|
- * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * suboffset_dim[0] = new_ndim
|
|
- */
|
|
- __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 899, __pyx_L1_error)
|
|
- }
|
|
- __pyx_L26:;
|
|
-
|
|
- /* "View.MemoryView":895
|
|
- *
|
|
+ /* "View.MemoryView":937
|
|
+ * resultp = bufp + index * stride
|
|
* if suboffset >= 0:
|
|
- * if not is_slice: # <<<<<<<<<<<<<<
|
|
- * if new_ndim == 0:
|
|
- * dst.data = (<char **> dst.data)[0] + suboffset
|
|
- */
|
|
- goto __pyx_L25;
|
|
- }
|
|
-
|
|
- /* "View.MemoryView":902
|
|
- * "must be indexed and not sliced", dim)
|
|
- * else:
|
|
- * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
|
|
+ * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
|
|
*
|
|
- * return 0
|
|
+ * return resultp
|
|
*/
|
|
- /*else*/ {
|
|
- (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
|
|
- }
|
|
- __pyx_L25:;
|
|
+ __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
|
|
|
|
- /* "View.MemoryView":894
|
|
- * dst.suboffsets[suboffset_dim[0]] += start * stride
|
|
+ /* "View.MemoryView":936
|
|
*
|
|
+ * resultp = bufp + index * stride
|
|
* if suboffset >= 0: # <<<<<<<<<<<<<<
|
|
- * if not is_slice:
|
|
- * if new_ndim == 0:
|
|
+ * resultp = (<char **> resultp)[0] + suboffset
|
|
+ *
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":904
|
|
- * suboffset_dim[0] = new_ndim
|
|
+ /* "View.MemoryView":939
|
|
+ * resultp = (<char **> resultp)[0] + suboffset
|
|
*
|
|
- * return 0 # <<<<<<<<<<<<<<
|
|
+ * return resultp # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_r = 0;
|
|
+ __pyx_r = __pyx_v_resultp;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":807
|
|
+ /* "View.MemoryView":912
|
|
*
|
|
- * @cname('__pyx_memoryview_slice_memviewslice')
|
|
- * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
|
|
- * __Pyx_memviewslice *dst,
|
|
- * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
|
|
+ * @cname('__pyx_pybuffer_index')
|
|
+ * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
|
|
+ * Py_ssize_t dim) except NULL:
|
|
+ * cdef Py_ssize_t shape, stride, suboffset = -1
|
|
*/
|
|
|
|
/* function exit code */
|
|
__pyx_L1_error:;
|
|
- {
|
|
- #ifdef WITH_THREAD
|
|
- PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
|
|
- #endif
|
|
- __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- #ifdef WITH_THREAD
|
|
- __Pyx_PyGILState_Release(__pyx_gilstate_save);
|
|
- #endif
|
|
- }
|
|
- __pyx_r = -1;
|
|
+ __Pyx_XDECREF(__pyx_t_3);
|
|
+ __Pyx_XDECREF(__pyx_t_4);
|
|
+ __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = NULL;
|
|
__pyx_L0:;
|
|
+ __Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":910
|
|
+/* "View.MemoryView":945
|
|
+ *
|
|
+ * @cname('__pyx_memslice_transpose')
|
|
+ * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
|
|
+ * cdef int ndim = memslice.memview.view.ndim
|
|
*
|
|
- * @cname('__pyx_pybuffer_index')
|
|
- * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
|
|
- * Py_ssize_t dim) except NULL:
|
|
- * cdef Py_ssize_t shape, stride, suboffset = -1
|
|
*/
|
|
|
|
-static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
|
|
- Py_ssize_t __pyx_v_shape;
|
|
- Py_ssize_t __pyx_v_stride;
|
|
- Py_ssize_t __pyx_v_suboffset;
|
|
- Py_ssize_t __pyx_v_itemsize;
|
|
- char *__pyx_v_resultp;
|
|
- char *__pyx_r;
|
|
- __Pyx_RefNannyDeclarations
|
|
- Py_ssize_t __pyx_t_1;
|
|
- int __pyx_t_2;
|
|
- PyObject *__pyx_t_3 = NULL;
|
|
- PyObject *__pyx_t_4 = NULL;
|
|
+static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
|
|
+ int __pyx_v_ndim;
|
|
+ Py_ssize_t *__pyx_v_shape;
|
|
+ Py_ssize_t *__pyx_v_strides;
|
|
+ int __pyx_v_i;
|
|
+ int __pyx_v_j;
|
|
+ int __pyx_r;
|
|
+ int __pyx_t_1;
|
|
+ Py_ssize_t *__pyx_t_2;
|
|
+ long __pyx_t_3;
|
|
+ long __pyx_t_4;
|
|
+ Py_ssize_t __pyx_t_5;
|
|
+ Py_ssize_t __pyx_t_6;
|
|
+ int __pyx_t_7;
|
|
+ int __pyx_t_8;
|
|
+ int __pyx_t_9;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("pybuffer_index", 0);
|
|
|
|
- /* "View.MemoryView":912
|
|
- * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
|
|
- * Py_ssize_t dim) except NULL:
|
|
- * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
|
|
- * cdef Py_ssize_t itemsize = view.itemsize
|
|
- * cdef char *resultp
|
|
+ /* "View.MemoryView":946
|
|
+ * @cname('__pyx_memslice_transpose')
|
|
+ * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
|
|
+ * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * cdef Py_ssize_t *shape = memslice.shape
|
|
*/
|
|
- __pyx_v_suboffset = -1L;
|
|
+ __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
|
|
+ __pyx_v_ndim = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":913
|
|
- * Py_ssize_t dim) except NULL:
|
|
- * cdef Py_ssize_t shape, stride, suboffset = -1
|
|
- * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
|
|
- * cdef char *resultp
|
|
+ /* "View.MemoryView":948
|
|
+ * cdef int ndim = memslice.memview.view.ndim
|
|
+ *
|
|
+ * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
|
|
+ * cdef Py_ssize_t *strides = memslice.strides
|
|
*
|
|
*/
|
|
- __pyx_t_1 = __pyx_v_view->itemsize;
|
|
- __pyx_v_itemsize = __pyx_t_1;
|
|
+ __pyx_t_2 = __pyx_v_memslice->shape;
|
|
+ __pyx_v_shape = __pyx_t_2;
|
|
|
|
- /* "View.MemoryView":916
|
|
- * cdef char *resultp
|
|
+ /* "View.MemoryView":949
|
|
+ *
|
|
+ * cdef Py_ssize_t *shape = memslice.shape
|
|
+ * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
|
|
+ *
|
|
*
|
|
- * if view.ndim == 0: # <<<<<<<<<<<<<<
|
|
- * shape = view.len / itemsize
|
|
- * stride = itemsize
|
|
*/
|
|
- __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
|
|
- if (__pyx_t_2) {
|
|
+ __pyx_t_2 = __pyx_v_memslice->strides;
|
|
+ __pyx_v_strides = __pyx_t_2;
|
|
|
|
- /* "View.MemoryView":917
|
|
+ /* "View.MemoryView":953
|
|
*
|
|
- * if view.ndim == 0:
|
|
- * shape = view.len / itemsize # <<<<<<<<<<<<<<
|
|
- * stride = itemsize
|
|
- * else:
|
|
+ * cdef int i, j
|
|
+ * for i in range(ndim / 2): # <<<<<<<<<<<<<<
|
|
+ * j = ndim - 1 - i
|
|
+ * strides[i], strides[j] = strides[j], strides[i]
|
|
*/
|
|
- if (unlikely(__pyx_v_itemsize == 0)) {
|
|
- PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
|
|
- __PYX_ERR(2, 917, __pyx_L1_error)
|
|
- }
|
|
- else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
|
|
- PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
|
|
- __PYX_ERR(2, 917, __pyx_L1_error)
|
|
- }
|
|
- __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
|
|
+ __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
|
|
+ __pyx_t_4 = __pyx_t_3;
|
|
+ for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
|
|
+ __pyx_v_i = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":918
|
|
- * if view.ndim == 0:
|
|
- * shape = view.len / itemsize
|
|
- * stride = itemsize # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * shape = view.shape[dim]
|
|
+ /* "View.MemoryView":954
|
|
+ * cdef int i, j
|
|
+ * for i in range(ndim / 2):
|
|
+ * j = ndim - 1 - i # <<<<<<<<<<<<<<
|
|
+ * strides[i], strides[j] = strides[j], strides[i]
|
|
+ * shape[i], shape[j] = shape[j], shape[i]
|
|
*/
|
|
- __pyx_v_stride = __pyx_v_itemsize;
|
|
+ __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
|
|
|
|
- /* "View.MemoryView":916
|
|
- * cdef char *resultp
|
|
+ /* "View.MemoryView":955
|
|
+ * for i in range(ndim / 2):
|
|
+ * j = ndim - 1 - i
|
|
+ * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
|
|
+ * shape[i], shape[j] = shape[j], shape[i]
|
|
*
|
|
- * if view.ndim == 0: # <<<<<<<<<<<<<<
|
|
- * shape = view.len / itemsize
|
|
- * stride = itemsize
|
|
- */
|
|
- goto __pyx_L3;
|
|
- }
|
|
-
|
|
- /* "View.MemoryView":920
|
|
- * stride = itemsize
|
|
- * else:
|
|
- * shape = view.shape[dim] # <<<<<<<<<<<<<<
|
|
- * stride = view.strides[dim]
|
|
- * if view.suboffsets != NULL:
|
|
*/
|
|
- /*else*/ {
|
|
- __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
|
|
+ __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
|
|
+ __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
|
|
+ (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
|
|
+ (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
|
|
|
|
- /* "View.MemoryView":921
|
|
- * else:
|
|
- * shape = view.shape[dim]
|
|
- * stride = view.strides[dim] # <<<<<<<<<<<<<<
|
|
- * if view.suboffsets != NULL:
|
|
- * suboffset = view.suboffsets[dim]
|
|
+ /* "View.MemoryView":956
|
|
+ * j = ndim - 1 - i
|
|
+ * strides[i], strides[j] = strides[j], strides[i]
|
|
+ * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
|
|
*/
|
|
- __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
|
|
+ __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
|
|
+ __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
|
|
+ (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
|
|
+ (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
|
|
|
|
- /* "View.MemoryView":922
|
|
- * shape = view.shape[dim]
|
|
- * stride = view.strides[dim]
|
|
- * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
|
|
- * suboffset = view.suboffsets[dim]
|
|
+ /* "View.MemoryView":958
|
|
+ * shape[i], shape[j] = shape[j], shape[i]
|
|
+ *
|
|
+ * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
|
|
+ * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
|
|
*
|
|
*/
|
|
- __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
|
|
- if (__pyx_t_2) {
|
|
+ __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
|
|
+ if (!__pyx_t_8) {
|
|
+ } else {
|
|
+ __pyx_t_7 = __pyx_t_8;
|
|
+ goto __pyx_L6_bool_binop_done;
|
|
+ }
|
|
+ __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
|
|
+ __pyx_t_7 = __pyx_t_8;
|
|
+ __pyx_L6_bool_binop_done:;
|
|
+ if (__pyx_t_7) {
|
|
|
|
- /* "View.MemoryView":923
|
|
- * stride = view.strides[dim]
|
|
- * if view.suboffsets != NULL:
|
|
- * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":959
|
|
*
|
|
- * if index < 0:
|
|
+ * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
|
|
+ * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ * return 1
|
|
*/
|
|
- __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
|
|
+ __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 959, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":922
|
|
- * shape = view.shape[dim]
|
|
- * stride = view.strides[dim]
|
|
- * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
|
|
- * suboffset = view.suboffsets[dim]
|
|
+ /* "View.MemoryView":958
|
|
+ * shape[i], shape[j] = shape[j], shape[i]
|
|
+ *
|
|
+ * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
|
|
+ * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
|
|
*
|
|
*/
|
|
}
|
|
}
|
|
- __pyx_L3:;
|
|
|
|
- /* "View.MemoryView":925
|
|
- * suboffset = view.suboffsets[dim]
|
|
+ /* "View.MemoryView":961
|
|
+ * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
|
|
*
|
|
- * if index < 0: # <<<<<<<<<<<<<<
|
|
- * index += view.shape[dim]
|
|
- * if index < 0:
|
|
- */
|
|
- __pyx_t_2 = ((__pyx_v_index < 0) != 0);
|
|
- if (__pyx_t_2) {
|
|
-
|
|
- /* "View.MemoryView":926
|
|
+ * return 1 # <<<<<<<<<<<<<<
|
|
*
|
|
- * if index < 0:
|
|
- * index += view.shape[dim] # <<<<<<<<<<<<<<
|
|
- * if index < 0:
|
|
- * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
|
|
- */
|
|
- __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
|
|
-
|
|
- /* "View.MemoryView":927
|
|
- * if index < 0:
|
|
- * index += view.shape[dim]
|
|
- * if index < 0: # <<<<<<<<<<<<<<
|
|
- * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
|
|
*
|
|
*/
|
|
- __pyx_t_2 = ((__pyx_v_index < 0) != 0);
|
|
- if (unlikely(__pyx_t_2)) {
|
|
+ __pyx_r = 1;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":928
|
|
- * index += view.shape[dim]
|
|
- * if index < 0:
|
|
- * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":945
|
|
*
|
|
- * if index >= shape:
|
|
- */
|
|
- __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 928, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __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(2, 928, __pyx_L1_error)
|
|
-
|
|
- /* "View.MemoryView":927
|
|
- * if index < 0:
|
|
- * index += view.shape[dim]
|
|
- * if index < 0: # <<<<<<<<<<<<<<
|
|
- * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
|
|
+ * @cname('__pyx_memslice_transpose')
|
|
+ * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
|
|
+ * cdef int ndim = memslice.memview.view.ndim
|
|
*
|
|
*/
|
|
- }
|
|
|
|
- /* "View.MemoryView":925
|
|
- * suboffset = view.suboffsets[dim]
|
|
- *
|
|
- * if index < 0: # <<<<<<<<<<<<<<
|
|
- * index += view.shape[dim]
|
|
- * if index < 0:
|
|
- */
|
|
+ /* function exit code */
|
|
+ __pyx_L1_error:;
|
|
+ {
|
|
+ #ifdef WITH_THREAD
|
|
+ PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
|
|
+ #endif
|
|
+ __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ #ifdef WITH_THREAD
|
|
+ __Pyx_PyGILState_Release(__pyx_gilstate_save);
|
|
+ #endif
|
|
}
|
|
+ __pyx_r = 0;
|
|
+ __pyx_L0:;
|
|
+ return __pyx_r;
|
|
+}
|
|
|
|
- /* "View.MemoryView":930
|
|
- * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
|
|
+/* "View.MemoryView":978
|
|
+ * cdef int (*to_dtype_func)(char *, object) except 0
|
|
*
|
|
- * if index >= shape: # <<<<<<<<<<<<<<
|
|
- * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
|
|
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
|
|
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
|
|
*
|
|
*/
|
|
- __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
|
|
- if (unlikely(__pyx_t_2)) {
|
|
|
|
- /* "View.MemoryView":931
|
|
+/* Python wrapper */
|
|
+static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
|
|
+static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
|
|
+ __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
|
|
+
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+}
|
|
+
|
|
+static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ __Pyx_RefNannySetupContext("__dealloc__", 0);
|
|
+
|
|
+ /* "View.MemoryView":979
|
|
*
|
|
- * if index >= shape:
|
|
- * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
|
|
+ * def __dealloc__(self):
|
|
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
|
|
*
|
|
- * resultp = bufp + index * stride
|
|
+ * cdef convert_item_to_object(self, char *itemp):
|
|
*/
|
|
- __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 931, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __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(2, 931, __pyx_L1_error)
|
|
+ __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
|
|
|
|
- /* "View.MemoryView":930
|
|
- * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
|
|
+ /* "View.MemoryView":978
|
|
+ * cdef int (*to_dtype_func)(char *, object) except 0
|
|
*
|
|
- * if index >= shape: # <<<<<<<<<<<<<<
|
|
- * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
|
|
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
|
|
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
|
|
*
|
|
*/
|
|
- }
|
|
|
|
- /* "View.MemoryView":933
|
|
- * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+}
|
|
+
|
|
+/* "View.MemoryView":981
|
|
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
|
|
*
|
|
- * resultp = bufp + index * stride # <<<<<<<<<<<<<<
|
|
- * if suboffset >= 0:
|
|
- * resultp = (<char **> resultp)[0] + suboffset
|
|
+ * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
|
|
+ * if self.to_object_func != NULL:
|
|
+ * return self.to_object_func(itemp)
|
|
*/
|
|
- __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
|
|
|
|
- /* "View.MemoryView":934
|
|
- *
|
|
- * resultp = bufp + index * stride
|
|
- * if suboffset >= 0: # <<<<<<<<<<<<<<
|
|
- * resultp = (<char **> resultp)[0] + suboffset
|
|
+static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
|
|
+ PyObject *__pyx_r = NULL;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ int __pyx_t_1;
|
|
+ PyObject *__pyx_t_2 = NULL;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("convert_item_to_object", 0);
|
|
+
|
|
+ /* "View.MemoryView":982
|
|
*
|
|
+ * cdef convert_item_to_object(self, char *itemp):
|
|
+ * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
|
|
+ * return self.to_object_func(itemp)
|
|
+ * else:
|
|
*/
|
|
- __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
|
|
- if (__pyx_t_2) {
|
|
+ __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":935
|
|
- * resultp = bufp + index * stride
|
|
- * if suboffset >= 0:
|
|
- * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
|
|
- *
|
|
- * return resultp
|
|
+ /* "View.MemoryView":983
|
|
+ * cdef convert_item_to_object(self, char *itemp):
|
|
+ * if self.to_object_func != NULL:
|
|
+ * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * return memoryview.convert_item_to_object(self, itemp)
|
|
*/
|
|
- __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 983, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __pyx_r = __pyx_t_2;
|
|
+ __pyx_t_2 = 0;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":934
|
|
- *
|
|
- * resultp = bufp + index * stride
|
|
- * if suboffset >= 0: # <<<<<<<<<<<<<<
|
|
- * resultp = (<char **> resultp)[0] + suboffset
|
|
+ /* "View.MemoryView":982
|
|
*
|
|
+ * cdef convert_item_to_object(self, char *itemp):
|
|
+ * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
|
|
+ * return self.to_object_func(itemp)
|
|
+ * else:
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":937
|
|
- * resultp = (<char **> resultp)[0] + suboffset
|
|
- *
|
|
- * return resultp # <<<<<<<<<<<<<<
|
|
- *
|
|
+ /* "View.MemoryView":985
|
|
+ * return self.to_object_func(itemp)
|
|
+ * else:
|
|
+ * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
|
|
*
|
|
+ * cdef assign_item_from_object(self, char *itemp, object value):
|
|
*/
|
|
- __pyx_r = __pyx_v_resultp;
|
|
- goto __pyx_L0;
|
|
+ /*else*/ {
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 985, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_2);
|
|
+ __pyx_r = __pyx_t_2;
|
|
+ __pyx_t_2 = 0;
|
|
+ goto __pyx_L0;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":910
|
|
+ /* "View.MemoryView":981
|
|
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
|
|
*
|
|
- * @cname('__pyx_pybuffer_index')
|
|
- * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
|
|
- * Py_ssize_t dim) except NULL:
|
|
- * cdef Py_ssize_t shape, stride, suboffset = -1
|
|
+ * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
|
|
+ * if self.to_object_func != NULL:
|
|
+ * return self.to_object_func(itemp)
|
|
*/
|
|
|
|
/* function exit code */
|
|
__pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_3);
|
|
- __Pyx_XDECREF(__pyx_t_4);
|
|
- __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = NULL;
|
|
+ __Pyx_XDECREF(__pyx_t_2);
|
|
+ __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = 0;
|
|
__pyx_L0:;
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":943
|
|
- *
|
|
- * @cname('__pyx_memslice_transpose')
|
|
- * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
|
|
- * cdef int ndim = memslice.memview.view.ndim
|
|
+/* "View.MemoryView":987
|
|
+ * return memoryview.convert_item_to_object(self, itemp)
|
|
*
|
|
+ * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
|
|
+ * if self.to_dtype_func != NULL:
|
|
+ * self.to_dtype_func(itemp, value)
|
|
*/
|
|
|
|
-static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
|
|
- int __pyx_v_ndim;
|
|
- Py_ssize_t *__pyx_v_shape;
|
|
- Py_ssize_t *__pyx_v_strides;
|
|
- int __pyx_v_i;
|
|
- int __pyx_v_j;
|
|
- int __pyx_r;
|
|
+static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
|
|
+ PyObject *__pyx_r = NULL;
|
|
+ __Pyx_RefNannyDeclarations
|
|
int __pyx_t_1;
|
|
- Py_ssize_t *__pyx_t_2;
|
|
- long __pyx_t_3;
|
|
- long __pyx_t_4;
|
|
- Py_ssize_t __pyx_t_5;
|
|
- Py_ssize_t __pyx_t_6;
|
|
- int __pyx_t_7;
|
|
- int __pyx_t_8;
|
|
- int __pyx_t_9;
|
|
+ int __pyx_t_2;
|
|
+ PyObject *__pyx_t_3 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("assign_item_from_object", 0);
|
|
|
|
- /* "View.MemoryView":944
|
|
- * @cname('__pyx_memslice_transpose')
|
|
- * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
|
|
- * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
|
|
+ /* "View.MemoryView":988
|
|
*
|
|
- * cdef Py_ssize_t *shape = memslice.shape
|
|
+ * cdef assign_item_from_object(self, char *itemp, object value):
|
|
+ * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
|
|
+ * self.to_dtype_func(itemp, value)
|
|
+ * else:
|
|
*/
|
|
- __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
|
|
- __pyx_v_ndim = __pyx_t_1;
|
|
+ __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
|
|
+ if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":946
|
|
- * cdef int ndim = memslice.memview.view.ndim
|
|
- *
|
|
- * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
|
|
- * cdef Py_ssize_t *strides = memslice.strides
|
|
- *
|
|
+ /* "View.MemoryView":989
|
|
+ * cdef assign_item_from_object(self, char *itemp, object value):
|
|
+ * if self.to_dtype_func != NULL:
|
|
+ * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
|
|
+ * else:
|
|
+ * memoryview.assign_item_from_object(self, itemp, value)
|
|
*/
|
|
- __pyx_t_2 = __pyx_v_memslice->shape;
|
|
- __pyx_v_shape = __pyx_t_2;
|
|
+ __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 989, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":947
|
|
- *
|
|
- * cdef Py_ssize_t *shape = memslice.shape
|
|
- * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
|
|
- *
|
|
+ /* "View.MemoryView":988
|
|
*
|
|
+ * cdef assign_item_from_object(self, char *itemp, object value):
|
|
+ * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
|
|
+ * self.to_dtype_func(itemp, value)
|
|
+ * else:
|
|
*/
|
|
- __pyx_t_2 = __pyx_v_memslice->strides;
|
|
- __pyx_v_strides = __pyx_t_2;
|
|
+ goto __pyx_L3;
|
|
+ }
|
|
|
|
- /* "View.MemoryView":951
|
|
+ /* "View.MemoryView":991
|
|
+ * self.to_dtype_func(itemp, value)
|
|
+ * else:
|
|
+ * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
|
|
*
|
|
- * cdef int i, j
|
|
- * for i in range(ndim / 2): # <<<<<<<<<<<<<<
|
|
- * j = ndim - 1 - i
|
|
- * strides[i], strides[j] = strides[j], strides[i]
|
|
+ * @property
|
|
*/
|
|
- __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
|
|
- __pyx_t_4 = __pyx_t_3;
|
|
- for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
|
|
- __pyx_v_i = __pyx_t_1;
|
|
+ /*else*/ {
|
|
+ __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 991, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_3);
|
|
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
+ }
|
|
+ __pyx_L3:;
|
|
|
|
- /* "View.MemoryView":952
|
|
- * cdef int i, j
|
|
- * for i in range(ndim / 2):
|
|
- * j = ndim - 1 - i # <<<<<<<<<<<<<<
|
|
- * strides[i], strides[j] = strides[j], strides[i]
|
|
- * shape[i], shape[j] = shape[j], shape[i]
|
|
+ /* "View.MemoryView":987
|
|
+ * return memoryview.convert_item_to_object(self, itemp)
|
|
+ *
|
|
+ * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
|
|
+ * if self.to_dtype_func != NULL:
|
|
+ * self.to_dtype_func(itemp, value)
|
|
*/
|
|
- __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
|
|
|
|
- /* "View.MemoryView":953
|
|
- * for i in range(ndim / 2):
|
|
- * j = ndim - 1 - i
|
|
- * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
|
|
- * shape[i], shape[j] = shape[j], shape[i]
|
|
+ /* function exit code */
|
|
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
+ goto __pyx_L0;
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_3);
|
|
+ __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = 0;
|
|
+ __pyx_L0:;
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+/* "View.MemoryView":994
|
|
+ *
|
|
+ * @property
|
|
+ * def base(self): # <<<<<<<<<<<<<<
|
|
+ * return self.from_object
|
|
*
|
|
*/
|
|
- __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
|
|
- __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
|
|
- (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
|
|
- (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
|
|
|
|
- /* "View.MemoryView":954
|
|
- * j = ndim - 1 - i
|
|
- * strides[i], strides[j] = strides[j], strides[i]
|
|
- * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
|
|
+/* Python wrapper */
|
|
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
|
|
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
|
|
+ PyObject *__pyx_r = 0;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
|
|
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
|
|
+
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
|
|
+ PyObject *__pyx_r = NULL;
|
|
+ __Pyx_RefNannyDeclarations
|
|
+ __Pyx_RefNannySetupContext("__get__", 0);
|
|
+
|
|
+ /* "View.MemoryView":995
|
|
+ * @property
|
|
+ * def base(self):
|
|
+ * return self.from_object # <<<<<<<<<<<<<<
|
|
*
|
|
- * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
|
|
+ * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
|
|
*/
|
|
- __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
|
|
- __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
|
|
- (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
|
|
- (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __Pyx_INCREF(__pyx_v_self->from_object);
|
|
+ __pyx_r = __pyx_v_self->from_object;
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":956
|
|
- * shape[i], shape[j] = shape[j], shape[i]
|
|
+ /* "View.MemoryView":994
|
|
*
|
|
- * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
|
|
- * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
|
|
- *
|
|
- */
|
|
- __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
|
|
- if (!__pyx_t_8) {
|
|
- } else {
|
|
- __pyx_t_7 = __pyx_t_8;
|
|
- goto __pyx_L6_bool_binop_done;
|
|
- }
|
|
- __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
|
|
- __pyx_t_7 = __pyx_t_8;
|
|
- __pyx_L6_bool_binop_done:;
|
|
- if (__pyx_t_7) {
|
|
-
|
|
- /* "View.MemoryView":957
|
|
- *
|
|
- * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
|
|
- * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
|
|
- *
|
|
- * return 1
|
|
- */
|
|
- __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 957, __pyx_L1_error)
|
|
-
|
|
- /* "View.MemoryView":956
|
|
- * shape[i], shape[j] = shape[j], shape[i]
|
|
- *
|
|
- * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
|
|
- * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
|
|
- *
|
|
- */
|
|
- }
|
|
- }
|
|
-
|
|
- /* "View.MemoryView":959
|
|
- * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
|
|
- *
|
|
- * return 1 # <<<<<<<<<<<<<<
|
|
- *
|
|
- *
|
|
- */
|
|
- __pyx_r = 1;
|
|
- goto __pyx_L0;
|
|
-
|
|
- /* "View.MemoryView":943
|
|
- *
|
|
- * @cname('__pyx_memslice_transpose')
|
|
- * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
|
|
- * cdef int ndim = memslice.memview.view.ndim
|
|
+ * @property
|
|
+ * def base(self): # <<<<<<<<<<<<<<
|
|
+ * return self.from_object
|
|
*
|
|
*/
|
|
|
|
/* function exit code */
|
|
- __pyx_L1_error:;
|
|
- {
|
|
- #ifdef WITH_THREAD
|
|
- PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
|
|
- #endif
|
|
- __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- #ifdef WITH_THREAD
|
|
- __Pyx_PyGILState_Release(__pyx_gilstate_save);
|
|
- #endif
|
|
- }
|
|
- __pyx_r = 0;
|
|
__pyx_L0:;
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
+ __Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":976
|
|
- * cdef int (*to_dtype_func)(char *, object) except 0
|
|
- *
|
|
- * def __dealloc__(self): # <<<<<<<<<<<<<<
|
|
- * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
|
|
- *
|
|
+/* "(tree fragment)":1
|
|
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
+ * def __setstate_cython__(self, __pyx_state):
|
|
*/
|
|
|
|
/* Python wrapper */
|
|
-static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
|
|
-static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
|
|
+static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
+static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
|
|
+ PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
|
|
- __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
|
|
+ __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
|
|
+ __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
|
|
|
|
/* function exit code */
|
|
__Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
}
|
|
|
|
-static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
|
|
+static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
|
|
+ PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__dealloc__", 0);
|
|
+ PyObject *__pyx_t_1 = NULL;
|
|
+ int __pyx_lineno = 0;
|
|
+ const char *__pyx_filename = NULL;
|
|
+ int __pyx_clineno = 0;
|
|
+ __Pyx_RefNannySetupContext("__reduce_cython__", 0);
|
|
|
|
- /* "View.MemoryView":977
|
|
- *
|
|
- * def __dealloc__(self):
|
|
- * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
|
|
- *
|
|
- * cdef convert_item_to_object(self, char *itemp):
|
|
+ /* "(tree fragment)":2
|
|
+ * def __reduce_cython__(self):
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
|
|
+ * def __setstate_cython__(self, __pyx_state):
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
*/
|
|
- __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
|
|
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __PYX_ERR(2, 2, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":976
|
|
- * cdef int (*to_dtype_func)(char *, object) except 0
|
|
- *
|
|
- * def __dealloc__(self): # <<<<<<<<<<<<<<
|
|
- * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
|
|
- *
|
|
+ /* "(tree fragment)":1
|
|
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
+ * def __setstate_cython__(self, __pyx_state):
|
|
*/
|
|
|
|
/* function exit code */
|
|
+ __pyx_L1_error:;
|
|
+ __Pyx_XDECREF(__pyx_t_1);
|
|
+ __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = NULL;
|
|
+ __Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":979
|
|
- * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
|
|
- *
|
|
- * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
|
|
- * if self.to_object_func != NULL:
|
|
- * return self.to_object_func(itemp)
|
|
+/* "(tree fragment)":3
|
|
+ * def __reduce_cython__(self):
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
*/
|
|
|
|
-static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
|
|
+/* Python wrapper */
|
|
+static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
|
|
+static PyObject *__pyx_pw___pyx_memoryviewslice_3__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___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
|
|
+
|
|
+ /* function exit code */
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return __pyx_r;
|
|
+}
|
|
+
|
|
+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) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
- int __pyx_t_1;
|
|
- PyObject *__pyx_t_2 = NULL;
|
|
+ PyObject *__pyx_t_1 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("convert_item_to_object", 0);
|
|
-
|
|
- /* "View.MemoryView":980
|
|
- *
|
|
- * cdef convert_item_to_object(self, char *itemp):
|
|
- * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
|
|
- * return self.to_object_func(itemp)
|
|
- * else:
|
|
- */
|
|
- __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
|
|
- if (__pyx_t_1) {
|
|
-
|
|
- /* "View.MemoryView":981
|
|
- * cdef convert_item_to_object(self, char *itemp):
|
|
- * if self.to_object_func != NULL:
|
|
- * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * return memoryview.convert_item_to_object(self, itemp)
|
|
- */
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 981, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_r = __pyx_t_2;
|
|
- __pyx_t_2 = 0;
|
|
- goto __pyx_L0;
|
|
-
|
|
- /* "View.MemoryView":980
|
|
- *
|
|
- * cdef convert_item_to_object(self, char *itemp):
|
|
- * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
|
|
- * return self.to_object_func(itemp)
|
|
- * else:
|
|
- */
|
|
- }
|
|
+ __Pyx_RefNannySetupContext("__setstate_cython__", 0);
|
|
|
|
- /* "View.MemoryView":983
|
|
- * return self.to_object_func(itemp)
|
|
- * else:
|
|
- * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
|
|
- *
|
|
- * cdef assign_item_from_object(self, char *itemp, object value):
|
|
+ /* "(tree fragment)":4
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
+ * def __setstate_cython__(self, __pyx_state):
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
|
|
*/
|
|
- /*else*/ {
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 983, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_r = __pyx_t_2;
|
|
- __pyx_t_2 = 0;
|
|
- goto __pyx_L0;
|
|
- }
|
|
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __PYX_ERR(2, 4, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":979
|
|
- * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
|
|
- *
|
|
- * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
|
|
- * if self.to_object_func != NULL:
|
|
- * return self.to_object_func(itemp)
|
|
+ /* "(tree fragment)":3
|
|
+ * def __reduce_cython__(self):
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
|
|
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
*/
|
|
|
|
/* function exit code */
|
|
__pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_2);
|
|
- __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = 0;
|
|
- __pyx_L0:;
|
|
+ __Pyx_XDECREF(__pyx_t_1);
|
|
+ __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
+ __pyx_r = NULL;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":985
|
|
- * return memoryview.convert_item_to_object(self, itemp)
|
|
+/* "View.MemoryView":1001
|
|
*
|
|
- * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
|
|
- * if self.to_dtype_func != NULL:
|
|
- * self.to_dtype_func(itemp, value)
|
|
+ * @cname('__pyx_memoryview_fromslice')
|
|
+ * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
|
|
+ * int ndim,
|
|
+ * object (*to_object_func)(char *),
|
|
*/
|
|
|
|
-static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
|
|
+static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
|
|
+ struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
|
|
+ Py_ssize_t __pyx_v_suboffset;
|
|
+ PyObject *__pyx_v_length = NULL;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
int __pyx_t_1;
|
|
- int __pyx_t_2;
|
|
+ PyObject *__pyx_t_2 = NULL;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
+ __Pyx_TypeInfo *__pyx_t_4;
|
|
+ Py_buffer __pyx_t_5;
|
|
+ Py_ssize_t *__pyx_t_6;
|
|
+ Py_ssize_t *__pyx_t_7;
|
|
+ Py_ssize_t *__pyx_t_8;
|
|
+ Py_ssize_t __pyx_t_9;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("assign_item_from_object", 0);
|
|
+ __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
|
|
|
|
- /* "View.MemoryView":986
|
|
+ /* "View.MemoryView":1009
|
|
+ * cdef _memoryviewslice result
|
|
+ *
|
|
+ * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
|
|
+ * return None
|
|
*
|
|
- * cdef assign_item_from_object(self, char *itemp, object value):
|
|
- * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
|
|
- * self.to_dtype_func(itemp, value)
|
|
- * else:
|
|
*/
|
|
- __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
|
|
+ __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":987
|
|
- * cdef assign_item_from_object(self, char *itemp, object value):
|
|
- * if self.to_dtype_func != NULL:
|
|
- * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
|
|
- * else:
|
|
- * memoryview.assign_item_from_object(self, itemp, value)
|
|
+ /* "View.MemoryView":1010
|
|
+ *
|
|
+ * if <PyObject *> memviewslice.memview == Py_None:
|
|
+ * return None # <<<<<<<<<<<<<<
|
|
+ *
|
|
+ *
|
|
*/
|
|
- __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 987, __pyx_L1_error)
|
|
+ __Pyx_XDECREF(__pyx_r);
|
|
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
+ goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":986
|
|
- *
|
|
- * cdef assign_item_from_object(self, char *itemp, object value):
|
|
- * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
|
|
- * self.to_dtype_func(itemp, value)
|
|
- * else:
|
|
- */
|
|
- goto __pyx_L3;
|
|
- }
|
|
-
|
|
- /* "View.MemoryView":989
|
|
- * self.to_dtype_func(itemp, value)
|
|
- * else:
|
|
- * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
|
|
- *
|
|
- * @property
|
|
- */
|
|
- /*else*/ {
|
|
- __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 989, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- }
|
|
- __pyx_L3:;
|
|
-
|
|
- /* "View.MemoryView":985
|
|
- * return memoryview.convert_item_to_object(self, itemp)
|
|
- *
|
|
- * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
|
|
- * if self.to_dtype_func != NULL:
|
|
- * self.to_dtype_func(itemp, value)
|
|
- */
|
|
-
|
|
- /* function exit code */
|
|
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
- goto __pyx_L0;
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_3);
|
|
- __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = 0;
|
|
- __pyx_L0:;
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-/* "View.MemoryView":992
|
|
- *
|
|
- * @property
|
|
- * def base(self): # <<<<<<<<<<<<<<
|
|
- * return self.from_object
|
|
- *
|
|
- */
|
|
-
|
|
-/* Python wrapper */
|
|
-static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
|
|
-static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
|
|
- PyObject *__pyx_r = 0;
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
|
|
- __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
|
|
-
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
|
|
- PyObject *__pyx_r = NULL;
|
|
- __Pyx_RefNannyDeclarations
|
|
- __Pyx_RefNannySetupContext("__get__", 0);
|
|
-
|
|
- /* "View.MemoryView":993
|
|
- * @property
|
|
- * def base(self):
|
|
- * return self.from_object # <<<<<<<<<<<<<<
|
|
- *
|
|
- * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
|
|
- */
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __Pyx_INCREF(__pyx_v_self->from_object);
|
|
- __pyx_r = __pyx_v_self->from_object;
|
|
- goto __pyx_L0;
|
|
-
|
|
- /* "View.MemoryView":992
|
|
- *
|
|
- * @property
|
|
- * def base(self): # <<<<<<<<<<<<<<
|
|
- * return self.from_object
|
|
- *
|
|
- */
|
|
-
|
|
- /* function exit code */
|
|
- __pyx_L0:;
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-/* "(tree fragment)":1
|
|
- * def __reduce_cython__(self): # <<<<<<<<<<<<<<
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
- * def __setstate_cython__(self, __pyx_state):
|
|
- */
|
|
-
|
|
-/* Python wrapper */
|
|
-static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
-static PyObject *__pyx_pw___pyx_memoryviewslice_1__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___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
|
|
-
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
|
|
- PyObject *__pyx_r = NULL;
|
|
- __Pyx_RefNannyDeclarations
|
|
- PyObject *__pyx_t_1 = NULL;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__reduce_cython__", 0);
|
|
-
|
|
- /* "(tree fragment)":2
|
|
- * def __reduce_cython__(self):
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
|
|
- * def __setstate_cython__(self, __pyx_state):
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
- */
|
|
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __Pyx_Raise(__pyx_t_1, 0, 0, 0);
|
|
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
- __PYX_ERR(2, 2, __pyx_L1_error)
|
|
-
|
|
- /* "(tree fragment)":1
|
|
- * def __reduce_cython__(self): # <<<<<<<<<<<<<<
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
- * def __setstate_cython__(self, __pyx_state):
|
|
- */
|
|
-
|
|
- /* function exit code */
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = NULL;
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-/* "(tree fragment)":3
|
|
- * def __reduce_cython__(self):
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
- * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
- */
|
|
-
|
|
-/* Python wrapper */
|
|
-static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
|
|
-static PyObject *__pyx_pw___pyx_memoryviewslice_3__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___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
|
|
-
|
|
- /* function exit code */
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-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) {
|
|
- PyObject *__pyx_r = NULL;
|
|
- __Pyx_RefNannyDeclarations
|
|
- PyObject *__pyx_t_1 = NULL;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("__setstate_cython__", 0);
|
|
-
|
|
- /* "(tree fragment)":4
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
- * def __setstate_cython__(self, __pyx_state):
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
|
|
- */
|
|
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_1);
|
|
- __Pyx_Raise(__pyx_t_1, 0, 0, 0);
|
|
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
- __PYX_ERR(2, 4, __pyx_L1_error)
|
|
-
|
|
- /* "(tree fragment)":3
|
|
- * def __reduce_cython__(self):
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
- * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
|
|
- * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
- */
|
|
-
|
|
- /* function exit code */
|
|
- __pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_1);
|
|
- __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
- __pyx_r = NULL;
|
|
- __Pyx_XGIVEREF(__pyx_r);
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return __pyx_r;
|
|
-}
|
|
-
|
|
-/* "View.MemoryView":999
|
|
- *
|
|
- * @cname('__pyx_memoryview_fromslice')
|
|
- * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
|
|
- * int ndim,
|
|
- * object (*to_object_func)(char *),
|
|
- */
|
|
-
|
|
-static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
|
|
- struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
|
|
- Py_ssize_t __pyx_v_suboffset;
|
|
- PyObject *__pyx_v_length = NULL;
|
|
- PyObject *__pyx_r = NULL;
|
|
- __Pyx_RefNannyDeclarations
|
|
- int __pyx_t_1;
|
|
- PyObject *__pyx_t_2 = NULL;
|
|
- PyObject *__pyx_t_3 = NULL;
|
|
- __Pyx_TypeInfo *__pyx_t_4;
|
|
- Py_buffer __pyx_t_5;
|
|
- Py_ssize_t *__pyx_t_6;
|
|
- Py_ssize_t *__pyx_t_7;
|
|
- Py_ssize_t *__pyx_t_8;
|
|
- Py_ssize_t __pyx_t_9;
|
|
- int __pyx_lineno = 0;
|
|
- const char *__pyx_filename = NULL;
|
|
- int __pyx_clineno = 0;
|
|
- __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
|
|
-
|
|
- /* "View.MemoryView":1007
|
|
- * cdef _memoryviewslice result
|
|
- *
|
|
- * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
|
|
- * return None
|
|
- *
|
|
- */
|
|
- __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
|
|
- if (__pyx_t_1) {
|
|
-
|
|
- /* "View.MemoryView":1008
|
|
- *
|
|
- * if <PyObject *> memviewslice.memview == Py_None:
|
|
- * return None # <<<<<<<<<<<<<<
|
|
- *
|
|
- *
|
|
- */
|
|
- __Pyx_XDECREF(__pyx_r);
|
|
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
- goto __pyx_L0;
|
|
-
|
|
- /* "View.MemoryView":1007
|
|
- * cdef _memoryviewslice result
|
|
+ /* "View.MemoryView":1009
|
|
+ * cdef _memoryviewslice result
|
|
*
|
|
* if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
|
|
* return None
|
|
@@ -15617,16 +14255,16 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1013
|
|
+ /* "View.MemoryView":1015
|
|
*
|
|
*
|
|
* result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
|
|
*
|
|
* result.from_slice = memviewslice
|
|
*/
|
|
- __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1015, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1013, __pyx_L1_error)
|
|
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1015, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_INCREF(Py_None);
|
|
__Pyx_GIVEREF(Py_None);
|
|
@@ -15637,13 +14275,13 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
__Pyx_GIVEREF(__pyx_t_2);
|
|
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
|
|
__pyx_t_2 = 0;
|
|
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1015, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
|
|
__pyx_t_2 = 0;
|
|
|
|
- /* "View.MemoryView":1015
|
|
+ /* "View.MemoryView":1017
|
|
* result = _memoryviewslice(None, 0, dtype_is_object)
|
|
*
|
|
* result.from_slice = memviewslice # <<<<<<<<<<<<<<
|
|
@@ -15652,7 +14290,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
__pyx_v_result->from_slice = __pyx_v_memviewslice;
|
|
|
|
- /* "View.MemoryView":1016
|
|
+ /* "View.MemoryView":1018
|
|
*
|
|
* result.from_slice = memviewslice
|
|
* __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
|
|
@@ -15661,14 +14299,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
__PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
|
|
|
|
- /* "View.MemoryView":1018
|
|
+ /* "View.MemoryView":1020
|
|
* __PYX_INC_MEMVIEW(&memviewslice, 1)
|
|
*
|
|
* result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
|
|
* result.typeinfo = memviewslice.memview.typeinfo
|
|
*
|
|
*/
|
|
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1018, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1020, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_GIVEREF(__pyx_t_2);
|
|
__Pyx_GOTREF(__pyx_v_result->from_object);
|
|
@@ -15676,7 +14314,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
__pyx_v_result->from_object = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
|
|
- /* "View.MemoryView":1019
|
|
+ /* "View.MemoryView":1021
|
|
*
|
|
* result.from_object = (<memoryview> memviewslice.memview).base
|
|
* result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
|
|
@@ -15686,7 +14324,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
__pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
|
|
__pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1021
|
|
+ /* "View.MemoryView":1023
|
|
* result.typeinfo = memviewslice.memview.typeinfo
|
|
*
|
|
* result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
|
|
@@ -15696,7 +14334,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
__pyx_t_5 = __pyx_v_memviewslice.memview->view;
|
|
__pyx_v_result->__pyx_base.view = __pyx_t_5;
|
|
|
|
- /* "View.MemoryView":1022
|
|
+ /* "View.MemoryView":1024
|
|
*
|
|
* result.view = memviewslice.memview.view
|
|
* result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
|
|
@@ -15705,7 +14343,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
__pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
|
|
|
|
- /* "View.MemoryView":1023
|
|
+ /* "View.MemoryView":1025
|
|
* result.view = memviewslice.memview.view
|
|
* result.view.buf = <void *> memviewslice.data
|
|
* result.view.ndim = ndim # <<<<<<<<<<<<<<
|
|
@@ -15714,7 +14352,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
__pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
|
|
|
|
- /* "View.MemoryView":1024
|
|
+ /* "View.MemoryView":1026
|
|
* result.view.buf = <void *> memviewslice.data
|
|
* result.view.ndim = ndim
|
|
* (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
|
|
@@ -15723,7 +14361,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
|
|
|
|
- /* "View.MemoryView":1025
|
|
+ /* "View.MemoryView":1027
|
|
* result.view.ndim = ndim
|
|
* (<__pyx_buffer *> &result.view).obj = Py_None
|
|
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
|
|
@@ -15732,7 +14370,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
Py_INCREF(Py_None);
|
|
|
|
- /* "View.MemoryView":1027
|
|
+ /* "View.MemoryView":1029
|
|
* Py_INCREF(Py_None)
|
|
*
|
|
* if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
|
|
@@ -15742,7 +14380,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
__pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":1028
|
|
+ /* "View.MemoryView":1030
|
|
*
|
|
* if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
|
|
* result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
|
|
@@ -15751,7 +14389,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
__pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
|
|
|
|
- /* "View.MemoryView":1027
|
|
+ /* "View.MemoryView":1029
|
|
* Py_INCREF(Py_None)
|
|
*
|
|
* if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
|
|
@@ -15761,7 +14399,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
goto __pyx_L4;
|
|
}
|
|
|
|
- /* "View.MemoryView":1030
|
|
+ /* "View.MemoryView":1032
|
|
* result.flags = PyBUF_RECORDS
|
|
* else:
|
|
* result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
|
|
@@ -15773,7 +14411,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
}
|
|
__pyx_L4:;
|
|
|
|
- /* "View.MemoryView":1032
|
|
+ /* "View.MemoryView":1034
|
|
* result.flags = PyBUF_RECORDS_RO
|
|
*
|
|
* result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
|
|
@@ -15782,7 +14420,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
__pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
|
|
|
|
- /* "View.MemoryView":1033
|
|
+ /* "View.MemoryView":1035
|
|
*
|
|
* result.view.shape = <Py_ssize_t *> result.from_slice.shape
|
|
* result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
|
|
@@ -15791,7 +14429,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
__pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
|
|
|
|
- /* "View.MemoryView":1036
|
|
+ /* "View.MemoryView":1038
|
|
*
|
|
*
|
|
* result.view.suboffsets = NULL # <<<<<<<<<<<<<<
|
|
@@ -15800,7 +14438,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
__pyx_v_result->__pyx_base.view.suboffsets = NULL;
|
|
|
|
- /* "View.MemoryView":1037
|
|
+ /* "View.MemoryView":1039
|
|
*
|
|
* result.view.suboffsets = NULL
|
|
* for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
|
|
@@ -15812,7 +14450,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
__pyx_t_6 = __pyx_t_8;
|
|
__pyx_v_suboffset = (__pyx_t_6[0]);
|
|
|
|
- /* "View.MemoryView":1038
|
|
+ /* "View.MemoryView":1040
|
|
* result.view.suboffsets = NULL
|
|
* for suboffset in result.from_slice.suboffsets[:ndim]:
|
|
* if suboffset >= 0: # <<<<<<<<<<<<<<
|
|
@@ -15822,7 +14460,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
__pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":1039
|
|
+ /* "View.MemoryView":1041
|
|
* for suboffset in result.from_slice.suboffsets[:ndim]:
|
|
* if suboffset >= 0:
|
|
* result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
|
|
@@ -15831,7 +14469,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
__pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
|
|
|
|
- /* "View.MemoryView":1040
|
|
+ /* "View.MemoryView":1042
|
|
* if suboffset >= 0:
|
|
* result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
|
|
* break # <<<<<<<<<<<<<<
|
|
@@ -15840,7 +14478,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
goto __pyx_L6_break;
|
|
|
|
- /* "View.MemoryView":1038
|
|
+ /* "View.MemoryView":1040
|
|
* result.view.suboffsets = NULL
|
|
* for suboffset in result.from_slice.suboffsets[:ndim]:
|
|
* if suboffset >= 0: # <<<<<<<<<<<<<<
|
|
@@ -15851,7 +14489,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
}
|
|
__pyx_L6_break:;
|
|
|
|
- /* "View.MemoryView":1042
|
|
+ /* "View.MemoryView":1044
|
|
* break
|
|
*
|
|
* result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
|
|
@@ -15861,7 +14499,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
__pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
|
|
__pyx_v_result->__pyx_base.view.len = __pyx_t_9;
|
|
|
|
- /* "View.MemoryView":1043
|
|
+ /* "View.MemoryView":1045
|
|
*
|
|
* result.view.len = result.view.itemsize
|
|
* for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
|
|
@@ -15871,29 +14509,29 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
__pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
|
|
for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
|
|
__pyx_t_6 = __pyx_t_8;
|
|
- __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1043, __pyx_L1_error)
|
|
+ __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1045, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
|
|
__pyx_t_2 = 0;
|
|
|
|
- /* "View.MemoryView":1044
|
|
+ /* "View.MemoryView":1046
|
|
* result.view.len = result.view.itemsize
|
|
* for length in result.view.shape[:ndim]:
|
|
* result.view.len *= length # <<<<<<<<<<<<<<
|
|
*
|
|
* result.to_object_func = to_object_func
|
|
*/
|
|
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1044, __pyx_L1_error)
|
|
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1046, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1044, __pyx_L1_error)
|
|
+ __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1046, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1044, __pyx_L1_error)
|
|
+ __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1046, __pyx_L1_error)
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__pyx_v_result->__pyx_base.view.len = __pyx_t_9;
|
|
}
|
|
|
|
- /* "View.MemoryView":1046
|
|
+ /* "View.MemoryView":1048
|
|
* result.view.len *= length
|
|
*
|
|
* result.to_object_func = to_object_func # <<<<<<<<<<<<<<
|
|
@@ -15902,7 +14540,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
__pyx_v_result->to_object_func = __pyx_v_to_object_func;
|
|
|
|
- /* "View.MemoryView":1047
|
|
+ /* "View.MemoryView":1049
|
|
*
|
|
* result.to_object_func = to_object_func
|
|
* result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
|
|
@@ -15911,7 +14549,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
*/
|
|
__pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
|
|
|
|
- /* "View.MemoryView":1049
|
|
+ /* "View.MemoryView":1051
|
|
* result.to_dtype_func = to_dtype_func
|
|
*
|
|
* return result # <<<<<<<<<<<<<<
|
|
@@ -15923,7 +14561,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
__pyx_r = ((PyObject *)__pyx_v_result);
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":999
|
|
+ /* "View.MemoryView":1001
|
|
*
|
|
* @cname('__pyx_memoryview_fromslice')
|
|
* cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
|
|
@@ -15945,7 +14583,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1052
|
|
+/* "View.MemoryView":1054
|
|
*
|
|
* @cname('__pyx_memoryview_get_slice_from_memoryview')
|
|
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
|
|
@@ -15965,7 +14603,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("get_slice_from_memview", 0);
|
|
|
|
- /* "View.MemoryView":1055
|
|
+ /* "View.MemoryView":1057
|
|
* __Pyx_memviewslice *mslice) except NULL:
|
|
* cdef _memoryviewslice obj
|
|
* if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
|
|
@@ -15976,20 +14614,20 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
|
|
__pyx_t_2 = (__pyx_t_1 != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1056
|
|
+ /* "View.MemoryView":1058
|
|
* cdef _memoryviewslice obj
|
|
* if isinstance(memview, _memoryviewslice):
|
|
* obj = memview # <<<<<<<<<<<<<<
|
|
* return &obj.from_slice
|
|
* else:
|
|
*/
|
|
- if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1056, __pyx_L1_error)
|
|
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1058, __pyx_L1_error)
|
|
__pyx_t_3 = ((PyObject *)__pyx_v_memview);
|
|
__Pyx_INCREF(__pyx_t_3);
|
|
__pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
|
|
__pyx_t_3 = 0;
|
|
|
|
- /* "View.MemoryView":1057
|
|
+ /* "View.MemoryView":1059
|
|
* if isinstance(memview, _memoryviewslice):
|
|
* obj = memview
|
|
* return &obj.from_slice # <<<<<<<<<<<<<<
|
|
@@ -15999,7 +14637,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
|
|
__pyx_r = (&__pyx_v_obj->from_slice);
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":1055
|
|
+ /* "View.MemoryView":1057
|
|
* __Pyx_memviewslice *mslice) except NULL:
|
|
* cdef _memoryviewslice obj
|
|
* if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
|
|
@@ -16008,7 +14646,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1059
|
|
+ /* "View.MemoryView":1061
|
|
* return &obj.from_slice
|
|
* else:
|
|
* slice_copy(memview, mslice) # <<<<<<<<<<<<<<
|
|
@@ -16018,7 +14656,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
|
|
/*else*/ {
|
|
__pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
|
|
|
|
- /* "View.MemoryView":1060
|
|
+ /* "View.MemoryView":1062
|
|
* else:
|
|
* slice_copy(memview, mslice)
|
|
* return mslice # <<<<<<<<<<<<<<
|
|
@@ -16029,7 +14667,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
|
|
goto __pyx_L0;
|
|
}
|
|
|
|
- /* "View.MemoryView":1052
|
|
+ /* "View.MemoryView":1054
|
|
*
|
|
* @cname('__pyx_memoryview_get_slice_from_memoryview')
|
|
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
|
|
@@ -16048,7 +14686,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1063
|
|
+/* "View.MemoryView":1065
|
|
*
|
|
* @cname('__pyx_memoryview_slice_copy')
|
|
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
|
|
@@ -16069,7 +14707,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
|
|
Py_ssize_t __pyx_t_5;
|
|
__Pyx_RefNannySetupContext("slice_copy", 0);
|
|
|
|
- /* "View.MemoryView":1067
|
|
+ /* "View.MemoryView":1069
|
|
* cdef (Py_ssize_t*) shape, strides, suboffsets
|
|
*
|
|
* shape = memview.view.shape # <<<<<<<<<<<<<<
|
|
@@ -16079,7 +14717,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
|
|
__pyx_t_1 = __pyx_v_memview->view.shape;
|
|
__pyx_v_shape = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":1068
|
|
+ /* "View.MemoryView":1070
|
|
*
|
|
* shape = memview.view.shape
|
|
* strides = memview.view.strides # <<<<<<<<<<<<<<
|
|
@@ -16089,7 +14727,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
|
|
__pyx_t_1 = __pyx_v_memview->view.strides;
|
|
__pyx_v_strides = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":1069
|
|
+ /* "View.MemoryView":1071
|
|
* shape = memview.view.shape
|
|
* strides = memview.view.strides
|
|
* suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
|
|
@@ -16099,7 +14737,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
|
|
__pyx_t_1 = __pyx_v_memview->view.suboffsets;
|
|
__pyx_v_suboffsets = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":1071
|
|
+ /* "View.MemoryView":1073
|
|
* suboffsets = memview.view.suboffsets
|
|
*
|
|
* dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
|
|
@@ -16108,7 +14746,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
|
|
*/
|
|
__pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
|
|
|
|
- /* "View.MemoryView":1072
|
|
+ /* "View.MemoryView":1074
|
|
*
|
|
* dst.memview = <__pyx_memoryview *> memview
|
|
* dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
|
|
@@ -16117,7 +14755,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
|
|
*/
|
|
__pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
|
|
|
|
- /* "View.MemoryView":1074
|
|
+ /* "View.MemoryView":1076
|
|
* dst.data = <char *> memview.view.buf
|
|
*
|
|
* for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
|
|
@@ -16129,7 +14767,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
|
|
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
|
|
__pyx_v_dim = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1075
|
|
+ /* "View.MemoryView":1077
|
|
*
|
|
* for dim in range(memview.view.ndim):
|
|
* dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
|
|
@@ -16138,7 +14776,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
|
|
*/
|
|
(__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
|
|
|
|
- /* "View.MemoryView":1076
|
|
+ /* "View.MemoryView":1078
|
|
* for dim in range(memview.view.ndim):
|
|
* dst.shape[dim] = shape[dim]
|
|
* dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
|
|
@@ -16147,7 +14785,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
|
|
*/
|
|
(__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
|
|
|
|
- /* "View.MemoryView":1077
|
|
+ /* "View.MemoryView":1079
|
|
* dst.shape[dim] = shape[dim]
|
|
* dst.strides[dim] = strides[dim]
|
|
* dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
|
|
@@ -16162,7 +14800,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
|
|
(__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
|
|
}
|
|
|
|
- /* "View.MemoryView":1063
|
|
+ /* "View.MemoryView":1065
|
|
*
|
|
* @cname('__pyx_memoryview_slice_copy')
|
|
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
|
|
@@ -16174,7 +14812,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
|
|
__Pyx_RefNannyFinishContext();
|
|
}
|
|
|
|
-/* "View.MemoryView":1080
|
|
+/* "View.MemoryView":1082
|
|
*
|
|
* @cname('__pyx_memoryview_copy_object')
|
|
* cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
|
|
@@ -16192,7 +14830,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("memoryview_copy", 0);
|
|
|
|
- /* "View.MemoryView":1083
|
|
+ /* "View.MemoryView":1085
|
|
* "Create a new memoryview object"
|
|
* cdef __Pyx_memviewslice memviewslice
|
|
* slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
|
|
@@ -16201,7 +14839,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
|
|
*/
|
|
__pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
|
|
|
|
- /* "View.MemoryView":1084
|
|
+ /* "View.MemoryView":1086
|
|
* cdef __Pyx_memviewslice memviewslice
|
|
* slice_copy(memview, &memviewslice)
|
|
* return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
|
|
@@ -16209,13 +14847,13 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
|
|
* @cname('__pyx_memoryview_copy_object_from_slice')
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
- __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1084, __pyx_L1_error)
|
|
+ __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1086, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_r = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":1080
|
|
+ /* "View.MemoryView":1082
|
|
*
|
|
* @cname('__pyx_memoryview_copy_object')
|
|
* cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
|
|
@@ -16234,7 +14872,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1087
|
|
+/* "View.MemoryView":1089
|
|
*
|
|
* @cname('__pyx_memoryview_copy_object_from_slice')
|
|
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
|
|
@@ -16257,7 +14895,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
|
|
|
|
- /* "View.MemoryView":1094
|
|
+ /* "View.MemoryView":1096
|
|
* cdef int (*to_dtype_func)(char *, object) except 0
|
|
*
|
|
* if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
|
|
@@ -16268,7 +14906,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
|
|
__pyx_t_2 = (__pyx_t_1 != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1095
|
|
+ /* "View.MemoryView":1097
|
|
*
|
|
* if isinstance(memview, _memoryviewslice):
|
|
* to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
|
|
@@ -16278,7 +14916,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
|
|
__pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
|
|
__pyx_v_to_object_func = __pyx_t_3;
|
|
|
|
- /* "View.MemoryView":1096
|
|
+ /* "View.MemoryView":1098
|
|
* if isinstance(memview, _memoryviewslice):
|
|
* to_object_func = (<_memoryviewslice> memview).to_object_func
|
|
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
|
|
@@ -16288,7 +14926,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
|
|
__pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
|
|
__pyx_v_to_dtype_func = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1094
|
|
+ /* "View.MemoryView":1096
|
|
* cdef int (*to_dtype_func)(char *, object) except 0
|
|
*
|
|
* if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
|
|
@@ -16298,7 +14936,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
- /* "View.MemoryView":1098
|
|
+ /* "View.MemoryView":1100
|
|
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
|
|
* else:
|
|
* to_object_func = NULL # <<<<<<<<<<<<<<
|
|
@@ -16308,7 +14946,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
|
|
/*else*/ {
|
|
__pyx_v_to_object_func = NULL;
|
|
|
|
- /* "View.MemoryView":1099
|
|
+ /* "View.MemoryView":1101
|
|
* else:
|
|
* to_object_func = NULL
|
|
* to_dtype_func = NULL # <<<<<<<<<<<<<<
|
|
@@ -16319,7 +14957,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
|
|
}
|
|
__pyx_L3:;
|
|
|
|
- /* "View.MemoryView":1101
|
|
+ /* "View.MemoryView":1103
|
|
* to_dtype_func = NULL
|
|
*
|
|
* return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
|
|
@@ -16328,20 +14966,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
|
|
- /* "View.MemoryView":1103
|
|
+ /* "View.MemoryView":1105
|
|
* return memoryview_fromslice(memviewslice[0], memview.view.ndim,
|
|
* to_object_func, to_dtype_func,
|
|
* memview.dtype_is_object) # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1101, __pyx_L1_error)
|
|
+ __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1103, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__pyx_r = __pyx_t_5;
|
|
__pyx_t_5 = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":1087
|
|
+ /* "View.MemoryView":1089
|
|
*
|
|
* @cname('__pyx_memoryview_copy_object_from_slice')
|
|
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
|
|
@@ -16360,7 +14998,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1109
|
|
+/* "View.MemoryView":1111
|
|
*
|
|
*
|
|
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
|
|
@@ -16372,7 +15010,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
|
|
Py_ssize_t __pyx_r;
|
|
int __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":1110
|
|
+ /* "View.MemoryView":1112
|
|
*
|
|
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
|
|
* if arg < 0: # <<<<<<<<<<<<<<
|
|
@@ -16382,7 +15020,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
|
|
__pyx_t_1 = ((__pyx_v_arg < 0) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":1111
|
|
+ /* "View.MemoryView":1113
|
|
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
|
|
* if arg < 0:
|
|
* return -arg # <<<<<<<<<<<<<<
|
|
@@ -16392,7 +15030,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
|
|
__pyx_r = (-__pyx_v_arg);
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":1110
|
|
+ /* "View.MemoryView":1112
|
|
*
|
|
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
|
|
* if arg < 0: # <<<<<<<<<<<<<<
|
|
@@ -16401,7 +15039,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1113
|
|
+ /* "View.MemoryView":1115
|
|
* return -arg
|
|
* else:
|
|
* return arg # <<<<<<<<<<<<<<
|
|
@@ -16413,7 +15051,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
|
|
goto __pyx_L0;
|
|
}
|
|
|
|
- /* "View.MemoryView":1109
|
|
+ /* "View.MemoryView":1111
|
|
*
|
|
*
|
|
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
|
|
@@ -16426,7 +15064,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1116
|
|
+/* "View.MemoryView":1118
|
|
*
|
|
* @cname('__pyx_get_best_slice_order')
|
|
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
|
|
@@ -16444,7 +15082,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
int __pyx_t_3;
|
|
int __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1121
|
|
+ /* "View.MemoryView":1123
|
|
* """
|
|
* cdef int i
|
|
* cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
|
|
@@ -16453,7 +15091,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
*/
|
|
__pyx_v_c_stride = 0;
|
|
|
|
- /* "View.MemoryView":1122
|
|
+ /* "View.MemoryView":1124
|
|
* cdef int i
|
|
* cdef Py_ssize_t c_stride = 0
|
|
* cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
|
|
@@ -16462,7 +15100,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
*/
|
|
__pyx_v_f_stride = 0;
|
|
|
|
- /* "View.MemoryView":1124
|
|
+ /* "View.MemoryView":1126
|
|
* cdef Py_ssize_t f_stride = 0
|
|
*
|
|
* for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
|
|
@@ -16472,7 +15110,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
|
|
__pyx_v_i = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":1125
|
|
+ /* "View.MemoryView":1127
|
|
*
|
|
* for i in range(ndim - 1, -1, -1):
|
|
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
|
|
@@ -16482,7 +15120,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
__pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1126
|
|
+ /* "View.MemoryView":1128
|
|
* for i in range(ndim - 1, -1, -1):
|
|
* if mslice.shape[i] > 1:
|
|
* c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
|
|
@@ -16491,7 +15129,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
*/
|
|
__pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
|
|
|
|
- /* "View.MemoryView":1127
|
|
+ /* "View.MemoryView":1129
|
|
* if mslice.shape[i] > 1:
|
|
* c_stride = mslice.strides[i]
|
|
* break # <<<<<<<<<<<<<<
|
|
@@ -16500,7 +15138,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
*/
|
|
goto __pyx_L4_break;
|
|
|
|
- /* "View.MemoryView":1125
|
|
+ /* "View.MemoryView":1127
|
|
*
|
|
* for i in range(ndim - 1, -1, -1):
|
|
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
|
|
@@ -16511,7 +15149,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
}
|
|
__pyx_L4_break:;
|
|
|
|
- /* "View.MemoryView":1129
|
|
+ /* "View.MemoryView":1131
|
|
* break
|
|
*
|
|
* for i in range(ndim): # <<<<<<<<<<<<<<
|
|
@@ -16523,7 +15161,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
|
|
__pyx_v_i = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1130
|
|
+ /* "View.MemoryView":1132
|
|
*
|
|
* for i in range(ndim):
|
|
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
|
|
@@ -16533,7 +15171,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
__pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1131
|
|
+ /* "View.MemoryView":1133
|
|
* for i in range(ndim):
|
|
* if mslice.shape[i] > 1:
|
|
* f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
|
|
@@ -16542,7 +15180,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
*/
|
|
__pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
|
|
|
|
- /* "View.MemoryView":1132
|
|
+ /* "View.MemoryView":1134
|
|
* if mslice.shape[i] > 1:
|
|
* f_stride = mslice.strides[i]
|
|
* break # <<<<<<<<<<<<<<
|
|
@@ -16551,7 +15189,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
*/
|
|
goto __pyx_L7_break;
|
|
|
|
- /* "View.MemoryView":1130
|
|
+ /* "View.MemoryView":1132
|
|
*
|
|
* for i in range(ndim):
|
|
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
|
|
@@ -16562,7 +15200,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
}
|
|
__pyx_L7_break:;
|
|
|
|
- /* "View.MemoryView":1134
|
|
+ /* "View.MemoryView":1136
|
|
* break
|
|
*
|
|
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
|
|
@@ -16572,7 +15210,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
__pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1135
|
|
+ /* "View.MemoryView":1137
|
|
*
|
|
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
|
|
* return 'C' # <<<<<<<<<<<<<<
|
|
@@ -16582,7 +15220,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
__pyx_r = 'C';
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":1134
|
|
+ /* "View.MemoryView":1136
|
|
* break
|
|
*
|
|
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
|
|
@@ -16591,7 +15229,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1137
|
|
+ /* "View.MemoryView":1139
|
|
* return 'C'
|
|
* else:
|
|
* return 'F' # <<<<<<<<<<<<<<
|
|
@@ -16603,7 +15241,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
goto __pyx_L0;
|
|
}
|
|
|
|
- /* "View.MemoryView":1116
|
|
+ /* "View.MemoryView":1118
|
|
*
|
|
* @cname('__pyx_get_best_slice_order')
|
|
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
|
|
@@ -16616,7 +15254,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1140
|
|
+/* "View.MemoryView":1142
|
|
*
|
|
* @cython.cdivision(True)
|
|
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
|
|
@@ -16637,7 +15275,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
Py_ssize_t __pyx_t_5;
|
|
Py_ssize_t __pyx_t_6;
|
|
|
|
- /* "View.MemoryView":1147
|
|
+ /* "View.MemoryView":1149
|
|
*
|
|
* cdef Py_ssize_t i
|
|
* cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
|
|
@@ -16646,7 +15284,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
*/
|
|
__pyx_v_src_extent = (__pyx_v_src_shape[0]);
|
|
|
|
- /* "View.MemoryView":1148
|
|
+ /* "View.MemoryView":1150
|
|
* cdef Py_ssize_t i
|
|
* cdef Py_ssize_t src_extent = src_shape[0]
|
|
* cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
|
|
@@ -16655,7 +15293,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
*/
|
|
__pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
|
|
|
|
- /* "View.MemoryView":1149
|
|
+ /* "View.MemoryView":1151
|
|
* cdef Py_ssize_t src_extent = src_shape[0]
|
|
* cdef Py_ssize_t dst_extent = dst_shape[0]
|
|
* cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
|
|
@@ -16664,7 +15302,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
*/
|
|
__pyx_v_src_stride = (__pyx_v_src_strides[0]);
|
|
|
|
- /* "View.MemoryView":1150
|
|
+ /* "View.MemoryView":1152
|
|
* cdef Py_ssize_t dst_extent = dst_shape[0]
|
|
* cdef Py_ssize_t src_stride = src_strides[0]
|
|
* cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
|
|
@@ -16673,7 +15311,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
*/
|
|
__pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
|
|
|
|
- /* "View.MemoryView":1152
|
|
+ /* "View.MemoryView":1154
|
|
* cdef Py_ssize_t dst_stride = dst_strides[0]
|
|
*
|
|
* if ndim == 1: # <<<<<<<<<<<<<<
|
|
@@ -16683,7 +15321,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
__pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":1153
|
|
+ /* "View.MemoryView":1155
|
|
*
|
|
* if ndim == 1:
|
|
* if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
|
|
@@ -16703,7 +15341,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
goto __pyx_L5_bool_binop_done;
|
|
}
|
|
|
|
- /* "View.MemoryView":1154
|
|
+ /* "View.MemoryView":1156
|
|
* if ndim == 1:
|
|
* if (src_stride > 0 and dst_stride > 0 and
|
|
* <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
|
|
@@ -16718,7 +15356,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
__pyx_t_1 = __pyx_t_3;
|
|
__pyx_L5_bool_binop_done:;
|
|
|
|
- /* "View.MemoryView":1153
|
|
+ /* "View.MemoryView":1155
|
|
*
|
|
* if ndim == 1:
|
|
* if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
|
|
@@ -16727,7 +15365,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
*/
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":1155
|
|
+ /* "View.MemoryView":1157
|
|
* if (src_stride > 0 and dst_stride > 0 and
|
|
* <size_t> src_stride == itemsize == <size_t> dst_stride):
|
|
* memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
|
|
@@ -16736,7 +15374,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
*/
|
|
(void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
|
|
|
|
- /* "View.MemoryView":1153
|
|
+ /* "View.MemoryView":1155
|
|
*
|
|
* if ndim == 1:
|
|
* if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
|
|
@@ -16746,7 +15384,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
goto __pyx_L4;
|
|
}
|
|
|
|
- /* "View.MemoryView":1157
|
|
+ /* "View.MemoryView":1159
|
|
* memcpy(dst_data, src_data, itemsize * dst_extent)
|
|
* else:
|
|
* for i in range(dst_extent): # <<<<<<<<<<<<<<
|
|
@@ -16759,7 +15397,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
|
|
__pyx_v_i = __pyx_t_6;
|
|
|
|
- /* "View.MemoryView":1158
|
|
+ /* "View.MemoryView":1160
|
|
* else:
|
|
* for i in range(dst_extent):
|
|
* memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
|
|
@@ -16768,7 +15406,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
*/
|
|
(void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
|
|
|
|
- /* "View.MemoryView":1159
|
|
+ /* "View.MemoryView":1161
|
|
* for i in range(dst_extent):
|
|
* memcpy(dst_data, src_data, itemsize)
|
|
* src_data += src_stride # <<<<<<<<<<<<<<
|
|
@@ -16777,7 +15415,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
*/
|
|
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
|
|
|
|
- /* "View.MemoryView":1160
|
|
+ /* "View.MemoryView":1162
|
|
* memcpy(dst_data, src_data, itemsize)
|
|
* src_data += src_stride
|
|
* dst_data += dst_stride # <<<<<<<<<<<<<<
|
|
@@ -16789,7 +15427,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
}
|
|
__pyx_L4:;
|
|
|
|
- /* "View.MemoryView":1152
|
|
+ /* "View.MemoryView":1154
|
|
* cdef Py_ssize_t dst_stride = dst_strides[0]
|
|
*
|
|
* if ndim == 1: # <<<<<<<<<<<<<<
|
|
@@ -16799,7 +15437,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
- /* "View.MemoryView":1162
|
|
+ /* "View.MemoryView":1164
|
|
* dst_data += dst_stride
|
|
* else:
|
|
* for i in range(dst_extent): # <<<<<<<<<<<<<<
|
|
@@ -16812,7 +15450,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
|
|
__pyx_v_i = __pyx_t_6;
|
|
|
|
- /* "View.MemoryView":1163
|
|
+ /* "View.MemoryView":1165
|
|
* else:
|
|
* for i in range(dst_extent):
|
|
* _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
|
|
@@ -16821,7 +15459,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
*/
|
|
_copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
|
|
|
|
- /* "View.MemoryView":1167
|
|
+ /* "View.MemoryView":1169
|
|
* src_shape + 1, dst_shape + 1,
|
|
* ndim - 1, itemsize)
|
|
* src_data += src_stride # <<<<<<<<<<<<<<
|
|
@@ -16830,7 +15468,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
*/
|
|
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
|
|
|
|
- /* "View.MemoryView":1168
|
|
+ /* "View.MemoryView":1170
|
|
* ndim - 1, itemsize)
|
|
* src_data += src_stride
|
|
* dst_data += dst_stride # <<<<<<<<<<<<<<
|
|
@@ -16842,7 +15480,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
}
|
|
__pyx_L3:;
|
|
|
|
- /* "View.MemoryView":1140
|
|
+ /* "View.MemoryView":1142
|
|
*
|
|
* @cython.cdivision(True)
|
|
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
|
|
@@ -16853,7 +15491,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
/* function exit code */
|
|
}
|
|
|
|
-/* "View.MemoryView":1170
|
|
+/* "View.MemoryView":1172
|
|
* dst_data += dst_stride
|
|
*
|
|
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
|
|
@@ -16863,7 +15501,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
|
|
|
|
static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
|
|
|
|
- /* "View.MemoryView":1173
|
|
+ /* "View.MemoryView":1175
|
|
* __Pyx_memviewslice *dst,
|
|
* int ndim, size_t itemsize) nogil:
|
|
* _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
|
|
@@ -16872,7 +15510,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi
|
|
*/
|
|
_copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
|
|
|
|
- /* "View.MemoryView":1170
|
|
+ /* "View.MemoryView":1172
|
|
* dst_data += dst_stride
|
|
*
|
|
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
|
|
@@ -16883,7 +15521,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi
|
|
/* function exit code */
|
|
}
|
|
|
|
-/* "View.MemoryView":1177
|
|
+/* "View.MemoryView":1179
|
|
*
|
|
* @cname('__pyx_memoryview_slice_get_size')
|
|
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
|
|
@@ -16900,7 +15538,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
|
|
Py_ssize_t *__pyx_t_3;
|
|
Py_ssize_t *__pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1179
|
|
+ /* "View.MemoryView":1181
|
|
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
|
|
* "Return the size of the memory occupied by the slice in number of bytes"
|
|
* cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
|
|
@@ -16910,7 +15548,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
|
|
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
|
|
__pyx_v_size = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":1181
|
|
+ /* "View.MemoryView":1183
|
|
* cdef Py_ssize_t shape, size = src.memview.view.itemsize
|
|
*
|
|
* for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
|
|
@@ -16922,7 +15560,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
|
|
__pyx_t_2 = __pyx_t_4;
|
|
__pyx_v_shape = (__pyx_t_2[0]);
|
|
|
|
- /* "View.MemoryView":1182
|
|
+ /* "View.MemoryView":1184
|
|
*
|
|
* for shape in src.shape[:ndim]:
|
|
* size *= shape # <<<<<<<<<<<<<<
|
|
@@ -16932,7 +15570,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
|
|
__pyx_v_size = (__pyx_v_size * __pyx_v_shape);
|
|
}
|
|
|
|
- /* "View.MemoryView":1184
|
|
+ /* "View.MemoryView":1186
|
|
* size *= shape
|
|
*
|
|
* return size # <<<<<<<<<<<<<<
|
|
@@ -16942,7 +15580,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
|
|
__pyx_r = __pyx_v_size;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":1177
|
|
+ /* "View.MemoryView":1179
|
|
*
|
|
* @cname('__pyx_memoryview_slice_get_size')
|
|
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
|
|
@@ -16955,7 +15593,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1187
|
|
+/* "View.MemoryView":1189
|
|
*
|
|
* @cname('__pyx_fill_contig_strides_array')
|
|
* cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
|
|
@@ -16971,7 +15609,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
|
|
int __pyx_t_3;
|
|
int __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1196
|
|
+ /* "View.MemoryView":1198
|
|
* cdef int idx
|
|
*
|
|
* if order == 'F': # <<<<<<<<<<<<<<
|
|
@@ -16981,7 +15619,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
|
|
__pyx_t_1 = ((__pyx_v_order == 'F') != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":1197
|
|
+ /* "View.MemoryView":1199
|
|
*
|
|
* if order == 'F':
|
|
* for idx in range(ndim): # <<<<<<<<<<<<<<
|
|
@@ -16993,7 +15631,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
|
|
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
|
|
__pyx_v_idx = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1198
|
|
+ /* "View.MemoryView":1200
|
|
* if order == 'F':
|
|
* for idx in range(ndim):
|
|
* strides[idx] = stride # <<<<<<<<<<<<<<
|
|
@@ -17002,7 +15640,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
|
|
*/
|
|
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
|
|
|
|
- /* "View.MemoryView":1199
|
|
+ /* "View.MemoryView":1201
|
|
* for idx in range(ndim):
|
|
* strides[idx] = stride
|
|
* stride *= shape[idx] # <<<<<<<<<<<<<<
|
|
@@ -17012,7 +15650,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
|
|
__pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
|
|
}
|
|
|
|
- /* "View.MemoryView":1196
|
|
+ /* "View.MemoryView":1198
|
|
* cdef int idx
|
|
*
|
|
* if order == 'F': # <<<<<<<<<<<<<<
|
|
@@ -17022,7 +15660,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
- /* "View.MemoryView":1201
|
|
+ /* "View.MemoryView":1203
|
|
* stride *= shape[idx]
|
|
* else:
|
|
* for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
|
|
@@ -17033,7 +15671,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
|
|
for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
|
|
__pyx_v_idx = __pyx_t_2;
|
|
|
|
- /* "View.MemoryView":1202
|
|
+ /* "View.MemoryView":1204
|
|
* else:
|
|
* for idx in range(ndim - 1, -1, -1):
|
|
* strides[idx] = stride # <<<<<<<<<<<<<<
|
|
@@ -17042,7 +15680,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
|
|
*/
|
|
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
|
|
|
|
- /* "View.MemoryView":1203
|
|
+ /* "View.MemoryView":1205
|
|
* for idx in range(ndim - 1, -1, -1):
|
|
* strides[idx] = stride
|
|
* stride *= shape[idx] # <<<<<<<<<<<<<<
|
|
@@ -17054,7 +15692,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
|
|
}
|
|
__pyx_L3:;
|
|
|
|
- /* "View.MemoryView":1205
|
|
+ /* "View.MemoryView":1207
|
|
* stride *= shape[idx]
|
|
*
|
|
* return stride # <<<<<<<<<<<<<<
|
|
@@ -17064,7 +15702,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
|
|
__pyx_r = __pyx_v_stride;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":1187
|
|
+ /* "View.MemoryView":1189
|
|
*
|
|
* @cname('__pyx_fill_contig_strides_array')
|
|
* cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
|
|
@@ -17077,7 +15715,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1208
|
|
+/* "View.MemoryView":1210
|
|
*
|
|
* @cname('__pyx_memoryview_copy_data_to_temp')
|
|
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
|
|
@@ -17101,7 +15739,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
|
|
- /* "View.MemoryView":1219
|
|
+ /* "View.MemoryView":1221
|
|
* cdef void *result
|
|
*
|
|
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
|
|
@@ -17111,7 +15749,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
|
|
__pyx_v_itemsize = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":1220
|
|
+ /* "View.MemoryView":1222
|
|
*
|
|
* cdef size_t itemsize = src.memview.view.itemsize
|
|
* cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
|
|
@@ -17120,7 +15758,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
*/
|
|
__pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
|
|
|
|
- /* "View.MemoryView":1222
|
|
+ /* "View.MemoryView":1224
|
|
* cdef size_t size = slice_get_size(src, ndim)
|
|
*
|
|
* result = malloc(size) # <<<<<<<<<<<<<<
|
|
@@ -17129,7 +15767,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
*/
|
|
__pyx_v_result = malloc(__pyx_v_size);
|
|
|
|
- /* "View.MemoryView":1223
|
|
+ /* "View.MemoryView":1225
|
|
*
|
|
* result = malloc(size)
|
|
* if not result: # <<<<<<<<<<<<<<
|
|
@@ -17139,16 +15777,16 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
__pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1224
|
|
+ /* "View.MemoryView":1226
|
|
* result = malloc(size)
|
|
* if not result:
|
|
* _err(MemoryError, NULL) # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1224, __pyx_L1_error)
|
|
+ __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1226, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":1223
|
|
+ /* "View.MemoryView":1225
|
|
*
|
|
* result = malloc(size)
|
|
* if not result: # <<<<<<<<<<<<<<
|
|
@@ -17157,7 +15795,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1227
|
|
+ /* "View.MemoryView":1229
|
|
*
|
|
*
|
|
* tmpslice.data = <char *> result # <<<<<<<<<<<<<<
|
|
@@ -17166,7 +15804,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
*/
|
|
__pyx_v_tmpslice->data = ((char *)__pyx_v_result);
|
|
|
|
- /* "View.MemoryView":1228
|
|
+ /* "View.MemoryView":1230
|
|
*
|
|
* tmpslice.data = <char *> result
|
|
* tmpslice.memview = src.memview # <<<<<<<<<<<<<<
|
|
@@ -17176,7 +15814,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
__pyx_t_4 = __pyx_v_src->memview;
|
|
__pyx_v_tmpslice->memview = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1229
|
|
+ /* "View.MemoryView":1231
|
|
* tmpslice.data = <char *> result
|
|
* tmpslice.memview = src.memview
|
|
* for i in range(ndim): # <<<<<<<<<<<<<<
|
|
@@ -17188,7 +15826,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
|
|
__pyx_v_i = __pyx_t_6;
|
|
|
|
- /* "View.MemoryView":1230
|
|
+ /* "View.MemoryView":1232
|
|
* tmpslice.memview = src.memview
|
|
* for i in range(ndim):
|
|
* tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
|
|
@@ -17197,7 +15835,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
*/
|
|
(__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
|
|
|
|
- /* "View.MemoryView":1231
|
|
+ /* "View.MemoryView":1233
|
|
* for i in range(ndim):
|
|
* tmpslice.shape[i] = src.shape[i]
|
|
* tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
|
|
@@ -17207,7 +15845,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
(__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
|
|
}
|
|
|
|
- /* "View.MemoryView":1233
|
|
+ /* "View.MemoryView":1235
|
|
* tmpslice.suboffsets[i] = -1
|
|
*
|
|
* fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
|
|
@@ -17216,7 +15854,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
*/
|
|
(void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
|
|
|
|
- /* "View.MemoryView":1237
|
|
+ /* "View.MemoryView":1239
|
|
*
|
|
*
|
|
* for i in range(ndim): # <<<<<<<<<<<<<<
|
|
@@ -17228,7 +15866,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
|
|
__pyx_v_i = __pyx_t_6;
|
|
|
|
- /* "View.MemoryView":1238
|
|
+ /* "View.MemoryView":1240
|
|
*
|
|
* for i in range(ndim):
|
|
* if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
|
|
@@ -17238,7 +15876,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
__pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1239
|
|
+ /* "View.MemoryView":1241
|
|
* for i in range(ndim):
|
|
* if tmpslice.shape[i] == 1:
|
|
* tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
|
|
@@ -17247,7 +15885,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
*/
|
|
(__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
|
|
|
|
- /* "View.MemoryView":1238
|
|
+ /* "View.MemoryView":1240
|
|
*
|
|
* for i in range(ndim):
|
|
* if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
|
|
@@ -17257,7 +15895,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
}
|
|
}
|
|
|
|
- /* "View.MemoryView":1241
|
|
+ /* "View.MemoryView":1243
|
|
* tmpslice.strides[i] = 0
|
|
*
|
|
* if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
|
|
@@ -17267,7 +15905,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
__pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1242
|
|
+ /* "View.MemoryView":1244
|
|
*
|
|
* if slice_is_contig(src[0], order, ndim):
|
|
* memcpy(result, src.data, size) # <<<<<<<<<<<<<<
|
|
@@ -17276,7 +15914,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
*/
|
|
(void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
|
|
|
|
- /* "View.MemoryView":1241
|
|
+ /* "View.MemoryView":1243
|
|
* tmpslice.strides[i] = 0
|
|
*
|
|
* if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
|
|
@@ -17286,7 +15924,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
goto __pyx_L9;
|
|
}
|
|
|
|
- /* "View.MemoryView":1244
|
|
+ /* "View.MemoryView":1246
|
|
* memcpy(result, src.data, size)
|
|
* else:
|
|
* copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
|
|
@@ -17298,7 +15936,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
}
|
|
__pyx_L9:;
|
|
|
|
- /* "View.MemoryView":1246
|
|
+ /* "View.MemoryView":1248
|
|
* copy_strided_to_strided(src, tmpslice, ndim, itemsize)
|
|
*
|
|
* return result # <<<<<<<<<<<<<<
|
|
@@ -17308,7 +15946,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
__pyx_r = __pyx_v_result;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":1208
|
|
+ /* "View.MemoryView":1210
|
|
*
|
|
* @cname('__pyx_memoryview_copy_data_to_temp')
|
|
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
|
|
@@ -17332,7 +15970,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1251
|
|
+/* "View.MemoryView":1253
|
|
*
|
|
* @cname('__pyx_memoryview_err_extents')
|
|
* cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
|
|
@@ -17355,20 +15993,20 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
|
|
#endif
|
|
__Pyx_RefNannySetupContext("_err_extents", 0);
|
|
|
|
- /* "View.MemoryView":1254
|
|
+ /* "View.MemoryView":1256
|
|
* Py_ssize_t extent2) except -1 with gil:
|
|
* raise ValueError("got differing extents in dimension %d (got %d and %d)" %
|
|
* (i, extent1, extent2)) # <<<<<<<<<<<<<<
|
|
*
|
|
* @cname('__pyx_memoryview_err_dim')
|
|
*/
|
|
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1254, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1256, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1254, __pyx_L1_error)
|
|
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1256, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1254, __pyx_L1_error)
|
|
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1256, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1254, __pyx_L1_error)
|
|
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1256, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__Pyx_GIVEREF(__pyx_t_1);
|
|
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
|
|
@@ -17380,24 +16018,24 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
|
|
__pyx_t_2 = 0;
|
|
__pyx_t_3 = 0;
|
|
|
|
- /* "View.MemoryView":1253
|
|
+ /* "View.MemoryView":1255
|
|
* cdef int _err_extents(int i, Py_ssize_t extent1,
|
|
* Py_ssize_t extent2) except -1 with gil:
|
|
* raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
|
|
* (i, extent1, extent2))
|
|
*
|
|
*/
|
|
- __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1253, __pyx_L1_error)
|
|
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1255, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1253, __pyx_L1_error)
|
|
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1255, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- __PYX_ERR(2, 1253, __pyx_L1_error)
|
|
+ __PYX_ERR(2, 1255, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":1251
|
|
+ /* "View.MemoryView":1253
|
|
*
|
|
* @cname('__pyx_memoryview_err_extents')
|
|
* cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
|
|
@@ -17420,7 +16058,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1257
|
|
+/* "View.MemoryView":1259
|
|
*
|
|
* @cname('__pyx_memoryview_err_dim')
|
|
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
|
|
@@ -17444,18 +16082,18 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
|
|
__Pyx_RefNannySetupContext("_err_dim", 0);
|
|
__Pyx_INCREF(__pyx_v_error);
|
|
|
|
- /* "View.MemoryView":1258
|
|
+ /* "View.MemoryView":1260
|
|
* @cname('__pyx_memoryview_err_dim')
|
|
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
|
|
* raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
|
|
*
|
|
* @cname('__pyx_memoryview_err')
|
|
*/
|
|
- __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1258, __pyx_L1_error)
|
|
+ __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1260, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1258, __pyx_L1_error)
|
|
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1260, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
- __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1258, __pyx_L1_error)
|
|
+ __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1260, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
@@ -17473,14 +16111,14 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
|
|
__pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
|
|
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1258, __pyx_L1_error)
|
|
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1260, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
- __PYX_ERR(2, 1258, __pyx_L1_error)
|
|
+ __PYX_ERR(2, 1260, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":1257
|
|
+ /* "View.MemoryView":1259
|
|
*
|
|
* @cname('__pyx_memoryview_err_dim')
|
|
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
|
|
@@ -17504,7 +16142,7 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1261
|
|
+/* "View.MemoryView":1263
|
|
*
|
|
* @cname('__pyx_memoryview_err')
|
|
* cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
|
|
@@ -17529,7 +16167,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
|
|
__Pyx_RefNannySetupContext("_err", 0);
|
|
__Pyx_INCREF(__pyx_v_error);
|
|
|
|
- /* "View.MemoryView":1262
|
|
+ /* "View.MemoryView":1264
|
|
* @cname('__pyx_memoryview_err')
|
|
* cdef int _err(object error, char *msg) except -1 with gil:
|
|
* if msg != NULL: # <<<<<<<<<<<<<<
|
|
@@ -17539,14 +16177,14 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
|
|
__pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
|
|
if (unlikely(__pyx_t_1)) {
|
|
|
|
- /* "View.MemoryView":1263
|
|
+ /* "View.MemoryView":1265
|
|
* cdef int _err(object error, char *msg) except -1 with gil:
|
|
* if msg != NULL:
|
|
* raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
|
|
* else:
|
|
* raise error
|
|
*/
|
|
- __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1263, __pyx_L1_error)
|
|
+ __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1265, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_INCREF(__pyx_v_error);
|
|
__pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
|
|
@@ -17562,14 +16200,14 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
|
|
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
|
|
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
- if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1263, __pyx_L1_error)
|
|
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1265, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __PYX_ERR(2, 1263, __pyx_L1_error)
|
|
+ __PYX_ERR(2, 1265, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":1262
|
|
+ /* "View.MemoryView":1264
|
|
* @cname('__pyx_memoryview_err')
|
|
* cdef int _err(object error, char *msg) except -1 with gil:
|
|
* if msg != NULL: # <<<<<<<<<<<<<<
|
|
@@ -17578,7 +16216,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1265
|
|
+ /* "View.MemoryView":1267
|
|
* raise error(msg.decode('ascii'))
|
|
* else:
|
|
* raise error # <<<<<<<<<<<<<<
|
|
@@ -17587,10 +16225,10 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
|
|
*/
|
|
/*else*/ {
|
|
__Pyx_Raise(__pyx_v_error, 0, 0, 0);
|
|
- __PYX_ERR(2, 1265, __pyx_L1_error)
|
|
+ __PYX_ERR(2, 1267, __pyx_L1_error)
|
|
}
|
|
|
|
- /* "View.MemoryView":1261
|
|
+ /* "View.MemoryView":1263
|
|
*
|
|
* @cname('__pyx_memoryview_err')
|
|
* cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
|
|
@@ -17614,7 +16252,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1268
|
|
+/* "View.MemoryView":1270
|
|
*
|
|
* @cname('__pyx_memoryview_copy_contents')
|
|
* cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
|
|
@@ -17644,7 +16282,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
|
|
- /* "View.MemoryView":1276
|
|
+ /* "View.MemoryView":1278
|
|
* Check for overlapping memory and verify the shapes.
|
|
* """
|
|
* cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
|
|
@@ -17653,7 +16291,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_v_tmpdata = NULL;
|
|
|
|
- /* "View.MemoryView":1277
|
|
+ /* "View.MemoryView":1279
|
|
* """
|
|
* cdef void *tmpdata = NULL
|
|
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
|
|
@@ -17663,7 +16301,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_1 = __pyx_v_src.memview->view.itemsize;
|
|
__pyx_v_itemsize = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":1279
|
|
+ /* "View.MemoryView":1281
|
|
* cdef size_t itemsize = src.memview.view.itemsize
|
|
* cdef int i
|
|
* cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
|
|
@@ -17672,7 +16310,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
|
|
|
|
- /* "View.MemoryView":1280
|
|
+ /* "View.MemoryView":1282
|
|
* cdef int i
|
|
* cdef char order = get_best_order(&src, src_ndim)
|
|
* cdef bint broadcasting = False # <<<<<<<<<<<<<<
|
|
@@ -17681,7 +16319,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_v_broadcasting = 0;
|
|
|
|
- /* "View.MemoryView":1281
|
|
+ /* "View.MemoryView":1283
|
|
* cdef char order = get_best_order(&src, src_ndim)
|
|
* cdef bint broadcasting = False
|
|
* cdef bint direct_copy = False # <<<<<<<<<<<<<<
|
|
@@ -17690,7 +16328,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_v_direct_copy = 0;
|
|
|
|
- /* "View.MemoryView":1284
|
|
+ /* "View.MemoryView":1286
|
|
* cdef __Pyx_memviewslice tmp
|
|
*
|
|
* if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
|
|
@@ -17700,7 +16338,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1285
|
|
+ /* "View.MemoryView":1287
|
|
*
|
|
* if src_ndim < dst_ndim:
|
|
* broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
|
|
@@ -17709,7 +16347,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
|
|
|
|
- /* "View.MemoryView":1284
|
|
+ /* "View.MemoryView":1286
|
|
* cdef __Pyx_memviewslice tmp
|
|
*
|
|
* if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
|
|
@@ -17719,7 +16357,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
- /* "View.MemoryView":1286
|
|
+ /* "View.MemoryView":1288
|
|
* if src_ndim < dst_ndim:
|
|
* broadcast_leading(&src, src_ndim, dst_ndim)
|
|
* elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
|
|
@@ -17729,7 +16367,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1287
|
|
+ /* "View.MemoryView":1289
|
|
* broadcast_leading(&src, src_ndim, dst_ndim)
|
|
* elif dst_ndim < src_ndim:
|
|
* broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
|
|
@@ -17738,7 +16376,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
|
|
|
|
- /* "View.MemoryView":1286
|
|
+ /* "View.MemoryView":1288
|
|
* if src_ndim < dst_ndim:
|
|
* broadcast_leading(&src, src_ndim, dst_ndim)
|
|
* elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
|
|
@@ -17748,7 +16386,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
}
|
|
__pyx_L3:;
|
|
|
|
- /* "View.MemoryView":1289
|
|
+ /* "View.MemoryView":1291
|
|
* broadcast_leading(&dst, dst_ndim, src_ndim)
|
|
*
|
|
* cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
|
|
@@ -17764,7 +16402,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
}
|
|
__pyx_v_ndim = __pyx_t_5;
|
|
|
|
- /* "View.MemoryView":1291
|
|
+ /* "View.MemoryView":1293
|
|
* cdef int ndim = max(src_ndim, dst_ndim)
|
|
*
|
|
* for i in range(ndim): # <<<<<<<<<<<<<<
|
|
@@ -17776,7 +16414,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
|
|
__pyx_v_i = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1292
|
|
+ /* "View.MemoryView":1294
|
|
*
|
|
* for i in range(ndim):
|
|
* if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
|
|
@@ -17786,7 +16424,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1293
|
|
+ /* "View.MemoryView":1295
|
|
* for i in range(ndim):
|
|
* if src.shape[i] != dst.shape[i]:
|
|
* if src.shape[i] == 1: # <<<<<<<<<<<<<<
|
|
@@ -17796,7 +16434,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1294
|
|
+ /* "View.MemoryView":1296
|
|
* if src.shape[i] != dst.shape[i]:
|
|
* if src.shape[i] == 1:
|
|
* broadcasting = True # <<<<<<<<<<<<<<
|
|
@@ -17805,7 +16443,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_v_broadcasting = 1;
|
|
|
|
- /* "View.MemoryView":1295
|
|
+ /* "View.MemoryView":1297
|
|
* if src.shape[i] == 1:
|
|
* broadcasting = True
|
|
* src.strides[i] = 0 # <<<<<<<<<<<<<<
|
|
@@ -17814,7 +16452,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
(__pyx_v_src.strides[__pyx_v_i]) = 0;
|
|
|
|
- /* "View.MemoryView":1293
|
|
+ /* "View.MemoryView":1295
|
|
* for i in range(ndim):
|
|
* if src.shape[i] != dst.shape[i]:
|
|
* if src.shape[i] == 1: # <<<<<<<<<<<<<<
|
|
@@ -17824,7 +16462,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
goto __pyx_L7;
|
|
}
|
|
|
|
- /* "View.MemoryView":1297
|
|
+ /* "View.MemoryView":1299
|
|
* src.strides[i] = 0
|
|
* else:
|
|
* _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
|
|
@@ -17832,11 +16470,11 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
* if src.suboffsets[i] >= 0:
|
|
*/
|
|
/*else*/ {
|
|
- __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1297, __pyx_L1_error)
|
|
+ __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1299, __pyx_L1_error)
|
|
}
|
|
__pyx_L7:;
|
|
|
|
- /* "View.MemoryView":1292
|
|
+ /* "View.MemoryView":1294
|
|
*
|
|
* for i in range(ndim):
|
|
* if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
|
|
@@ -17845,7 +16483,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1299
|
|
+ /* "View.MemoryView":1301
|
|
* _err_extents(i, dst.shape[i], src.shape[i])
|
|
*
|
|
* if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
|
|
@@ -17855,16 +16493,16 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1300
|
|
+ /* "View.MemoryView":1302
|
|
*
|
|
* if src.suboffsets[i] >= 0:
|
|
* _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
|
|
*
|
|
* if slices_overlap(&src, &dst, ndim, itemsize):
|
|
*/
|
|
- __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1300, __pyx_L1_error)
|
|
+ __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1302, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":1299
|
|
+ /* "View.MemoryView":1301
|
|
* _err_extents(i, dst.shape[i], src.shape[i])
|
|
*
|
|
* if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
|
|
@@ -17874,7 +16512,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
}
|
|
}
|
|
|
|
- /* "View.MemoryView":1302
|
|
+ /* "View.MemoryView":1304
|
|
* _err_dim(ValueError, "Dimension %d is not direct", i)
|
|
*
|
|
* if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
|
|
@@ -17884,7 +16522,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1304
|
|
+ /* "View.MemoryView":1306
|
|
* if slices_overlap(&src, &dst, ndim, itemsize):
|
|
*
|
|
* if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
|
|
@@ -17894,7 +16532,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1305
|
|
+ /* "View.MemoryView":1307
|
|
*
|
|
* if not slice_is_contig(src, order, ndim):
|
|
* order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
|
|
@@ -17903,7 +16541,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
|
|
|
|
- /* "View.MemoryView":1304
|
|
+ /* "View.MemoryView":1306
|
|
* if slices_overlap(&src, &dst, ndim, itemsize):
|
|
*
|
|
* if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
|
|
@@ -17912,17 +16550,17 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1307
|
|
+ /* "View.MemoryView":1309
|
|
* order = get_best_order(&dst, ndim)
|
|
*
|
|
* tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
|
|
* src = tmp
|
|
*
|
|
*/
|
|
- __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(2, 1307, __pyx_L1_error)
|
|
+ __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(2, 1309, __pyx_L1_error)
|
|
__pyx_v_tmpdata = __pyx_t_7;
|
|
|
|
- /* "View.MemoryView":1308
|
|
+ /* "View.MemoryView":1310
|
|
*
|
|
* tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
|
|
* src = tmp # <<<<<<<<<<<<<<
|
|
@@ -17931,7 +16569,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_v_src = __pyx_v_tmp;
|
|
|
|
- /* "View.MemoryView":1302
|
|
+ /* "View.MemoryView":1304
|
|
* _err_dim(ValueError, "Dimension %d is not direct", i)
|
|
*
|
|
* if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
|
|
@@ -17940,7 +16578,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1310
|
|
+ /* "View.MemoryView":1312
|
|
* src = tmp
|
|
*
|
|
* if not broadcasting: # <<<<<<<<<<<<<<
|
|
@@ -17950,7 +16588,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1313
|
|
+ /* "View.MemoryView":1315
|
|
*
|
|
*
|
|
* if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
|
|
@@ -17960,7 +16598,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1314
|
|
+ /* "View.MemoryView":1316
|
|
*
|
|
* if slice_is_contig(src, 'C', ndim):
|
|
* direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
|
|
@@ -17969,7 +16607,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
|
|
|
|
- /* "View.MemoryView":1313
|
|
+ /* "View.MemoryView":1315
|
|
*
|
|
*
|
|
* if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
|
|
@@ -17979,7 +16617,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
goto __pyx_L12;
|
|
}
|
|
|
|
- /* "View.MemoryView":1315
|
|
+ /* "View.MemoryView":1317
|
|
* if slice_is_contig(src, 'C', ndim):
|
|
* direct_copy = slice_is_contig(dst, 'C', ndim)
|
|
* elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
|
|
@@ -17989,7 +16627,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1316
|
|
+ /* "View.MemoryView":1318
|
|
* direct_copy = slice_is_contig(dst, 'C', ndim)
|
|
* elif slice_is_contig(src, 'F', ndim):
|
|
* direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
|
|
@@ -17998,7 +16636,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
|
|
|
|
- /* "View.MemoryView":1315
|
|
+ /* "View.MemoryView":1317
|
|
* if slice_is_contig(src, 'C', ndim):
|
|
* direct_copy = slice_is_contig(dst, 'C', ndim)
|
|
* elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
|
|
@@ -18008,7 +16646,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
}
|
|
__pyx_L12:;
|
|
|
|
- /* "View.MemoryView":1318
|
|
+ /* "View.MemoryView":1320
|
|
* direct_copy = slice_is_contig(dst, 'F', ndim)
|
|
*
|
|
* if direct_copy: # <<<<<<<<<<<<<<
|
|
@@ -18018,7 +16656,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_2 = (__pyx_v_direct_copy != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
- /* "View.MemoryView":1320
|
|
+ /* "View.MemoryView":1322
|
|
* if direct_copy:
|
|
*
|
|
* refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
|
|
@@ -18027,7 +16665,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
|
|
|
|
- /* "View.MemoryView":1321
|
|
+ /* "View.MemoryView":1323
|
|
*
|
|
* refcount_copying(&dst, dtype_is_object, ndim, False)
|
|
* memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
|
|
@@ -18036,7 +16674,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
(void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
|
|
|
|
- /* "View.MemoryView":1322
|
|
+ /* "View.MemoryView":1324
|
|
* refcount_copying(&dst, dtype_is_object, ndim, False)
|
|
* memcpy(dst.data, src.data, slice_get_size(&src, ndim))
|
|
* refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
|
|
@@ -18045,7 +16683,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
|
|
|
|
- /* "View.MemoryView":1323
|
|
+ /* "View.MemoryView":1325
|
|
* memcpy(dst.data, src.data, slice_get_size(&src, ndim))
|
|
* refcount_copying(&dst, dtype_is_object, ndim, True)
|
|
* free(tmpdata) # <<<<<<<<<<<<<<
|
|
@@ -18054,7 +16692,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
free(__pyx_v_tmpdata);
|
|
|
|
- /* "View.MemoryView":1324
|
|
+ /* "View.MemoryView":1326
|
|
* refcount_copying(&dst, dtype_is_object, ndim, True)
|
|
* free(tmpdata)
|
|
* return 0 # <<<<<<<<<<<<<<
|
|
@@ -18064,7 +16702,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_r = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":1318
|
|
+ /* "View.MemoryView":1320
|
|
* direct_copy = slice_is_contig(dst, 'F', ndim)
|
|
*
|
|
* if direct_copy: # <<<<<<<<<<<<<<
|
|
@@ -18073,7 +16711,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1310
|
|
+ /* "View.MemoryView":1312
|
|
* src = tmp
|
|
*
|
|
* if not broadcasting: # <<<<<<<<<<<<<<
|
|
@@ -18082,7 +16720,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1326
|
|
+ /* "View.MemoryView":1328
|
|
* return 0
|
|
*
|
|
* if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
|
|
@@ -18096,25 +16734,25 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_t_8 = (__pyx_t_2 != 0);
|
|
if (__pyx_t_8) {
|
|
|
|
- /* "View.MemoryView":1329
|
|
+ /* "View.MemoryView":1331
|
|
*
|
|
*
|
|
* transpose_memslice(&src) # <<<<<<<<<<<<<<
|
|
* transpose_memslice(&dst)
|
|
*
|
|
*/
|
|
- __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1329, __pyx_L1_error)
|
|
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1331, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":1330
|
|
+ /* "View.MemoryView":1332
|
|
*
|
|
* transpose_memslice(&src)
|
|
* transpose_memslice(&dst) # <<<<<<<<<<<<<<
|
|
*
|
|
* refcount_copying(&dst, dtype_is_object, ndim, False)
|
|
*/
|
|
- __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1330, __pyx_L1_error)
|
|
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1332, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":1326
|
|
+ /* "View.MemoryView":1328
|
|
* return 0
|
|
*
|
|
* if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
|
|
@@ -18123,7 +16761,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1332
|
|
+ /* "View.MemoryView":1334
|
|
* transpose_memslice(&dst)
|
|
*
|
|
* refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
|
|
@@ -18132,7 +16770,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
|
|
|
|
- /* "View.MemoryView":1333
|
|
+ /* "View.MemoryView":1335
|
|
*
|
|
* refcount_copying(&dst, dtype_is_object, ndim, False)
|
|
* copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
|
|
@@ -18141,7 +16779,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
|
|
|
|
- /* "View.MemoryView":1334
|
|
+ /* "View.MemoryView":1336
|
|
* refcount_copying(&dst, dtype_is_object, ndim, False)
|
|
* copy_strided_to_strided(&src, &dst, ndim, itemsize)
|
|
* refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
|
|
@@ -18150,7 +16788,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
|
|
|
|
- /* "View.MemoryView":1336
|
|
+ /* "View.MemoryView":1338
|
|
* refcount_copying(&dst, dtype_is_object, ndim, True)
|
|
*
|
|
* free(tmpdata) # <<<<<<<<<<<<<<
|
|
@@ -18159,7 +16797,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
*/
|
|
free(__pyx_v_tmpdata);
|
|
|
|
- /* "View.MemoryView":1337
|
|
+ /* "View.MemoryView":1339
|
|
*
|
|
* free(tmpdata)
|
|
* return 0 # <<<<<<<<<<<<<<
|
|
@@ -18169,7 +16807,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
__pyx_r = 0;
|
|
goto __pyx_L0;
|
|
|
|
- /* "View.MemoryView":1268
|
|
+ /* "View.MemoryView":1270
|
|
*
|
|
* @cname('__pyx_memoryview_copy_contents')
|
|
* cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
|
|
@@ -18193,7 +16831,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
|
|
return __pyx_r;
|
|
}
|
|
|
|
-/* "View.MemoryView":1340
|
|
+/* "View.MemoryView":1342
|
|
*
|
|
* @cname('__pyx_memoryview_broadcast_leading')
|
|
* cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
|
|
@@ -18208,7 +16846,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic
|
|
int __pyx_t_2;
|
|
int __pyx_t_3;
|
|
|
|
- /* "View.MemoryView":1344
|
|
+ /* "View.MemoryView":1346
|
|
* int ndim_other) nogil:
|
|
* cdef int i
|
|
* cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
|
|
@@ -18217,7 +16855,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic
|
|
*/
|
|
__pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
|
|
|
|
- /* "View.MemoryView":1346
|
|
+ /* "View.MemoryView":1348
|
|
* cdef int offset = ndim_other - ndim
|
|
*
|
|
* for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
|
|
@@ -18227,7 +16865,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic
|
|
for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
|
|
__pyx_v_i = __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":1347
|
|
+ /* "View.MemoryView":1349
|
|
*
|
|
* for i in range(ndim - 1, -1, -1):
|
|
* mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
|
|
@@ -18236,7 +16874,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic
|
|
*/
|
|
(__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
|
|
|
|
- /* "View.MemoryView":1348
|
|
+ /* "View.MemoryView":1350
|
|
* for i in range(ndim - 1, -1, -1):
|
|
* mslice.shape[i + offset] = mslice.shape[i]
|
|
* mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
|
|
@@ -18245,7 +16883,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic
|
|
*/
|
|
(__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
|
|
|
|
- /* "View.MemoryView":1349
|
|
+ /* "View.MemoryView":1351
|
|
* mslice.shape[i + offset] = mslice.shape[i]
|
|
* mslice.strides[i + offset] = mslice.strides[i]
|
|
* mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
|
|
@@ -18255,7 +16893,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic
|
|
(__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
|
|
}
|
|
|
|
- /* "View.MemoryView":1351
|
|
+ /* "View.MemoryView":1353
|
|
* mslice.suboffsets[i + offset] = mslice.suboffsets[i]
|
|
*
|
|
* for i in range(offset): # <<<<<<<<<<<<<<
|
|
@@ -18267,7 +16905,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic
|
|
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
|
|
__pyx_v_i = __pyx_t_3;
|
|
|
|
- /* "View.MemoryView":1352
|
|
+ /* "View.MemoryView":1354
|
|
*
|
|
* for i in range(offset):
|
|
* mslice.shape[i] = 1 # <<<<<<<<<<<<<<
|
|
@@ -18276,7 +16914,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic
|
|
*/
|
|
(__pyx_v_mslice->shape[__pyx_v_i]) = 1;
|
|
|
|
- /* "View.MemoryView":1353
|
|
+ /* "View.MemoryView":1355
|
|
* for i in range(offset):
|
|
* mslice.shape[i] = 1
|
|
* mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
|
|
@@ -18285,7 +16923,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic
|
|
*/
|
|
(__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
|
|
|
|
- /* "View.MemoryView":1354
|
|
+ /* "View.MemoryView":1356
|
|
* mslice.shape[i] = 1
|
|
* mslice.strides[i] = mslice.strides[0]
|
|
* mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
|
|
@@ -18295,7 +16933,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic
|
|
(__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
|
|
}
|
|
|
|
- /* "View.MemoryView":1340
|
|
+ /* "View.MemoryView":1342
|
|
*
|
|
* @cname('__pyx_memoryview_broadcast_leading')
|
|
* cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
|
|
@@ -18306,7 +16944,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic
|
|
/* function exit code */
|
|
}
|
|
|
|
-/* "View.MemoryView":1362
|
|
+/* "View.MemoryView":1364
|
|
*
|
|
* @cname('__pyx_memoryview_refcount_copying')
|
|
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
|
|
@@ -18317,7 +16955,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic
|
|
static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
|
|
int __pyx_t_1;
|
|
|
|
- /* "View.MemoryView":1366
|
|
+ /* "View.MemoryView":1368
|
|
*
|
|
*
|
|
* if dtype_is_object: # <<<<<<<<<<<<<<
|
|
@@ -18327,7 +16965,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
|
|
__pyx_t_1 = (__pyx_v_dtype_is_object != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":1367
|
|
+ /* "View.MemoryView":1369
|
|
*
|
|
* if dtype_is_object:
|
|
* refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
|
|
@@ -18336,7 +16974,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
|
|
*/
|
|
__pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
|
|
|
|
- /* "View.MemoryView":1366
|
|
+ /* "View.MemoryView":1368
|
|
*
|
|
*
|
|
* if dtype_is_object: # <<<<<<<<<<<<<<
|
|
@@ -18345,7 +16983,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
|
|
*/
|
|
}
|
|
|
|
- /* "View.MemoryView":1362
|
|
+ /* "View.MemoryView":1364
|
|
*
|
|
* @cname('__pyx_memoryview_refcount_copying')
|
|
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
|
|
@@ -18356,7 +16994,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
|
|
/* function exit code */
|
|
}
|
|
|
|
-/* "View.MemoryView":1371
|
|
+/* "View.MemoryView":1373
|
|
*
|
|
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
|
|
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
|
|
@@ -18371,7 +17009,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
|
|
#endif
|
|
__Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
|
|
|
|
- /* "View.MemoryView":1374
|
|
+ /* "View.MemoryView":1376
|
|
* Py_ssize_t *strides, int ndim,
|
|
* bint inc) with gil:
|
|
* refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
|
|
@@ -18380,7 +17018,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
|
|
*/
|
|
__pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
|
|
|
|
- /* "View.MemoryView":1371
|
|
+ /* "View.MemoryView":1373
|
|
*
|
|
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
|
|
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
|
|
@@ -18395,7 +17033,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
|
|
#endif
|
|
}
|
|
|
|
-/* "View.MemoryView":1377
|
|
+/* "View.MemoryView":1379
|
|
*
|
|
* @cname('__pyx_memoryview_refcount_objects_in_slice')
|
|
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
|
|
@@ -18412,7 +17050,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
int __pyx_t_4;
|
|
__Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
|
|
|
|
- /* "View.MemoryView":1381
|
|
+ /* "View.MemoryView":1383
|
|
* cdef Py_ssize_t i
|
|
*
|
|
* for i in range(shape[0]): # <<<<<<<<<<<<<<
|
|
@@ -18424,7 +17062,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
|
|
__pyx_v_i = __pyx_t_3;
|
|
|
|
- /* "View.MemoryView":1382
|
|
+ /* "View.MemoryView":1384
|
|
*
|
|
* for i in range(shape[0]):
|
|
* if ndim == 1: # <<<<<<<<<<<<<<
|
|
@@ -18434,7 +17072,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
__pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
|
|
if (__pyx_t_4) {
|
|
|
|
- /* "View.MemoryView":1383
|
|
+ /* "View.MemoryView":1385
|
|
* for i in range(shape[0]):
|
|
* if ndim == 1:
|
|
* if inc: # <<<<<<<<<<<<<<
|
|
@@ -18444,7 +17082,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
__pyx_t_4 = (__pyx_v_inc != 0);
|
|
if (__pyx_t_4) {
|
|
|
|
- /* "View.MemoryView":1384
|
|
+ /* "View.MemoryView":1386
|
|
* if ndim == 1:
|
|
* if inc:
|
|
* Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
|
|
@@ -18453,7 +17091,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
*/
|
|
Py_INCREF((((PyObject **)__pyx_v_data)[0]));
|
|
|
|
- /* "View.MemoryView":1383
|
|
+ /* "View.MemoryView":1385
|
|
* for i in range(shape[0]):
|
|
* if ndim == 1:
|
|
* if inc: # <<<<<<<<<<<<<<
|
|
@@ -18463,7 +17101,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
goto __pyx_L6;
|
|
}
|
|
|
|
- /* "View.MemoryView":1386
|
|
+ /* "View.MemoryView":1388
|
|
* Py_INCREF((<PyObject **> data)[0])
|
|
* else:
|
|
* Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
|
|
@@ -18475,7 +17113,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
}
|
|
__pyx_L6:;
|
|
|
|
- /* "View.MemoryView":1382
|
|
+ /* "View.MemoryView":1384
|
|
*
|
|
* for i in range(shape[0]):
|
|
* if ndim == 1: # <<<<<<<<<<<<<<
|
|
@@ -18485,7 +17123,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
goto __pyx_L5;
|
|
}
|
|
|
|
- /* "View.MemoryView":1388
|
|
+ /* "View.MemoryView":1390
|
|
* Py_DECREF((<PyObject **> data)[0])
|
|
* else:
|
|
* refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
|
|
@@ -18494,7 +17132,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
*/
|
|
/*else*/ {
|
|
|
|
- /* "View.MemoryView":1389
|
|
+ /* "View.MemoryView":1391
|
|
* else:
|
|
* refcount_objects_in_slice(data, shape + 1, strides + 1,
|
|
* ndim - 1, inc) # <<<<<<<<<<<<<<
|
|
@@ -18505,7 +17143,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
}
|
|
__pyx_L5:;
|
|
|
|
- /* "View.MemoryView":1391
|
|
+ /* "View.MemoryView":1393
|
|
* ndim - 1, inc)
|
|
*
|
|
* data += strides[0] # <<<<<<<<<<<<<<
|
|
@@ -18515,7 +17153,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
__pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
|
|
}
|
|
|
|
- /* "View.MemoryView":1377
|
|
+ /* "View.MemoryView":1379
|
|
*
|
|
* @cname('__pyx_memoryview_refcount_objects_in_slice')
|
|
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
|
|
@@ -18527,7 +17165,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
__Pyx_RefNannyFinishContext();
|
|
}
|
|
|
|
-/* "View.MemoryView":1397
|
|
+/* "View.MemoryView":1399
|
|
*
|
|
* @cname('__pyx_memoryview_slice_assign_scalar')
|
|
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
|
|
@@ -18537,7 +17175,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
|
|
|
|
static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
|
|
|
|
- /* "View.MemoryView":1400
|
|
+ /* "View.MemoryView":1402
|
|
* size_t itemsize, void *item,
|
|
* bint dtype_is_object) nogil:
|
|
* refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
|
|
@@ -18546,7 +17184,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
|
|
*/
|
|
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
|
|
|
|
- /* "View.MemoryView":1401
|
|
+ /* "View.MemoryView":1403
|
|
* bint dtype_is_object) nogil:
|
|
* refcount_copying(dst, dtype_is_object, ndim, False)
|
|
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
|
|
@@ -18555,7 +17193,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
|
|
*/
|
|
__pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
|
|
|
|
- /* "View.MemoryView":1403
|
|
+ /* "View.MemoryView":1405
|
|
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
|
|
* itemsize, item)
|
|
* refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
|
|
@@ -18564,7 +17202,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
|
|
*/
|
|
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
|
|
|
|
- /* "View.MemoryView":1397
|
|
+ /* "View.MemoryView":1399
|
|
*
|
|
* @cname('__pyx_memoryview_slice_assign_scalar')
|
|
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
|
|
@@ -18575,7 +17213,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
|
|
/* function exit code */
|
|
}
|
|
|
|
-/* "View.MemoryView":1407
|
|
+/* "View.MemoryView":1409
|
|
*
|
|
* @cname('__pyx_memoryview__slice_assign_scalar')
|
|
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
|
|
@@ -18592,7 +17230,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
|
|
Py_ssize_t __pyx_t_3;
|
|
Py_ssize_t __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1411
|
|
+ /* "View.MemoryView":1413
|
|
* size_t itemsize, void *item) nogil:
|
|
* cdef Py_ssize_t i
|
|
* cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
|
|
@@ -18601,7 +17239,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
|
|
*/
|
|
__pyx_v_stride = (__pyx_v_strides[0]);
|
|
|
|
- /* "View.MemoryView":1412
|
|
+ /* "View.MemoryView":1414
|
|
* cdef Py_ssize_t i
|
|
* cdef Py_ssize_t stride = strides[0]
|
|
* cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
|
|
@@ -18610,7 +17248,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
|
|
*/
|
|
__pyx_v_extent = (__pyx_v_shape[0]);
|
|
|
|
- /* "View.MemoryView":1414
|
|
+ /* "View.MemoryView":1416
|
|
* cdef Py_ssize_t extent = shape[0]
|
|
*
|
|
* if ndim == 1: # <<<<<<<<<<<<<<
|
|
@@ -18620,7 +17258,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
|
|
__pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
- /* "View.MemoryView":1415
|
|
+ /* "View.MemoryView":1417
|
|
*
|
|
* if ndim == 1:
|
|
* for i in range(extent): # <<<<<<<<<<<<<<
|
|
@@ -18632,7 +17270,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
|
|
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
|
|
__pyx_v_i = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1416
|
|
+ /* "View.MemoryView":1418
|
|
* if ndim == 1:
|
|
* for i in range(extent):
|
|
* memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
|
|
@@ -18641,7 +17279,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
|
|
*/
|
|
(void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
|
|
|
|
- /* "View.MemoryView":1417
|
|
+ /* "View.MemoryView":1419
|
|
* for i in range(extent):
|
|
* memcpy(data, item, itemsize)
|
|
* data += stride # <<<<<<<<<<<<<<
|
|
@@ -18651,7 +17289,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
|
|
__pyx_v_data = (__pyx_v_data + __pyx_v_stride);
|
|
}
|
|
|
|
- /* "View.MemoryView":1414
|
|
+ /* "View.MemoryView":1416
|
|
* cdef Py_ssize_t extent = shape[0]
|
|
*
|
|
* if ndim == 1: # <<<<<<<<<<<<<<
|
|
@@ -18661,7 +17299,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
- /* "View.MemoryView":1419
|
|
+ /* "View.MemoryView":1421
|
|
* data += stride
|
|
* else:
|
|
* for i in range(extent): # <<<<<<<<<<<<<<
|
|
@@ -18674,7 +17312,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
|
|
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
|
|
__pyx_v_i = __pyx_t_4;
|
|
|
|
- /* "View.MemoryView":1420
|
|
+ /* "View.MemoryView":1422
|
|
* else:
|
|
* for i in range(extent):
|
|
* _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
|
|
@@ -18683,7 +17321,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
|
|
*/
|
|
__pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
|
|
|
|
- /* "View.MemoryView":1422
|
|
+ /* "View.MemoryView":1424
|
|
* _slice_assign_scalar(data, shape + 1, strides + 1,
|
|
* ndim - 1, itemsize, item)
|
|
* data += stride # <<<<<<<<<<<<<<
|
|
@@ -18695,7 +17333,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
|
|
}
|
|
__pyx_L3:;
|
|
|
|
- /* "View.MemoryView":1407
|
|
+ /* "View.MemoryView":1409
|
|
*
|
|
* @cname('__pyx_memoryview__slice_assign_scalar')
|
|
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
|
|
@@ -18793,12 +17431,12 @@ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSE
|
|
PyObject *__pyx_v___pyx_result = 0;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
- int __pyx_t_1;
|
|
- PyObject *__pyx_t_2 = NULL;
|
|
- PyObject *__pyx_t_3 = NULL;
|
|
+ PyObject *__pyx_t_1 = NULL;
|
|
+ int __pyx_t_2;
|
|
+ int __pyx_t_3;
|
|
PyObject *__pyx_t_4 = NULL;
|
|
PyObject *__pyx_t_5 = NULL;
|
|
- int __pyx_t_6;
|
|
+ PyObject *__pyx_t_6 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
@@ -18807,114 +17445,118 @@ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSE
|
|
/* "(tree fragment)":4
|
|
* cdef object __pyx_PickleError
|
|
* cdef object __pyx_result
|
|
- * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
|
|
+ * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
|
|
* from pickle import PickleError as __pyx_PickleError
|
|
- * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
|
|
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
|
|
*/
|
|
- __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
|
|
- if (__pyx_t_1) {
|
|
+ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__22, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 4, __pyx_L1_error)
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __pyx_t_3 = (__pyx_t_2 != 0);
|
|
+ if (__pyx_t_3) {
|
|
|
|
/* "(tree fragment)":5
|
|
* cdef object __pyx_result
|
|
- * if __pyx_checksum != 0xb068931:
|
|
+ * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
|
|
* from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
|
|
- * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
|
|
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
|
|
* __pyx_result = Enum.__new__(__pyx_type)
|
|
*/
|
|
- __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_INCREF(__pyx_n_s_PickleError);
|
|
__Pyx_GIVEREF(__pyx_n_s_PickleError);
|
|
- PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
|
|
- __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __Pyx_INCREF(__pyx_t_2);
|
|
- __pyx_v___pyx_PickleError = __pyx_t_2;
|
|
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
|
|
+ __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __Pyx_INCREF(__pyx_t_1);
|
|
+ __pyx_v___pyx_PickleError = __pyx_t_1;
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
|
|
/* "(tree fragment)":6
|
|
- * if __pyx_checksum != 0xb068931:
|
|
+ * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
|
|
* from pickle import PickleError as __pyx_PickleError
|
|
- * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
|
|
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
|
|
* __pyx_result = Enum.__new__(__pyx_type)
|
|
* if __pyx_state is not None:
|
|
*/
|
|
- __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_4);
|
|
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
+ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 6, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_5);
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__Pyx_INCREF(__pyx_v___pyx_PickleError);
|
|
- __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
|
|
- 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_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
|
|
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
|
|
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
|
|
+ if (likely(__pyx_t_6)) {
|
|
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
|
|
+ __Pyx_INCREF(__pyx_t_6);
|
|
__Pyx_INCREF(function);
|
|
- __Pyx_DECREF_SET(__pyx_t_2, function);
|
|
+ __Pyx_DECREF_SET(__pyx_t_1, function);
|
|
}
|
|
}
|
|
- __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
|
|
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
+ __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
|
|
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__PYX_ERR(2, 6, __pyx_L1_error)
|
|
|
|
/* "(tree fragment)":4
|
|
* cdef object __pyx_PickleError
|
|
* cdef object __pyx_result
|
|
- * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
|
|
+ * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
|
|
* from pickle import PickleError as __pyx_PickleError
|
|
- * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
|
|
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
|
|
*/
|
|
}
|
|
|
|
/* "(tree fragment)":7
|
|
* from pickle import PickleError as __pyx_PickleError
|
|
- * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
|
|
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
|
|
* __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
|
|
* if __pyx_state is not None:
|
|
* __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
|
|
*/
|
|
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_2);
|
|
- __pyx_t_4 = NULL;
|
|
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
|
|
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
|
|
- if (likely(__pyx_t_4)) {
|
|
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
|
|
- __Pyx_INCREF(__pyx_t_4);
|
|
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 7, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_1);
|
|
+ __pyx_t_5 = NULL;
|
|
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
|
|
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
|
|
+ if (likely(__pyx_t_5)) {
|
|
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
|
|
+ __Pyx_INCREF(__pyx_t_5);
|
|
__Pyx_INCREF(function);
|
|
- __Pyx_DECREF_SET(__pyx_t_2, function);
|
|
+ __Pyx_DECREF_SET(__pyx_t_1, function);
|
|
}
|
|
}
|
|
- __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
|
|
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
- if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
- __pyx_v___pyx_result = __pyx_t_3;
|
|
- __pyx_t_3 = 0;
|
|
+ __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type);
|
|
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 7, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
+ __pyx_v___pyx_result = __pyx_t_4;
|
|
+ __pyx_t_4 = 0;
|
|
|
|
/* "(tree fragment)":8
|
|
- * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
|
|
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
|
|
* __pyx_result = Enum.__new__(__pyx_type)
|
|
* if __pyx_state is not None: # <<<<<<<<<<<<<<
|
|
* __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
|
|
* return __pyx_result
|
|
*/
|
|
- __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
|
|
- __pyx_t_6 = (__pyx_t_1 != 0);
|
|
- if (__pyx_t_6) {
|
|
+ __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
|
|
+ __pyx_t_2 = (__pyx_t_3 != 0);
|
|
+ if (__pyx_t_2) {
|
|
|
|
/* "(tree fragment)":9
|
|
* __pyx_result = Enum.__new__(__pyx_type)
|
|
@@ -18924,12 +17566,12 @@ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSE
|
|
* cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __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(2, 9, __pyx_L1_error)
|
|
- __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_t_3);
|
|
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
+ __pyx_t_4 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 9, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_t_4);
|
|
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
|
|
/* "(tree fragment)":8
|
|
- * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
|
|
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
|
|
* __pyx_result = Enum.__new__(__pyx_type)
|
|
* if __pyx_state is not None: # <<<<<<<<<<<<<<
|
|
* __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
|
|
@@ -18957,10 +17599,10 @@ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSE
|
|
|
|
/* function exit code */
|
|
__pyx_L1_error:;
|
|
- __Pyx_XDECREF(__pyx_t_2);
|
|
- __Pyx_XDECREF(__pyx_t_3);
|
|
+ __Pyx_XDECREF(__pyx_t_1);
|
|
__Pyx_XDECREF(__pyx_t_4);
|
|
__Pyx_XDECREF(__pyx_t_5);
|
|
+ __Pyx_XDECREF(__pyx_t_6);
|
|
__Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
@@ -19884,10 +18526,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
|
|
{&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
|
|
{&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
|
|
{&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
|
|
- {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
|
|
- {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
|
|
{&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
|
|
- {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
|
|
+ {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
|
|
{&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
|
|
{&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
|
|
{&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
|
|
@@ -19895,11 +18535,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
|
|
{&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
|
|
{&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
|
|
{&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
|
|
- {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
|
|
{&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
|
|
{&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
|
|
{&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
|
|
- {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
|
|
{&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
|
|
{&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
|
|
{&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
|
|
@@ -19948,8 +18586,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
|
|
{&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
|
|
{&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
|
|
{&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
|
|
- {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
|
|
- {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
|
|
{&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
|
|
{&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
|
|
{&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
|
|
@@ -19996,7 +18632,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
|
|
{&__pyx_n_s_total_size, __pyx_k_total_size, sizeof(__pyx_k_total_size), 0, 0, 1, 1},
|
|
{&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
|
|
{&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
|
|
- {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
|
|
{&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
|
|
{&__pyx_n_s_unpack_byte_array, __pyx_k_unpack_byte_array, sizeof(__pyx_k_unpack_byte_array), 0, 0, 1, 1},
|
|
{&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
|
|
@@ -20008,14 +18643,13 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
|
|
__pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 47, __pyx_L1_error)
|
|
__pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 48, __pyx_L1_error)
|
|
__pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 72, __pyx_L1_error)
|
|
- __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 272, __pyx_L1_error)
|
|
- __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 855, __pyx_L1_error)
|
|
- __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 1037, __pyx_L1_error)
|
|
- __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 148, __pyx_L1_error)
|
|
- __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 151, __pyx_L1_error)
|
|
- __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 404, __pyx_L1_error)
|
|
- __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 613, __pyx_L1_error)
|
|
- __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 832, __pyx_L1_error)
|
|
+ __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 945, __pyx_L1_error)
|
|
+ __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 134, __pyx_L1_error)
|
|
+ __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 149, __pyx_L1_error)
|
|
+ __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 152, __pyx_L1_error)
|
|
+ __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 406, __pyx_L1_error)
|
|
+ __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 615, __pyx_L1_error)
|
|
+ __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 834, __pyx_L1_error)
|
|
return 0;
|
|
__pyx_L1_error:;
|
|
return -1;
|
|
@@ -20036,137 +18670,82 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
|
|
__Pyx_GOTREF(__pyx_tuple_);
|
|
__Pyx_GIVEREF(__pyx_tuple_);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":272
|
|
- * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
|
|
- * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
|
|
- * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
|
|
- *
|
|
- * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
|
|
- */
|
|
- __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 272, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__2);
|
|
- __Pyx_GIVEREF(__pyx_tuple__2);
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":276
|
|
- * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
|
|
- * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
|
|
- * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
|
|
- *
|
|
- * info.buf = PyArray_DATA(self)
|
|
- */
|
|
- __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 276, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__3);
|
|
- __Pyx_GIVEREF(__pyx_tuple__3);
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":306
|
|
- * if ((descr.byteorder == c'>' and little_endian) or
|
|
- * (descr.byteorder == c'<' and not little_endian)):
|
|
- * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
|
|
- * if t == NPY_BYTE: f = "b"
|
|
- * elif t == NPY_UBYTE: f = "B"
|
|
- */
|
|
- __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 306, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__4);
|
|
- __Pyx_GIVEREF(__pyx_tuple__4);
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":855
|
|
- *
|
|
- * if (end - f) - <int>(new_offset - offset[0]) < 15:
|
|
- * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
|
|
- *
|
|
- * if ((child.byteorder == c'>' and little_endian) or
|
|
- */
|
|
- __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 855, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__5);
|
|
- __Pyx_GIVEREF(__pyx_tuple__5);
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":879
|
|
- * t = child.type_num
|
|
- * if end - f < 5:
|
|
- * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
|
|
- *
|
|
- * # Until ticket #99 is fixed, use integers to avoid warnings
|
|
- */
|
|
- __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 879, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__6);
|
|
- __Pyx_GIVEREF(__pyx_tuple__6);
|
|
-
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1037
|
|
- * _import_array()
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":945
|
|
+ * __pyx_import_array()
|
|
* except Exception:
|
|
* raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef inline int import_umath() except -1:
|
|
*/
|
|
- __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 1037, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__7);
|
|
- __Pyx_GIVEREF(__pyx_tuple__7);
|
|
+ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 945, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__2);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__2);
|
|
|
|
- /* "../../../../private/var/folders/37/tv8hwzgx3tjgtbn0lsb6vrdc0000gp/T/pip-build-env-kr7xxga9/overlay/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd":1043
|
|
+ /* "../../../../private/var/folders/j9/_t7bg0ss12qbyy27ly_c2t180000gp/T/pip-build-env-hh_pn27e/overlay/lib/python3.9/site-packages/numpy/__init__.pxd":951
|
|
* _import_umath()
|
|
* except Exception:
|
|
* raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef inline int import_ufunc() except -1:
|
|
*/
|
|
- __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 1043, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__8);
|
|
- __Pyx_GIVEREF(__pyx_tuple__8);
|
|
+ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 951, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__3);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__3);
|
|
|
|
- /* "View.MemoryView":133
|
|
+ /* "View.MemoryView":134
|
|
*
|
|
* if not self.ndim:
|
|
* raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
|
|
*
|
|
* if itemsize <= 0:
|
|
*/
|
|
- __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 133, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__9);
|
|
- __Pyx_GIVEREF(__pyx_tuple__9);
|
|
+ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(2, 134, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__4);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__4);
|
|
|
|
- /* "View.MemoryView":136
|
|
+ /* "View.MemoryView":137
|
|
*
|
|
* if itemsize <= 0:
|
|
* raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
|
|
*
|
|
* if not isinstance(format, bytes):
|
|
*/
|
|
- __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 136, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__10);
|
|
- __Pyx_GIVEREF(__pyx_tuple__10);
|
|
+ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 137, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__5);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__5);
|
|
|
|
- /* "View.MemoryView":148
|
|
+ /* "View.MemoryView":149
|
|
*
|
|
* if not self._shape:
|
|
* raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 148, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__11);
|
|
- __Pyx_GIVEREF(__pyx_tuple__11);
|
|
+ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 149, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__6);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__6);
|
|
|
|
- /* "View.MemoryView":176
|
|
+ /* "View.MemoryView":177
|
|
* self.data = <char *>malloc(self.len)
|
|
* if not self.data:
|
|
* raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
|
|
*
|
|
* if self.dtype_is_object:
|
|
*/
|
|
- __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 176, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__12);
|
|
- __Pyx_GIVEREF(__pyx_tuple__12);
|
|
+ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 177, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__7);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__7);
|
|
|
|
- /* "View.MemoryView":192
|
|
+ /* "View.MemoryView":193
|
|
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
|
|
* if not (flags & bufmode):
|
|
* raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
|
|
* info.buf = self.data
|
|
* info.len = self.len
|
|
*/
|
|
- __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 192, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__13);
|
|
- __Pyx_GIVEREF(__pyx_tuple__13);
|
|
+ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 193, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__8);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__8);
|
|
|
|
/* "(tree fragment)":2
|
|
* def __reduce_cython__(self):
|
|
@@ -20174,76 +18753,76 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
|
|
* def __setstate_cython__(self, __pyx_state):
|
|
* raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
*/
|
|
- __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 2, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__14);
|
|
- __Pyx_GIVEREF(__pyx_tuple__14);
|
|
+ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 2, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__9);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__9);
|
|
|
|
/* "(tree fragment)":4
|
|
* raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
* def __setstate_cython__(self, __pyx_state):
|
|
* raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
|
|
*/
|
|
- __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 4, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__15);
|
|
- __Pyx_GIVEREF(__pyx_tuple__15);
|
|
+ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 4, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__10);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__10);
|
|
|
|
- /* "View.MemoryView":418
|
|
+ /* "View.MemoryView":420
|
|
* def __setitem__(memoryview self, object index, object value):
|
|
* if self.view.readonly:
|
|
* raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
|
|
*
|
|
* have_slices, index = _unellipsify(index, self.view.ndim)
|
|
*/
|
|
- __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 418, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__16);
|
|
- __Pyx_GIVEREF(__pyx_tuple__16);
|
|
+ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 420, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__11);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__11);
|
|
|
|
- /* "View.MemoryView":495
|
|
+ /* "View.MemoryView":497
|
|
* result = struct.unpack(self.view.format, bytesitem)
|
|
* except struct.error:
|
|
* raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
|
|
* else:
|
|
* if len(self.view.format) == 1:
|
|
*/
|
|
- __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 495, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__17);
|
|
- __Pyx_GIVEREF(__pyx_tuple__17);
|
|
+ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 497, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__12);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__12);
|
|
|
|
- /* "View.MemoryView":520
|
|
+ /* "View.MemoryView":522
|
|
* def __getbuffer__(self, Py_buffer *info, int flags):
|
|
* if flags & PyBUF_WRITABLE and self.view.readonly:
|
|
* raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
|
|
*
|
|
* if flags & PyBUF_ND:
|
|
*/
|
|
- __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 520, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__18);
|
|
- __Pyx_GIVEREF(__pyx_tuple__18);
|
|
+ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 522, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__13);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__13);
|
|
|
|
- /* "View.MemoryView":570
|
|
+ /* "View.MemoryView":572
|
|
* if self.view.strides == NULL:
|
|
*
|
|
* raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
|
|
*
|
|
* return tuple([stride for stride in self.view.strides[:self.view.ndim]])
|
|
*/
|
|
- __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 570, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__19);
|
|
- __Pyx_GIVEREF(__pyx_tuple__19);
|
|
+ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 572, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__14);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__14);
|
|
|
|
- /* "View.MemoryView":577
|
|
+ /* "View.MemoryView":579
|
|
* def suboffsets(self):
|
|
* if self.view.suboffsets == NULL:
|
|
* return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
|
|
*
|
|
* return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
|
|
*/
|
|
- __pyx_tuple__20 = PyTuple_New(1); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 577, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__20);
|
|
+ __pyx_tuple__15 = PyTuple_New(1); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 579, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__15);
|
|
__Pyx_INCREF(__pyx_int_neg_1);
|
|
__Pyx_GIVEREF(__pyx_int_neg_1);
|
|
- PyTuple_SET_ITEM(__pyx_tuple__20, 0, __pyx_int_neg_1);
|
|
- __Pyx_GIVEREF(__pyx_tuple__20);
|
|
+ PyTuple_SET_ITEM(__pyx_tuple__15, 0, __pyx_int_neg_1);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__15);
|
|
|
|
/* "(tree fragment)":2
|
|
* def __reduce_cython__(self):
|
|
@@ -20251,40 +18830,40 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
|
|
* def __setstate_cython__(self, __pyx_state):
|
|
* raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
*/
|
|
- __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 2, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__21);
|
|
- __Pyx_GIVEREF(__pyx_tuple__21);
|
|
+ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 2, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__16);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__16);
|
|
|
|
/* "(tree fragment)":4
|
|
* raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
* def __setstate_cython__(self, __pyx_state):
|
|
* raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
|
|
*/
|
|
- __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 4, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__22);
|
|
- __Pyx_GIVEREF(__pyx_tuple__22);
|
|
+ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 4, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__17);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__17);
|
|
|
|
- /* "View.MemoryView":682
|
|
+ /* "View.MemoryView":684
|
|
* if item is Ellipsis:
|
|
* if not seen_ellipsis:
|
|
* result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
|
|
* seen_ellipsis = True
|
|
* else:
|
|
*/
|
|
- __pyx_slice__23 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__23)) __PYX_ERR(2, 682, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_slice__23);
|
|
- __Pyx_GIVEREF(__pyx_slice__23);
|
|
+ __pyx_slice__18 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__18)) __PYX_ERR(2, 684, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_slice__18);
|
|
+ __Pyx_GIVEREF(__pyx_slice__18);
|
|
|
|
- /* "View.MemoryView":703
|
|
+ /* "View.MemoryView":705
|
|
* for suboffset in suboffsets[:ndim]:
|
|
* if suboffset >= 0:
|
|
* raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 703, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__24);
|
|
- __Pyx_GIVEREF(__pyx_tuple__24);
|
|
+ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 705, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__19);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__19);
|
|
|
|
/* "(tree fragment)":2
|
|
* def __reduce_cython__(self):
|
|
@@ -20292,18 +18871,21 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
|
|
* def __setstate_cython__(self, __pyx_state):
|
|
* raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
*/
|
|
- __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 2, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__25);
|
|
- __Pyx_GIVEREF(__pyx_tuple__25);
|
|
+ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 2, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__20);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__20);
|
|
|
|
/* "(tree fragment)":4
|
|
* raise TypeError("no default __reduce__ due to non-trivial __cinit__")
|
|
* def __setstate_cython__(self, __pyx_state):
|
|
* raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
|
|
*/
|
|
- __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 4, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__26);
|
|
- __Pyx_GIVEREF(__pyx_tuple__26);
|
|
+ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 4, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__21);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__21);
|
|
+ __pyx_tuple__22 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 4, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__22);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__22);
|
|
|
|
/* "fastparquet/speedups.pyx":29
|
|
*
|
|
@@ -20312,9 +18894,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_u_object); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 29, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__27);
|
|
- __Pyx_GIVEREF(__pyx_tuple__27);
|
|
+ __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_u_object); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 29, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__23);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__23);
|
|
|
|
/* "fastparquet/speedups.pyx":32
|
|
*
|
|
@@ -20323,10 +18905,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
|
|
* """
|
|
* utf-8 encode all elements of a 1d ndarray of "object" dtype.
|
|
*/
|
|
- __pyx_tuple__28 = PyTuple_Pack(5, __pyx_n_s_inp, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_arr, __pyx_n_s_result); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 32, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__28);
|
|
- __Pyx_GIVEREF(__pyx_tuple__28);
|
|
- __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastparquet_speedups_pyx, __pyx_n_s_array_encode_utf8, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 32, __pyx_L1_error)
|
|
+ __pyx_tuple__24 = PyTuple_Pack(5, __pyx_n_s_inp, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_arr, __pyx_n_s_result); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 32, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__24);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__24);
|
|
+ __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastparquet_speedups_pyx, __pyx_n_s_array_encode_utf8, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 32, __pyx_L1_error)
|
|
|
|
/* "fastparquet/speedups.pyx":55
|
|
*
|
|
@@ -20335,10 +18917,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
|
|
* """
|
|
* Pack a variable length byte array column.
|
|
*/
|
|
- __pyx_tuple__30 = PyTuple_Pack(9, __pyx_n_s_items, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_itemlen, __pyx_n_s_total_size, __pyx_n_s_start, __pyx_n_s_data, __pyx_n_s_val, __pyx_n_s_out); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 55, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__30);
|
|
- __Pyx_GIVEREF(__pyx_tuple__30);
|
|
- __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastparquet_speedups_pyx, __pyx_n_s_pack_byte_array, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 55, __pyx_L1_error)
|
|
+ __pyx_tuple__26 = PyTuple_Pack(9, __pyx_n_s_items, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_itemlen, __pyx_n_s_total_size, __pyx_n_s_start, __pyx_n_s_data, __pyx_n_s_val, __pyx_n_s_out); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 55, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__26);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__26);
|
|
+ __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastparquet_speedups_pyx, __pyx_n_s_pack_byte_array, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 55, __pyx_L1_error)
|
|
|
|
/* "fastparquet/speedups.pyx":93
|
|
*
|
|
@@ -20347,75 +18929,75 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
|
|
* """
|
|
* Unpack a variable length byte array column.
|
|
*/
|
|
- __pyx_tuple__32 = PyTuple_Pack(8, __pyx_n_s_raw_bytes, __pyx_n_s_n, __pyx_n_s_utf, __pyx_n_s_i, __pyx_n_s_ptr, __pyx_n_s_itemlen, __pyx_n_s_bytecount, __pyx_n_s_out); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 93, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__32);
|
|
- __Pyx_GIVEREF(__pyx_tuple__32);
|
|
- __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastparquet_speedups_pyx, __pyx_n_s_unpack_byte_array, 93, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 93, __pyx_L1_error)
|
|
+ __pyx_tuple__28 = PyTuple_Pack(8, __pyx_n_s_raw_bytes, __pyx_n_s_n, __pyx_n_s_utf, __pyx_n_s_i, __pyx_n_s_ptr, __pyx_n_s_itemlen, __pyx_n_s_bytecount, __pyx_n_s_out); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 93, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__28);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__28);
|
|
+ __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastparquet_speedups_pyx, __pyx_n_s_unpack_byte_array, 93, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 93, __pyx_L1_error)
|
|
|
|
- /* "View.MemoryView":286
|
|
+ /* "View.MemoryView":287
|
|
* return self.name
|
|
*
|
|
* cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
|
|
* cdef strided = Enum("<strided and direct>") # default
|
|
* cdef indirect = Enum("<strided and indirect>")
|
|
*/
|
|
- __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(2, 286, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__34);
|
|
- __Pyx_GIVEREF(__pyx_tuple__34);
|
|
+ __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(2, 287, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__30);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__30);
|
|
|
|
- /* "View.MemoryView":287
|
|
+ /* "View.MemoryView":288
|
|
*
|
|
* cdef generic = Enum("<strided and direct or indirect>")
|
|
* cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
|
|
* cdef indirect = Enum("<strided and indirect>")
|
|
*
|
|
*/
|
|
- __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(2, 287, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__35);
|
|
- __Pyx_GIVEREF(__pyx_tuple__35);
|
|
+ __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(2, 288, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__31);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__31);
|
|
|
|
- /* "View.MemoryView":288
|
|
+ /* "View.MemoryView":289
|
|
* cdef generic = Enum("<strided and direct or indirect>")
|
|
* cdef strided = Enum("<strided and direct>") # default
|
|
* cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(2, 288, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__36);
|
|
- __Pyx_GIVEREF(__pyx_tuple__36);
|
|
+ __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(2, 289, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__32);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__32);
|
|
|
|
- /* "View.MemoryView":291
|
|
+ /* "View.MemoryView":292
|
|
*
|
|
*
|
|
* cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
|
|
* cdef indirect_contiguous = Enum("<contiguous and indirect>")
|
|
*
|
|
*/
|
|
- __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(2, 291, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__37);
|
|
- __Pyx_GIVEREF(__pyx_tuple__37);
|
|
+ __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(2, 292, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__33);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__33);
|
|
|
|
- /* "View.MemoryView":292
|
|
+ /* "View.MemoryView":293
|
|
*
|
|
* cdef contiguous = Enum("<contiguous and direct>")
|
|
* cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(2, 292, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__38);
|
|
- __Pyx_GIVEREF(__pyx_tuple__38);
|
|
+ __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(2, 293, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__34);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__34);
|
|
|
|
/* "(tree fragment)":1
|
|
* def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
|
|
* cdef object __pyx_PickleError
|
|
* cdef object __pyx_result
|
|
*/
|
|
- __pyx_tuple__39 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(2, 1, __pyx_L1_error)
|
|
- __Pyx_GOTREF(__pyx_tuple__39);
|
|
- __Pyx_GIVEREF(__pyx_tuple__39);
|
|
- __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(2, 1, __pyx_L1_error)
|
|
+ __pyx_tuple__35 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(2, 1, __pyx_L1_error)
|
|
+ __Pyx_GOTREF(__pyx_tuple__35);
|
|
+ __Pyx_GIVEREF(__pyx_tuple__35);
|
|
+ __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(2, 1, __pyx_L1_error)
|
|
__Pyx_RefNannyFinishContext();
|
|
return 0;
|
|
__pyx_L1_error:;
|
|
@@ -20427,6 +19009,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
|
|
if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
|
|
__pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
__pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
+ __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
+ __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
__pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
__pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
return 0;
|
|
@@ -20480,21 +19064,21 @@ static int __Pyx_modinit_type_init_code(void) {
|
|
/*--- Type init code ---*/
|
|
__pyx_vtabptr_array = &__pyx_vtable_array;
|
|
__pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
|
|
- if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
|
|
+ if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 106, __pyx_L1_error)
|
|
#if PY_VERSION_HEX < 0x030800B1
|
|
__pyx_type___pyx_array.tp_print = 0;
|
|
#endif
|
|
- if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
|
|
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
|
|
+ if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 106, __pyx_L1_error)
|
|
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 106, __pyx_L1_error)
|
|
__pyx_array_type = &__pyx_type___pyx_array;
|
|
- if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error)
|
|
+ if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 280, __pyx_L1_error)
|
|
#if PY_VERSION_HEX < 0x030800B1
|
|
__pyx_type___pyx_MemviewEnum.tp_print = 0;
|
|
#endif
|
|
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
|
|
__pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
|
|
}
|
|
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error)
|
|
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 280, __pyx_L1_error)
|
|
__pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
|
|
__pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
|
|
__pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
|
|
@@ -20504,30 +19088,30 @@ static int __Pyx_modinit_type_init_code(void) {
|
|
__pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
|
|
__pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
|
|
__pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
|
|
- if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
|
|
+ if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 331, __pyx_L1_error)
|
|
#if PY_VERSION_HEX < 0x030800B1
|
|
__pyx_type___pyx_memoryview.tp_print = 0;
|
|
#endif
|
|
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
|
|
__pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
|
|
}
|
|
- if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
|
|
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
|
|
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 331, __pyx_L1_error)
|
|
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 331, __pyx_L1_error)
|
|
__pyx_memoryview_type = &__pyx_type___pyx_memoryview;
|
|
__pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
|
|
__pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
|
|
__pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
|
|
__pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
|
|
__pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
|
|
- if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
|
|
+ if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 967, __pyx_L1_error)
|
|
#if PY_VERSION_HEX < 0x030800B1
|
|
__pyx_type___pyx_memoryviewslice.tp_print = 0;
|
|
#endif
|
|
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
|
|
__pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
|
|
}
|
|
- if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
|
|
- if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
|
|
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 967, __pyx_L1_error)
|
|
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 967, __pyx_L1_error)
|
|
__pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
|
|
__Pyx_RefNannyFinishContext();
|
|
return 0;
|
|
@@ -20565,18 +19149,38 @@ static int __Pyx_modinit_type_import_code(void) {
|
|
__pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __Pyx_ImportType_CheckSize_Warn);
|
|
if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(5, 15, __pyx_L1_error)
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
- __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 206, __pyx_L1_error)
|
|
+ __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 200, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
|
|
- if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 206, __pyx_L1_error)
|
|
+ if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 200, __pyx_L1_error)
|
|
__pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
|
|
- if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 229, __pyx_L1_error)
|
|
+ if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 223, __pyx_L1_error)
|
|
__pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
|
|
- if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 233, __pyx_L1_error)
|
|
+ if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 227, __pyx_L1_error)
|
|
__pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
|
|
- if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 242, __pyx_L1_error)
|
|
+ if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 239, __pyx_L1_error)
|
|
+ __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
|
|
+ if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 771, __pyx_L1_error)
|
|
+ __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
|
|
+ if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 773, __pyx_L1_error)
|
|
+ __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
|
|
+ if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 775, __pyx_L1_error)
|
|
+ __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
|
|
+ if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 777, __pyx_L1_error)
|
|
+ __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
|
|
+ if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 779, __pyx_L1_error)
|
|
+ __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
|
|
+ if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 781, __pyx_L1_error)
|
|
+ __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
|
|
+ if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 783, __pyx_L1_error)
|
|
+ __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
|
|
+ if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 785, __pyx_L1_error)
|
|
+ __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
|
|
+ if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 787, __pyx_L1_error)
|
|
+ __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
|
|
+ if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 789, __pyx_L1_error)
|
|
__pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
|
|
- if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 917, __pyx_L1_error)
|
|
+ if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 827, __pyx_L1_error)
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__Pyx_RefNannyFinishContext();
|
|
return 0;
|
|
@@ -20822,7 +19426,7 @@ if (!__Pyx_RefNanny) {
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (PyDict_SetItem(__pyx_d, __pyx_n_s_obj_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
@@ -20873,90 +19477,90 @@ if (!__Pyx_RefNanny) {
|
|
if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
|
|
- /* "View.MemoryView":209
|
|
+ /* "View.MemoryView":210
|
|
* info.obj = self
|
|
*
|
|
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
|
|
*
|
|
* def __dealloc__(array self):
|
|
*/
|
|
- __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 209, __pyx_L1_error)
|
|
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 210, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
- if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 209, __pyx_L1_error)
|
|
+ if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 210, __pyx_L1_error)
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
PyType_Modified(__pyx_array_type);
|
|
|
|
- /* "View.MemoryView":286
|
|
+ /* "View.MemoryView":287
|
|
* return self.name
|
|
*
|
|
* cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
|
|
* cdef strided = Enum("<strided and direct>") # default
|
|
* cdef indirect = Enum("<strided and indirect>")
|
|
*/
|
|
- __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 286, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 287, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_XGOTREF(generic);
|
|
__Pyx_DECREF_SET(generic, __pyx_t_1);
|
|
__Pyx_GIVEREF(__pyx_t_1);
|
|
__pyx_t_1 = 0;
|
|
|
|
- /* "View.MemoryView":287
|
|
+ /* "View.MemoryView":288
|
|
*
|
|
* cdef generic = Enum("<strided and direct or indirect>")
|
|
* cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
|
|
* cdef indirect = Enum("<strided and indirect>")
|
|
*
|
|
*/
|
|
- __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 287, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 288, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_XGOTREF(strided);
|
|
__Pyx_DECREF_SET(strided, __pyx_t_1);
|
|
__Pyx_GIVEREF(__pyx_t_1);
|
|
__pyx_t_1 = 0;
|
|
|
|
- /* "View.MemoryView":288
|
|
+ /* "View.MemoryView":289
|
|
* cdef generic = Enum("<strided and direct or indirect>")
|
|
* cdef strided = Enum("<strided and direct>") # default
|
|
* cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 288, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 289, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_XGOTREF(indirect);
|
|
__Pyx_DECREF_SET(indirect, __pyx_t_1);
|
|
__Pyx_GIVEREF(__pyx_t_1);
|
|
__pyx_t_1 = 0;
|
|
|
|
- /* "View.MemoryView":291
|
|
+ /* "View.MemoryView":292
|
|
*
|
|
*
|
|
* cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
|
|
* cdef indirect_contiguous = Enum("<contiguous and indirect>")
|
|
*
|
|
*/
|
|
- __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 291, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 292, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_XGOTREF(contiguous);
|
|
__Pyx_DECREF_SET(contiguous, __pyx_t_1);
|
|
__Pyx_GIVEREF(__pyx_t_1);
|
|
__pyx_t_1 = 0;
|
|
|
|
- /* "View.MemoryView":292
|
|
+ /* "View.MemoryView":293
|
|
*
|
|
* cdef contiguous = Enum("<contiguous and direct>")
|
|
* cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 292, __pyx_L1_error)
|
|
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 293, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_XGOTREF(indirect_contiguous);
|
|
__Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
|
|
__Pyx_GIVEREF(__pyx_t_1);
|
|
__pyx_t_1 = 0;
|
|
|
|
- /* "View.MemoryView":316
|
|
+ /* "View.MemoryView":317
|
|
*
|
|
* DEF THREAD_LOCKS_PREALLOCATED = 8
|
|
* cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
|
|
@@ -20965,7 +19569,7 @@ if (!__Pyx_RefNanny) {
|
|
*/
|
|
__pyx_memoryview_thread_locks_used = 0;
|
|
|
|
- /* "View.MemoryView":317
|
|
+ /* "View.MemoryView":318
|
|
* DEF THREAD_LOCKS_PREALLOCATED = 8
|
|
* cdef int __pyx_memoryview_thread_locks_used = 0
|
|
* cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
|
|
@@ -20982,29 +19586,29 @@ if (!__Pyx_RefNanny) {
|
|
__pyx_t_2[7] = PyThread_allocate_lock();
|
|
memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
|
|
|
|
- /* "View.MemoryView":549
|
|
+ /* "View.MemoryView":551
|
|
* info.obj = self
|
|
*
|
|
* __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 549, __pyx_L1_error)
|
|
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 551, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
- if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 549, __pyx_L1_error)
|
|
+ if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 551, __pyx_L1_error)
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
PyType_Modified(__pyx_memoryview_type);
|
|
|
|
- /* "View.MemoryView":995
|
|
+ /* "View.MemoryView":997
|
|
* return self.from_object
|
|
*
|
|
* __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
- __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 995, __pyx_L1_error)
|
|
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 997, __pyx_L1_error)
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
- if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 995, __pyx_L1_error)
|
|
+ if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 997, __pyx_L1_error)
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
PyType_Modified(__pyx_memoryviewslice_type);
|
|
|
|
@@ -22221,354 +20825,110 @@ __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
|
|
memviewslice->strides[i] = stride;
|
|
stride *= buf->shape[i];
|
|
}
|
|
- }
|
|
- for (i = 0; i < ndim; i++) {
|
|
- memviewslice->shape[i] = buf->shape[i];
|
|
- if (buf->suboffsets) {
|
|
- memviewslice->suboffsets[i] = buf->suboffsets[i];
|
|
- } else {
|
|
- memviewslice->suboffsets[i] = -1;
|
|
- }
|
|
- }
|
|
- memviewslice->memview = memview;
|
|
- memviewslice->data = (char *)buf->buf;
|
|
- if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
|
|
- Py_INCREF(memview);
|
|
- }
|
|
- retval = 0;
|
|
- goto no_fail;
|
|
-fail:
|
|
- memviewslice->memview = 0;
|
|
- memviewslice->data = 0;
|
|
- retval = -1;
|
|
-no_fail:
|
|
- __Pyx_RefNannyFinishContext();
|
|
- return retval;
|
|
-}
|
|
-#ifndef Py_NO_RETURN
|
|
-#define Py_NO_RETURN
|
|
-#endif
|
|
-static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
|
|
- va_list vargs;
|
|
- char msg[200];
|
|
-#ifdef HAVE_STDARG_PROTOTYPES
|
|
- va_start(vargs, fmt);
|
|
-#else
|
|
- va_start(vargs);
|
|
-#endif
|
|
- vsnprintf(msg, 200, fmt, vargs);
|
|
- va_end(vargs);
|
|
- Py_FatalError(msg);
|
|
-}
|
|
-static CYTHON_INLINE int
|
|
-__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
|
|
- PyThread_type_lock lock)
|
|
-{
|
|
- int result;
|
|
- PyThread_acquire_lock(lock, 1);
|
|
- result = (*acquisition_count)++;
|
|
- PyThread_release_lock(lock);
|
|
- return result;
|
|
-}
|
|
-static CYTHON_INLINE int
|
|
-__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
|
|
- PyThread_type_lock lock)
|
|
-{
|
|
- int result;
|
|
- PyThread_acquire_lock(lock, 1);
|
|
- result = (*acquisition_count)--;
|
|
- PyThread_release_lock(lock);
|
|
- return result;
|
|
-}
|
|
-static CYTHON_INLINE void
|
|
-__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
|
|
-{
|
|
- int first_time;
|
|
- struct __pyx_memoryview_obj *memview = memslice->memview;
|
|
- if (unlikely(!memview || (PyObject *) memview == Py_None))
|
|
- return;
|
|
- if (unlikely(__pyx_get_slice_count(memview) < 0))
|
|
- __pyx_fatalerror("Acquisition count is %d (line %d)",
|
|
- __pyx_get_slice_count(memview), lineno);
|
|
- first_time = __pyx_add_acquisition_count(memview) == 0;
|
|
- if (unlikely(first_time)) {
|
|
- if (have_gil) {
|
|
- Py_INCREF((PyObject *) memview);
|
|
- } else {
|
|
- PyGILState_STATE _gilstate = PyGILState_Ensure();
|
|
- Py_INCREF((PyObject *) memview);
|
|
- PyGILState_Release(_gilstate);
|
|
- }
|
|
- }
|
|
-}
|
|
-static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
|
|
- int have_gil, int lineno) {
|
|
- int last_time;
|
|
- struct __pyx_memoryview_obj *memview = memslice->memview;
|
|
- if (unlikely(!memview || (PyObject *) memview == Py_None)) {
|
|
- memslice->memview = NULL;
|
|
- return;
|
|
- }
|
|
- if (unlikely(__pyx_get_slice_count(memview) <= 0))
|
|
- __pyx_fatalerror("Acquisition count is %d (line %d)",
|
|
- __pyx_get_slice_count(memview), lineno);
|
|
- last_time = __pyx_sub_acquisition_count(memview) == 1;
|
|
- memslice->data = NULL;
|
|
- if (unlikely(last_time)) {
|
|
- if (have_gil) {
|
|
- Py_CLEAR(memslice->memview);
|
|
- } else {
|
|
- PyGILState_STATE _gilstate = PyGILState_Ensure();
|
|
- Py_CLEAR(memslice->memview);
|
|
- PyGILState_Release(_gilstate);
|
|
- }
|
|
- } else {
|
|
- memslice->memview = NULL;
|
|
- }
|
|
-}
|
|
-
|
|
-/* PyCFunctionFastCall */
|
|
- #if CYTHON_FAST_PYCCALL
|
|
-static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
|
|
- PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
|
|
- PyCFunction meth = PyCFunction_GET_FUNCTION(func);
|
|
- PyObject *self = PyCFunction_GET_SELF(func);
|
|
- int flags = PyCFunction_GET_FLAGS(func);
|
|
- assert(PyCFunction_Check(func));
|
|
- assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
|
|
- assert(nargs >= 0);
|
|
- assert(nargs == 0 || args != NULL);
|
|
- /* _PyCFunction_FastCallDict() must not be called with an exception set,
|
|
- because it may clear it (directly or indirectly) and so the
|
|
- caller loses its exception */
|
|
- assert(!PyErr_Occurred());
|
|
- if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
|
|
- return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
|
|
- } else {
|
|
- return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
|
|
- }
|
|
-}
|
|
-#endif
|
|
-
|
|
-/* PyFunctionFastCall */
|
|
- #if CYTHON_FAST_PYCALL
|
|
-static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
|
|
- PyObject *globals) {
|
|
- PyFrameObject *f;
|
|
- PyThreadState *tstate = __Pyx_PyThreadState_Current;
|
|
- PyObject **fastlocals;
|
|
- Py_ssize_t i;
|
|
- PyObject *result;
|
|
- assert(globals != NULL);
|
|
- /* XXX Perhaps we should create a specialized
|
|
- PyFrame_New() that doesn't take locals, but does
|
|
- take builtins without sanity checking them.
|
|
- */
|
|
- assert(tstate != NULL);
|
|
- f = PyFrame_New(tstate, co, globals, NULL);
|
|
- if (f == NULL) {
|
|
- return NULL;
|
|
- }
|
|
- fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
|
|
- for (i = 0; i < na; i++) {
|
|
- Py_INCREF(*args);
|
|
- fastlocals[i] = *args++;
|
|
- }
|
|
- result = PyEval_EvalFrameEx(f,0);
|
|
- ++tstate->recursion_depth;
|
|
- Py_DECREF(f);
|
|
- --tstate->recursion_depth;
|
|
- return result;
|
|
-}
|
|
-#if 1 || PY_VERSION_HEX < 0x030600B1
|
|
-static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
|
|
- PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
|
|
- PyObject *globals = PyFunction_GET_GLOBALS(func);
|
|
- PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
|
|
- PyObject *closure;
|
|
-#if PY_MAJOR_VERSION >= 3
|
|
- PyObject *kwdefs;
|
|
-#endif
|
|
- PyObject *kwtuple, **k;
|
|
- PyObject **d;
|
|
- Py_ssize_t nd;
|
|
- Py_ssize_t nk;
|
|
- PyObject *result;
|
|
- assert(kwargs == NULL || PyDict_Check(kwargs));
|
|
- nk = kwargs ? PyDict_Size(kwargs) : 0;
|
|
- if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
|
|
- return NULL;
|
|
- }
|
|
- if (
|
|
-#if PY_MAJOR_VERSION >= 3
|
|
- co->co_kwonlyargcount == 0 &&
|
|
-#endif
|
|
- likely(kwargs == NULL || nk == 0) &&
|
|
- co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
|
|
- if (argdefs == NULL && co->co_argcount == nargs) {
|
|
- result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
|
|
- goto done;
|
|
- }
|
|
- else if (nargs == 0 && argdefs != NULL
|
|
- && co->co_argcount == Py_SIZE(argdefs)) {
|
|
- /* function called with no arguments, but all parameters have
|
|
- a default value: use default values as arguments .*/
|
|
- args = &PyTuple_GET_ITEM(argdefs, 0);
|
|
- result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
|
|
- goto done;
|
|
- }
|
|
- }
|
|
- if (kwargs != NULL) {
|
|
- Py_ssize_t pos, i;
|
|
- kwtuple = PyTuple_New(2 * nk);
|
|
- if (kwtuple == NULL) {
|
|
- result = NULL;
|
|
- goto done;
|
|
- }
|
|
- k = &PyTuple_GET_ITEM(kwtuple, 0);
|
|
- pos = i = 0;
|
|
- while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
|
|
- Py_INCREF(k[i]);
|
|
- Py_INCREF(k[i+1]);
|
|
- i += 2;
|
|
- }
|
|
- nk = i / 2;
|
|
- }
|
|
- else {
|
|
- kwtuple = NULL;
|
|
- k = NULL;
|
|
- }
|
|
- closure = PyFunction_GET_CLOSURE(func);
|
|
-#if PY_MAJOR_VERSION >= 3
|
|
- kwdefs = PyFunction_GET_KW_DEFAULTS(func);
|
|
-#endif
|
|
- if (argdefs != NULL) {
|
|
- d = &PyTuple_GET_ITEM(argdefs, 0);
|
|
- nd = Py_SIZE(argdefs);
|
|
- }
|
|
- else {
|
|
- d = NULL;
|
|
- nd = 0;
|
|
- }
|
|
-#if PY_MAJOR_VERSION >= 3
|
|
- result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
|
|
- args, (int)nargs,
|
|
- k, (int)nk,
|
|
- d, (int)nd, kwdefs, closure);
|
|
-#else
|
|
- result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
|
|
- args, (int)nargs,
|
|
- k, (int)nk,
|
|
- d, (int)nd, closure);
|
|
-#endif
|
|
- Py_XDECREF(kwtuple);
|
|
-done:
|
|
- Py_LeaveRecursiveCall();
|
|
- return result;
|
|
-}
|
|
-#endif
|
|
-#endif
|
|
-
|
|
-/* PyObjectCallMethO */
|
|
- #if CYTHON_COMPILING_IN_CPYTHON
|
|
-static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
|
|
- PyObject *self, *result;
|
|
- PyCFunction cfunc;
|
|
- cfunc = PyCFunction_GET_FUNCTION(func);
|
|
- self = PyCFunction_GET_SELF(func);
|
|
- if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
|
|
- return NULL;
|
|
- result = cfunc(self, arg);
|
|
- Py_LeaveRecursiveCall();
|
|
- if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
|
|
- PyErr_SetString(
|
|
- PyExc_SystemError,
|
|
- "NULL result without error in PyObject_Call");
|
|
- }
|
|
- return result;
|
|
-}
|
|
-#endif
|
|
-
|
|
-/* PyObjectCallOneArg */
|
|
- #if CYTHON_COMPILING_IN_CPYTHON
|
|
-static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
|
|
- PyObject *result;
|
|
- PyObject *args = PyTuple_New(1);
|
|
- if (unlikely(!args)) return NULL;
|
|
- Py_INCREF(arg);
|
|
- PyTuple_SET_ITEM(args, 0, arg);
|
|
- result = __Pyx_PyObject_Call(func, args, NULL);
|
|
- Py_DECREF(args);
|
|
- return result;
|
|
-}
|
|
-static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
|
|
-#if CYTHON_FAST_PYCALL
|
|
- if (PyFunction_Check(func)) {
|
|
- return __Pyx_PyFunction_FastCall(func, &arg, 1);
|
|
- }
|
|
-#endif
|
|
- if (likely(PyCFunction_Check(func))) {
|
|
- if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
|
|
- return __Pyx_PyObject_CallMethO(func, arg);
|
|
-#if CYTHON_FAST_PYCCALL
|
|
- } else if (__Pyx_PyFastCFunction_Check(func)) {
|
|
- return __Pyx_PyCFunction_FastCall(func, &arg, 1);
|
|
-#endif
|
|
+ }
|
|
+ for (i = 0; i < ndim; i++) {
|
|
+ memviewslice->shape[i] = buf->shape[i];
|
|
+ if (buf->suboffsets) {
|
|
+ memviewslice->suboffsets[i] = buf->suboffsets[i];
|
|
+ } else {
|
|
+ memviewslice->suboffsets[i] = -1;
|
|
}
|
|
}
|
|
- return __Pyx__PyObject_CallOneArg(func, arg);
|
|
+ memviewslice->memview = memview;
|
|
+ memviewslice->data = (char *)buf->buf;
|
|
+ if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
|
|
+ Py_INCREF(memview);
|
|
+ }
|
|
+ retval = 0;
|
|
+ goto no_fail;
|
|
+fail:
|
|
+ memviewslice->memview = 0;
|
|
+ memviewslice->data = 0;
|
|
+ retval = -1;
|
|
+no_fail:
|
|
+ __Pyx_RefNannyFinishContext();
|
|
+ return retval;
|
|
}
|
|
+#ifndef Py_NO_RETURN
|
|
+#define Py_NO_RETURN
|
|
+#endif
|
|
+static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
|
|
+ va_list vargs;
|
|
+ char msg[200];
|
|
+#if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
|
|
+ va_start(vargs, fmt);
|
|
#else
|
|
-static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
|
|
- PyObject *result;
|
|
- PyObject *args = PyTuple_Pack(1, arg);
|
|
- if (unlikely(!args)) return NULL;
|
|
- result = __Pyx_PyObject_Call(func, args, NULL);
|
|
- Py_DECREF(args);
|
|
+ va_start(vargs);
|
|
+#endif
|
|
+ vsnprintf(msg, 200, fmt, vargs);
|
|
+ va_end(vargs);
|
|
+ Py_FatalError(msg);
|
|
+}
|
|
+static CYTHON_INLINE int
|
|
+__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
|
|
+ PyThread_type_lock lock)
|
|
+{
|
|
+ int result;
|
|
+ PyThread_acquire_lock(lock, 1);
|
|
+ result = (*acquisition_count)++;
|
|
+ PyThread_release_lock(lock);
|
|
return result;
|
|
}
|
|
-#endif
|
|
-
|
|
-/* DictGetItem */
|
|
- #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
|
|
-static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
|
|
- PyObject *value;
|
|
- value = PyDict_GetItemWithError(d, key);
|
|
- if (unlikely(!value)) {
|
|
- if (!PyErr_Occurred()) {
|
|
- if (unlikely(PyTuple_Check(key))) {
|
|
- PyObject* args = PyTuple_Pack(1, key);
|
|
- if (likely(args)) {
|
|
- PyErr_SetObject(PyExc_KeyError, args);
|
|
- Py_DECREF(args);
|
|
- }
|
|
- } else {
|
|
- PyErr_SetObject(PyExc_KeyError, key);
|
|
- }
|
|
+static CYTHON_INLINE int
|
|
+__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
|
|
+ PyThread_type_lock lock)
|
|
+{
|
|
+ int result;
|
|
+ PyThread_acquire_lock(lock, 1);
|
|
+ result = (*acquisition_count)--;
|
|
+ PyThread_release_lock(lock);
|
|
+ return result;
|
|
+}
|
|
+static CYTHON_INLINE void
|
|
+__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
|
|
+{
|
|
+ int first_time;
|
|
+ struct __pyx_memoryview_obj *memview = memslice->memview;
|
|
+ if (unlikely(!memview || (PyObject *) memview == Py_None))
|
|
+ return;
|
|
+ if (unlikely(__pyx_get_slice_count(memview) < 0))
|
|
+ __pyx_fatalerror("Acquisition count is %d (line %d)",
|
|
+ __pyx_get_slice_count(memview), lineno);
|
|
+ first_time = __pyx_add_acquisition_count(memview) == 0;
|
|
+ if (unlikely(first_time)) {
|
|
+ if (have_gil) {
|
|
+ Py_INCREF((PyObject *) memview);
|
|
+ } else {
|
|
+ PyGILState_STATE _gilstate = PyGILState_Ensure();
|
|
+ Py_INCREF((PyObject *) memview);
|
|
+ PyGILState_Release(_gilstate);
|
|
}
|
|
- return NULL;
|
|
}
|
|
- Py_INCREF(value);
|
|
- return value;
|
|
-}
|
|
-#endif
|
|
-
|
|
-/* RaiseTooManyValuesToUnpack */
|
|
- static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
|
|
- PyErr_Format(PyExc_ValueError,
|
|
- "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
|
|
-}
|
|
-
|
|
-/* RaiseNeedMoreValuesToUnpack */
|
|
- static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
|
|
- PyErr_Format(PyExc_ValueError,
|
|
- "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
|
|
- index, (index == 1) ? "" : "s");
|
|
}
|
|
-
|
|
-/* RaiseNoneIterError */
|
|
- static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
|
|
- PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
|
|
+static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
|
|
+ int have_gil, int lineno) {
|
|
+ int last_time;
|
|
+ struct __pyx_memoryview_obj *memview = memslice->memview;
|
|
+ if (unlikely(!memview || (PyObject *) memview == Py_None)) {
|
|
+ memslice->memview = NULL;
|
|
+ return;
|
|
+ }
|
|
+ if (unlikely(__pyx_get_slice_count(memview) <= 0))
|
|
+ __pyx_fatalerror("Acquisition count is %d (line %d)",
|
|
+ __pyx_get_slice_count(memview), lineno);
|
|
+ last_time = __pyx_sub_acquisition_count(memview) == 1;
|
|
+ memslice->data = NULL;
|
|
+ if (unlikely(last_time)) {
|
|
+ if (have_gil) {
|
|
+ Py_CLEAR(memslice->memview);
|
|
+ } else {
|
|
+ PyGILState_STATE _gilstate = PyGILState_Ensure();
|
|
+ Py_CLEAR(memslice->memview);
|
|
+ PyGILState_Release(_gilstate);
|
|
+ }
|
|
+ } else {
|
|
+ memslice->memview = NULL;
|
|
+ }
|
|
}
|
|
|
|
/* GetTopmostException */
|
|
@@ -22701,30 +21061,172 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
|
|
exc_info->exc_value = local_value;
|
|
exc_info->exc_traceback = local_tb;
|
|
}
|
|
- #else
|
|
- tmp_type = tstate->exc_type;
|
|
- tmp_value = tstate->exc_value;
|
|
- tmp_tb = tstate->exc_traceback;
|
|
- tstate->exc_type = local_type;
|
|
- tstate->exc_value = local_value;
|
|
- tstate->exc_traceback = local_tb;
|
|
- #endif
|
|
- Py_XDECREF(tmp_type);
|
|
- Py_XDECREF(tmp_value);
|
|
- Py_XDECREF(tmp_tb);
|
|
+ #else
|
|
+ tmp_type = tstate->exc_type;
|
|
+ tmp_value = tstate->exc_value;
|
|
+ tmp_tb = tstate->exc_traceback;
|
|
+ tstate->exc_type = local_type;
|
|
+ tstate->exc_value = local_value;
|
|
+ tstate->exc_traceback = local_tb;
|
|
+ #endif
|
|
+ Py_XDECREF(tmp_type);
|
|
+ Py_XDECREF(tmp_value);
|
|
+ Py_XDECREF(tmp_tb);
|
|
+#else
|
|
+ PyErr_SetExcInfo(local_type, local_value, local_tb);
|
|
+#endif
|
|
+ return 0;
|
|
+bad:
|
|
+ *type = 0;
|
|
+ *value = 0;
|
|
+ *tb = 0;
|
|
+ Py_XDECREF(local_type);
|
|
+ Py_XDECREF(local_value);
|
|
+ Py_XDECREF(local_tb);
|
|
+ return -1;
|
|
+}
|
|
+
|
|
+/* PyCFunctionFastCall */
|
|
+ #if CYTHON_FAST_PYCCALL
|
|
+static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
|
|
+ PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
|
|
+ PyCFunction meth = PyCFunction_GET_FUNCTION(func);
|
|
+ PyObject *self = PyCFunction_GET_SELF(func);
|
|
+ int flags = PyCFunction_GET_FLAGS(func);
|
|
+ assert(PyCFunction_Check(func));
|
|
+ assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
|
|
+ assert(nargs >= 0);
|
|
+ assert(nargs == 0 || args != NULL);
|
|
+ /* _PyCFunction_FastCallDict() must not be called with an exception set,
|
|
+ because it may clear it (directly or indirectly) and so the
|
|
+ caller loses its exception */
|
|
+ assert(!PyErr_Occurred());
|
|
+ if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
|
|
+ return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
|
|
+ } else {
|
|
+ return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
|
|
+ }
|
|
+}
|
|
+#endif
|
|
+
|
|
+/* PyFunctionFastCall */
|
|
+ #if CYTHON_FAST_PYCALL
|
|
+static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
|
|
+ PyObject *globals) {
|
|
+ PyFrameObject *f;
|
|
+ PyThreadState *tstate = __Pyx_PyThreadState_Current;
|
|
+ PyObject **fastlocals;
|
|
+ Py_ssize_t i;
|
|
+ PyObject *result;
|
|
+ assert(globals != NULL);
|
|
+ /* XXX Perhaps we should create a specialized
|
|
+ PyFrame_New() that doesn't take locals, but does
|
|
+ take builtins without sanity checking them.
|
|
+ */
|
|
+ assert(tstate != NULL);
|
|
+ f = PyFrame_New(tstate, co, globals, NULL);
|
|
+ if (f == NULL) {
|
|
+ return NULL;
|
|
+ }
|
|
+ fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
|
|
+ for (i = 0; i < na; i++) {
|
|
+ Py_INCREF(*args);
|
|
+ fastlocals[i] = *args++;
|
|
+ }
|
|
+ result = PyEval_EvalFrameEx(f,0);
|
|
+ ++tstate->recursion_depth;
|
|
+ Py_DECREF(f);
|
|
+ --tstate->recursion_depth;
|
|
+ return result;
|
|
+}
|
|
+#if 1 || PY_VERSION_HEX < 0x030600B1
|
|
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
|
|
+ PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
|
|
+ PyObject *globals = PyFunction_GET_GLOBALS(func);
|
|
+ PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
|
|
+ PyObject *closure;
|
|
+#if PY_MAJOR_VERSION >= 3
|
|
+ PyObject *kwdefs;
|
|
+#endif
|
|
+ PyObject *kwtuple, **k;
|
|
+ PyObject **d;
|
|
+ Py_ssize_t nd;
|
|
+ Py_ssize_t nk;
|
|
+ PyObject *result;
|
|
+ assert(kwargs == NULL || PyDict_Check(kwargs));
|
|
+ nk = kwargs ? PyDict_Size(kwargs) : 0;
|
|
+ if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
|
|
+ return NULL;
|
|
+ }
|
|
+ if (
|
|
+#if PY_MAJOR_VERSION >= 3
|
|
+ co->co_kwonlyargcount == 0 &&
|
|
+#endif
|
|
+ likely(kwargs == NULL || nk == 0) &&
|
|
+ co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
|
|
+ if (argdefs == NULL && co->co_argcount == nargs) {
|
|
+ result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
|
|
+ goto done;
|
|
+ }
|
|
+ else if (nargs == 0 && argdefs != NULL
|
|
+ && co->co_argcount == Py_SIZE(argdefs)) {
|
|
+ /* function called with no arguments, but all parameters have
|
|
+ a default value: use default values as arguments .*/
|
|
+ args = &PyTuple_GET_ITEM(argdefs, 0);
|
|
+ result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
|
|
+ goto done;
|
|
+ }
|
|
+ }
|
|
+ if (kwargs != NULL) {
|
|
+ Py_ssize_t pos, i;
|
|
+ kwtuple = PyTuple_New(2 * nk);
|
|
+ if (kwtuple == NULL) {
|
|
+ result = NULL;
|
|
+ goto done;
|
|
+ }
|
|
+ k = &PyTuple_GET_ITEM(kwtuple, 0);
|
|
+ pos = i = 0;
|
|
+ while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
|
|
+ Py_INCREF(k[i]);
|
|
+ Py_INCREF(k[i+1]);
|
|
+ i += 2;
|
|
+ }
|
|
+ nk = i / 2;
|
|
+ }
|
|
+ else {
|
|
+ kwtuple = NULL;
|
|
+ k = NULL;
|
|
+ }
|
|
+ closure = PyFunction_GET_CLOSURE(func);
|
|
+#if PY_MAJOR_VERSION >= 3
|
|
+ kwdefs = PyFunction_GET_KW_DEFAULTS(func);
|
|
+#endif
|
|
+ if (argdefs != NULL) {
|
|
+ d = &PyTuple_GET_ITEM(argdefs, 0);
|
|
+ nd = Py_SIZE(argdefs);
|
|
+ }
|
|
+ else {
|
|
+ d = NULL;
|
|
+ nd = 0;
|
|
+ }
|
|
+#if PY_MAJOR_VERSION >= 3
|
|
+ result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
|
|
+ args, (int)nargs,
|
|
+ k, (int)nk,
|
|
+ d, (int)nd, kwdefs, closure);
|
|
#else
|
|
- PyErr_SetExcInfo(local_type, local_value, local_tb);
|
|
+ result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
|
|
+ args, (int)nargs,
|
|
+ k, (int)nk,
|
|
+ d, (int)nd, closure);
|
|
#endif
|
|
- return 0;
|
|
-bad:
|
|
- *type = 0;
|
|
- *value = 0;
|
|
- *tb = 0;
|
|
- Py_XDECREF(local_type);
|
|
- Py_XDECREF(local_value);
|
|
- Py_XDECREF(local_tb);
|
|
- return -1;
|
|
+ Py_XDECREF(kwtuple);
|
|
+done:
|
|
+ Py_LeaveRecursiveCall();
|
|
+ return result;
|
|
}
|
|
+#endif
|
|
+#endif
|
|
|
|
/* PyObjectCall2Args */
|
|
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
|
|
@@ -22755,6 +21257,66 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
|
|
return result;
|
|
}
|
|
|
|
+/* PyObjectCallMethO */
|
|
+ #if CYTHON_COMPILING_IN_CPYTHON
|
|
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
|
|
+ PyObject *self, *result;
|
|
+ PyCFunction cfunc;
|
|
+ cfunc = PyCFunction_GET_FUNCTION(func);
|
|
+ self = PyCFunction_GET_SELF(func);
|
|
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
|
|
+ return NULL;
|
|
+ result = cfunc(self, arg);
|
|
+ Py_LeaveRecursiveCall();
|
|
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
|
|
+ PyErr_SetString(
|
|
+ PyExc_SystemError,
|
|
+ "NULL result without error in PyObject_Call");
|
|
+ }
|
|
+ return result;
|
|
+}
|
|
+#endif
|
|
+
|
|
+/* PyObjectCallOneArg */
|
|
+ #if CYTHON_COMPILING_IN_CPYTHON
|
|
+static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
|
|
+ PyObject *result;
|
|
+ PyObject *args = PyTuple_New(1);
|
|
+ if (unlikely(!args)) return NULL;
|
|
+ Py_INCREF(arg);
|
|
+ PyTuple_SET_ITEM(args, 0, arg);
|
|
+ result = __Pyx_PyObject_Call(func, args, NULL);
|
|
+ Py_DECREF(args);
|
|
+ return result;
|
|
+}
|
|
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
|
|
+#if CYTHON_FAST_PYCALL
|
|
+ if (PyFunction_Check(func)) {
|
|
+ return __Pyx_PyFunction_FastCall(func, &arg, 1);
|
|
+ }
|
|
+#endif
|
|
+ if (likely(PyCFunction_Check(func))) {
|
|
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
|
|
+ return __Pyx_PyObject_CallMethO(func, arg);
|
|
+#if CYTHON_FAST_PYCCALL
|
|
+ } else if (__Pyx_PyFastCFunction_Check(func)) {
|
|
+ return __Pyx_PyCFunction_FastCall(func, &arg, 1);
|
|
+#endif
|
|
+ }
|
|
+ }
|
|
+ return __Pyx__PyObject_CallOneArg(func, arg);
|
|
+}
|
|
+#else
|
|
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
|
|
+ PyObject *result;
|
|
+ PyObject *args = PyTuple_Pack(1, arg);
|
|
+ if (unlikely(!args)) return NULL;
|
|
+ result = __Pyx_PyObject_Call(func, args, NULL);
|
|
+ Py_DECREF(args);
|
|
+ return result;
|
|
+}
|
|
+#endif
|
|
+
|
|
/* BytesEquals */
|
|
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
|
|
#if CYTHON_COMPILING_IN_PYPY
|
|
@@ -22775,7 +21337,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
|
|
return (equals == Py_EQ);
|
|
} else {
|
|
int result;
|
|
-#if CYTHON_USE_UNICODE_INTERNALS
|
|
+#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
|
|
Py_hash_t hash1, hash2;
|
|
hash1 = ((PyBytesObject*)s1)->ob_shash;
|
|
hash2 = ((PyBytesObject*)s2)->ob_shash;
|
|
@@ -23002,6 +21564,24 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject
|
|
return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
|
|
}
|
|
|
|
+/* RaiseTooManyValuesToUnpack */
|
|
+ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
|
|
+ PyErr_Format(PyExc_ValueError,
|
|
+ "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
|
|
+}
|
|
+
|
|
+/* RaiseNeedMoreValuesToUnpack */
|
|
+ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
|
|
+ PyErr_Format(PyExc_ValueError,
|
|
+ "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
|
|
+ index, (index == 1) ? "" : "s");
|
|
+}
|
|
+
|
|
+/* RaiseNoneIterError */
|
|
+ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
|
|
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
|
|
+}
|
|
+
|
|
/* SwapException */
|
|
#if CYTHON_FAST_THREAD_STATE
|
|
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
|
|
@@ -23481,17 +22061,35 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P
|
|
static int __Pyx_setup_reduce(PyObject* type_obj) {
|
|
int ret = 0;
|
|
PyObject *object_reduce = NULL;
|
|
+ PyObject *object_getstate = NULL;
|
|
PyObject *object_reduce_ex = NULL;
|
|
PyObject *reduce = NULL;
|
|
PyObject *reduce_ex = NULL;
|
|
PyObject *reduce_cython = NULL;
|
|
PyObject *setstate = NULL;
|
|
PyObject *setstate_cython = NULL;
|
|
+ PyObject *getstate = NULL;
|
|
+#if CYTHON_USE_PYTYPE_LOOKUP
|
|
+ getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
|
|
+#else
|
|
+ getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
|
|
+ if (!getstate && PyErr_Occurred()) {
|
|
+ goto __PYX_BAD;
|
|
+ }
|
|
+#endif
|
|
+ if (getstate) {
|
|
#if CYTHON_USE_PYTYPE_LOOKUP
|
|
- if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
|
|
+ object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
|
|
#else
|
|
- if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
|
|
+ object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
|
|
+ if (!object_getstate && PyErr_Occurred()) {
|
|
+ goto __PYX_BAD;
|
|
+ }
|
|
#endif
|
|
+ if (object_getstate != getstate) {
|
|
+ goto __PYX_GOOD;
|
|
+ }
|
|
+ }
|
|
#if CYTHON_USE_PYTYPE_LOOKUP
|
|
object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
|
|
#else
|
|
@@ -23536,6 +22134,8 @@ static int __Pyx_setup_reduce(PyObject* type_obj) {
|
|
#if !CYTHON_USE_PYTYPE_LOOKUP
|
|
Py_XDECREF(object_reduce);
|
|
Py_XDECREF(object_reduce_ex);
|
|
+ Py_XDECREF(object_getstate);
|
|
+ Py_XDECREF(getstate);
|
|
#endif
|
|
Py_XDECREF(reduce);
|
|
Py_XDECREF(reduce_ex);
|
|
@@ -23732,6 +22332,12 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
|
|
#include "compile.h"
|
|
#include "frameobject.h"
|
|
#include "traceback.h"
|
|
+#if PY_VERSION_HEX >= 0x030b00a6
|
|
+ #ifndef Py_BUILD_CORE
|
|
+ #define Py_BUILD_CORE 1
|
|
+ #endif
|
|
+ #include "internal/pycore_frame.h"
|
|
+#endif
|
|
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
|
|
const char *funcname, int c_line,
|
|
int py_line, const char *filename) {
|
|
@@ -23795,14 +22401,24 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line,
|
|
PyCodeObject *py_code = 0;
|
|
PyFrameObject *py_frame = 0;
|
|
PyThreadState *tstate = __Pyx_PyThreadState_Current;
|
|
+ PyObject *ptype, *pvalue, *ptraceback;
|
|
if (c_line) {
|
|
c_line = __Pyx_CLineForTraceback(tstate, c_line);
|
|
}
|
|
py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
|
|
if (!py_code) {
|
|
+ __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
|
|
py_code = __Pyx_CreateCodeObjectForTraceback(
|
|
funcname, c_line, py_line, filename);
|
|
- if (!py_code) goto bad;
|
|
+ if (!py_code) {
|
|
+ /* If the code object creation fails, then we should clear the
|
|
+ fetched exception references and propagate the new exception */
|
|
+ Py_XDECREF(ptype);
|
|
+ Py_XDECREF(pvalue);
|
|
+ Py_XDECREF(ptraceback);
|
|
+ goto bad;
|
|
+ }
|
|
+ __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
|
|
__pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
|
|
}
|
|
py_frame = PyFrame_New(
|
|
@@ -23822,7 +22438,6 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line,
|
|
#if PY_MAJOR_VERSION < 3
|
|
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
|
|
if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
|
|
- if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
|
|
if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
|
|
if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
|
|
PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
|
|
@@ -23836,7 +22451,6 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) {
|
|
return;
|
|
}
|
|
if ((0)) {}
|
|
- else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
|
|
view->obj = NULL;
|
|
Py_DECREF(obj);
|
|
}
|
|
@@ -24752,44 +23366,6 @@ __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
|
|
return (char) -1;
|
|
}
|
|
|
|
-/* CIntToPy */
|
|
- static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
|
|
-#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
|
-#pragma GCC diagnostic push
|
|
-#pragma GCC diagnostic ignored "-Wconversion"
|
|
-#endif
|
|
- const int neg_one = (int) -1, const_zero = (int) 0;
|
|
-#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
|
-#pragma GCC diagnostic pop
|
|
-#endif
|
|
- const int is_unsigned = neg_one > const_zero;
|
|
- if (is_unsigned) {
|
|
- if (sizeof(int) < sizeof(long)) {
|
|
- return PyInt_FromLong((long) value);
|
|
- } else if (sizeof(int) <= sizeof(unsigned long)) {
|
|
- return PyLong_FromUnsignedLong((unsigned long) value);
|
|
-#ifdef HAVE_LONG_LONG
|
|
- } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
|
|
- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
|
|
-#endif
|
|
- }
|
|
- } else {
|
|
- if (sizeof(int) <= sizeof(long)) {
|
|
- return PyInt_FromLong((long) value);
|
|
-#ifdef HAVE_LONG_LONG
|
|
- } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
|
|
- return PyLong_FromLongLong((PY_LONG_LONG) value);
|
|
-#endif
|
|
- }
|
|
- }
|
|
- {
|
|
- int one = 1; int little = (int)*(unsigned char *)&one;
|
|
- unsigned char *bytes = (unsigned char *)&value;
|
|
- return _PyLong_FromByteArray(bytes, sizeof(int),
|
|
- little, !is_unsigned);
|
|
- }
|
|
-}
|
|
-
|
|
/* CIntFromPy */
|
|
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
|
|
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
|
@@ -24986,44 +23562,6 @@ __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
|
|
return (int) -1;
|
|
}
|
|
|
|
-/* CIntToPy */
|
|
- static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
|
|
-#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
|
-#pragma GCC diagnostic push
|
|
-#pragma GCC diagnostic ignored "-Wconversion"
|
|
-#endif
|
|
- const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0;
|
|
-#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
|
-#pragma GCC diagnostic pop
|
|
-#endif
|
|
- const int is_unsigned = neg_one > const_zero;
|
|
- if (is_unsigned) {
|
|
- if (sizeof(enum NPY_TYPES) < sizeof(long)) {
|
|
- return PyInt_FromLong((long) value);
|
|
- } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
|
|
- return PyLong_FromUnsignedLong((unsigned long) value);
|
|
-#ifdef HAVE_LONG_LONG
|
|
- } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
|
|
- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
|
|
-#endif
|
|
- }
|
|
- } else {
|
|
- if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
|
|
- return PyInt_FromLong((long) value);
|
|
-#ifdef HAVE_LONG_LONG
|
|
- } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
|
|
- return PyLong_FromLongLong((PY_LONG_LONG) value);
|
|
-#endif
|
|
- }
|
|
- }
|
|
- {
|
|
- int one = 1; int little = (int)*(unsigned char *)&one;
|
|
- unsigned char *bytes = (unsigned char *)&value;
|
|
- return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
|
|
- little, !is_unsigned);
|
|
- }
|
|
-}
|
|
-
|
|
/* CIntFromPy */
|
|
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
|
|
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
|
@@ -25220,6 +23758,44 @@ __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
|
|
return (long) -1;
|
|
}
|
|
|
|
+/* CIntToPy */
|
|
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
|
|
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
|
+#pragma GCC diagnostic push
|
|
+#pragma GCC diagnostic ignored "-Wconversion"
|
|
+#endif
|
|
+ const int neg_one = (int) -1, const_zero = (int) 0;
|
|
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
|
+#pragma GCC diagnostic pop
|
|
+#endif
|
|
+ const int is_unsigned = neg_one > const_zero;
|
|
+ if (is_unsigned) {
|
|
+ if (sizeof(int) < sizeof(long)) {
|
|
+ return PyInt_FromLong((long) value);
|
|
+ } else if (sizeof(int) <= sizeof(unsigned long)) {
|
|
+ return PyLong_FromUnsignedLong((unsigned long) value);
|
|
+#ifdef HAVE_LONG_LONG
|
|
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
|
|
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
|
|
+#endif
|
|
+ }
|
|
+ } else {
|
|
+ if (sizeof(int) <= sizeof(long)) {
|
|
+ return PyInt_FromLong((long) value);
|
|
+#ifdef HAVE_LONG_LONG
|
|
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
|
|
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
|
|
+#endif
|
|
+ }
|
|
+ }
|
|
+ {
|
|
+ int one = 1; int little = (int)*(unsigned char *)&one;
|
|
+ unsigned char *bytes = (unsigned char *)&value;
|
|
+ return _PyLong_FromByteArray(bytes, sizeof(int),
|
|
+ little, !is_unsigned);
|
|
+ }
|
|
+}
|
|
+
|
|
/* CIntToPy */
|
|
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
|
|
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
|
@@ -25260,11 +23836,33 @@ __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
|
|
|
|
/* CheckBinaryVersion */
|
|
static int __Pyx_check_binary_version(void) {
|
|
- char ctversion[4], rtversion[4];
|
|
- PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
|
|
- PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
|
|
- if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
|
|
+ char ctversion[5];
|
|
+ int same=1, i, found_dot;
|
|
+ const char* rt_from_call = Py_GetVersion();
|
|
+ PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
|
|
+ found_dot = 0;
|
|
+ for (i = 0; i < 4; i++) {
|
|
+ if (!ctversion[i]) {
|
|
+ same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
|
|
+ break;
|
|
+ }
|
|
+ if (rt_from_call[i] != ctversion[i]) {
|
|
+ same = 0;
|
|
+ break;
|
|
+ }
|
|
+ }
|
|
+ if (!same) {
|
|
+ char rtversion[5] = {'\0'};
|
|
char message[200];
|
|
+ for (i=0; i<4; ++i) {
|
|
+ if (rt_from_call[i] == '.') {
|
|
+ if (found_dot) break;
|
|
+ found_dot = 1;
|
|
+ } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
|
|
+ break;
|
|
+ }
|
|
+ rtversion[i] = rt_from_call[i];
|
|
+ }
|
|
PyOS_snprintf(message, sizeof(message),
|
|
"compiletime version %s of module '%.100s' "
|
|
"does not match runtime version %s",
|
|
diff --git a/fastparquet/test/test_api.py b/fastparquet/test/test_api.py
|
|
index da2e4ed7..9fb16693 100644
|
|
--- a/fastparquet/test/test_api.py
|
|
+++ b/fastparquet/test/test_api.py
|
|
@@ -941,7 +941,8 @@ def test_multi_cat(tempdir):
|
|
|
|
pf = ParquetFile(fn)
|
|
df1 = pf.to_pandas()
|
|
- assert df1.equals(df)
|
|
+ assert (df1.index.values == df.index.values).all()
|
|
+ assert (df1.c.values == df.c.values).all()
|
|
|
|
|
|
def test_multi_cat_single(tempdir):
|
|
diff --git a/fastparquet/test/test_partition_filters_specialstrings.py b/fastparquet/test/test_partition_filters_specialstrings.py
|
|
index c498b02a..059481b8 100644
|
|
--- a/fastparquet/test/test_partition_filters_specialstrings.py
|
|
+++ b/fastparquet/test/test_partition_filters_specialstrings.py
|
|
@@ -57,10 +57,6 @@ def frame_symbol_dtTrade_type_strike(days=1 * 252,
|
|
['symbol', 'dtTrade'],
|
|
[('dtTrade', '==',
|
|
'2005-01-02 00:00:00')]),
|
|
- (['NOW', 'SPY', 'VIX'], 10, 'hive', 2,
|
|
- ['symbol', 'dtTrade'],
|
|
- [('dtTrade', '==',
|
|
- Timestamp('2005-01-01 00:00:00'))]),
|
|
]
|
|
)
|
|
def test_frame_write_read_verify(tempdir, input_symbols, input_days,
|
|
diff --git a/fastparquet/test/test_read.py b/fastparquet/test/test_read.py
|
|
index cd38129a..3d20e6a5 100644
|
|
--- a/fastparquet/test/test_read.py
|
|
+++ b/fastparquet/test/test_read.py
|
|
@@ -366,7 +366,7 @@ def test_multi_index_category(tempdir):
|
|
assert dg.index.levels[0].name == 'a'
|
|
assert dg.index.levels[0].dtype == '<M8[ns]'
|
|
assert dg.index.levels[1].name == 'b'
|
|
- assert dg.equals(df)
|
|
+ assert str(dg.c.tolist()) == str(df.c.tolist()) # ignore nan and cats
|
|
|
|
|
|
def test_no_columns(tempdir):
|
|
diff --git a/requirements.txt b/requirements.txt
|
|
index 24a81d19..2277ef7d 100644
|
|
--- a/requirements.txt
|
|
+++ b/requirements.txt
|
|
@@ -1,5 +1,5 @@
|
|
-pandas>=1.1.0
|
|
-numpy>=1.18
|
|
+pandas>=1.5.0
|
|
+numpy>=1.20.3
|
|
cramjam>=2.3.0
|
|
fsspec
|
|
packaging
|