1 /* Generated by Cython 0.29.12 */
2
3 /* BEGIN: Cython Metadata
4 {
5 "distutils": {
6 "depends": [
7 "yt/utilities/lib/fixed_interpolator.hpp"
8 ],
9 "extra_compile_args": [
10 "-std=c++14"
11 ],
12 "extra_link_args": [
13 "-std=c++14"
14 ],
15 "include_dirs": [
16 "yt/utilities/lib/",
17 "./yt/utilities/lib"
18 ],
19 "language": "c++",
20 "libraries": [
21 "m"
22 ],
23 "name": "yt.utilities.lib.partitioned_grid",
24 "sources": [
25 "yt/utilities/lib/partitioned_grid.pyx",
26 "yt/utilities/lib/fixed_interpolator.cpp"
27 ]
28 },
29 "module_name": "yt.utilities.lib.partitioned_grid"
30 }
31 END: Cython Metadata */
32
33 #define PY_SSIZE_T_CLEAN
34 #include "Python.h"
35 #ifndef Py_PYTHON_H
36 #error Python headers needed to compile C extensions, please install development version of Python.
37 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
38 #error Cython requires Python 2.6+ or Python 3.3+.
39 #else
40 #define CYTHON_ABI "0_29_12"
41 #define CYTHON_HEX_VERSION 0x001D0CF0
42 #define CYTHON_FUTURE_DIVISION 0
43 #include <stddef.h>
44 #ifndef offsetof
45 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
46 #endif
47 #if !defined(WIN32) && !defined(MS_WINDOWS)
48 #ifndef __stdcall
49 #define __stdcall
50 #endif
51 #ifndef __cdecl
52 #define __cdecl
53 #endif
54 #ifndef __fastcall
55 #define __fastcall
56 #endif
57 #endif
58 #ifndef DL_IMPORT
59 #define DL_IMPORT(t) t
60 #endif
61 #ifndef DL_EXPORT
62 #define DL_EXPORT(t) t
63 #endif
64 #define __PYX_COMMA ,
65 #ifndef HAVE_LONG_LONG
66 #if PY_VERSION_HEX >= 0x02070000
67 #define HAVE_LONG_LONG
68 #endif
69 #endif
70 #ifndef PY_LONG_LONG
71 #define PY_LONG_LONG LONG_LONG
72 #endif
73 #ifndef Py_HUGE_VAL
74 #define Py_HUGE_VAL HUGE_VAL
75 #endif
76 #ifdef PYPY_VERSION
77 #define CYTHON_COMPILING_IN_PYPY 1
78 #define CYTHON_COMPILING_IN_PYSTON 0
79 #define CYTHON_COMPILING_IN_CPYTHON 0
80 #undef CYTHON_USE_TYPE_SLOTS
81 #define CYTHON_USE_TYPE_SLOTS 0
82 #undef CYTHON_USE_PYTYPE_LOOKUP
83 #define CYTHON_USE_PYTYPE_LOOKUP 0
84 #if PY_VERSION_HEX < 0x03050000
85 #undef CYTHON_USE_ASYNC_SLOTS
86 #define CYTHON_USE_ASYNC_SLOTS 0
87 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
88 #define CYTHON_USE_ASYNC_SLOTS 1
89 #endif
90 #undef CYTHON_USE_PYLIST_INTERNALS
91 #define CYTHON_USE_PYLIST_INTERNALS 0
92 #undef CYTHON_USE_UNICODE_INTERNALS
93 #define CYTHON_USE_UNICODE_INTERNALS 0
94 #undef CYTHON_USE_UNICODE_WRITER
95 #define CYTHON_USE_UNICODE_WRITER 0
96 #undef CYTHON_USE_PYLONG_INTERNALS
97 #define CYTHON_USE_PYLONG_INTERNALS 0
98 #undef CYTHON_AVOID_BORROWED_REFS
99 #define CYTHON_AVOID_BORROWED_REFS 1
100 #undef CYTHON_ASSUME_SAFE_MACROS
101 #define CYTHON_ASSUME_SAFE_MACROS 0
102 #undef CYTHON_UNPACK_METHODS
103 #define CYTHON_UNPACK_METHODS 0
104 #undef CYTHON_FAST_THREAD_STATE
105 #define CYTHON_FAST_THREAD_STATE 0
106 #undef CYTHON_FAST_PYCALL
107 #define CYTHON_FAST_PYCALL 0
108 #undef CYTHON_PEP489_MULTI_PHASE_INIT
109 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
110 #undef CYTHON_USE_TP_FINALIZE
111 #define CYTHON_USE_TP_FINALIZE 0
112 #undef CYTHON_USE_DICT_VERSIONS
113 #define CYTHON_USE_DICT_VERSIONS 0
114 #undef CYTHON_USE_EXC_INFO_STACK
115 #define CYTHON_USE_EXC_INFO_STACK 0
116 #elif defined(PYSTON_VERSION)
117 #define CYTHON_COMPILING_IN_PYPY 0
118 #define CYTHON_COMPILING_IN_PYSTON 1
119 #define CYTHON_COMPILING_IN_CPYTHON 0
120 #ifndef CYTHON_USE_TYPE_SLOTS
121 #define CYTHON_USE_TYPE_SLOTS 1
122 #endif
123 #undef CYTHON_USE_PYTYPE_LOOKUP
124 #define CYTHON_USE_PYTYPE_LOOKUP 0
125 #undef CYTHON_USE_ASYNC_SLOTS
126 #define CYTHON_USE_ASYNC_SLOTS 0
127 #undef CYTHON_USE_PYLIST_INTERNALS
128 #define CYTHON_USE_PYLIST_INTERNALS 0
129 #ifndef CYTHON_USE_UNICODE_INTERNALS
130 #define CYTHON_USE_UNICODE_INTERNALS 1
131 #endif
132 #undef CYTHON_USE_UNICODE_WRITER
133 #define CYTHON_USE_UNICODE_WRITER 0
134 #undef CYTHON_USE_PYLONG_INTERNALS
135 #define CYTHON_USE_PYLONG_INTERNALS 0
136 #ifndef CYTHON_AVOID_BORROWED_REFS
137 #define CYTHON_AVOID_BORROWED_REFS 0
138 #endif
139 #ifndef CYTHON_ASSUME_SAFE_MACROS
140 #define CYTHON_ASSUME_SAFE_MACROS 1
141 #endif
142 #ifndef CYTHON_UNPACK_METHODS
143 #define CYTHON_UNPACK_METHODS 1
144 #endif
145 #undef CYTHON_FAST_THREAD_STATE
146 #define CYTHON_FAST_THREAD_STATE 0
147 #undef CYTHON_FAST_PYCALL
148 #define CYTHON_FAST_PYCALL 0
149 #undef CYTHON_PEP489_MULTI_PHASE_INIT
150 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
151 #undef CYTHON_USE_TP_FINALIZE
152 #define CYTHON_USE_TP_FINALIZE 0
153 #undef CYTHON_USE_DICT_VERSIONS
154 #define CYTHON_USE_DICT_VERSIONS 0
155 #undef CYTHON_USE_EXC_INFO_STACK
156 #define CYTHON_USE_EXC_INFO_STACK 0
157 #else
158 #define CYTHON_COMPILING_IN_PYPY 0
159 #define CYTHON_COMPILING_IN_PYSTON 0
160 #define CYTHON_COMPILING_IN_CPYTHON 1
161 #ifndef CYTHON_USE_TYPE_SLOTS
162 #define CYTHON_USE_TYPE_SLOTS 1
163 #endif
164 #if PY_VERSION_HEX < 0x02070000
165 #undef CYTHON_USE_PYTYPE_LOOKUP
166 #define CYTHON_USE_PYTYPE_LOOKUP 0
167 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
168 #define CYTHON_USE_PYTYPE_LOOKUP 1
169 #endif
170 #if PY_MAJOR_VERSION < 3
171 #undef CYTHON_USE_ASYNC_SLOTS
172 #define CYTHON_USE_ASYNC_SLOTS 0
173 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
174 #define CYTHON_USE_ASYNC_SLOTS 1
175 #endif
176 #if PY_VERSION_HEX < 0x02070000
177 #undef CYTHON_USE_PYLONG_INTERNALS
178 #define CYTHON_USE_PYLONG_INTERNALS 0
179 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
180 #define CYTHON_USE_PYLONG_INTERNALS 1
181 #endif
182 #ifndef CYTHON_USE_PYLIST_INTERNALS
183 #define CYTHON_USE_PYLIST_INTERNALS 1
184 #endif
185 #ifndef CYTHON_USE_UNICODE_INTERNALS
186 #define CYTHON_USE_UNICODE_INTERNALS 1
187 #endif
188 #if PY_VERSION_HEX < 0x030300F0
189 #undef CYTHON_USE_UNICODE_WRITER
190 #define CYTHON_USE_UNICODE_WRITER 0
191 #elif !defined(CYTHON_USE_UNICODE_WRITER)
192 #define CYTHON_USE_UNICODE_WRITER 1
193 #endif
194 #ifndef CYTHON_AVOID_BORROWED_REFS
195 #define CYTHON_AVOID_BORROWED_REFS 0
196 #endif
197 #ifndef CYTHON_ASSUME_SAFE_MACROS
198 #define CYTHON_ASSUME_SAFE_MACROS 1
199 #endif
200 #ifndef CYTHON_UNPACK_METHODS
201 #define CYTHON_UNPACK_METHODS 1
202 #endif
203 #ifndef CYTHON_FAST_THREAD_STATE
204 #define CYTHON_FAST_THREAD_STATE 1
205 #endif
206 #ifndef CYTHON_FAST_PYCALL
207 #define CYTHON_FAST_PYCALL 1
208 #endif
209 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
210 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
211 #endif
212 #ifndef CYTHON_USE_TP_FINALIZE
213 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
214 #endif
215 #ifndef CYTHON_USE_DICT_VERSIONS
216 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
217 #endif
218 #ifndef CYTHON_USE_EXC_INFO_STACK
219 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
220 #endif
221 #endif
222 #if !defined(CYTHON_FAST_PYCCALL)
223 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
224 #endif
225 #if CYTHON_USE_PYLONG_INTERNALS
226 #include "longintrepr.h"
227 #undef SHIFT
228 #undef BASE
229 #undef MASK
230 #ifdef SIZEOF_VOID_P
231 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
232 #endif
233 #endif
234 #ifndef __has_attribute
235 #define __has_attribute(x) 0
236 #endif
237 #ifndef __has_cpp_attribute
238 #define __has_cpp_attribute(x) 0
239 #endif
240 #ifndef CYTHON_RESTRICT
241 #if defined(__GNUC__)
242 #define CYTHON_RESTRICT __restrict__
243 #elif defined(_MSC_VER) && _MSC_VER >= 1400
244 #define CYTHON_RESTRICT __restrict
245 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
246 #define CYTHON_RESTRICT restrict
247 #else
248 #define CYTHON_RESTRICT
249 #endif
250 #endif
251 #ifndef CYTHON_UNUSED
252 # if defined(__GNUC__)
253 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
254 # define CYTHON_UNUSED __attribute__ ((__unused__))
255 # else
256 # define CYTHON_UNUSED
257 # endif
258 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
259 # define CYTHON_UNUSED __attribute__ ((__unused__))
260 # else
261 # define CYTHON_UNUSED
262 # endif
263 #endif
264 #ifndef CYTHON_MAYBE_UNUSED_VAR
265 # if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)266 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
267 # else
268 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
269 # endif
270 #endif
271 #ifndef CYTHON_NCP_UNUSED
272 # if CYTHON_COMPILING_IN_CPYTHON
273 # define CYTHON_NCP_UNUSED
274 # else
275 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
276 # endif
277 #endif
278 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
279 #ifdef _MSC_VER
280 #ifndef _MSC_STDINT_H_
281 #if _MSC_VER < 1300
282 typedef unsigned char uint8_t;
283 typedef unsigned int uint32_t;
284 #else
285 typedef unsigned __int8 uint8_t;
286 typedef unsigned __int32 uint32_t;
287 #endif
288 #endif
289 #else
290 #include <stdint.h>
291 #endif
292 #ifndef CYTHON_FALLTHROUGH
293 #if defined(__cplusplus) && __cplusplus >= 201103L
294 #if __has_cpp_attribute(fallthrough)
295 #define CYTHON_FALLTHROUGH [[fallthrough]]
296 #elif __has_cpp_attribute(clang::fallthrough)
297 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
298 #elif __has_cpp_attribute(gnu::fallthrough)
299 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
300 #endif
301 #endif
302 #ifndef CYTHON_FALLTHROUGH
303 #if __has_attribute(fallthrough)
304 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
305 #else
306 #define CYTHON_FALLTHROUGH
307 #endif
308 #endif
309 #if defined(__clang__ ) && defined(__apple_build_version__)
310 #if __apple_build_version__ < 7000000
311 #undef CYTHON_FALLTHROUGH
312 #define CYTHON_FALLTHROUGH
313 #endif
314 #endif
315 #endif
316
317 #ifndef __cplusplus
318 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
319 #endif
320 #ifndef CYTHON_INLINE
321 #if defined(__clang__)
322 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
323 #else
324 #define CYTHON_INLINE inline
325 #endif
326 #endif
327 template<typename T>
__Pyx_call_destructor(T & x)328 void __Pyx_call_destructor(T& x) {
329 x.~T();
330 }
331 template<typename T>
332 class __Pyx_FakeReference {
333 public:
__Pyx_FakeReference()334 __Pyx_FakeReference() : ptr(NULL) { }
__Pyx_FakeReference(const T & ref)335 __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
operator ->()336 T *operator->() { return ptr; }
operator &()337 T *operator&() { return ptr; }
operator T&()338 operator T&() { return *ptr; }
operator ==(U other)339 template<typename U> bool operator ==(U other) { return *ptr == other; }
operator !=(U other)340 template<typename U> bool operator !=(U other) { return *ptr != other; }
341 private:
342 T *ptr;
343 };
344
345 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
346 #define Py_OptimizeFlag 0
347 #endif
348 #define __PYX_BUILD_PY_SSIZE_T "n"
349 #define CYTHON_FORMAT_SSIZE_T "z"
350 #if PY_MAJOR_VERSION < 3
351 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
352 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
353 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
354 #define __Pyx_DefaultClassType PyClass_Type
355 #else
356 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
357 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
358 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
359 PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
360 #else
361 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
362 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
363 #endif
364 #define __Pyx_DefaultClassType PyType_Type
365 #endif
366 #ifndef Py_TPFLAGS_CHECKTYPES
367 #define Py_TPFLAGS_CHECKTYPES 0
368 #endif
369 #ifndef Py_TPFLAGS_HAVE_INDEX
370 #define Py_TPFLAGS_HAVE_INDEX 0
371 #endif
372 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
373 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
374 #endif
375 #ifndef Py_TPFLAGS_HAVE_FINALIZE
376 #define Py_TPFLAGS_HAVE_FINALIZE 0
377 #endif
378 #ifndef METH_STACKLESS
379 #define METH_STACKLESS 0
380 #endif
381 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
382 #ifndef METH_FASTCALL
383 #define METH_FASTCALL 0x80
384 #endif
385 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
386 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
387 Py_ssize_t nargs, PyObject *kwnames);
388 #else
389 #define __Pyx_PyCFunctionFast _PyCFunctionFast
390 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
391 #endif
392 #if CYTHON_FAST_PYCCALL
393 #define __Pyx_PyFastCFunction_Check(func)\
394 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
395 #else
396 #define __Pyx_PyFastCFunction_Check(func) 0
397 #endif
398 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
399 #define PyObject_Malloc(s) PyMem_Malloc(s)
400 #define PyObject_Free(p) PyMem_Free(p)
401 #define PyObject_Realloc(p) PyMem_Realloc(p)
402 #endif
403 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
404 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
405 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
406 #define PyMem_RawFree(p) PyMem_Free(p)
407 #endif
408 #if CYTHON_COMPILING_IN_PYSTON
409 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
410 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
411 #else
412 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
413 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
414 #endif
415 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
416 #define __Pyx_PyThreadState_Current PyThreadState_GET()
417 #elif PY_VERSION_HEX >= 0x03060000
418 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
419 #elif PY_VERSION_HEX >= 0x03000000
420 #define __Pyx_PyThreadState_Current PyThreadState_GET()
421 #else
422 #define __Pyx_PyThreadState_Current _PyThreadState_Current
423 #endif
424 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
425 #include "pythread.h"
426 #define Py_tss_NEEDS_INIT 0
427 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)428 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
429 *key = PyThread_create_key();
430 return 0;
431 }
PyThread_tss_alloc(void)432 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
433 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
434 *key = Py_tss_NEEDS_INIT;
435 return key;
436 }
PyThread_tss_free(Py_tss_t * key)437 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
438 PyObject_Free(key);
439 }
PyThread_tss_is_created(Py_tss_t * key)440 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
441 return *key != Py_tss_NEEDS_INIT;
442 }
PyThread_tss_delete(Py_tss_t * key)443 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
444 PyThread_delete_key(*key);
445 *key = Py_tss_NEEDS_INIT;
446 }
PyThread_tss_set(Py_tss_t * key,void * value)447 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
448 return PyThread_set_key_value(*key, value);
449 }
PyThread_tss_get(Py_tss_t * key)450 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
451 return PyThread_get_key_value(*key);
452 }
453 #endif
454 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
455 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
456 #else
457 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
458 #endif
459 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
460 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
461 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
462 #else
463 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
464 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
465 #endif
466 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
467 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
468 #else
469 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
470 #endif
471 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
472 #define CYTHON_PEP393_ENABLED 1
473 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
474 0 : _PyUnicode_Ready((PyObject *)(op)))
475 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
476 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
477 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
478 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
479 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
480 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
481 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
482 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
483 #else
484 #define CYTHON_PEP393_ENABLED 0
485 #define PyUnicode_1BYTE_KIND 1
486 #define PyUnicode_2BYTE_KIND 2
487 #define PyUnicode_4BYTE_KIND 4
488 #define __Pyx_PyUnicode_READY(op) (0)
489 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
490 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
491 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
492 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
493 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
494 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
495 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
496 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
497 #endif
498 #if CYTHON_COMPILING_IN_PYPY
499 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
500 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
501 #else
502 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
503 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
504 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
505 #endif
506 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
507 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
508 #endif
509 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
510 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
511 #endif
512 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
513 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
514 #endif
515 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
516 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
517 #if PY_MAJOR_VERSION >= 3
518 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
519 #else
520 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
521 #endif
522 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
523 #define PyObject_ASCII(o) PyObject_Repr(o)
524 #endif
525 #if PY_MAJOR_VERSION >= 3
526 #define PyBaseString_Type PyUnicode_Type
527 #define PyStringObject PyUnicodeObject
528 #define PyString_Type PyUnicode_Type
529 #define PyString_Check PyUnicode_Check
530 #define PyString_CheckExact PyUnicode_CheckExact
531 #define PyObject_Unicode PyObject_Str
532 #endif
533 #if PY_MAJOR_VERSION >= 3
534 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
535 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
536 #else
537 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
538 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
539 #endif
540 #ifndef PySet_CheckExact
541 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
542 #endif
543 #if CYTHON_ASSUME_SAFE_MACROS
544 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
545 #else
546 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
547 #endif
548 #if PY_MAJOR_VERSION >= 3
549 #define PyIntObject PyLongObject
550 #define PyInt_Type PyLong_Type
551 #define PyInt_Check(op) PyLong_Check(op)
552 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
553 #define PyInt_FromString PyLong_FromString
554 #define PyInt_FromUnicode PyLong_FromUnicode
555 #define PyInt_FromLong PyLong_FromLong
556 #define PyInt_FromSize_t PyLong_FromSize_t
557 #define PyInt_FromSsize_t PyLong_FromSsize_t
558 #define PyInt_AsLong PyLong_AsLong
559 #define PyInt_AS_LONG PyLong_AS_LONG
560 #define PyInt_AsSsize_t PyLong_AsSsize_t
561 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
562 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
563 #define PyNumber_Int PyNumber_Long
564 #endif
565 #if PY_MAJOR_VERSION >= 3
566 #define PyBoolObject PyLongObject
567 #endif
568 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
569 #ifndef PyUnicode_InternFromString
570 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
571 #endif
572 #endif
573 #if PY_VERSION_HEX < 0x030200A4
574 typedef long Py_hash_t;
575 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
576 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
577 #else
578 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
579 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
580 #endif
581 #if PY_MAJOR_VERSION >= 3
582 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
583 #else
584 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
585 #endif
586 #if CYTHON_USE_ASYNC_SLOTS
587 #if PY_VERSION_HEX >= 0x030500B1
588 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
589 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
590 #else
591 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
592 #endif
593 #else
594 #define __Pyx_PyType_AsAsync(obj) NULL
595 #endif
596 #ifndef __Pyx_PyAsyncMethodsStruct
597 typedef struct {
598 unaryfunc am_await;
599 unaryfunc am_aiter;
600 unaryfunc am_anext;
601 } __Pyx_PyAsyncMethodsStruct;
602 #endif
603
604 #if defined(WIN32) || defined(MS_WINDOWS)
605 #define _USE_MATH_DEFINES
606 #endif
607 #include <math.h>
608 #ifdef NAN
609 #define __PYX_NAN() ((float) NAN)
610 #else
__PYX_NAN()611 static CYTHON_INLINE float __PYX_NAN() {
612 float value;
613 memset(&value, 0xFF, sizeof(value));
614 return value;
615 }
616 #endif
617 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
618 #define __Pyx_truncl trunc
619 #else
620 #define __Pyx_truncl truncl
621 #endif
622
623
624 #define __PYX_ERR(f_index, lineno, Ln_error) \
625 { \
626 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
627 }
628
629 #ifndef __PYX_EXTERN_C
630 #ifdef __cplusplus
631 #define __PYX_EXTERN_C extern "C"
632 #else
633 #define __PYX_EXTERN_C extern
634 #endif
635 #endif
636
637 #define __PYX_HAVE__yt__utilities__lib__partitioned_grid
638 #define __PYX_HAVE_API__yt__utilities__lib__partitioned_grid
639 /* Early includes */
640 #include <string.h>
641 #include <stdio.h>
642 #include "numpy/arrayobject.h"
643 #include "numpy/ufuncobject.h"
644 #include <stdlib.h>
645 #include "fixed_interpolator.hpp"
646 #ifdef _OPENMP
647 #include <omp.h>
648 #endif /* _OPENMP */
649
650 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
651 #define CYTHON_WITHOUT_ASSERTIONS
652 #endif
653
654 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
655 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
656
657 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
658 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
659 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
660 #define __PYX_DEFAULT_STRING_ENCODING ""
661 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
662 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
663 #define __Pyx_uchar_cast(c) ((unsigned char)c)
664 #define __Pyx_long_cast(x) ((long)x)
665 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
666 (sizeof(type) < sizeof(Py_ssize_t)) ||\
667 (sizeof(type) > sizeof(Py_ssize_t) &&\
668 likely(v < (type)PY_SSIZE_T_MAX ||\
669 v == (type)PY_SSIZE_T_MAX) &&\
670 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
671 v == (type)PY_SSIZE_T_MIN))) ||\
672 (sizeof(type) == sizeof(Py_ssize_t) &&\
673 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
674 v == (type)PY_SSIZE_T_MAX))) )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)675 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
676 return (size_t) i < (size_t) limit;
677 }
678 #if defined (__cplusplus) && __cplusplus >= 201103L
679 #include <cstdlib>
680 #define __Pyx_sst_abs(value) std::abs(value)
681 #elif SIZEOF_INT >= SIZEOF_SIZE_T
682 #define __Pyx_sst_abs(value) abs(value)
683 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
684 #define __Pyx_sst_abs(value) labs(value)
685 #elif defined (_MSC_VER)
686 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
687 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
688 #define __Pyx_sst_abs(value) llabs(value)
689 #elif defined (__GNUC__)
690 #define __Pyx_sst_abs(value) __builtin_llabs(value)
691 #else
692 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
693 #endif
694 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
695 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
696 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
697 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
698 #define __Pyx_PyBytes_FromString PyBytes_FromString
699 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
700 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
701 #if PY_MAJOR_VERSION < 3
702 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
703 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
704 #else
705 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
706 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
707 #endif
708 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
709 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
710 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
711 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
712 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
713 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
714 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
715 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
716 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
717 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
718 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
719 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
720 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
721 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
722 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
723 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)724 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
725 const Py_UNICODE *u_end = u;
726 while (*u_end++) ;
727 return (size_t)(u_end - u - 1);
728 }
729 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
730 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
731 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
732 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
733 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
734 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
735 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
736 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
737 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
738 #define __Pyx_PySequence_Tuple(obj)\
739 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
740 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
741 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
742 #if CYTHON_ASSUME_SAFE_MACROS
743 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
744 #else
745 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
746 #endif
747 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
748 #if PY_MAJOR_VERSION >= 3
749 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
750 #else
751 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
752 #endif
753 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
754 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
755 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)756 static int __Pyx_init_sys_getdefaultencoding_params(void) {
757 PyObject* sys;
758 PyObject* default_encoding = NULL;
759 PyObject* ascii_chars_u = NULL;
760 PyObject* ascii_chars_b = NULL;
761 const char* default_encoding_c;
762 sys = PyImport_ImportModule("sys");
763 if (!sys) goto bad;
764 default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
765 Py_DECREF(sys);
766 if (!default_encoding) goto bad;
767 default_encoding_c = PyBytes_AsString(default_encoding);
768 if (!default_encoding_c) goto bad;
769 if (strcmp(default_encoding_c, "ascii") == 0) {
770 __Pyx_sys_getdefaultencoding_not_ascii = 0;
771 } else {
772 char ascii_chars[128];
773 int c;
774 for (c = 0; c < 128; c++) {
775 ascii_chars[c] = c;
776 }
777 __Pyx_sys_getdefaultencoding_not_ascii = 1;
778 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
779 if (!ascii_chars_u) goto bad;
780 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
781 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
782 PyErr_Format(
783 PyExc_ValueError,
784 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
785 default_encoding_c);
786 goto bad;
787 }
788 Py_DECREF(ascii_chars_u);
789 Py_DECREF(ascii_chars_b);
790 }
791 Py_DECREF(default_encoding);
792 return 0;
793 bad:
794 Py_XDECREF(default_encoding);
795 Py_XDECREF(ascii_chars_u);
796 Py_XDECREF(ascii_chars_b);
797 return -1;
798 }
799 #endif
800 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
801 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
802 #else
803 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
804 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
805 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)806 static int __Pyx_init_sys_getdefaultencoding_params(void) {
807 PyObject* sys;
808 PyObject* default_encoding = NULL;
809 char* default_encoding_c;
810 sys = PyImport_ImportModule("sys");
811 if (!sys) goto bad;
812 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
813 Py_DECREF(sys);
814 if (!default_encoding) goto bad;
815 default_encoding_c = PyBytes_AsString(default_encoding);
816 if (!default_encoding_c) goto bad;
817 __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
818 if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
819 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
820 Py_DECREF(default_encoding);
821 return 0;
822 bad:
823 Py_XDECREF(default_encoding);
824 return -1;
825 }
826 #endif
827 #endif
828
829
830 /* Test for GCC > 2.95 */
831 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
832 #define likely(x) __builtin_expect(!!(x), 1)
833 #define unlikely(x) __builtin_expect(!!(x), 0)
834 #else /* !__GNUC__ or GCC < 2.95 */
835 #define likely(x) (x)
836 #define unlikely(x) (x)
837 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)838 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
839
840 static PyObject *__pyx_m = NULL;
841 static PyObject *__pyx_d;
842 static PyObject *__pyx_b;
843 static PyObject *__pyx_cython_runtime = NULL;
844 static PyObject *__pyx_empty_tuple;
845 static PyObject *__pyx_empty_bytes;
846 static PyObject *__pyx_empty_unicode;
847 static int __pyx_lineno;
848 static int __pyx_clineno = 0;
849 static const char * __pyx_cfilenm= __FILE__;
850 static const char *__pyx_filename;
851
852 /* Header.proto */
853 #if !defined(CYTHON_CCOMPLEX)
854 #if defined(__cplusplus)
855 #define CYTHON_CCOMPLEX 1
856 #elif defined(_Complex_I)
857 #define CYTHON_CCOMPLEX 1
858 #else
859 #define CYTHON_CCOMPLEX 0
860 #endif
861 #endif
862 #if CYTHON_CCOMPLEX
863 #ifdef __cplusplus
864 #include <complex>
865 #else
866 #include <complex.h>
867 #endif
868 #endif
869 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
870 #undef _Complex_I
871 #define _Complex_I 1.0fj
872 #endif
873
874
875 static const char *__pyx_f[] = {
876 "yt/utilities/lib/partitioned_grid.pyx",
877 "stringsource",
878 "yt/utilities/lib/partitioned_grid.pxd",
879 "__init__.pxd",
880 "type.pxd",
881 };
882 /* BufferFormatStructs.proto */
883 #define IS_UNSIGNED(type) (((type) -1) > 0)
884 struct __Pyx_StructField_;
885 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
886 typedef struct {
887 const char* name;
888 struct __Pyx_StructField_* fields;
889 size_t size;
890 size_t arraysize[8];
891 int ndim;
892 char typegroup;
893 char is_unsigned;
894 int flags;
895 } __Pyx_TypeInfo;
896 typedef struct __Pyx_StructField_ {
897 __Pyx_TypeInfo* type;
898 const char* name;
899 size_t offset;
900 } __Pyx_StructField;
901 typedef struct {
902 __Pyx_StructField* field;
903 size_t parent_offset;
904 } __Pyx_BufFmt_StackElem;
905 typedef struct {
906 __Pyx_StructField root;
907 __Pyx_BufFmt_StackElem* head;
908 size_t fmt_offset;
909 size_t new_count, enc_count;
910 size_t struct_alignment;
911 int is_complex;
912 char enc_type;
913 char new_packmode;
914 char enc_packmode;
915 char is_valid_array;
916 } __Pyx_BufFmt_Context;
917
918
919 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776
920 * # in Cython to enable them only on the right systems.
921 *
922 * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
923 * ctypedef npy_int16 int16_t
924 * ctypedef npy_int32 int32_t
925 */
926 typedef npy_int8 __pyx_t_5numpy_int8_t;
927
928 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":777
929 *
930 * ctypedef npy_int8 int8_t
931 * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
932 * ctypedef npy_int32 int32_t
933 * ctypedef npy_int64 int64_t
934 */
935 typedef npy_int16 __pyx_t_5numpy_int16_t;
936
937 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778
938 * ctypedef npy_int8 int8_t
939 * ctypedef npy_int16 int16_t
940 * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
941 * ctypedef npy_int64 int64_t
942 * #ctypedef npy_int96 int96_t
943 */
944 typedef npy_int32 __pyx_t_5numpy_int32_t;
945
946 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779
947 * ctypedef npy_int16 int16_t
948 * ctypedef npy_int32 int32_t
949 * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
950 * #ctypedef npy_int96 int96_t
951 * #ctypedef npy_int128 int128_t
952 */
953 typedef npy_int64 __pyx_t_5numpy_int64_t;
954
955 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":783
956 * #ctypedef npy_int128 int128_t
957 *
958 * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
959 * ctypedef npy_uint16 uint16_t
960 * ctypedef npy_uint32 uint32_t
961 */
962 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
963
964 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784
965 *
966 * ctypedef npy_uint8 uint8_t
967 * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
968 * ctypedef npy_uint32 uint32_t
969 * ctypedef npy_uint64 uint64_t
970 */
971 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
972
973 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785
974 * ctypedef npy_uint8 uint8_t
975 * ctypedef npy_uint16 uint16_t
976 * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
977 * ctypedef npy_uint64 uint64_t
978 * #ctypedef npy_uint96 uint96_t
979 */
980 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
981
982 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":786
983 * ctypedef npy_uint16 uint16_t
984 * ctypedef npy_uint32 uint32_t
985 * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
986 * #ctypedef npy_uint96 uint96_t
987 * #ctypedef npy_uint128 uint128_t
988 */
989 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
990
991 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790
992 * #ctypedef npy_uint128 uint128_t
993 *
994 * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
995 * ctypedef npy_float64 float64_t
996 * #ctypedef npy_float80 float80_t
997 */
998 typedef npy_float32 __pyx_t_5numpy_float32_t;
999
1000 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791
1001 *
1002 * ctypedef npy_float32 float32_t
1003 * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1004 * #ctypedef npy_float80 float80_t
1005 * #ctypedef npy_float128 float128_t
1006 */
1007 typedef npy_float64 __pyx_t_5numpy_float64_t;
1008
1009 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":800
1010 * # The int types are mapped a bit surprising --
1011 * # numpy.int corresponds to 'l' and numpy.long to 'q'
1012 * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1013 * ctypedef npy_longlong long_t
1014 * ctypedef npy_longlong longlong_t
1015 */
1016 typedef npy_long __pyx_t_5numpy_int_t;
1017
1018 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801
1019 * # numpy.int corresponds to 'l' and numpy.long to 'q'
1020 * ctypedef npy_long int_t
1021 * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1022 * ctypedef npy_longlong longlong_t
1023 *
1024 */
1025 typedef npy_longlong __pyx_t_5numpy_long_t;
1026
1027 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802
1028 * ctypedef npy_long int_t
1029 * ctypedef npy_longlong long_t
1030 * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1031 *
1032 * ctypedef npy_ulong uint_t
1033 */
1034 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1035
1036 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":804
1037 * ctypedef npy_longlong longlong_t
1038 *
1039 * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1040 * ctypedef npy_ulonglong ulong_t
1041 * ctypedef npy_ulonglong ulonglong_t
1042 */
1043 typedef npy_ulong __pyx_t_5numpy_uint_t;
1044
1045 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805
1046 *
1047 * ctypedef npy_ulong uint_t
1048 * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1049 * ctypedef npy_ulonglong ulonglong_t
1050 *
1051 */
1052 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1053
1054 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806
1055 * ctypedef npy_ulong uint_t
1056 * ctypedef npy_ulonglong ulong_t
1057 * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1058 *
1059 * ctypedef npy_intp intp_t
1060 */
1061 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1062
1063 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":808
1064 * ctypedef npy_ulonglong ulonglong_t
1065 *
1066 * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1067 * ctypedef npy_uintp uintp_t
1068 *
1069 */
1070 typedef npy_intp __pyx_t_5numpy_intp_t;
1071
1072 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809
1073 *
1074 * ctypedef npy_intp intp_t
1075 * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1076 *
1077 * ctypedef npy_double float_t
1078 */
1079 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1080
1081 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":811
1082 * ctypedef npy_uintp uintp_t
1083 *
1084 * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1085 * ctypedef npy_double double_t
1086 * ctypedef npy_longdouble longdouble_t
1087 */
1088 typedef npy_double __pyx_t_5numpy_float_t;
1089
1090 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812
1091 *
1092 * ctypedef npy_double float_t
1093 * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1094 * ctypedef npy_longdouble longdouble_t
1095 *
1096 */
1097 typedef npy_double __pyx_t_5numpy_double_t;
1098
1099 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813
1100 * ctypedef npy_double float_t
1101 * ctypedef npy_double double_t
1102 * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1103 *
1104 * ctypedef npy_cfloat cfloat_t
1105 */
1106 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1107 /* Declarations.proto */
1108 #if CYTHON_CCOMPLEX
1109 #ifdef __cplusplus
1110 typedef ::std::complex< float > __pyx_t_float_complex;
1111 #else
1112 typedef float _Complex __pyx_t_float_complex;
1113 #endif
1114 #else
1115 typedef struct { float real, imag; } __pyx_t_float_complex;
1116 #endif
1117 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1118
1119 /* Declarations.proto */
1120 #if CYTHON_CCOMPLEX
1121 #ifdef __cplusplus
1122 typedef ::std::complex< double > __pyx_t_double_complex;
1123 #else
1124 typedef double _Complex __pyx_t_double_complex;
1125 #endif
1126 #else
1127 typedef struct { double real, imag; } __pyx_t_double_complex;
1128 #endif
1129 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1130
1131
1132 /*--- Type declarations ---*/
1133 struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid;
1134
1135 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":815
1136 * ctypedef npy_longdouble longdouble_t
1137 *
1138 * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1139 * ctypedef npy_cdouble cdouble_t
1140 * ctypedef npy_clongdouble clongdouble_t
1141 */
1142 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1143
1144 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":816
1145 *
1146 * ctypedef npy_cfloat cfloat_t
1147 * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1148 * ctypedef npy_clongdouble clongdouble_t
1149 *
1150 */
1151 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1152
1153 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":817
1154 * ctypedef npy_cfloat cfloat_t
1155 * ctypedef npy_cdouble cdouble_t
1156 * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1157 *
1158 * ctypedef npy_cdouble complex_t
1159 */
1160 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1161
1162 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":819
1163 * ctypedef npy_clongdouble clongdouble_t
1164 *
1165 * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1166 *
1167 * cdef inline object PyArray_MultiIterNew1(a):
1168 */
1169 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1170 struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer;
1171
1172 /* "volume_container.pxd":13
1173 *
1174 *
1175 * cdef struct VolumeContainer: # <<<<<<<<<<<<<<
1176 * #-----------------------------------------------------------------------------
1177 * # Encapsulates a volume container used for volume rendering.
1178 */
1179 struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer {
1180 int n_fields;
1181 __pyx_t_5numpy_float64_t **data;
1182 __pyx_t_5numpy_uint8_t *mask;
1183 __pyx_t_5numpy_float64_t left_edge[3];
1184 __pyx_t_5numpy_float64_t right_edge[3];
1185 __pyx_t_5numpy_float64_t dds[3];
1186 __pyx_t_5numpy_float64_t idds[3];
1187 int dims[3];
1188 };
1189
1190 /* "yt/utilities/lib/partitioned_grid.pxd":18
1191 *
1192 *
1193 * cdef class PartitionedGrid: # <<<<<<<<<<<<<<
1194 * cdef public object my_data
1195 * cdef public object source_mask
1196 */
1197 struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid {
1198 PyObject_HEAD
1199 struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_vtab;
1200 PyObject *my_data;
1201 PyObject *source_mask;
1202 PyObject *LeftEdge;
1203 PyObject *RightEdge;
1204 int parent_grid_id;
1205 struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *container;
1206 __pyx_t_5numpy_float64_t star_er;
1207 __pyx_t_5numpy_float64_t star_sigma_num;
1208 __pyx_t_5numpy_float64_t star_coeff;
1209 };
1210
1211
1212
1213 /* "yt/utilities/lib/partitioned_grid.pyx":24
1214 *
1215 *
1216 * cdef class PartitionedGrid: # <<<<<<<<<<<<<<
1217 *
1218 * @cython.boundscheck(False)
1219 */
1220
1221 struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid {
1222 void (*get_vector_field)(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *);
1223 };
1224 static struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid;
1225
1226 /* --- Runtime support code (head) --- */
1227 /* Refnanny.proto */
1228 #ifndef CYTHON_REFNANNY
1229 #define CYTHON_REFNANNY 0
1230 #endif
1231 #if CYTHON_REFNANNY
1232 typedef struct {
1233 void (*INCREF)(void*, PyObject*, int);
1234 void (*DECREF)(void*, PyObject*, int);
1235 void (*GOTREF)(void*, PyObject*, int);
1236 void (*GIVEREF)(void*, PyObject*, int);
1237 void* (*SetupContext)(const char*, int, const char*);
1238 void (*FinishContext)(void**);
1239 } __Pyx_RefNannyAPIStruct;
1240 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1241 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1242 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1243 #ifdef WITH_THREAD
1244 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1245 if (acquire_gil) {\
1246 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1247 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1248 PyGILState_Release(__pyx_gilstate_save);\
1249 } else {\
1250 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1251 }
1252 #else
1253 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1254 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1255 #endif
1256 #define __Pyx_RefNannyFinishContext()\
1257 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1258 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1259 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1260 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1261 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1262 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1263 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1264 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1265 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1266 #else
1267 #define __Pyx_RefNannyDeclarations
1268 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1269 #define __Pyx_RefNannyFinishContext()
1270 #define __Pyx_INCREF(r) Py_INCREF(r)
1271 #define __Pyx_DECREF(r) Py_DECREF(r)
1272 #define __Pyx_GOTREF(r)
1273 #define __Pyx_GIVEREF(r)
1274 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1275 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1276 #define __Pyx_XGOTREF(r)
1277 #define __Pyx_XGIVEREF(r)
1278 #endif
1279 #define __Pyx_XDECREF_SET(r, v) do {\
1280 PyObject *tmp = (PyObject *) r;\
1281 r = v; __Pyx_XDECREF(tmp);\
1282 } while (0)
1283 #define __Pyx_DECREF_SET(r, v) do {\
1284 PyObject *tmp = (PyObject *) r;\
1285 r = v; __Pyx_DECREF(tmp);\
1286 } while (0)
1287 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1288 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1289
1290 /* PyObjectGetAttrStr.proto */
1291 #if CYTHON_USE_TYPE_SLOTS
1292 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1293 #else
1294 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1295 #endif
1296
1297 /* GetBuiltinName.proto */
1298 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1299
1300 /* RaiseArgTupleInvalid.proto */
1301 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1302 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1303
1304 /* RaiseDoubleKeywords.proto */
1305 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1306
1307 /* ParseKeywords.proto */
1308 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1309 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1310 const char* function_name);
1311
1312 /* ArgTypeTest.proto */
1313 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1314 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1315 __Pyx__ArgTypeTest(obj, type, name, exact))
1316 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1317
1318 /* IsLittleEndian.proto */
1319 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
1320
1321 /* BufferFormatCheck.proto */
1322 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
1323 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
1324 __Pyx_BufFmt_StackElem* stack,
1325 __Pyx_TypeInfo* type);
1326
1327 /* BufferGetAndValidate.proto */
1328 #define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
1329 ((obj == Py_None || obj == NULL) ?\
1330 (__Pyx_ZeroBuffer(buf), 0) :\
1331 __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
1332 static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
1333 __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
1334 static void __Pyx_ZeroBuffer(Py_buffer* buf);
1335 static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
1336 static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
1337 static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
1338
1339 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
1340 /* ExtTypeTest.proto */
1341 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1342
1343 /* BufferFallbackError.proto */
1344 static void __Pyx_RaiseBufferFallbackError(void);
1345
1346 /* GetItemInt.proto */
1347 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1348 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1349 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1350 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1351 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1352 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1353 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1354 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1355 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1356 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1357 int wraparound, int boundscheck);
1358 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1359 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1360 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1361 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1362 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1363 int wraparound, int boundscheck);
1364 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1365 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1366 int is_list, int wraparound, int boundscheck);
1367
1368 /* PyThreadStateGet.proto */
1369 #if CYTHON_FAST_THREAD_STATE
1370 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1371 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1372 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1373 #else
1374 #define __Pyx_PyThreadState_declare
1375 #define __Pyx_PyThreadState_assign
1376 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1377 #endif
1378
1379 /* PyErrFetchRestore.proto */
1380 #if CYTHON_FAST_THREAD_STATE
1381 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1382 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1383 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1384 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1385 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1386 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1387 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1388 #if CYTHON_COMPILING_IN_CPYTHON
1389 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1390 #else
1391 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1392 #endif
1393 #else
1394 #define __Pyx_PyErr_Clear() PyErr_Clear()
1395 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1396 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1397 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1398 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1399 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1400 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1401 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1402 #endif
1403
1404 /* SetItemInt.proto */
1405 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1406 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1407 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
1408 (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
1409 __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
1410 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
1411 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
1412 int is_list, int wraparound, int boundscheck);
1413
1414 /* PyDictVersioning.proto */
1415 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1416 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1417 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1418 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1419 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1420 (cache_var) = (value);
1421 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1422 static PY_UINT64_T __pyx_dict_version = 0;\
1423 static PyObject *__pyx_dict_cached_value = NULL;\
1424 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1425 (VAR) = __pyx_dict_cached_value;\
1426 } else {\
1427 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1428 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1429 }\
1430 }
1431 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1432 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1433 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1434 #else
1435 #define __PYX_GET_DICT_VERSION(dict) (0)
1436 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1437 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1438 #endif
1439
1440 /* GetModuleGlobalName.proto */
1441 #if CYTHON_USE_DICT_VERSIONS
1442 #define __Pyx_GetModuleGlobalName(var, name) {\
1443 static PY_UINT64_T __pyx_dict_version = 0;\
1444 static PyObject *__pyx_dict_cached_value = NULL;\
1445 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1446 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1447 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1448 }
1449 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1450 PY_UINT64_T __pyx_dict_version;\
1451 PyObject *__pyx_dict_cached_value;\
1452 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1453 }
1454 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1455 #else
1456 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1457 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1458 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1459 #endif
1460
1461 /* PyCFunctionFastCall.proto */
1462 #if CYTHON_FAST_PYCCALL
1463 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1464 #else
1465 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1466 #endif
1467
1468 /* PyFunctionFastCall.proto */
1469 #if CYTHON_FAST_PYCALL
1470 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1471 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1472 #if 1 || PY_VERSION_HEX < 0x030600B1
1473 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1474 #else
1475 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1476 #endif
1477 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1478 (sizeof(char [1 - 2*!(cond)]) - 1)
1479 #ifndef Py_MEMBER_SIZE
1480 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1481 #endif
1482 static size_t __pyx_pyframe_localsplus_offset = 0;
1483 #include "frameobject.h"
1484 #define __Pxy_PyFrame_Initialize_Offsets()\
1485 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1486 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1487 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1488 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1489 #endif
1490
1491 /* PyObjectCall.proto */
1492 #if CYTHON_COMPILING_IN_CPYTHON
1493 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1494 #else
1495 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1496 #endif
1497
1498 /* PyObjectCall2Args.proto */
1499 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1500
1501 /* PyObjectCallMethO.proto */
1502 #if CYTHON_COMPILING_IN_CPYTHON
1503 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1504 #endif
1505
1506 /* PyObjectCallOneArg.proto */
1507 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1508
1509 /* WriteUnraisableException.proto */
1510 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1511 int lineno, const char *filename,
1512 int full_traceback, int nogil);
1513
1514 /* RaiseException.proto */
1515 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1516
1517 /* DictGetItem.proto */
1518 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1519 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1520 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1521 (likely(PyDict_CheckExact(obj)) ?\
1522 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1523 #else
1524 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1525 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1526 #endif
1527
1528 /* RaiseTooManyValuesToUnpack.proto */
1529 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1530
1531 /* RaiseNeedMoreValuesToUnpack.proto */
1532 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1533
1534 /* RaiseNoneIterError.proto */
1535 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1536
1537 /* GetTopmostException.proto */
1538 #if CYTHON_USE_EXC_INFO_STACK
1539 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1540 #endif
1541
1542 /* SaveResetException.proto */
1543 #if CYTHON_FAST_THREAD_STATE
1544 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1545 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1546 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1547 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1548 #else
1549 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1550 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1551 #endif
1552
1553 /* PyErrExceptionMatches.proto */
1554 #if CYTHON_FAST_THREAD_STATE
1555 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1556 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1557 #else
1558 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1559 #endif
1560
1561 /* GetException.proto */
1562 #if CYTHON_FAST_THREAD_STATE
1563 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1564 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1565 #else
1566 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1567 #endif
1568
1569 /* PyObject_GenericGetAttrNoDict.proto */
1570 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1571 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1572 #else
1573 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1574 #endif
1575
1576 /* PyObject_GenericGetAttr.proto */
1577 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1578 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1579 #else
1580 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1581 #endif
1582
1583 /* SetVTable.proto */
1584 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
1585
1586 /* SetupReduce.proto */
1587 static int __Pyx_setup_reduce(PyObject* type_obj);
1588
1589 /* TypeImport.proto */
1590 #ifndef __PYX_HAVE_RT_ImportType_proto
1591 #define __PYX_HAVE_RT_ImportType_proto
1592 enum __Pyx_ImportType_CheckSize {
1593 __Pyx_ImportType_CheckSize_Error = 0,
1594 __Pyx_ImportType_CheckSize_Warn = 1,
1595 __Pyx_ImportType_CheckSize_Ignore = 2
1596 };
1597 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1598 #endif
1599
1600 /* Import.proto */
1601 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1602
1603 /* CLineInTraceback.proto */
1604 #ifdef CYTHON_CLINE_IN_TRACEBACK
1605 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1606 #else
1607 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1608 #endif
1609
1610 /* CodeObjectCache.proto */
1611 typedef struct {
1612 PyCodeObject* code_object;
1613 int code_line;
1614 } __Pyx_CodeObjectCacheEntry;
1615 struct __Pyx_CodeObjectCache {
1616 int count;
1617 int max_count;
1618 __Pyx_CodeObjectCacheEntry* entries;
1619 };
1620 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1621 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1622 static PyCodeObject *__pyx_find_code_object(int code_line);
1623 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1624
1625 /* AddTraceback.proto */
1626 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1627 int py_line, const char *filename);
1628
1629 /* BufferStructDeclare.proto */
1630 typedef struct {
1631 Py_ssize_t shape, strides, suboffsets;
1632 } __Pyx_Buf_DimInfo;
1633 typedef struct {
1634 size_t refcount;
1635 Py_buffer pybuffer;
1636 } __Pyx_Buffer;
1637 typedef struct {
1638 __Pyx_Buffer *rcbuffer;
1639 char *data;
1640 __Pyx_Buf_DimInfo diminfo[8];
1641 } __Pyx_LocalBuf_ND;
1642
1643 #if PY_MAJOR_VERSION < 3
1644 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
1645 static void __Pyx_ReleaseBuffer(Py_buffer *view);
1646 #else
1647 #define __Pyx_GetBuffer PyObject_GetBuffer
1648 #define __Pyx_ReleaseBuffer PyBuffer_Release
1649 #endif
1650
1651
1652 /* CIntToPy.proto */
1653 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
1654
1655 /* CIntToPy.proto */
1656 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1657
1658 /* RealImag.proto */
1659 #if CYTHON_CCOMPLEX
1660 #ifdef __cplusplus
1661 #define __Pyx_CREAL(z) ((z).real())
1662 #define __Pyx_CIMAG(z) ((z).imag())
1663 #else
1664 #define __Pyx_CREAL(z) (__real__(z))
1665 #define __Pyx_CIMAG(z) (__imag__(z))
1666 #endif
1667 #else
1668 #define __Pyx_CREAL(z) ((z).real)
1669 #define __Pyx_CIMAG(z) ((z).imag)
1670 #endif
1671 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1672 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1673 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1674 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1675 #else
1676 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1677 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1678 #endif
1679
1680 /* Arithmetic.proto */
1681 #if CYTHON_CCOMPLEX
1682 #define __Pyx_c_eq_float(a, b) ((a)==(b))
1683 #define __Pyx_c_sum_float(a, b) ((a)+(b))
1684 #define __Pyx_c_diff_float(a, b) ((a)-(b))
1685 #define __Pyx_c_prod_float(a, b) ((a)*(b))
1686 #define __Pyx_c_quot_float(a, b) ((a)/(b))
1687 #define __Pyx_c_neg_float(a) (-(a))
1688 #ifdef __cplusplus
1689 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
1690 #define __Pyx_c_conj_float(z) (::std::conj(z))
1691 #if 1
1692 #define __Pyx_c_abs_float(z) (::std::abs(z))
1693 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
1694 #endif
1695 #else
1696 #define __Pyx_c_is_zero_float(z) ((z)==0)
1697 #define __Pyx_c_conj_float(z) (conjf(z))
1698 #if 1
1699 #define __Pyx_c_abs_float(z) (cabsf(z))
1700 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
1701 #endif
1702 #endif
1703 #else
1704 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1705 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1706 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1707 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1708 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1709 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1710 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1711 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1712 #if 1
1713 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
1714 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1715 #endif
1716 #endif
1717
1718 /* Arithmetic.proto */
1719 #if CYTHON_CCOMPLEX
1720 #define __Pyx_c_eq_double(a, b) ((a)==(b))
1721 #define __Pyx_c_sum_double(a, b) ((a)+(b))
1722 #define __Pyx_c_diff_double(a, b) ((a)-(b))
1723 #define __Pyx_c_prod_double(a, b) ((a)*(b))
1724 #define __Pyx_c_quot_double(a, b) ((a)/(b))
1725 #define __Pyx_c_neg_double(a) (-(a))
1726 #ifdef __cplusplus
1727 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
1728 #define __Pyx_c_conj_double(z) (::std::conj(z))
1729 #if 1
1730 #define __Pyx_c_abs_double(z) (::std::abs(z))
1731 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
1732 #endif
1733 #else
1734 #define __Pyx_c_is_zero_double(z) ((z)==0)
1735 #define __Pyx_c_conj_double(z) (conj(z))
1736 #if 1
1737 #define __Pyx_c_abs_double(z) (cabs(z))
1738 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
1739 #endif
1740 #endif
1741 #else
1742 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1743 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1744 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1745 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1746 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1747 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1748 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1749 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1750 #if 1
1751 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
1752 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1753 #endif
1754 #endif
1755
1756 /* CIntToPy.proto */
1757 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
1758
1759 /* CIntFromPy.proto */
1760 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1761
1762 /* CIntFromPy.proto */
1763 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1764
1765 /* FastTypeChecks.proto */
1766 #if CYTHON_COMPILING_IN_CPYTHON
1767 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1768 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1769 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1770 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1771 #else
1772 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1773 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1774 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1775 #endif
1776 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1777
1778 /* CheckBinaryVersion.proto */
1779 static int __Pyx_check_binary_version(void);
1780
1781 /* InitStrings.proto */
1782 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1783
1784 static void __pyx_f_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_get_vector_field(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t *__pyx_v_vel, __pyx_t_5numpy_float64_t *__pyx_v_vel_mag); /* proto*/
1785
1786 /* Module declarations from 'cython' */
1787
1788 /* Module declarations from 'cpython.buffer' */
1789
1790 /* Module declarations from 'libc.string' */
1791
1792 /* Module declarations from 'libc.stdio' */
1793
1794 /* Module declarations from '__builtin__' */
1795
1796 /* Module declarations from 'cpython.type' */
1797 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
1798
1799 /* Module declarations from 'cpython' */
1800
1801 /* Module declarations from 'cpython.object' */
1802
1803 /* Module declarations from 'cpython.ref' */
1804
1805 /* Module declarations from 'cpython.mem' */
1806
1807 /* Module declarations from 'numpy' */
1808
1809 /* Module declarations from 'numpy' */
1810 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
1811 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
1812 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
1813 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
1814 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
1815 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
1816
1817 /* Module declarations from 'yt.utilities.lib.volume_container' */
1818 static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, int, int, int); /*proto*/
1819
1820 /* Module declarations from 'libc.stdlib' */
1821
1822 /* Module declarations from 'yt.utilities.lib.fixed_interpolator' */
1823
1824 /* Module declarations from 'yt.utilities.lib.partitioned_grid' */
1825 static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = 0;
1826 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 };
1827 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 };
1828 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 };
1829 #define __Pyx_MODULE_NAME "yt.utilities.lib.partitioned_grid"
1830 extern int __pyx_module_is_main_yt__utilities__lib__partitioned_grid;
1831 int __pyx_module_is_main_yt__utilities__lib__partitioned_grid = 0;
1832
1833 /* Implementation of 'yt.utilities.lib.partitioned_grid' */
1834 static PyObject *__pyx_builtin_range;
1835 static PyObject *__pyx_builtin_TypeError;
1836 static PyObject *__pyx_builtin_ValueError;
1837 static PyObject *__pyx_builtin_RuntimeError;
1838 static PyObject *__pyx_builtin_ImportError;
1839 static const char __pyx_k_h[] = "h";
1840 static const char __pyx_k_np[] = "np";
1841 static const char __pyx_k_mag[] = "mag";
1842 static const char __pyx_k_pos[] = "pos";
1843 static const char __pyx_k_data[] = "data";
1844 static const char __pyx_k_dims[] = "dims";
1845 static const char __pyx_k_main[] = "__main__";
1846 static const char __pyx_k_mask[] = "mask";
1847 static const char __pyx_k_name[] = "__name__";
1848 static const char __pyx_k_sqrt[] = "sqrt";
1849 static const char __pyx_k_test[] = "__test__";
1850 static const char __pyx_k_numpy[] = "numpy";
1851 static const char __pyx_k_range[] = "range";
1852 static const char __pyx_k_import[] = "__import__";
1853 static const char __pyx_k_reduce[] = "__reduce__";
1854 static const char __pyx_k_getstate[] = "__getstate__";
1855 static const char __pyx_k_n_fields[] = "n_fields";
1856 static const char __pyx_k_setstate[] = "__setstate__";
1857 static const char __pyx_k_TypeError[] = "TypeError";
1858 static const char __pyx_k_left_edge[] = "left_edge";
1859 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
1860 static const char __pyx_k_ValueError[] = "ValueError";
1861 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
1862 static const char __pyx_k_right_edge[] = "right_edge";
1863 static const char __pyx_k_ImportError[] = "ImportError";
1864 static const char __pyx_k_RuntimeError[] = "RuntimeError";
1865 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
1866 static const char __pyx_k_parent_grid_id[] = "parent_grid_id";
1867 static const char __pyx_k_PartitionedGrid[] = "PartitionedGrid";
1868 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
1869 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
1870 static const char __pyx_k_Image_sampler_definitions[] = "\nImage sampler definitions\n\n\n\n";
1871 static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
1872 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
1873 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
1874 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
1875 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
1876 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
1877 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
1878 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
1879 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
1880 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
1881 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
1882 static PyObject *__pyx_n_s_ImportError;
1883 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
1884 static PyObject *__pyx_n_s_PartitionedGrid;
1885 static PyObject *__pyx_n_s_RuntimeError;
1886 static PyObject *__pyx_n_s_TypeError;
1887 static PyObject *__pyx_n_s_ValueError;
1888 static PyObject *__pyx_n_s_cline_in_traceback;
1889 static PyObject *__pyx_n_s_data;
1890 static PyObject *__pyx_n_s_dims;
1891 static PyObject *__pyx_n_s_getstate;
1892 static PyObject *__pyx_n_s_h;
1893 static PyObject *__pyx_n_s_import;
1894 static PyObject *__pyx_n_s_left_edge;
1895 static PyObject *__pyx_n_s_mag;
1896 static PyObject *__pyx_n_s_main;
1897 static PyObject *__pyx_n_s_mask;
1898 static PyObject *__pyx_n_s_n_fields;
1899 static PyObject *__pyx_n_s_name;
1900 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
1901 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
1902 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
1903 static PyObject *__pyx_n_s_np;
1904 static PyObject *__pyx_n_s_numpy;
1905 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
1906 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
1907 static PyObject *__pyx_n_s_parent_grid_id;
1908 static PyObject *__pyx_n_s_pos;
1909 static PyObject *__pyx_n_s_pyx_vtable;
1910 static PyObject *__pyx_n_s_range;
1911 static PyObject *__pyx_n_s_reduce;
1912 static PyObject *__pyx_n_s_reduce_cython;
1913 static PyObject *__pyx_n_s_reduce_ex;
1914 static PyObject *__pyx_n_s_right_edge;
1915 static PyObject *__pyx_n_s_setstate;
1916 static PyObject *__pyx_n_s_setstate_cython;
1917 static PyObject *__pyx_n_s_sqrt;
1918 static PyObject *__pyx_n_s_test;
1919 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
1920 static int __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid___cinit__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self, int __pyx_v_parent_grid_id, PyObject *__pyx_v_data, PyObject *__pyx_v_mask, PyArrayObject *__pyx_v_left_edge, PyArrayObject *__pyx_v_right_edge, PyArrayObject *__pyx_v_dims, int __pyx_v_n_fields); /* proto */
1921 static void __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_2__dealloc__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self); /* proto */
1922 static PyObject *__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_4integrate_streamline(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self, PyObject *__pyx_v_pos, __pyx_t_5numpy_float64_t __pyx_v_h, PyObject *__pyx_v_mag); /* proto */
1923 static PyObject *__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7my_data___get__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self); /* proto */
1924 static int __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7my_data_2__set__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
1925 static int __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7my_data_4__del__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self); /* proto */
1926 static PyObject *__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_11source_mask___get__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self); /* proto */
1927 static int __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_11source_mask_2__set__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
1928 static int __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_11source_mask_4__del__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self); /* proto */
1929 static PyObject *__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8LeftEdge___get__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self); /* proto */
1930 static int __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8LeftEdge_2__set__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
1931 static int __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8LeftEdge_4__del__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self); /* proto */
1932 static PyObject *__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9RightEdge___get__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self); /* proto */
1933 static int __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9RightEdge_2__set__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
1934 static int __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9RightEdge_4__del__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self); /* proto */
1935 static PyObject *__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_14parent_grid_id___get__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self); /* proto */
1936 static int __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_14parent_grid_id_2__set__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
1937 static PyObject *__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self); /* proto */
1938 static PyObject *__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
1939 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
1940 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
1941 static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
1942 static PyObject *__pyx_tuple_;
1943 static PyObject *__pyx_tuple__2;
1944 static PyObject *__pyx_tuple__3;
1945 static PyObject *__pyx_tuple__4;
1946 static PyObject *__pyx_tuple__5;
1947 static PyObject *__pyx_tuple__6;
1948 static PyObject *__pyx_tuple__7;
1949 static PyObject *__pyx_tuple__8;
1950 static PyObject *__pyx_tuple__9;
1951 /* Late includes */
1952
1953 /* "yt/utilities/lib/partitioned_grid.pyx":29
1954 * @cython.wraparound(False)
1955 * @cython.cdivision(True)
1956 * def __cinit__(self, # <<<<<<<<<<<<<<
1957 * int parent_grid_id, data,
1958 * mask,
1959 */
1960
1961 /* Python wrapper */
1962 static int __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_1__cinit__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)1963 static int __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1964 int __pyx_v_parent_grid_id;
1965 PyObject *__pyx_v_data = 0;
1966 PyObject *__pyx_v_mask = 0;
1967 PyArrayObject *__pyx_v_left_edge = 0;
1968 PyArrayObject *__pyx_v_right_edge = 0;
1969 PyArrayObject *__pyx_v_dims = 0;
1970 int __pyx_v_n_fields;
1971 int __pyx_r;
1972 __Pyx_RefNannyDeclarations
1973 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
1974 {
1975 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_parent_grid_id,&__pyx_n_s_data,&__pyx_n_s_mask,&__pyx_n_s_left_edge,&__pyx_n_s_right_edge,&__pyx_n_s_dims,&__pyx_n_s_n_fields,0};
1976 PyObject* values[7] = {0,0,0,0,0,0,0};
1977 if (unlikely(__pyx_kwds)) {
1978 Py_ssize_t kw_args;
1979 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1980 switch (pos_args) {
1981 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
1982 CYTHON_FALLTHROUGH;
1983 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
1984 CYTHON_FALLTHROUGH;
1985 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
1986 CYTHON_FALLTHROUGH;
1987 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1988 CYTHON_FALLTHROUGH;
1989 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1990 CYTHON_FALLTHROUGH;
1991 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1992 CYTHON_FALLTHROUGH;
1993 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1994 CYTHON_FALLTHROUGH;
1995 case 0: break;
1996 default: goto __pyx_L5_argtuple_error;
1997 }
1998 kw_args = PyDict_Size(__pyx_kwds);
1999 switch (pos_args) {
2000 case 0:
2001 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_grid_id)) != 0)) kw_args--;
2002 else goto __pyx_L5_argtuple_error;
2003 CYTHON_FALLTHROUGH;
2004 case 1:
2005 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
2006 else {
2007 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 6, 7, 1); __PYX_ERR(0, 29, __pyx_L3_error)
2008 }
2009 CYTHON_FALLTHROUGH;
2010 case 2:
2011 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
2012 else {
2013 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 6, 7, 2); __PYX_ERR(0, 29, __pyx_L3_error)
2014 }
2015 CYTHON_FALLTHROUGH;
2016 case 3:
2017 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_left_edge)) != 0)) kw_args--;
2018 else {
2019 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 6, 7, 3); __PYX_ERR(0, 29, __pyx_L3_error)
2020 }
2021 CYTHON_FALLTHROUGH;
2022 case 4:
2023 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_right_edge)) != 0)) kw_args--;
2024 else {
2025 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 6, 7, 4); __PYX_ERR(0, 29, __pyx_L3_error)
2026 }
2027 CYTHON_FALLTHROUGH;
2028 case 5:
2029 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dims)) != 0)) kw_args--;
2030 else {
2031 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 6, 7, 5); __PYX_ERR(0, 29, __pyx_L3_error)
2032 }
2033 CYTHON_FALLTHROUGH;
2034 case 6:
2035 if (kw_args > 0) {
2036 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n_fields);
2037 if (value) { values[6] = value; kw_args--; }
2038 }
2039 }
2040 if (unlikely(kw_args > 0)) {
2041 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 29, __pyx_L3_error)
2042 }
2043 } else {
2044 switch (PyTuple_GET_SIZE(__pyx_args)) {
2045 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2046 CYTHON_FALLTHROUGH;
2047 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2048 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2049 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2050 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2051 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2052 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2053 break;
2054 default: goto __pyx_L5_argtuple_error;
2055 }
2056 }
2057 __pyx_v_parent_grid_id = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_parent_grid_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 30, __pyx_L3_error)
2058 __pyx_v_data = values[1];
2059 __pyx_v_mask = values[2];
2060 __pyx_v_left_edge = ((PyArrayObject *)values[3]);
2061 __pyx_v_right_edge = ((PyArrayObject *)values[4]);
2062 __pyx_v_dims = ((PyArrayObject *)values[5]);
2063 if (values[6]) {
2064 __pyx_v_n_fields = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_n_fields == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L3_error)
2065 } else {
2066 __pyx_v_n_fields = ((int)-1);
2067 }
2068 }
2069 goto __pyx_L4_argument_unpacking_done;
2070 __pyx_L5_argtuple_error:;
2071 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 6, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 29, __pyx_L3_error)
2072 __pyx_L3_error:;
2073 __Pyx_AddTraceback("yt.utilities.lib.partitioned_grid.PartitionedGrid.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2074 __Pyx_RefNannyFinishContext();
2075 return -1;
2076 __pyx_L4_argument_unpacking_done:;
2077 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edge), __pyx_ptype_5numpy_ndarray, 1, "left_edge", 0))) __PYX_ERR(0, 32, __pyx_L1_error)
2078 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edge), __pyx_ptype_5numpy_ndarray, 1, "right_edge", 0))) __PYX_ERR(0, 33, __pyx_L1_error)
2079 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dims), __pyx_ptype_5numpy_ndarray, 1, "dims", 0))) __PYX_ERR(0, 34, __pyx_L1_error)
2080 __pyx_r = __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid___cinit__(((struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self), __pyx_v_parent_grid_id, __pyx_v_data, __pyx_v_mask, __pyx_v_left_edge, __pyx_v_right_edge, __pyx_v_dims, __pyx_v_n_fields);
2081
2082 /* function exit code */
2083 goto __pyx_L0;
2084 __pyx_L1_error:;
2085 __pyx_r = -1;
2086 __pyx_L0:;
2087 __Pyx_RefNannyFinishContext();
2088 return __pyx_r;
2089 }
2090
__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid___cinit__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid * __pyx_v_self,int __pyx_v_parent_grid_id,PyObject * __pyx_v_data,PyObject * __pyx_v_mask,PyArrayObject * __pyx_v_left_edge,PyArrayObject * __pyx_v_right_edge,PyArrayObject * __pyx_v_dims,int __pyx_v_n_fields)2091 static int __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid___cinit__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self, int __pyx_v_parent_grid_id, PyObject *__pyx_v_data, PyObject *__pyx_v_mask, PyArrayObject *__pyx_v_left_edge, PyArrayObject *__pyx_v_right_edge, PyArrayObject *__pyx_v_dims, int __pyx_v_n_fields) {
2092 PyArrayObject *__pyx_v_tdata = 0;
2093 PyArrayObject *__pyx_v_mask_data = 0;
2094 struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_c;
2095 int __pyx_v_n_data;
2096 long __pyx_v_i;
2097 __Pyx_LocalBuf_ND __pyx_pybuffernd_dims;
2098 __Pyx_Buffer __pyx_pybuffer_dims;
2099 __Pyx_LocalBuf_ND __pyx_pybuffernd_left_edge;
2100 __Pyx_Buffer __pyx_pybuffer_left_edge;
2101 __Pyx_LocalBuf_ND __pyx_pybuffernd_mask_data;
2102 __Pyx_Buffer __pyx_pybuffer_mask_data;
2103 __Pyx_LocalBuf_ND __pyx_pybuffernd_right_edge;
2104 __Pyx_Buffer __pyx_pybuffer_right_edge;
2105 __Pyx_LocalBuf_ND __pyx_pybuffernd_tdata;
2106 __Pyx_Buffer __pyx_pybuffer_tdata;
2107 int __pyx_r;
2108 __Pyx_RefNannyDeclarations
2109 struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_t_1;
2110 int __pyx_t_2;
2111 Py_ssize_t __pyx_t_3;
2112 long __pyx_t_4;
2113 Py_ssize_t __pyx_t_5;
2114 Py_ssize_t __pyx_t_6;
2115 Py_ssize_t __pyx_t_7;
2116 Py_ssize_t __pyx_t_8;
2117 PyObject *__pyx_t_9 = NULL;
2118 int __pyx_t_10;
2119 PyObject *__pyx_t_11 = NULL;
2120 PyObject *__pyx_t_12 = NULL;
2121 PyObject *__pyx_t_13 = NULL;
2122 int __pyx_t_14;
2123 PyArrayObject *__pyx_t_15 = NULL;
2124 int __pyx_t_16;
2125 __Pyx_RefNannySetupContext("__cinit__", 0);
2126 __pyx_pybuffer_tdata.pybuffer.buf = NULL;
2127 __pyx_pybuffer_tdata.refcount = 0;
2128 __pyx_pybuffernd_tdata.data = NULL;
2129 __pyx_pybuffernd_tdata.rcbuffer = &__pyx_pybuffer_tdata;
2130 __pyx_pybuffer_mask_data.pybuffer.buf = NULL;
2131 __pyx_pybuffer_mask_data.refcount = 0;
2132 __pyx_pybuffernd_mask_data.data = NULL;
2133 __pyx_pybuffernd_mask_data.rcbuffer = &__pyx_pybuffer_mask_data;
2134 __pyx_pybuffer_left_edge.pybuffer.buf = NULL;
2135 __pyx_pybuffer_left_edge.refcount = 0;
2136 __pyx_pybuffernd_left_edge.data = NULL;
2137 __pyx_pybuffernd_left_edge.rcbuffer = &__pyx_pybuffer_left_edge;
2138 __pyx_pybuffer_right_edge.pybuffer.buf = NULL;
2139 __pyx_pybuffer_right_edge.refcount = 0;
2140 __pyx_pybuffernd_right_edge.data = NULL;
2141 __pyx_pybuffernd_right_edge.rcbuffer = &__pyx_pybuffer_right_edge;
2142 __pyx_pybuffer_dims.pybuffer.buf = NULL;
2143 __pyx_pybuffer_dims.refcount = 0;
2144 __pyx_pybuffernd_dims.data = NULL;
2145 __pyx_pybuffernd_dims.rcbuffer = &__pyx_pybuffer_dims;
2146 {
2147 __Pyx_BufFmt_StackElem __pyx_stack[1];
2148 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error)
2149 }
2150 __pyx_pybuffernd_left_edge.diminfo[0].strides = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edge.diminfo[0].shape = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.shape[0];
2151 {
2152 __Pyx_BufFmt_StackElem __pyx_stack[1];
2153 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error)
2154 }
2155 __pyx_pybuffernd_right_edge.diminfo[0].strides = __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_edge.diminfo[0].shape = __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.shape[0];
2156 {
2157 __Pyx_BufFmt_StackElem __pyx_stack[1];
2158 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dims.rcbuffer->pybuffer, (PyObject*)__pyx_v_dims, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error)
2159 }
2160 __pyx_pybuffernd_dims.diminfo[0].strides = __pyx_pybuffernd_dims.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dims.diminfo[0].shape = __pyx_pybuffernd_dims.rcbuffer->pybuffer.shape[0];
2161
2162 /* "yt/utilities/lib/partitioned_grid.pyx":39
2163 * cdef np.ndarray[np.float64_t, ndim=3] tdata
2164 * cdef np.ndarray[np.uint8_t, ndim=3] mask_data
2165 * self.container = NULL # <<<<<<<<<<<<<<
2166 * self.parent_grid_id = parent_grid_id
2167 * self.LeftEdge = left_edge
2168 */
2169 __pyx_v_self->container = NULL;
2170
2171 /* "yt/utilities/lib/partitioned_grid.pyx":40
2172 * cdef np.ndarray[np.uint8_t, ndim=3] mask_data
2173 * self.container = NULL
2174 * self.parent_grid_id = parent_grid_id # <<<<<<<<<<<<<<
2175 * self.LeftEdge = left_edge
2176 * self.RightEdge = right_edge
2177 */
2178 __pyx_v_self->parent_grid_id = __pyx_v_parent_grid_id;
2179
2180 /* "yt/utilities/lib/partitioned_grid.pyx":41
2181 * self.container = NULL
2182 * self.parent_grid_id = parent_grid_id
2183 * self.LeftEdge = left_edge # <<<<<<<<<<<<<<
2184 * self.RightEdge = right_edge
2185 * self.container = <VolumeContainer *> \
2186 */
2187 __Pyx_INCREF(((PyObject *)__pyx_v_left_edge));
2188 __Pyx_GIVEREF(((PyObject *)__pyx_v_left_edge));
2189 __Pyx_GOTREF(__pyx_v_self->LeftEdge);
2190 __Pyx_DECREF(__pyx_v_self->LeftEdge);
2191 __pyx_v_self->LeftEdge = ((PyObject *)__pyx_v_left_edge);
2192
2193 /* "yt/utilities/lib/partitioned_grid.pyx":42
2194 * self.parent_grid_id = parent_grid_id
2195 * self.LeftEdge = left_edge
2196 * self.RightEdge = right_edge # <<<<<<<<<<<<<<
2197 * self.container = <VolumeContainer *> \
2198 * malloc(sizeof(VolumeContainer))
2199 */
2200 __Pyx_INCREF(((PyObject *)__pyx_v_right_edge));
2201 __Pyx_GIVEREF(((PyObject *)__pyx_v_right_edge));
2202 __Pyx_GOTREF(__pyx_v_self->RightEdge);
2203 __Pyx_DECREF(__pyx_v_self->RightEdge);
2204 __pyx_v_self->RightEdge = ((PyObject *)__pyx_v_right_edge);
2205
2206 /* "yt/utilities/lib/partitioned_grid.pyx":43
2207 * self.LeftEdge = left_edge
2208 * self.RightEdge = right_edge
2209 * self.container = <VolumeContainer *> \ # <<<<<<<<<<<<<<
2210 * malloc(sizeof(VolumeContainer))
2211 * cdef VolumeContainer *c = self.container # convenience
2212 */
2213 __pyx_v_self->container = ((struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *)malloc((sizeof(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer))));
2214
2215 /* "yt/utilities/lib/partitioned_grid.pyx":45
2216 * self.container = <VolumeContainer *> \
2217 * malloc(sizeof(VolumeContainer))
2218 * cdef VolumeContainer *c = self.container # convenience # <<<<<<<<<<<<<<
2219 * if n_fields == -1:
2220 * n_fields = len(data)
2221 */
2222 __pyx_t_1 = __pyx_v_self->container;
2223 __pyx_v_c = __pyx_t_1;
2224
2225 /* "yt/utilities/lib/partitioned_grid.pyx":46
2226 * malloc(sizeof(VolumeContainer))
2227 * cdef VolumeContainer *c = self.container # convenience
2228 * if n_fields == -1: # <<<<<<<<<<<<<<
2229 * n_fields = len(data)
2230 * cdef int n_data = len(data)
2231 */
2232 __pyx_t_2 = ((__pyx_v_n_fields == -1L) != 0);
2233 if (__pyx_t_2) {
2234
2235 /* "yt/utilities/lib/partitioned_grid.pyx":47
2236 * cdef VolumeContainer *c = self.container # convenience
2237 * if n_fields == -1:
2238 * n_fields = len(data) # <<<<<<<<<<<<<<
2239 * cdef int n_data = len(data)
2240 *
2241 */
2242 __pyx_t_3 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 47, __pyx_L1_error)
2243 __pyx_v_n_fields = __pyx_t_3;
2244
2245 /* "yt/utilities/lib/partitioned_grid.pyx":46
2246 * malloc(sizeof(VolumeContainer))
2247 * cdef VolumeContainer *c = self.container # convenience
2248 * if n_fields == -1: # <<<<<<<<<<<<<<
2249 * n_fields = len(data)
2250 * cdef int n_data = len(data)
2251 */
2252 }
2253
2254 /* "yt/utilities/lib/partitioned_grid.pyx":48
2255 * if n_fields == -1:
2256 * n_fields = len(data)
2257 * cdef int n_data = len(data) # <<<<<<<<<<<<<<
2258 *
2259 * c.n_fields = n_fields
2260 */
2261 __pyx_t_3 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 48, __pyx_L1_error)
2262 __pyx_v_n_data = __pyx_t_3;
2263
2264 /* "yt/utilities/lib/partitioned_grid.pyx":50
2265 * cdef int n_data = len(data)
2266 *
2267 * c.n_fields = n_fields # <<<<<<<<<<<<<<
2268 * for i in range(3):
2269 * c.left_edge[i] = left_edge[i]
2270 */
2271 __pyx_v_c->n_fields = __pyx_v_n_fields;
2272
2273 /* "yt/utilities/lib/partitioned_grid.pyx":51
2274 *
2275 * c.n_fields = n_fields
2276 * for i in range(3): # <<<<<<<<<<<<<<
2277 * c.left_edge[i] = left_edge[i]
2278 * c.right_edge[i] = right_edge[i]
2279 */
2280 for (__pyx_t_4 = 0; __pyx_t_4 < 3; __pyx_t_4+=1) {
2281 __pyx_v_i = __pyx_t_4;
2282
2283 /* "yt/utilities/lib/partitioned_grid.pyx":52
2284 * c.n_fields = n_fields
2285 * for i in range(3):
2286 * c.left_edge[i] = left_edge[i] # <<<<<<<<<<<<<<
2287 * c.right_edge[i] = right_edge[i]
2288 * c.dims[i] = dims[i]
2289 */
2290 __pyx_t_5 = __pyx_v_i;
2291 (__pyx_v_c->left_edge[__pyx_v_i]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_left_edge.diminfo[0].strides));
2292
2293 /* "yt/utilities/lib/partitioned_grid.pyx":53
2294 * for i in range(3):
2295 * c.left_edge[i] = left_edge[i]
2296 * c.right_edge[i] = right_edge[i] # <<<<<<<<<<<<<<
2297 * c.dims[i] = dims[i]
2298 * c.dds[i] = (c.right_edge[i] - c.left_edge[i])/dims[i]
2299 */
2300 __pyx_t_6 = __pyx_v_i;
2301 (__pyx_v_c->right_edge[__pyx_v_i]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_right_edge.diminfo[0].strides));
2302
2303 /* "yt/utilities/lib/partitioned_grid.pyx":54
2304 * c.left_edge[i] = left_edge[i]
2305 * c.right_edge[i] = right_edge[i]
2306 * c.dims[i] = dims[i] # <<<<<<<<<<<<<<
2307 * c.dds[i] = (c.right_edge[i] - c.left_edge[i])/dims[i]
2308 * c.idds[i] = 1.0/c.dds[i]
2309 */
2310 __pyx_t_7 = __pyx_v_i;
2311 (__pyx_v_c->dims[__pyx_v_i]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dims.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dims.diminfo[0].strides));
2312
2313 /* "yt/utilities/lib/partitioned_grid.pyx":55
2314 * c.right_edge[i] = right_edge[i]
2315 * c.dims[i] = dims[i]
2316 * c.dds[i] = (c.right_edge[i] - c.left_edge[i])/dims[i] # <<<<<<<<<<<<<<
2317 * c.idds[i] = 1.0/c.dds[i]
2318 * self.my_data = data
2319 */
2320 __pyx_t_8 = __pyx_v_i;
2321 (__pyx_v_c->dds[__pyx_v_i]) = (((__pyx_v_c->right_edge[__pyx_v_i]) - (__pyx_v_c->left_edge[__pyx_v_i])) / (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dims.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_dims.diminfo[0].strides)));
2322
2323 /* "yt/utilities/lib/partitioned_grid.pyx":56
2324 * c.dims[i] = dims[i]
2325 * c.dds[i] = (c.right_edge[i] - c.left_edge[i])/dims[i]
2326 * c.idds[i] = 1.0/c.dds[i] # <<<<<<<<<<<<<<
2327 * self.my_data = data
2328 * self.source_mask = mask
2329 */
2330 (__pyx_v_c->idds[__pyx_v_i]) = (1.0 / (__pyx_v_c->dds[__pyx_v_i]));
2331 }
2332
2333 /* "yt/utilities/lib/partitioned_grid.pyx":57
2334 * c.dds[i] = (c.right_edge[i] - c.left_edge[i])/dims[i]
2335 * c.idds[i] = 1.0/c.dds[i]
2336 * self.my_data = data # <<<<<<<<<<<<<<
2337 * self.source_mask = mask
2338 * mask_data = mask
2339 */
2340 __Pyx_INCREF(__pyx_v_data);
2341 __Pyx_GIVEREF(__pyx_v_data);
2342 __Pyx_GOTREF(__pyx_v_self->my_data);
2343 __Pyx_DECREF(__pyx_v_self->my_data);
2344 __pyx_v_self->my_data = __pyx_v_data;
2345
2346 /* "yt/utilities/lib/partitioned_grid.pyx":58
2347 * c.idds[i] = 1.0/c.dds[i]
2348 * self.my_data = data
2349 * self.source_mask = mask # <<<<<<<<<<<<<<
2350 * mask_data = mask
2351 * c.data = <np.float64_t **> malloc(sizeof(np.float64_t*) * n_fields)
2352 */
2353 __Pyx_INCREF(__pyx_v_mask);
2354 __Pyx_GIVEREF(__pyx_v_mask);
2355 __Pyx_GOTREF(__pyx_v_self->source_mask);
2356 __Pyx_DECREF(__pyx_v_self->source_mask);
2357 __pyx_v_self->source_mask = __pyx_v_mask;
2358
2359 /* "yt/utilities/lib/partitioned_grid.pyx":59
2360 * self.my_data = data
2361 * self.source_mask = mask
2362 * mask_data = mask # <<<<<<<<<<<<<<
2363 * c.data = <np.float64_t **> malloc(sizeof(np.float64_t*) * n_fields)
2364 * for i in range(n_data):
2365 */
2366 if (!(likely(((__pyx_v_mask) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_mask, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 59, __pyx_L1_error)
2367 __pyx_t_9 = __pyx_v_mask;
2368 __Pyx_INCREF(__pyx_t_9);
2369 {
2370 __Pyx_BufFmt_StackElem __pyx_stack[1];
2371 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask_data.rcbuffer->pybuffer);
2372 __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask_data.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_9), &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
2373 if (unlikely(__pyx_t_10 < 0)) {
2374 PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
2375 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
2376 Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
2377 __Pyx_RaiseBufferFallbackError();
2378 } else {
2379 PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
2380 }
2381 __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0;
2382 }
2383 __pyx_pybuffernd_mask_data.diminfo[0].strides = __pyx_pybuffernd_mask_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask_data.diminfo[0].shape = __pyx_pybuffernd_mask_data.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask_data.diminfo[1].strides = __pyx_pybuffernd_mask_data.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask_data.diminfo[1].shape = __pyx_pybuffernd_mask_data.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_mask_data.diminfo[2].strides = __pyx_pybuffernd_mask_data.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_mask_data.diminfo[2].shape = __pyx_pybuffernd_mask_data.rcbuffer->pybuffer.shape[2];
2384 if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 59, __pyx_L1_error)
2385 }
2386 __pyx_v_mask_data = ((PyArrayObject *)__pyx_t_9);
2387 __pyx_t_9 = 0;
2388
2389 /* "yt/utilities/lib/partitioned_grid.pyx":60
2390 * self.source_mask = mask
2391 * mask_data = mask
2392 * c.data = <np.float64_t **> malloc(sizeof(np.float64_t*) * n_fields) # <<<<<<<<<<<<<<
2393 * for i in range(n_data):
2394 * tdata = data[i]
2395 */
2396 __pyx_v_c->data = ((__pyx_t_5numpy_float64_t **)malloc(((sizeof(__pyx_t_5numpy_float64_t *)) * __pyx_v_n_fields)));
2397
2398 /* "yt/utilities/lib/partitioned_grid.pyx":61
2399 * mask_data = mask
2400 * c.data = <np.float64_t **> malloc(sizeof(np.float64_t*) * n_fields)
2401 * for i in range(n_data): # <<<<<<<<<<<<<<
2402 * tdata = data[i]
2403 * c.data[i] = <np.float64_t *> tdata.data
2404 */
2405 __pyx_t_10 = __pyx_v_n_data;
2406 __pyx_t_14 = __pyx_t_10;
2407 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_14; __pyx_t_4+=1) {
2408 __pyx_v_i = __pyx_t_4;
2409
2410 /* "yt/utilities/lib/partitioned_grid.pyx":62
2411 * c.data = <np.float64_t **> malloc(sizeof(np.float64_t*) * n_fields)
2412 * for i in range(n_data):
2413 * tdata = data[i] # <<<<<<<<<<<<<<
2414 * c.data[i] = <np.float64_t *> tdata.data
2415 * c.mask = <np.uint8_t *> mask_data.data
2416 */
2417 __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_data, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 62, __pyx_L1_error)
2418 __Pyx_GOTREF(__pyx_t_9);
2419 if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 62, __pyx_L1_error)
2420 __pyx_t_15 = ((PyArrayObject *)__pyx_t_9);
2421 {
2422 __Pyx_BufFmt_StackElem __pyx_stack[1];
2423 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tdata.rcbuffer->pybuffer);
2424 __pyx_t_16 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tdata.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
2425 if (unlikely(__pyx_t_16 < 0)) {
2426 PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
2427 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tdata.rcbuffer->pybuffer, (PyObject*)__pyx_v_tdata, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
2428 Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11);
2429 __Pyx_RaiseBufferFallbackError();
2430 } else {
2431 PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
2432 }
2433 __pyx_t_13 = __pyx_t_12 = __pyx_t_11 = 0;
2434 }
2435 __pyx_pybuffernd_tdata.diminfo[0].strides = __pyx_pybuffernd_tdata.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tdata.diminfo[0].shape = __pyx_pybuffernd_tdata.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_tdata.diminfo[1].strides = __pyx_pybuffernd_tdata.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_tdata.diminfo[1].shape = __pyx_pybuffernd_tdata.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_tdata.diminfo[2].strides = __pyx_pybuffernd_tdata.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_tdata.diminfo[2].shape = __pyx_pybuffernd_tdata.rcbuffer->pybuffer.shape[2];
2436 if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 62, __pyx_L1_error)
2437 }
2438 __pyx_t_15 = 0;
2439 __Pyx_XDECREF_SET(__pyx_v_tdata, ((PyArrayObject *)__pyx_t_9));
2440 __pyx_t_9 = 0;
2441
2442 /* "yt/utilities/lib/partitioned_grid.pyx":63
2443 * for i in range(n_data):
2444 * tdata = data[i]
2445 * c.data[i] = <np.float64_t *> tdata.data # <<<<<<<<<<<<<<
2446 * c.mask = <np.uint8_t *> mask_data.data
2447 *
2448 */
2449 (__pyx_v_c->data[__pyx_v_i]) = ((__pyx_t_5numpy_float64_t *)__pyx_v_tdata->data);
2450 }
2451
2452 /* "yt/utilities/lib/partitioned_grid.pyx":64
2453 * tdata = data[i]
2454 * c.data[i] = <np.float64_t *> tdata.data
2455 * c.mask = <np.uint8_t *> mask_data.data # <<<<<<<<<<<<<<
2456 *
2457 * def __dealloc__(self):
2458 */
2459 __pyx_v_c->mask = ((__pyx_t_5numpy_uint8_t *)__pyx_v_mask_data->data);
2460
2461 /* "yt/utilities/lib/partitioned_grid.pyx":29
2462 * @cython.wraparound(False)
2463 * @cython.cdivision(True)
2464 * def __cinit__(self, # <<<<<<<<<<<<<<
2465 * int parent_grid_id, data,
2466 * mask,
2467 */
2468
2469 /* function exit code */
2470 __pyx_r = 0;
2471 goto __pyx_L0;
2472 __pyx_L1_error:;
2473 __Pyx_XDECREF(__pyx_t_9);
2474 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
2475 __Pyx_PyThreadState_declare
2476 __Pyx_PyThreadState_assign
2477 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
2478 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dims.rcbuffer->pybuffer);
2479 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer);
2480 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask_data.rcbuffer->pybuffer);
2481 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_edge.rcbuffer->pybuffer);
2482 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tdata.rcbuffer->pybuffer);
2483 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
2484 __Pyx_AddTraceback("yt.utilities.lib.partitioned_grid.PartitionedGrid.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2485 __pyx_r = -1;
2486 goto __pyx_L2;
2487 __pyx_L0:;
2488 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dims.rcbuffer->pybuffer);
2489 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer);
2490 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask_data.rcbuffer->pybuffer);
2491 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_edge.rcbuffer->pybuffer);
2492 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tdata.rcbuffer->pybuffer);
2493 __pyx_L2:;
2494 __Pyx_XDECREF((PyObject *)__pyx_v_tdata);
2495 __Pyx_XDECREF((PyObject *)__pyx_v_mask_data);
2496 __Pyx_RefNannyFinishContext();
2497 return __pyx_r;
2498 }
2499
2500 /* "yt/utilities/lib/partitioned_grid.pyx":66
2501 * c.mask = <np.uint8_t *> mask_data.data
2502 *
2503 * def __dealloc__(self): # <<<<<<<<<<<<<<
2504 * # The data fields are not owned by the container, they are owned by us!
2505 * # So we don't need to deallocate them.
2506 */
2507
2508 /* Python wrapper */
2509 static void __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_3__dealloc__(PyObject * __pyx_v_self)2510 static void __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_3__dealloc__(PyObject *__pyx_v_self) {
2511 __Pyx_RefNannyDeclarations
2512 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
2513 __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_2__dealloc__(((struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self));
2514
2515 /* function exit code */
2516 __Pyx_RefNannyFinishContext();
2517 }
2518
__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_2__dealloc__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid * __pyx_v_self)2519 static void __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_2__dealloc__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self) {
2520 __Pyx_RefNannyDeclarations
2521 int __pyx_t_1;
2522 __Pyx_RefNannySetupContext("__dealloc__", 0);
2523
2524 /* "yt/utilities/lib/partitioned_grid.pyx":69
2525 * # The data fields are not owned by the container, they are owned by us!
2526 * # So we don't need to deallocate them.
2527 * if self.container == NULL: return # <<<<<<<<<<<<<<
2528 * if self.container.data != NULL: free(self.container.data)
2529 * free(self.container)
2530 */
2531 __pyx_t_1 = ((__pyx_v_self->container == NULL) != 0);
2532 if (__pyx_t_1) {
2533 goto __pyx_L0;
2534 }
2535
2536 /* "yt/utilities/lib/partitioned_grid.pyx":70
2537 * # So we don't need to deallocate them.
2538 * if self.container == NULL: return
2539 * if self.container.data != NULL: free(self.container.data) # <<<<<<<<<<<<<<
2540 * free(self.container)
2541 *
2542 */
2543 __pyx_t_1 = ((__pyx_v_self->container->data != NULL) != 0);
2544 if (__pyx_t_1) {
2545 free(__pyx_v_self->container->data);
2546 }
2547
2548 /* "yt/utilities/lib/partitioned_grid.pyx":71
2549 * if self.container == NULL: return
2550 * if self.container.data != NULL: free(self.container.data)
2551 * free(self.container) # <<<<<<<<<<<<<<
2552 *
2553 * @cython.boundscheck(False)
2554 */
2555 free(__pyx_v_self->container);
2556
2557 /* "yt/utilities/lib/partitioned_grid.pyx":66
2558 * c.mask = <np.uint8_t *> mask_data.data
2559 *
2560 * def __dealloc__(self): # <<<<<<<<<<<<<<
2561 * # The data fields are not owned by the container, they are owned by us!
2562 * # So we don't need to deallocate them.
2563 */
2564
2565 /* function exit code */
2566 __pyx_L0:;
2567 __Pyx_RefNannyFinishContext();
2568 }
2569
2570 /* "yt/utilities/lib/partitioned_grid.pyx":76
2571 * @cython.wraparound(False)
2572 * @cython.cdivision(True)
2573 * def integrate_streamline(self, pos, np.float64_t h, mag): # <<<<<<<<<<<<<<
2574 * cdef np.float64_t cmag[1]
2575 * cdef np.float64_t k1[3]
2576 */
2577
2578 /* Python wrapper */
2579 static PyObject *__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_5integrate_streamline(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_5integrate_streamline(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2580 static PyObject *__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_5integrate_streamline(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2581 PyObject *__pyx_v_pos = 0;
2582 __pyx_t_5numpy_float64_t __pyx_v_h;
2583 PyObject *__pyx_v_mag = 0;
2584 PyObject *__pyx_r = 0;
2585 __Pyx_RefNannyDeclarations
2586 __Pyx_RefNannySetupContext("integrate_streamline (wrapper)", 0);
2587 {
2588 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pos,&__pyx_n_s_h,&__pyx_n_s_mag,0};
2589 PyObject* values[3] = {0,0,0};
2590 if (unlikely(__pyx_kwds)) {
2591 Py_ssize_t kw_args;
2592 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2593 switch (pos_args) {
2594 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2595 CYTHON_FALLTHROUGH;
2596 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2597 CYTHON_FALLTHROUGH;
2598 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2599 CYTHON_FALLTHROUGH;
2600 case 0: break;
2601 default: goto __pyx_L5_argtuple_error;
2602 }
2603 kw_args = PyDict_Size(__pyx_kwds);
2604 switch (pos_args) {
2605 case 0:
2606 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pos)) != 0)) kw_args--;
2607 else goto __pyx_L5_argtuple_error;
2608 CYTHON_FALLTHROUGH;
2609 case 1:
2610 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
2611 else {
2612 __Pyx_RaiseArgtupleInvalid("integrate_streamline", 1, 3, 3, 1); __PYX_ERR(0, 76, __pyx_L3_error)
2613 }
2614 CYTHON_FALLTHROUGH;
2615 case 2:
2616 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mag)) != 0)) kw_args--;
2617 else {
2618 __Pyx_RaiseArgtupleInvalid("integrate_streamline", 1, 3, 3, 2); __PYX_ERR(0, 76, __pyx_L3_error)
2619 }
2620 }
2621 if (unlikely(kw_args > 0)) {
2622 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "integrate_streamline") < 0)) __PYX_ERR(0, 76, __pyx_L3_error)
2623 }
2624 } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
2625 goto __pyx_L5_argtuple_error;
2626 } else {
2627 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2628 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2629 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2630 }
2631 __pyx_v_pos = values[0];
2632 __pyx_v_h = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_h == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L3_error)
2633 __pyx_v_mag = values[2];
2634 }
2635 goto __pyx_L4_argument_unpacking_done;
2636 __pyx_L5_argtuple_error:;
2637 __Pyx_RaiseArgtupleInvalid("integrate_streamline", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 76, __pyx_L3_error)
2638 __pyx_L3_error:;
2639 __Pyx_AddTraceback("yt.utilities.lib.partitioned_grid.PartitionedGrid.integrate_streamline", __pyx_clineno, __pyx_lineno, __pyx_filename);
2640 __Pyx_RefNannyFinishContext();
2641 return NULL;
2642 __pyx_L4_argument_unpacking_done:;
2643 __pyx_r = __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_4integrate_streamline(((struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self), __pyx_v_pos, __pyx_v_h, __pyx_v_mag);
2644
2645 /* function exit code */
2646 __Pyx_RefNannyFinishContext();
2647 return __pyx_r;
2648 }
2649
__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_4integrate_streamline(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid * __pyx_v_self,PyObject * __pyx_v_pos,__pyx_t_5numpy_float64_t __pyx_v_h,PyObject * __pyx_v_mag)2650 static PyObject *__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_4integrate_streamline(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self, PyObject *__pyx_v_pos, __pyx_t_5numpy_float64_t __pyx_v_h, PyObject *__pyx_v_mag) {
2651 __pyx_t_5numpy_float64_t __pyx_v_cmag[1];
2652 __pyx_t_5numpy_float64_t __pyx_v_k1[3];
2653 __pyx_t_5numpy_float64_t __pyx_v_k2[3];
2654 __pyx_t_5numpy_float64_t __pyx_v_k3[3];
2655 __pyx_t_5numpy_float64_t __pyx_v_k4[3];
2656 __pyx_t_5numpy_float64_t __pyx_v_newpos[3];
2657 __pyx_t_5numpy_float64_t __pyx_v_oldpos[3];
2658 long __pyx_v_i;
2659 PyObject *__pyx_r = NULL;
2660 __Pyx_RefNannyDeclarations
2661 long __pyx_t_1;
2662 PyObject *__pyx_t_2 = NULL;
2663 __pyx_t_5numpy_float64_t __pyx_t_3;
2664 int __pyx_t_4;
2665 PyObject *__pyx_t_5 = NULL;
2666 PyObject *__pyx_t_6 = NULL;
2667 int __pyx_t_7;
2668 __Pyx_RefNannySetupContext("integrate_streamline", 0);
2669
2670 /* "yt/utilities/lib/partitioned_grid.pyx":84
2671 * cdef np.float64_t newpos[3]
2672 * cdef np.float64_t oldpos[3]
2673 * for i in range(3): # <<<<<<<<<<<<<<
2674 * newpos[i] = oldpos[i] = pos[i]
2675 * self.get_vector_field(newpos, k1, cmag)
2676 */
2677 for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
2678 __pyx_v_i = __pyx_t_1;
2679
2680 /* "yt/utilities/lib/partitioned_grid.pyx":85
2681 * cdef np.float64_t oldpos[3]
2682 * for i in range(3):
2683 * newpos[i] = oldpos[i] = pos[i] # <<<<<<<<<<<<<<
2684 * self.get_vector_field(newpos, k1, cmag)
2685 * for i in range(3):
2686 */
2687 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pos, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
2688 __Pyx_GOTREF(__pyx_t_2);
2689 __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L1_error)
2690 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2691 (__pyx_v_newpos[__pyx_v_i]) = __pyx_t_3;
2692 (__pyx_v_oldpos[__pyx_v_i]) = __pyx_t_3;
2693 }
2694
2695 /* "yt/utilities/lib/partitioned_grid.pyx":86
2696 * for i in range(3):
2697 * newpos[i] = oldpos[i] = pos[i]
2698 * self.get_vector_field(newpos, k1, cmag) # <<<<<<<<<<<<<<
2699 * for i in range(3):
2700 * newpos[i] = oldpos[i] + 0.5*k1[i]*h
2701 */
2702 ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self->__pyx_vtab)->get_vector_field(__pyx_v_self, __pyx_v_newpos, __pyx_v_k1, __pyx_v_cmag);
2703
2704 /* "yt/utilities/lib/partitioned_grid.pyx":87
2705 * newpos[i] = oldpos[i] = pos[i]
2706 * self.get_vector_field(newpos, k1, cmag)
2707 * for i in range(3): # <<<<<<<<<<<<<<
2708 * newpos[i] = oldpos[i] + 0.5*k1[i]*h
2709 *
2710 */
2711 for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
2712 __pyx_v_i = __pyx_t_1;
2713
2714 /* "yt/utilities/lib/partitioned_grid.pyx":88
2715 * self.get_vector_field(newpos, k1, cmag)
2716 * for i in range(3):
2717 * newpos[i] = oldpos[i] + 0.5*k1[i]*h # <<<<<<<<<<<<<<
2718 *
2719 * if not (self.LeftEdge[0] < newpos[0] and newpos[0] < self.RightEdge[0] and \
2720 */
2721 (__pyx_v_newpos[__pyx_v_i]) = ((__pyx_v_oldpos[__pyx_v_i]) + ((0.5 * (__pyx_v_k1[__pyx_v_i])) * __pyx_v_h));
2722 }
2723
2724 /* "yt/utilities/lib/partitioned_grid.pyx":90
2725 * newpos[i] = oldpos[i] + 0.5*k1[i]*h
2726 *
2727 * if not (self.LeftEdge[0] < newpos[0] and newpos[0] < self.RightEdge[0] and \ # <<<<<<<<<<<<<<
2728 * self.LeftEdge[1] < newpos[1] and newpos[1] < self.RightEdge[1] and \
2729 * self.LeftEdge[2] < newpos[2] and newpos[2] < self.RightEdge[2]):
2730 */
2731 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->LeftEdge, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
2732 __Pyx_GOTREF(__pyx_t_2);
2733 __pyx_t_5 = PyFloat_FromDouble((__pyx_v_newpos[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 90, __pyx_L1_error)
2734 __Pyx_GOTREF(__pyx_t_5);
2735 __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 90, __pyx_L1_error)
2736 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2737 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2738 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 90, __pyx_L1_error)
2739 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2740 if (__pyx_t_7) {
2741 } else {
2742 __pyx_t_4 = __pyx_t_7;
2743 goto __pyx_L8_bool_binop_done;
2744 }
2745 __pyx_t_6 = PyFloat_FromDouble((__pyx_v_newpos[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 90, __pyx_L1_error)
2746 __Pyx_GOTREF(__pyx_t_6);
2747 __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_self->RightEdge, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 90, __pyx_L1_error)
2748 __Pyx_GOTREF(__pyx_t_5);
2749 __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
2750 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2751 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2752 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 90, __pyx_L1_error)
2753 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2754 if (__pyx_t_7) {
2755 } else {
2756 __pyx_t_4 = __pyx_t_7;
2757 goto __pyx_L8_bool_binop_done;
2758 }
2759
2760 /* "yt/utilities/lib/partitioned_grid.pyx":91
2761 *
2762 * if not (self.LeftEdge[0] < newpos[0] and newpos[0] < self.RightEdge[0] and \
2763 * self.LeftEdge[1] < newpos[1] and newpos[1] < self.RightEdge[1] and \ # <<<<<<<<<<<<<<
2764 * self.LeftEdge[2] < newpos[2] and newpos[2] < self.RightEdge[2]):
2765 * if mag is not None:
2766 */
2767 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->LeftEdge, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
2768 __Pyx_GOTREF(__pyx_t_2);
2769 __pyx_t_5 = PyFloat_FromDouble((__pyx_v_newpos[1])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 91, __pyx_L1_error)
2770 __Pyx_GOTREF(__pyx_t_5);
2771 __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 91, __pyx_L1_error)
2772 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2773 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2774 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 91, __pyx_L1_error)
2775 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2776 if (__pyx_t_7) {
2777 } else {
2778 __pyx_t_4 = __pyx_t_7;
2779 goto __pyx_L8_bool_binop_done;
2780 }
2781 __pyx_t_6 = PyFloat_FromDouble((__pyx_v_newpos[1])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 91, __pyx_L1_error)
2782 __Pyx_GOTREF(__pyx_t_6);
2783 __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_self->RightEdge, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 91, __pyx_L1_error)
2784 __Pyx_GOTREF(__pyx_t_5);
2785 __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
2786 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2787 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2788 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 91, __pyx_L1_error)
2789 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2790 if (__pyx_t_7) {
2791 } else {
2792 __pyx_t_4 = __pyx_t_7;
2793 goto __pyx_L8_bool_binop_done;
2794 }
2795
2796 /* "yt/utilities/lib/partitioned_grid.pyx":92
2797 * if not (self.LeftEdge[0] < newpos[0] and newpos[0] < self.RightEdge[0] and \
2798 * self.LeftEdge[1] < newpos[1] and newpos[1] < self.RightEdge[1] and \
2799 * self.LeftEdge[2] < newpos[2] and newpos[2] < self.RightEdge[2]): # <<<<<<<<<<<<<<
2800 * if mag is not None:
2801 * mag[0] = cmag[0]
2802 */
2803 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->LeftEdge, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error)
2804 __Pyx_GOTREF(__pyx_t_2);
2805 __pyx_t_5 = PyFloat_FromDouble((__pyx_v_newpos[2])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 92, __pyx_L1_error)
2806 __Pyx_GOTREF(__pyx_t_5);
2807 __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 92, __pyx_L1_error)
2808 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2809 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2810 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 92, __pyx_L1_error)
2811 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2812 if (__pyx_t_7) {
2813 } else {
2814 __pyx_t_4 = __pyx_t_7;
2815 goto __pyx_L8_bool_binop_done;
2816 }
2817 __pyx_t_6 = PyFloat_FromDouble((__pyx_v_newpos[2])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 92, __pyx_L1_error)
2818 __Pyx_GOTREF(__pyx_t_6);
2819 __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_self->RightEdge, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 92, __pyx_L1_error)
2820 __Pyx_GOTREF(__pyx_t_5);
2821 __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error)
2822 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2823 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2824 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 92, __pyx_L1_error)
2825 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2826 __pyx_t_4 = __pyx_t_7;
2827 __pyx_L8_bool_binop_done:;
2828
2829 /* "yt/utilities/lib/partitioned_grid.pyx":90
2830 * newpos[i] = oldpos[i] + 0.5*k1[i]*h
2831 *
2832 * if not (self.LeftEdge[0] < newpos[0] and newpos[0] < self.RightEdge[0] and \ # <<<<<<<<<<<<<<
2833 * self.LeftEdge[1] < newpos[1] and newpos[1] < self.RightEdge[1] and \
2834 * self.LeftEdge[2] < newpos[2] and newpos[2] < self.RightEdge[2]):
2835 */
2836 __pyx_t_7 = ((!__pyx_t_4) != 0);
2837 if (__pyx_t_7) {
2838
2839 /* "yt/utilities/lib/partitioned_grid.pyx":93
2840 * self.LeftEdge[1] < newpos[1] and newpos[1] < self.RightEdge[1] and \
2841 * self.LeftEdge[2] < newpos[2] and newpos[2] < self.RightEdge[2]):
2842 * if mag is not None: # <<<<<<<<<<<<<<
2843 * mag[0] = cmag[0]
2844 * for i in range(3):
2845 */
2846 __pyx_t_7 = (__pyx_v_mag != Py_None);
2847 __pyx_t_4 = (__pyx_t_7 != 0);
2848 if (__pyx_t_4) {
2849
2850 /* "yt/utilities/lib/partitioned_grid.pyx":94
2851 * self.LeftEdge[2] < newpos[2] and newpos[2] < self.RightEdge[2]):
2852 * if mag is not None:
2853 * mag[0] = cmag[0] # <<<<<<<<<<<<<<
2854 * for i in range(3):
2855 * pos[i] = newpos[i]
2856 */
2857 __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cmag[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)
2858 __Pyx_GOTREF(__pyx_t_2);
2859 if (unlikely(__Pyx_SetItemInt(__pyx_v_mag, 0, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0) < 0)) __PYX_ERR(0, 94, __pyx_L1_error)
2860 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2861
2862 /* "yt/utilities/lib/partitioned_grid.pyx":93
2863 * self.LeftEdge[1] < newpos[1] and newpos[1] < self.RightEdge[1] and \
2864 * self.LeftEdge[2] < newpos[2] and newpos[2] < self.RightEdge[2]):
2865 * if mag is not None: # <<<<<<<<<<<<<<
2866 * mag[0] = cmag[0]
2867 * for i in range(3):
2868 */
2869 }
2870
2871 /* "yt/utilities/lib/partitioned_grid.pyx":95
2872 * if mag is not None:
2873 * mag[0] = cmag[0]
2874 * for i in range(3): # <<<<<<<<<<<<<<
2875 * pos[i] = newpos[i]
2876 * return
2877 */
2878 for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
2879 __pyx_v_i = __pyx_t_1;
2880
2881 /* "yt/utilities/lib/partitioned_grid.pyx":96
2882 * mag[0] = cmag[0]
2883 * for i in range(3):
2884 * pos[i] = newpos[i] # <<<<<<<<<<<<<<
2885 * return
2886 *
2887 */
2888 __pyx_t_2 = PyFloat_FromDouble((__pyx_v_newpos[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error)
2889 __Pyx_GOTREF(__pyx_t_2);
2890 if (unlikely(__Pyx_SetItemInt(__pyx_v_pos, __pyx_v_i, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0) < 0)) __PYX_ERR(0, 96, __pyx_L1_error)
2891 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2892 }
2893
2894 /* "yt/utilities/lib/partitioned_grid.pyx":97
2895 * for i in range(3):
2896 * pos[i] = newpos[i]
2897 * return # <<<<<<<<<<<<<<
2898 *
2899 * self.get_vector_field(newpos, k2, cmag)
2900 */
2901 __Pyx_XDECREF(__pyx_r);
2902 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2903 goto __pyx_L0;
2904
2905 /* "yt/utilities/lib/partitioned_grid.pyx":90
2906 * newpos[i] = oldpos[i] + 0.5*k1[i]*h
2907 *
2908 * if not (self.LeftEdge[0] < newpos[0] and newpos[0] < self.RightEdge[0] and \ # <<<<<<<<<<<<<<
2909 * self.LeftEdge[1] < newpos[1] and newpos[1] < self.RightEdge[1] and \
2910 * self.LeftEdge[2] < newpos[2] and newpos[2] < self.RightEdge[2]):
2911 */
2912 }
2913
2914 /* "yt/utilities/lib/partitioned_grid.pyx":99
2915 * return
2916 *
2917 * self.get_vector_field(newpos, k2, cmag) # <<<<<<<<<<<<<<
2918 * for i in range(3):
2919 * newpos[i] = oldpos[i] + 0.5*k2[i]*h
2920 */
2921 ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self->__pyx_vtab)->get_vector_field(__pyx_v_self, __pyx_v_newpos, __pyx_v_k2, __pyx_v_cmag);
2922
2923 /* "yt/utilities/lib/partitioned_grid.pyx":100
2924 *
2925 * self.get_vector_field(newpos, k2, cmag)
2926 * for i in range(3): # <<<<<<<<<<<<<<
2927 * newpos[i] = oldpos[i] + 0.5*k2[i]*h
2928 *
2929 */
2930 for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
2931 __pyx_v_i = __pyx_t_1;
2932
2933 /* "yt/utilities/lib/partitioned_grid.pyx":101
2934 * self.get_vector_field(newpos, k2, cmag)
2935 * for i in range(3):
2936 * newpos[i] = oldpos[i] + 0.5*k2[i]*h # <<<<<<<<<<<<<<
2937 *
2938 * if not (self.LeftEdge[0] <= newpos[0] and newpos[0] <= self.RightEdge[0] and \
2939 */
2940 (__pyx_v_newpos[__pyx_v_i]) = ((__pyx_v_oldpos[__pyx_v_i]) + ((0.5 * (__pyx_v_k2[__pyx_v_i])) * __pyx_v_h));
2941 }
2942
2943 /* "yt/utilities/lib/partitioned_grid.pyx":103
2944 * newpos[i] = oldpos[i] + 0.5*k2[i]*h
2945 *
2946 * if not (self.LeftEdge[0] <= newpos[0] and newpos[0] <= self.RightEdge[0] and \ # <<<<<<<<<<<<<<
2947 * self.LeftEdge[1] <= newpos[1] and newpos[1] <= self.RightEdge[1] and \
2948 * self.LeftEdge[2] <= newpos[2] and newpos[2] <= self.RightEdge[2]):
2949 */
2950 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->LeftEdge, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
2951 __Pyx_GOTREF(__pyx_t_2);
2952 __pyx_t_5 = PyFloat_FromDouble((__pyx_v_newpos[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 103, __pyx_L1_error)
2953 __Pyx_GOTREF(__pyx_t_5);
2954 __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 103, __pyx_L1_error)
2955 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2956 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2957 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 103, __pyx_L1_error)
2958 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2959 if (__pyx_t_7) {
2960 } else {
2961 __pyx_t_4 = __pyx_t_7;
2962 goto __pyx_L20_bool_binop_done;
2963 }
2964 __pyx_t_6 = PyFloat_FromDouble((__pyx_v_newpos[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 103, __pyx_L1_error)
2965 __Pyx_GOTREF(__pyx_t_6);
2966 __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_self->RightEdge, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 103, __pyx_L1_error)
2967 __Pyx_GOTREF(__pyx_t_5);
2968 __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
2969 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2970 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2971 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 103, __pyx_L1_error)
2972 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2973 if (__pyx_t_7) {
2974 } else {
2975 __pyx_t_4 = __pyx_t_7;
2976 goto __pyx_L20_bool_binop_done;
2977 }
2978
2979 /* "yt/utilities/lib/partitioned_grid.pyx":104
2980 *
2981 * if not (self.LeftEdge[0] <= newpos[0] and newpos[0] <= self.RightEdge[0] and \
2982 * self.LeftEdge[1] <= newpos[1] and newpos[1] <= self.RightEdge[1] and \ # <<<<<<<<<<<<<<
2983 * self.LeftEdge[2] <= newpos[2] and newpos[2] <= self.RightEdge[2]):
2984 * if mag is not None:
2985 */
2986 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->LeftEdge, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)
2987 __Pyx_GOTREF(__pyx_t_2);
2988 __pyx_t_5 = PyFloat_FromDouble((__pyx_v_newpos[1])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 104, __pyx_L1_error)
2989 __Pyx_GOTREF(__pyx_t_5);
2990 __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 104, __pyx_L1_error)
2991 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2992 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2993 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 104, __pyx_L1_error)
2994 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2995 if (__pyx_t_7) {
2996 } else {
2997 __pyx_t_4 = __pyx_t_7;
2998 goto __pyx_L20_bool_binop_done;
2999 }
3000 __pyx_t_6 = PyFloat_FromDouble((__pyx_v_newpos[1])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 104, __pyx_L1_error)
3001 __Pyx_GOTREF(__pyx_t_6);
3002 __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_self->RightEdge, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 104, __pyx_L1_error)
3003 __Pyx_GOTREF(__pyx_t_5);
3004 __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)
3005 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3006 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3007 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 104, __pyx_L1_error)
3008 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3009 if (__pyx_t_7) {
3010 } else {
3011 __pyx_t_4 = __pyx_t_7;
3012 goto __pyx_L20_bool_binop_done;
3013 }
3014
3015 /* "yt/utilities/lib/partitioned_grid.pyx":105
3016 * if not (self.LeftEdge[0] <= newpos[0] and newpos[0] <= self.RightEdge[0] and \
3017 * self.LeftEdge[1] <= newpos[1] and newpos[1] <= self.RightEdge[1] and \
3018 * self.LeftEdge[2] <= newpos[2] and newpos[2] <= self.RightEdge[2]): # <<<<<<<<<<<<<<
3019 * if mag is not None:
3020 * mag[0] = cmag[0]
3021 */
3022 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->LeftEdge, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
3023 __Pyx_GOTREF(__pyx_t_2);
3024 __pyx_t_5 = PyFloat_FromDouble((__pyx_v_newpos[2])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 105, __pyx_L1_error)
3025 __Pyx_GOTREF(__pyx_t_5);
3026 __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 105, __pyx_L1_error)
3027 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3028 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3029 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 105, __pyx_L1_error)
3030 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3031 if (__pyx_t_7) {
3032 } else {
3033 __pyx_t_4 = __pyx_t_7;
3034 goto __pyx_L20_bool_binop_done;
3035 }
3036 __pyx_t_6 = PyFloat_FromDouble((__pyx_v_newpos[2])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 105, __pyx_L1_error)
3037 __Pyx_GOTREF(__pyx_t_6);
3038 __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_self->RightEdge, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 105, __pyx_L1_error)
3039 __Pyx_GOTREF(__pyx_t_5);
3040 __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
3041 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3042 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3043 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 105, __pyx_L1_error)
3044 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3045 __pyx_t_4 = __pyx_t_7;
3046 __pyx_L20_bool_binop_done:;
3047
3048 /* "yt/utilities/lib/partitioned_grid.pyx":103
3049 * newpos[i] = oldpos[i] + 0.5*k2[i]*h
3050 *
3051 * if not (self.LeftEdge[0] <= newpos[0] and newpos[0] <= self.RightEdge[0] and \ # <<<<<<<<<<<<<<
3052 * self.LeftEdge[1] <= newpos[1] and newpos[1] <= self.RightEdge[1] and \
3053 * self.LeftEdge[2] <= newpos[2] and newpos[2] <= self.RightEdge[2]):
3054 */
3055 __pyx_t_7 = ((!__pyx_t_4) != 0);
3056 if (__pyx_t_7) {
3057
3058 /* "yt/utilities/lib/partitioned_grid.pyx":106
3059 * self.LeftEdge[1] <= newpos[1] and newpos[1] <= self.RightEdge[1] and \
3060 * self.LeftEdge[2] <= newpos[2] and newpos[2] <= self.RightEdge[2]):
3061 * if mag is not None: # <<<<<<<<<<<<<<
3062 * mag[0] = cmag[0]
3063 * for i in range(3):
3064 */
3065 __pyx_t_7 = (__pyx_v_mag != Py_None);
3066 __pyx_t_4 = (__pyx_t_7 != 0);
3067 if (__pyx_t_4) {
3068
3069 /* "yt/utilities/lib/partitioned_grid.pyx":107
3070 * self.LeftEdge[2] <= newpos[2] and newpos[2] <= self.RightEdge[2]):
3071 * if mag is not None:
3072 * mag[0] = cmag[0] # <<<<<<<<<<<<<<
3073 * for i in range(3):
3074 * pos[i] = newpos[i]
3075 */
3076 __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cmag[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error)
3077 __Pyx_GOTREF(__pyx_t_2);
3078 if (unlikely(__Pyx_SetItemInt(__pyx_v_mag, 0, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0) < 0)) __PYX_ERR(0, 107, __pyx_L1_error)
3079 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3080
3081 /* "yt/utilities/lib/partitioned_grid.pyx":106
3082 * self.LeftEdge[1] <= newpos[1] and newpos[1] <= self.RightEdge[1] and \
3083 * self.LeftEdge[2] <= newpos[2] and newpos[2] <= self.RightEdge[2]):
3084 * if mag is not None: # <<<<<<<<<<<<<<
3085 * mag[0] = cmag[0]
3086 * for i in range(3):
3087 */
3088 }
3089
3090 /* "yt/utilities/lib/partitioned_grid.pyx":108
3091 * if mag is not None:
3092 * mag[0] = cmag[0]
3093 * for i in range(3): # <<<<<<<<<<<<<<
3094 * pos[i] = newpos[i]
3095 * return
3096 */
3097 for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
3098 __pyx_v_i = __pyx_t_1;
3099
3100 /* "yt/utilities/lib/partitioned_grid.pyx":109
3101 * mag[0] = cmag[0]
3102 * for i in range(3):
3103 * pos[i] = newpos[i] # <<<<<<<<<<<<<<
3104 * return
3105 *
3106 */
3107 __pyx_t_2 = PyFloat_FromDouble((__pyx_v_newpos[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error)
3108 __Pyx_GOTREF(__pyx_t_2);
3109 if (unlikely(__Pyx_SetItemInt(__pyx_v_pos, __pyx_v_i, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0) < 0)) __PYX_ERR(0, 109, __pyx_L1_error)
3110 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3111 }
3112
3113 /* "yt/utilities/lib/partitioned_grid.pyx":110
3114 * for i in range(3):
3115 * pos[i] = newpos[i]
3116 * return # <<<<<<<<<<<<<<
3117 *
3118 * self.get_vector_field(newpos, k3, cmag)
3119 */
3120 __Pyx_XDECREF(__pyx_r);
3121 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3122 goto __pyx_L0;
3123
3124 /* "yt/utilities/lib/partitioned_grid.pyx":103
3125 * newpos[i] = oldpos[i] + 0.5*k2[i]*h
3126 *
3127 * if not (self.LeftEdge[0] <= newpos[0] and newpos[0] <= self.RightEdge[0] and \ # <<<<<<<<<<<<<<
3128 * self.LeftEdge[1] <= newpos[1] and newpos[1] <= self.RightEdge[1] and \
3129 * self.LeftEdge[2] <= newpos[2] and newpos[2] <= self.RightEdge[2]):
3130 */
3131 }
3132
3133 /* "yt/utilities/lib/partitioned_grid.pyx":112
3134 * return
3135 *
3136 * self.get_vector_field(newpos, k3, cmag) # <<<<<<<<<<<<<<
3137 * for i in range(3):
3138 * newpos[i] = oldpos[i] + k3[i]*h
3139 */
3140 ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self->__pyx_vtab)->get_vector_field(__pyx_v_self, __pyx_v_newpos, __pyx_v_k3, __pyx_v_cmag);
3141
3142 /* "yt/utilities/lib/partitioned_grid.pyx":113
3143 *
3144 * self.get_vector_field(newpos, k3, cmag)
3145 * for i in range(3): # <<<<<<<<<<<<<<
3146 * newpos[i] = oldpos[i] + k3[i]*h
3147 *
3148 */
3149 for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
3150 __pyx_v_i = __pyx_t_1;
3151
3152 /* "yt/utilities/lib/partitioned_grid.pyx":114
3153 * self.get_vector_field(newpos, k3, cmag)
3154 * for i in range(3):
3155 * newpos[i] = oldpos[i] + k3[i]*h # <<<<<<<<<<<<<<
3156 *
3157 * if not (self.LeftEdge[0] <= newpos[0] and newpos[0] <= self.RightEdge[0] and \
3158 */
3159 (__pyx_v_newpos[__pyx_v_i]) = ((__pyx_v_oldpos[__pyx_v_i]) + ((__pyx_v_k3[__pyx_v_i]) * __pyx_v_h));
3160 }
3161
3162 /* "yt/utilities/lib/partitioned_grid.pyx":116
3163 * newpos[i] = oldpos[i] + k3[i]*h
3164 *
3165 * if not (self.LeftEdge[0] <= newpos[0] and newpos[0] <= self.RightEdge[0] and \ # <<<<<<<<<<<<<<
3166 * self.LeftEdge[1] <= newpos[1] and newpos[1] <= self.RightEdge[1] and \
3167 * self.LeftEdge[2] <= newpos[2] and newpos[2] <= self.RightEdge[2]):
3168 */
3169 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->LeftEdge, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error)
3170 __Pyx_GOTREF(__pyx_t_2);
3171 __pyx_t_5 = PyFloat_FromDouble((__pyx_v_newpos[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 116, __pyx_L1_error)
3172 __Pyx_GOTREF(__pyx_t_5);
3173 __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 116, __pyx_L1_error)
3174 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3175 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3176 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 116, __pyx_L1_error)
3177 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3178 if (__pyx_t_7) {
3179 } else {
3180 __pyx_t_4 = __pyx_t_7;
3181 goto __pyx_L32_bool_binop_done;
3182 }
3183 __pyx_t_6 = PyFloat_FromDouble((__pyx_v_newpos[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 116, __pyx_L1_error)
3184 __Pyx_GOTREF(__pyx_t_6);
3185 __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_self->RightEdge, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 116, __pyx_L1_error)
3186 __Pyx_GOTREF(__pyx_t_5);
3187 __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error)
3188 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3189 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3190 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 116, __pyx_L1_error)
3191 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3192 if (__pyx_t_7) {
3193 } else {
3194 __pyx_t_4 = __pyx_t_7;
3195 goto __pyx_L32_bool_binop_done;
3196 }
3197
3198 /* "yt/utilities/lib/partitioned_grid.pyx":117
3199 *
3200 * if not (self.LeftEdge[0] <= newpos[0] and newpos[0] <= self.RightEdge[0] and \
3201 * self.LeftEdge[1] <= newpos[1] and newpos[1] <= self.RightEdge[1] and \ # <<<<<<<<<<<<<<
3202 * self.LeftEdge[2] <= newpos[2] and newpos[2] <= self.RightEdge[2]):
3203 * if mag is not None:
3204 */
3205 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->LeftEdge, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error)
3206 __Pyx_GOTREF(__pyx_t_2);
3207 __pyx_t_5 = PyFloat_FromDouble((__pyx_v_newpos[1])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 117, __pyx_L1_error)
3208 __Pyx_GOTREF(__pyx_t_5);
3209 __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 117, __pyx_L1_error)
3210 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3211 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3212 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 117, __pyx_L1_error)
3213 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3214 if (__pyx_t_7) {
3215 } else {
3216 __pyx_t_4 = __pyx_t_7;
3217 goto __pyx_L32_bool_binop_done;
3218 }
3219 __pyx_t_6 = PyFloat_FromDouble((__pyx_v_newpos[1])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 117, __pyx_L1_error)
3220 __Pyx_GOTREF(__pyx_t_6);
3221 __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_self->RightEdge, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 117, __pyx_L1_error)
3222 __Pyx_GOTREF(__pyx_t_5);
3223 __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error)
3224 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3225 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3226 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 117, __pyx_L1_error)
3227 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3228 if (__pyx_t_7) {
3229 } else {
3230 __pyx_t_4 = __pyx_t_7;
3231 goto __pyx_L32_bool_binop_done;
3232 }
3233
3234 /* "yt/utilities/lib/partitioned_grid.pyx":118
3235 * if not (self.LeftEdge[0] <= newpos[0] and newpos[0] <= self.RightEdge[0] and \
3236 * self.LeftEdge[1] <= newpos[1] and newpos[1] <= self.RightEdge[1] and \
3237 * self.LeftEdge[2] <= newpos[2] and newpos[2] <= self.RightEdge[2]): # <<<<<<<<<<<<<<
3238 * if mag is not None:
3239 * mag[0] = cmag[0]
3240 */
3241 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->LeftEdge, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error)
3242 __Pyx_GOTREF(__pyx_t_2);
3243 __pyx_t_5 = PyFloat_FromDouble((__pyx_v_newpos[2])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 118, __pyx_L1_error)
3244 __Pyx_GOTREF(__pyx_t_5);
3245 __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 118, __pyx_L1_error)
3246 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3247 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3248 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 118, __pyx_L1_error)
3249 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3250 if (__pyx_t_7) {
3251 } else {
3252 __pyx_t_4 = __pyx_t_7;
3253 goto __pyx_L32_bool_binop_done;
3254 }
3255 __pyx_t_6 = PyFloat_FromDouble((__pyx_v_newpos[2])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 118, __pyx_L1_error)
3256 __Pyx_GOTREF(__pyx_t_6);
3257 __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_self->RightEdge, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 118, __pyx_L1_error)
3258 __Pyx_GOTREF(__pyx_t_5);
3259 __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error)
3260 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3261 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3262 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 118, __pyx_L1_error)
3263 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3264 __pyx_t_4 = __pyx_t_7;
3265 __pyx_L32_bool_binop_done:;
3266
3267 /* "yt/utilities/lib/partitioned_grid.pyx":116
3268 * newpos[i] = oldpos[i] + k3[i]*h
3269 *
3270 * if not (self.LeftEdge[0] <= newpos[0] and newpos[0] <= self.RightEdge[0] and \ # <<<<<<<<<<<<<<
3271 * self.LeftEdge[1] <= newpos[1] and newpos[1] <= self.RightEdge[1] and \
3272 * self.LeftEdge[2] <= newpos[2] and newpos[2] <= self.RightEdge[2]):
3273 */
3274 __pyx_t_7 = ((!__pyx_t_4) != 0);
3275 if (__pyx_t_7) {
3276
3277 /* "yt/utilities/lib/partitioned_grid.pyx":119
3278 * self.LeftEdge[1] <= newpos[1] and newpos[1] <= self.RightEdge[1] and \
3279 * self.LeftEdge[2] <= newpos[2] and newpos[2] <= self.RightEdge[2]):
3280 * if mag is not None: # <<<<<<<<<<<<<<
3281 * mag[0] = cmag[0]
3282 * for i in range(3):
3283 */
3284 __pyx_t_7 = (__pyx_v_mag != Py_None);
3285 __pyx_t_4 = (__pyx_t_7 != 0);
3286 if (__pyx_t_4) {
3287
3288 /* "yt/utilities/lib/partitioned_grid.pyx":120
3289 * self.LeftEdge[2] <= newpos[2] and newpos[2] <= self.RightEdge[2]):
3290 * if mag is not None:
3291 * mag[0] = cmag[0] # <<<<<<<<<<<<<<
3292 * for i in range(3):
3293 * pos[i] = newpos[i]
3294 */
3295 __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cmag[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error)
3296 __Pyx_GOTREF(__pyx_t_2);
3297 if (unlikely(__Pyx_SetItemInt(__pyx_v_mag, 0, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0) < 0)) __PYX_ERR(0, 120, __pyx_L1_error)
3298 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3299
3300 /* "yt/utilities/lib/partitioned_grid.pyx":119
3301 * self.LeftEdge[1] <= newpos[1] and newpos[1] <= self.RightEdge[1] and \
3302 * self.LeftEdge[2] <= newpos[2] and newpos[2] <= self.RightEdge[2]):
3303 * if mag is not None: # <<<<<<<<<<<<<<
3304 * mag[0] = cmag[0]
3305 * for i in range(3):
3306 */
3307 }
3308
3309 /* "yt/utilities/lib/partitioned_grid.pyx":121
3310 * if mag is not None:
3311 * mag[0] = cmag[0]
3312 * for i in range(3): # <<<<<<<<<<<<<<
3313 * pos[i] = newpos[i]
3314 * return
3315 */
3316 for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
3317 __pyx_v_i = __pyx_t_1;
3318
3319 /* "yt/utilities/lib/partitioned_grid.pyx":122
3320 * mag[0] = cmag[0]
3321 * for i in range(3):
3322 * pos[i] = newpos[i] # <<<<<<<<<<<<<<
3323 * return
3324 *
3325 */
3326 __pyx_t_2 = PyFloat_FromDouble((__pyx_v_newpos[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
3327 __Pyx_GOTREF(__pyx_t_2);
3328 if (unlikely(__Pyx_SetItemInt(__pyx_v_pos, __pyx_v_i, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0) < 0)) __PYX_ERR(0, 122, __pyx_L1_error)
3329 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3330 }
3331
3332 /* "yt/utilities/lib/partitioned_grid.pyx":123
3333 * for i in range(3):
3334 * pos[i] = newpos[i]
3335 * return # <<<<<<<<<<<<<<
3336 *
3337 * self.get_vector_field(newpos, k4, cmag)
3338 */
3339 __Pyx_XDECREF(__pyx_r);
3340 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3341 goto __pyx_L0;
3342
3343 /* "yt/utilities/lib/partitioned_grid.pyx":116
3344 * newpos[i] = oldpos[i] + k3[i]*h
3345 *
3346 * if not (self.LeftEdge[0] <= newpos[0] and newpos[0] <= self.RightEdge[0] and \ # <<<<<<<<<<<<<<
3347 * self.LeftEdge[1] <= newpos[1] and newpos[1] <= self.RightEdge[1] and \
3348 * self.LeftEdge[2] <= newpos[2] and newpos[2] <= self.RightEdge[2]):
3349 */
3350 }
3351
3352 /* "yt/utilities/lib/partitioned_grid.pyx":125
3353 * return
3354 *
3355 * self.get_vector_field(newpos, k4, cmag) # <<<<<<<<<<<<<<
3356 *
3357 * for i in range(3):
3358 */
3359 ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self->__pyx_vtab)->get_vector_field(__pyx_v_self, __pyx_v_newpos, __pyx_v_k4, __pyx_v_cmag);
3360
3361 /* "yt/utilities/lib/partitioned_grid.pyx":127
3362 * self.get_vector_field(newpos, k4, cmag)
3363 *
3364 * for i in range(3): # <<<<<<<<<<<<<<
3365 * pos[i] = oldpos[i] + h*(k1[i]/6.0 + k2[i]/3.0 + k3[i]/3.0 + k4[i]/6.0)
3366 *
3367 */
3368 for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
3369 __pyx_v_i = __pyx_t_1;
3370
3371 /* "yt/utilities/lib/partitioned_grid.pyx":128
3372 *
3373 * for i in range(3):
3374 * pos[i] = oldpos[i] + h*(k1[i]/6.0 + k2[i]/3.0 + k3[i]/3.0 + k4[i]/6.0) # <<<<<<<<<<<<<<
3375 *
3376 * if mag is not None:
3377 */
3378 __pyx_t_2 = PyFloat_FromDouble(((__pyx_v_oldpos[__pyx_v_i]) + (__pyx_v_h * (((((__pyx_v_k1[__pyx_v_i]) / 6.0) + ((__pyx_v_k2[__pyx_v_i]) / 3.0)) + ((__pyx_v_k3[__pyx_v_i]) / 3.0)) + ((__pyx_v_k4[__pyx_v_i]) / 6.0))))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error)
3379 __Pyx_GOTREF(__pyx_t_2);
3380 if (unlikely(__Pyx_SetItemInt(__pyx_v_pos, __pyx_v_i, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0) < 0)) __PYX_ERR(0, 128, __pyx_L1_error)
3381 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3382 }
3383
3384 /* "yt/utilities/lib/partitioned_grid.pyx":130
3385 * pos[i] = oldpos[i] + h*(k1[i]/6.0 + k2[i]/3.0 + k3[i]/3.0 + k4[i]/6.0)
3386 *
3387 * if mag is not None: # <<<<<<<<<<<<<<
3388 * for i in range(3):
3389 * newpos[i] = pos[i]
3390 */
3391 __pyx_t_4 = (__pyx_v_mag != Py_None);
3392 __pyx_t_7 = (__pyx_t_4 != 0);
3393 if (__pyx_t_7) {
3394
3395 /* "yt/utilities/lib/partitioned_grid.pyx":131
3396 *
3397 * if mag is not None:
3398 * for i in range(3): # <<<<<<<<<<<<<<
3399 * newpos[i] = pos[i]
3400 * self.get_vector_field(newpos, k4, cmag)
3401 */
3402 for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
3403 __pyx_v_i = __pyx_t_1;
3404
3405 /* "yt/utilities/lib/partitioned_grid.pyx":132
3406 * if mag is not None:
3407 * for i in range(3):
3408 * newpos[i] = pos[i] # <<<<<<<<<<<<<<
3409 * self.get_vector_field(newpos, k4, cmag)
3410 * mag[0] = cmag[0]
3411 */
3412 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pos, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error)
3413 __Pyx_GOTREF(__pyx_t_2);
3414 __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
3415 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3416 (__pyx_v_newpos[__pyx_v_i]) = __pyx_t_3;
3417 }
3418
3419 /* "yt/utilities/lib/partitioned_grid.pyx":133
3420 * for i in range(3):
3421 * newpos[i] = pos[i]
3422 * self.get_vector_field(newpos, k4, cmag) # <<<<<<<<<<<<<<
3423 * mag[0] = cmag[0]
3424 *
3425 */
3426 ((struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self->__pyx_vtab)->get_vector_field(__pyx_v_self, __pyx_v_newpos, __pyx_v_k4, __pyx_v_cmag);
3427
3428 /* "yt/utilities/lib/partitioned_grid.pyx":134
3429 * newpos[i] = pos[i]
3430 * self.get_vector_field(newpos, k4, cmag)
3431 * mag[0] = cmag[0] # <<<<<<<<<<<<<<
3432 *
3433 * @cython.boundscheck(False)
3434 */
3435 __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cmag[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error)
3436 __Pyx_GOTREF(__pyx_t_2);
3437 if (unlikely(__Pyx_SetItemInt(__pyx_v_mag, 0, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0) < 0)) __PYX_ERR(0, 134, __pyx_L1_error)
3438 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3439
3440 /* "yt/utilities/lib/partitioned_grid.pyx":130
3441 * pos[i] = oldpos[i] + h*(k1[i]/6.0 + k2[i]/3.0 + k3[i]/3.0 + k4[i]/6.0)
3442 *
3443 * if mag is not None: # <<<<<<<<<<<<<<
3444 * for i in range(3):
3445 * newpos[i] = pos[i]
3446 */
3447 }
3448
3449 /* "yt/utilities/lib/partitioned_grid.pyx":76
3450 * @cython.wraparound(False)
3451 * @cython.cdivision(True)
3452 * def integrate_streamline(self, pos, np.float64_t h, mag): # <<<<<<<<<<<<<<
3453 * cdef np.float64_t cmag[1]
3454 * cdef np.float64_t k1[3]
3455 */
3456
3457 /* function exit code */
3458 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3459 goto __pyx_L0;
3460 __pyx_L1_error:;
3461 __Pyx_XDECREF(__pyx_t_2);
3462 __Pyx_XDECREF(__pyx_t_5);
3463 __Pyx_XDECREF(__pyx_t_6);
3464 __Pyx_AddTraceback("yt.utilities.lib.partitioned_grid.PartitionedGrid.integrate_streamline", __pyx_clineno, __pyx_lineno, __pyx_filename);
3465 __pyx_r = NULL;
3466 __pyx_L0:;
3467 __Pyx_XGIVEREF(__pyx_r);
3468 __Pyx_RefNannyFinishContext();
3469 return __pyx_r;
3470 }
3471
3472 /* "yt/utilities/lib/partitioned_grid.pyx":139
3473 * @cython.wraparound(False)
3474 * @cython.cdivision(True)
3475 * cdef void get_vector_field(self, np.float64_t pos[3], # <<<<<<<<<<<<<<
3476 * np.float64_t *vel, np.float64_t *vel_mag):
3477 * cdef np.float64_t dp[3]
3478 */
3479
__pyx_f_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_get_vector_field(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid * __pyx_v_self,__pyx_t_5numpy_float64_t * __pyx_v_pos,__pyx_t_5numpy_float64_t * __pyx_v_vel,__pyx_t_5numpy_float64_t * __pyx_v_vel_mag)3480 static void __pyx_f_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_get_vector_field(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_pos, __pyx_t_5numpy_float64_t *__pyx_v_vel, __pyx_t_5numpy_float64_t *__pyx_v_vel_mag) {
3481 __pyx_t_5numpy_float64_t __pyx_v_dp[3];
3482 int __pyx_v_ci[3];
3483 struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_c;
3484 long __pyx_v_i;
3485 int __pyx_v_offset;
3486 __Pyx_RefNannyDeclarations
3487 struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_t_1;
3488 long __pyx_t_2;
3489 PyObject *__pyx_t_3 = NULL;
3490 PyObject *__pyx_t_4 = NULL;
3491 PyObject *__pyx_t_5 = NULL;
3492 int __pyx_t_6;
3493 __pyx_t_5numpy_float64_t __pyx_t_7;
3494 long __pyx_t_8;
3495 PyObject *__pyx_t_9 = NULL;
3496 int __pyx_t_10;
3497 __Pyx_RefNannySetupContext("get_vector_field", 0);
3498
3499 /* "yt/utilities/lib/partitioned_grid.pyx":143
3500 * cdef np.float64_t dp[3]
3501 * cdef int ci[3]
3502 * cdef VolumeContainer *c = self.container # convenience # <<<<<<<<<<<<<<
3503 *
3504 * for i in range(3):
3505 */
3506 __pyx_t_1 = __pyx_v_self->container;
3507 __pyx_v_c = __pyx_t_1;
3508
3509 /* "yt/utilities/lib/partitioned_grid.pyx":145
3510 * cdef VolumeContainer *c = self.container # convenience
3511 *
3512 * for i in range(3): # <<<<<<<<<<<<<<
3513 * ci[i] = (int)((pos[i]-self.LeftEdge[i])/c.dds[i])
3514 * dp[i] = (pos[i] - ci[i]*c.dds[i] - self.LeftEdge[i])/c.dds[i]
3515 */
3516 for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) {
3517 __pyx_v_i = __pyx_t_2;
3518
3519 /* "yt/utilities/lib/partitioned_grid.pyx":146
3520 *
3521 * for i in range(3):
3522 * ci[i] = (int)((pos[i]-self.LeftEdge[i])/c.dds[i]) # <<<<<<<<<<<<<<
3523 * dp[i] = (pos[i] - ci[i]*c.dds[i] - self.LeftEdge[i])/c.dds[i]
3524 *
3525 */
3526 __pyx_t_3 = PyFloat_FromDouble((__pyx_v_pos[__pyx_v_i])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
3527 __Pyx_GOTREF(__pyx_t_3);
3528 __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_self->LeftEdge, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
3529 __Pyx_GOTREF(__pyx_t_4);
3530 __pyx_t_5 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error)
3531 __Pyx_GOTREF(__pyx_t_5);
3532 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3533 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3534 __pyx_t_4 = PyFloat_FromDouble((__pyx_v_c->dds[__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
3535 __Pyx_GOTREF(__pyx_t_4);
3536 __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
3537 __Pyx_GOTREF(__pyx_t_3);
3538 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3539 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3540 __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
3541 __Pyx_GOTREF(__pyx_t_4);
3542 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3543 __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error)
3544 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3545 (__pyx_v_ci[__pyx_v_i]) = __pyx_t_6;
3546
3547 /* "yt/utilities/lib/partitioned_grid.pyx":147
3548 * for i in range(3):
3549 * ci[i] = (int)((pos[i]-self.LeftEdge[i])/c.dds[i])
3550 * dp[i] = (pos[i] - ci[i]*c.dds[i] - self.LeftEdge[i])/c.dds[i] # <<<<<<<<<<<<<<
3551 *
3552 * cdef int offset = ci[0] * (c.dims[1] + 1) * (c.dims[2] + 1) \
3553 */
3554 __pyx_t_4 = PyFloat_FromDouble(((__pyx_v_pos[__pyx_v_i]) - ((__pyx_v_ci[__pyx_v_i]) * (__pyx_v_c->dds[__pyx_v_i])))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error)
3555 __Pyx_GOTREF(__pyx_t_4);
3556 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->LeftEdge, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
3557 __Pyx_GOTREF(__pyx_t_3);
3558 __pyx_t_5 = PyNumber_Subtract(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error)
3559 __Pyx_GOTREF(__pyx_t_5);
3560 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3561 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3562 __pyx_t_3 = PyFloat_FromDouble((__pyx_v_c->dds[__pyx_v_i])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
3563 __Pyx_GOTREF(__pyx_t_3);
3564 __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error)
3565 __Pyx_GOTREF(__pyx_t_4);
3566 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3567 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3568 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_7 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L1_error)
3569 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3570 (__pyx_v_dp[__pyx_v_i]) = __pyx_t_7;
3571 }
3572
3573 /* "yt/utilities/lib/partitioned_grid.pyx":150
3574 *
3575 * cdef int offset = ci[0] * (c.dims[1] + 1) * (c.dims[2] + 1) \
3576 * + ci[1] * (c.dims[2] + 1) + ci[2] # <<<<<<<<<<<<<<
3577 *
3578 * vel_mag[0] = 0.0
3579 */
3580 __pyx_v_offset = (((((__pyx_v_ci[0]) * ((__pyx_v_c->dims[1]) + 1)) * ((__pyx_v_c->dims[2]) + 1)) + ((__pyx_v_ci[1]) * ((__pyx_v_c->dims[2]) + 1))) + (__pyx_v_ci[2]));
3581
3582 /* "yt/utilities/lib/partitioned_grid.pyx":152
3583 * + ci[1] * (c.dims[2] + 1) + ci[2]
3584 *
3585 * vel_mag[0] = 0.0 # <<<<<<<<<<<<<<
3586 * for i in range(3):
3587 * vel[i] = offset_interpolate(c.dims, dp, c.data[i] + offset)
3588 */
3589 (__pyx_v_vel_mag[0]) = 0.0;
3590
3591 /* "yt/utilities/lib/partitioned_grid.pyx":153
3592 *
3593 * vel_mag[0] = 0.0
3594 * for i in range(3): # <<<<<<<<<<<<<<
3595 * vel[i] = offset_interpolate(c.dims, dp, c.data[i] + offset)
3596 * vel_mag[0] += vel[i]*vel[i]
3597 */
3598 for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) {
3599 __pyx_v_i = __pyx_t_2;
3600
3601 /* "yt/utilities/lib/partitioned_grid.pyx":154
3602 * vel_mag[0] = 0.0
3603 * for i in range(3):
3604 * vel[i] = offset_interpolate(c.dims, dp, c.data[i] + offset) # <<<<<<<<<<<<<<
3605 * vel_mag[0] += vel[i]*vel[i]
3606 * vel_mag[0] = np.sqrt(vel_mag[0])
3607 */
3608 (__pyx_v_vel[__pyx_v_i]) = offset_interpolate(__pyx_v_c->dims, __pyx_v_dp, ((__pyx_v_c->data[__pyx_v_i]) + __pyx_v_offset));
3609
3610 /* "yt/utilities/lib/partitioned_grid.pyx":155
3611 * for i in range(3):
3612 * vel[i] = offset_interpolate(c.dims, dp, c.data[i] + offset)
3613 * vel_mag[0] += vel[i]*vel[i] # <<<<<<<<<<<<<<
3614 * vel_mag[0] = np.sqrt(vel_mag[0])
3615 * if vel_mag[0] != 0.0:
3616 */
3617 __pyx_t_8 = 0;
3618 (__pyx_v_vel_mag[__pyx_t_8]) = ((__pyx_v_vel_mag[__pyx_t_8]) + ((__pyx_v_vel[__pyx_v_i]) * (__pyx_v_vel[__pyx_v_i])));
3619 }
3620
3621 /* "yt/utilities/lib/partitioned_grid.pyx":156
3622 * vel[i] = offset_interpolate(c.dims, dp, c.data[i] + offset)
3623 * vel_mag[0] += vel[i]*vel[i]
3624 * vel_mag[0] = np.sqrt(vel_mag[0]) # <<<<<<<<<<<<<<
3625 * if vel_mag[0] != 0.0:
3626 * for i in range(3):
3627 */
3628 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
3629 __Pyx_GOTREF(__pyx_t_3);
3630 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 156, __pyx_L1_error)
3631 __Pyx_GOTREF(__pyx_t_5);
3632 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3633 __pyx_t_3 = PyFloat_FromDouble((__pyx_v_vel_mag[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
3634 __Pyx_GOTREF(__pyx_t_3);
3635 __pyx_t_9 = NULL;
3636 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3637 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
3638 if (likely(__pyx_t_9)) {
3639 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
3640 __Pyx_INCREF(__pyx_t_9);
3641 __Pyx_INCREF(function);
3642 __Pyx_DECREF_SET(__pyx_t_5, function);
3643 }
3644 }
3645 __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_9, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3);
3646 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3647 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3648 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error)
3649 __Pyx_GOTREF(__pyx_t_4);
3650 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3651 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_7 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L1_error)
3652 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3653 (__pyx_v_vel_mag[0]) = __pyx_t_7;
3654
3655 /* "yt/utilities/lib/partitioned_grid.pyx":157
3656 * vel_mag[0] += vel[i]*vel[i]
3657 * vel_mag[0] = np.sqrt(vel_mag[0])
3658 * if vel_mag[0] != 0.0: # <<<<<<<<<<<<<<
3659 * for i in range(3):
3660 * vel[i] /= vel_mag[0]
3661 */
3662 __pyx_t_10 = (((__pyx_v_vel_mag[0]) != 0.0) != 0);
3663 if (__pyx_t_10) {
3664
3665 /* "yt/utilities/lib/partitioned_grid.pyx":158
3666 * vel_mag[0] = np.sqrt(vel_mag[0])
3667 * if vel_mag[0] != 0.0:
3668 * for i in range(3): # <<<<<<<<<<<<<<
3669 * vel[i] /= vel_mag[0]
3670 */
3671 for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) {
3672 __pyx_v_i = __pyx_t_2;
3673
3674 /* "yt/utilities/lib/partitioned_grid.pyx":159
3675 * if vel_mag[0] != 0.0:
3676 * for i in range(3):
3677 * vel[i] /= vel_mag[0] # <<<<<<<<<<<<<<
3678 */
3679 __pyx_t_8 = __pyx_v_i;
3680 (__pyx_v_vel[__pyx_t_8]) = ((__pyx_v_vel[__pyx_t_8]) / (__pyx_v_vel_mag[0]));
3681 }
3682
3683 /* "yt/utilities/lib/partitioned_grid.pyx":157
3684 * vel_mag[0] += vel[i]*vel[i]
3685 * vel_mag[0] = np.sqrt(vel_mag[0])
3686 * if vel_mag[0] != 0.0: # <<<<<<<<<<<<<<
3687 * for i in range(3):
3688 * vel[i] /= vel_mag[0]
3689 */
3690 }
3691
3692 /* "yt/utilities/lib/partitioned_grid.pyx":139
3693 * @cython.wraparound(False)
3694 * @cython.cdivision(True)
3695 * cdef void get_vector_field(self, np.float64_t pos[3], # <<<<<<<<<<<<<<
3696 * np.float64_t *vel, np.float64_t *vel_mag):
3697 * cdef np.float64_t dp[3]
3698 */
3699
3700 /* function exit code */
3701 goto __pyx_L0;
3702 __pyx_L1_error:;
3703 __Pyx_XDECREF(__pyx_t_3);
3704 __Pyx_XDECREF(__pyx_t_4);
3705 __Pyx_XDECREF(__pyx_t_5);
3706 __Pyx_XDECREF(__pyx_t_9);
3707 __Pyx_WriteUnraisable("yt.utilities.lib.partitioned_grid.PartitionedGrid.get_vector_field", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
3708 __pyx_L0:;
3709 __Pyx_RefNannyFinishContext();
3710 }
3711
3712 /* "yt/utilities/lib/partitioned_grid.pxd":19
3713 *
3714 * cdef class PartitionedGrid:
3715 * cdef public object my_data # <<<<<<<<<<<<<<
3716 * cdef public object source_mask
3717 * cdef public object LeftEdge
3718 */
3719
3720 /* Python wrapper */
3721 static PyObject *__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7my_data_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7my_data_1__get__(PyObject * __pyx_v_self)3722 static PyObject *__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7my_data_1__get__(PyObject *__pyx_v_self) {
3723 PyObject *__pyx_r = 0;
3724 __Pyx_RefNannyDeclarations
3725 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3726 __pyx_r = __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7my_data___get__(((struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self));
3727
3728 /* function exit code */
3729 __Pyx_RefNannyFinishContext();
3730 return __pyx_r;
3731 }
3732
__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7my_data___get__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid * __pyx_v_self)3733 static PyObject *__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7my_data___get__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self) {
3734 PyObject *__pyx_r = NULL;
3735 __Pyx_RefNannyDeclarations
3736 __Pyx_RefNannySetupContext("__get__", 0);
3737 __Pyx_XDECREF(__pyx_r);
3738 __Pyx_INCREF(__pyx_v_self->my_data);
3739 __pyx_r = __pyx_v_self->my_data;
3740 goto __pyx_L0;
3741
3742 /* function exit code */
3743 __pyx_L0:;
3744 __Pyx_XGIVEREF(__pyx_r);
3745 __Pyx_RefNannyFinishContext();
3746 return __pyx_r;
3747 }
3748
3749 /* Python wrapper */
3750 static int __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7my_data_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7my_data_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)3751 static int __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7my_data_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3752 int __pyx_r;
3753 __Pyx_RefNannyDeclarations
3754 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3755 __pyx_r = __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7my_data_2__set__(((struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3756
3757 /* function exit code */
3758 __Pyx_RefNannyFinishContext();
3759 return __pyx_r;
3760 }
3761
__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7my_data_2__set__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid * __pyx_v_self,PyObject * __pyx_v_value)3762 static int __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7my_data_2__set__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self, PyObject *__pyx_v_value) {
3763 int __pyx_r;
3764 __Pyx_RefNannyDeclarations
3765 __Pyx_RefNannySetupContext("__set__", 0);
3766 __Pyx_INCREF(__pyx_v_value);
3767 __Pyx_GIVEREF(__pyx_v_value);
3768 __Pyx_GOTREF(__pyx_v_self->my_data);
3769 __Pyx_DECREF(__pyx_v_self->my_data);
3770 __pyx_v_self->my_data = __pyx_v_value;
3771
3772 /* function exit code */
3773 __pyx_r = 0;
3774 __Pyx_RefNannyFinishContext();
3775 return __pyx_r;
3776 }
3777
3778 /* Python wrapper */
3779 static int __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7my_data_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7my_data_5__del__(PyObject * __pyx_v_self)3780 static int __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7my_data_5__del__(PyObject *__pyx_v_self) {
3781 int __pyx_r;
3782 __Pyx_RefNannyDeclarations
3783 __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
3784 __pyx_r = __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7my_data_4__del__(((struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self));
3785
3786 /* function exit code */
3787 __Pyx_RefNannyFinishContext();
3788 return __pyx_r;
3789 }
3790
__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7my_data_4__del__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid * __pyx_v_self)3791 static int __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7my_data_4__del__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self) {
3792 int __pyx_r;
3793 __Pyx_RefNannyDeclarations
3794 __Pyx_RefNannySetupContext("__del__", 0);
3795 __Pyx_INCREF(Py_None);
3796 __Pyx_GIVEREF(Py_None);
3797 __Pyx_GOTREF(__pyx_v_self->my_data);
3798 __Pyx_DECREF(__pyx_v_self->my_data);
3799 __pyx_v_self->my_data = Py_None;
3800
3801 /* function exit code */
3802 __pyx_r = 0;
3803 __Pyx_RefNannyFinishContext();
3804 return __pyx_r;
3805 }
3806
3807 /* "yt/utilities/lib/partitioned_grid.pxd":20
3808 * cdef class PartitionedGrid:
3809 * cdef public object my_data
3810 * cdef public object source_mask # <<<<<<<<<<<<<<
3811 * cdef public object LeftEdge
3812 * cdef public object RightEdge
3813 */
3814
3815 /* Python wrapper */
3816 static PyObject *__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_11source_mask_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_11source_mask_1__get__(PyObject * __pyx_v_self)3817 static PyObject *__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_11source_mask_1__get__(PyObject *__pyx_v_self) {
3818 PyObject *__pyx_r = 0;
3819 __Pyx_RefNannyDeclarations
3820 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3821 __pyx_r = __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_11source_mask___get__(((struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self));
3822
3823 /* function exit code */
3824 __Pyx_RefNannyFinishContext();
3825 return __pyx_r;
3826 }
3827
__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_11source_mask___get__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid * __pyx_v_self)3828 static PyObject *__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_11source_mask___get__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self) {
3829 PyObject *__pyx_r = NULL;
3830 __Pyx_RefNannyDeclarations
3831 __Pyx_RefNannySetupContext("__get__", 0);
3832 __Pyx_XDECREF(__pyx_r);
3833 __Pyx_INCREF(__pyx_v_self->source_mask);
3834 __pyx_r = __pyx_v_self->source_mask;
3835 goto __pyx_L0;
3836
3837 /* function exit code */
3838 __pyx_L0:;
3839 __Pyx_XGIVEREF(__pyx_r);
3840 __Pyx_RefNannyFinishContext();
3841 return __pyx_r;
3842 }
3843
3844 /* Python wrapper */
3845 static int __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_11source_mask_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_11source_mask_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)3846 static int __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_11source_mask_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3847 int __pyx_r;
3848 __Pyx_RefNannyDeclarations
3849 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3850 __pyx_r = __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_11source_mask_2__set__(((struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3851
3852 /* function exit code */
3853 __Pyx_RefNannyFinishContext();
3854 return __pyx_r;
3855 }
3856
__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_11source_mask_2__set__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid * __pyx_v_self,PyObject * __pyx_v_value)3857 static int __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_11source_mask_2__set__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self, PyObject *__pyx_v_value) {
3858 int __pyx_r;
3859 __Pyx_RefNannyDeclarations
3860 __Pyx_RefNannySetupContext("__set__", 0);
3861 __Pyx_INCREF(__pyx_v_value);
3862 __Pyx_GIVEREF(__pyx_v_value);
3863 __Pyx_GOTREF(__pyx_v_self->source_mask);
3864 __Pyx_DECREF(__pyx_v_self->source_mask);
3865 __pyx_v_self->source_mask = __pyx_v_value;
3866
3867 /* function exit code */
3868 __pyx_r = 0;
3869 __Pyx_RefNannyFinishContext();
3870 return __pyx_r;
3871 }
3872
3873 /* Python wrapper */
3874 static int __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_11source_mask_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_11source_mask_5__del__(PyObject * __pyx_v_self)3875 static int __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_11source_mask_5__del__(PyObject *__pyx_v_self) {
3876 int __pyx_r;
3877 __Pyx_RefNannyDeclarations
3878 __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
3879 __pyx_r = __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_11source_mask_4__del__(((struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self));
3880
3881 /* function exit code */
3882 __Pyx_RefNannyFinishContext();
3883 return __pyx_r;
3884 }
3885
__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_11source_mask_4__del__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid * __pyx_v_self)3886 static int __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_11source_mask_4__del__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self) {
3887 int __pyx_r;
3888 __Pyx_RefNannyDeclarations
3889 __Pyx_RefNannySetupContext("__del__", 0);
3890 __Pyx_INCREF(Py_None);
3891 __Pyx_GIVEREF(Py_None);
3892 __Pyx_GOTREF(__pyx_v_self->source_mask);
3893 __Pyx_DECREF(__pyx_v_self->source_mask);
3894 __pyx_v_self->source_mask = Py_None;
3895
3896 /* function exit code */
3897 __pyx_r = 0;
3898 __Pyx_RefNannyFinishContext();
3899 return __pyx_r;
3900 }
3901
3902 /* "yt/utilities/lib/partitioned_grid.pxd":21
3903 * cdef public object my_data
3904 * cdef public object source_mask
3905 * cdef public object LeftEdge # <<<<<<<<<<<<<<
3906 * cdef public object RightEdge
3907 * cdef public int parent_grid_id
3908 */
3909
3910 /* Python wrapper */
3911 static PyObject *__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8LeftEdge_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8LeftEdge_1__get__(PyObject * __pyx_v_self)3912 static PyObject *__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8LeftEdge_1__get__(PyObject *__pyx_v_self) {
3913 PyObject *__pyx_r = 0;
3914 __Pyx_RefNannyDeclarations
3915 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3916 __pyx_r = __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8LeftEdge___get__(((struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self));
3917
3918 /* function exit code */
3919 __Pyx_RefNannyFinishContext();
3920 return __pyx_r;
3921 }
3922
__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8LeftEdge___get__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid * __pyx_v_self)3923 static PyObject *__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8LeftEdge___get__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self) {
3924 PyObject *__pyx_r = NULL;
3925 __Pyx_RefNannyDeclarations
3926 __Pyx_RefNannySetupContext("__get__", 0);
3927 __Pyx_XDECREF(__pyx_r);
3928 __Pyx_INCREF(__pyx_v_self->LeftEdge);
3929 __pyx_r = __pyx_v_self->LeftEdge;
3930 goto __pyx_L0;
3931
3932 /* function exit code */
3933 __pyx_L0:;
3934 __Pyx_XGIVEREF(__pyx_r);
3935 __Pyx_RefNannyFinishContext();
3936 return __pyx_r;
3937 }
3938
3939 /* Python wrapper */
3940 static int __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8LeftEdge_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8LeftEdge_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)3941 static int __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8LeftEdge_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3942 int __pyx_r;
3943 __Pyx_RefNannyDeclarations
3944 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3945 __pyx_r = __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8LeftEdge_2__set__(((struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3946
3947 /* function exit code */
3948 __Pyx_RefNannyFinishContext();
3949 return __pyx_r;
3950 }
3951
__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8LeftEdge_2__set__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid * __pyx_v_self,PyObject * __pyx_v_value)3952 static int __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8LeftEdge_2__set__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self, PyObject *__pyx_v_value) {
3953 int __pyx_r;
3954 __Pyx_RefNannyDeclarations
3955 __Pyx_RefNannySetupContext("__set__", 0);
3956 __Pyx_INCREF(__pyx_v_value);
3957 __Pyx_GIVEREF(__pyx_v_value);
3958 __Pyx_GOTREF(__pyx_v_self->LeftEdge);
3959 __Pyx_DECREF(__pyx_v_self->LeftEdge);
3960 __pyx_v_self->LeftEdge = __pyx_v_value;
3961
3962 /* function exit code */
3963 __pyx_r = 0;
3964 __Pyx_RefNannyFinishContext();
3965 return __pyx_r;
3966 }
3967
3968 /* Python wrapper */
3969 static int __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8LeftEdge_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8LeftEdge_5__del__(PyObject * __pyx_v_self)3970 static int __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8LeftEdge_5__del__(PyObject *__pyx_v_self) {
3971 int __pyx_r;
3972 __Pyx_RefNannyDeclarations
3973 __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
3974 __pyx_r = __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8LeftEdge_4__del__(((struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self));
3975
3976 /* function exit code */
3977 __Pyx_RefNannyFinishContext();
3978 return __pyx_r;
3979 }
3980
__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8LeftEdge_4__del__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid * __pyx_v_self)3981 static int __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8LeftEdge_4__del__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self) {
3982 int __pyx_r;
3983 __Pyx_RefNannyDeclarations
3984 __Pyx_RefNannySetupContext("__del__", 0);
3985 __Pyx_INCREF(Py_None);
3986 __Pyx_GIVEREF(Py_None);
3987 __Pyx_GOTREF(__pyx_v_self->LeftEdge);
3988 __Pyx_DECREF(__pyx_v_self->LeftEdge);
3989 __pyx_v_self->LeftEdge = Py_None;
3990
3991 /* function exit code */
3992 __pyx_r = 0;
3993 __Pyx_RefNannyFinishContext();
3994 return __pyx_r;
3995 }
3996
3997 /* "yt/utilities/lib/partitioned_grid.pxd":22
3998 * cdef public object source_mask
3999 * cdef public object LeftEdge
4000 * cdef public object RightEdge # <<<<<<<<<<<<<<
4001 * cdef public int parent_grid_id
4002 * cdef VolumeContainer *container
4003 */
4004
4005 /* Python wrapper */
4006 static PyObject *__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9RightEdge_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9RightEdge_1__get__(PyObject * __pyx_v_self)4007 static PyObject *__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9RightEdge_1__get__(PyObject *__pyx_v_self) {
4008 PyObject *__pyx_r = 0;
4009 __Pyx_RefNannyDeclarations
4010 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4011 __pyx_r = __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9RightEdge___get__(((struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self));
4012
4013 /* function exit code */
4014 __Pyx_RefNannyFinishContext();
4015 return __pyx_r;
4016 }
4017
__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9RightEdge___get__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid * __pyx_v_self)4018 static PyObject *__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9RightEdge___get__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self) {
4019 PyObject *__pyx_r = NULL;
4020 __Pyx_RefNannyDeclarations
4021 __Pyx_RefNannySetupContext("__get__", 0);
4022 __Pyx_XDECREF(__pyx_r);
4023 __Pyx_INCREF(__pyx_v_self->RightEdge);
4024 __pyx_r = __pyx_v_self->RightEdge;
4025 goto __pyx_L0;
4026
4027 /* function exit code */
4028 __pyx_L0:;
4029 __Pyx_XGIVEREF(__pyx_r);
4030 __Pyx_RefNannyFinishContext();
4031 return __pyx_r;
4032 }
4033
4034 /* Python wrapper */
4035 static int __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9RightEdge_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9RightEdge_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)4036 static int __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9RightEdge_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4037 int __pyx_r;
4038 __Pyx_RefNannyDeclarations
4039 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
4040 __pyx_r = __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9RightEdge_2__set__(((struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4041
4042 /* function exit code */
4043 __Pyx_RefNannyFinishContext();
4044 return __pyx_r;
4045 }
4046
__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9RightEdge_2__set__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid * __pyx_v_self,PyObject * __pyx_v_value)4047 static int __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9RightEdge_2__set__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self, PyObject *__pyx_v_value) {
4048 int __pyx_r;
4049 __Pyx_RefNannyDeclarations
4050 __Pyx_RefNannySetupContext("__set__", 0);
4051 __Pyx_INCREF(__pyx_v_value);
4052 __Pyx_GIVEREF(__pyx_v_value);
4053 __Pyx_GOTREF(__pyx_v_self->RightEdge);
4054 __Pyx_DECREF(__pyx_v_self->RightEdge);
4055 __pyx_v_self->RightEdge = __pyx_v_value;
4056
4057 /* function exit code */
4058 __pyx_r = 0;
4059 __Pyx_RefNannyFinishContext();
4060 return __pyx_r;
4061 }
4062
4063 /* Python wrapper */
4064 static int __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9RightEdge_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9RightEdge_5__del__(PyObject * __pyx_v_self)4065 static int __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9RightEdge_5__del__(PyObject *__pyx_v_self) {
4066 int __pyx_r;
4067 __Pyx_RefNannyDeclarations
4068 __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
4069 __pyx_r = __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9RightEdge_4__del__(((struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self));
4070
4071 /* function exit code */
4072 __Pyx_RefNannyFinishContext();
4073 return __pyx_r;
4074 }
4075
__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9RightEdge_4__del__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid * __pyx_v_self)4076 static int __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9RightEdge_4__del__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self) {
4077 int __pyx_r;
4078 __Pyx_RefNannyDeclarations
4079 __Pyx_RefNannySetupContext("__del__", 0);
4080 __Pyx_INCREF(Py_None);
4081 __Pyx_GIVEREF(Py_None);
4082 __Pyx_GOTREF(__pyx_v_self->RightEdge);
4083 __Pyx_DECREF(__pyx_v_self->RightEdge);
4084 __pyx_v_self->RightEdge = Py_None;
4085
4086 /* function exit code */
4087 __pyx_r = 0;
4088 __Pyx_RefNannyFinishContext();
4089 return __pyx_r;
4090 }
4091
4092 /* "yt/utilities/lib/partitioned_grid.pxd":23
4093 * cdef public object LeftEdge
4094 * cdef public object RightEdge
4095 * cdef public int parent_grid_id # <<<<<<<<<<<<<<
4096 * cdef VolumeContainer *container
4097 * cdef np.float64_t star_er
4098 */
4099
4100 /* Python wrapper */
4101 static PyObject *__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_14parent_grid_id_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_14parent_grid_id_1__get__(PyObject * __pyx_v_self)4102 static PyObject *__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_14parent_grid_id_1__get__(PyObject *__pyx_v_self) {
4103 PyObject *__pyx_r = 0;
4104 __Pyx_RefNannyDeclarations
4105 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4106 __pyx_r = __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_14parent_grid_id___get__(((struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self));
4107
4108 /* function exit code */
4109 __Pyx_RefNannyFinishContext();
4110 return __pyx_r;
4111 }
4112
__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_14parent_grid_id___get__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid * __pyx_v_self)4113 static PyObject *__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_14parent_grid_id___get__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self) {
4114 PyObject *__pyx_r = NULL;
4115 __Pyx_RefNannyDeclarations
4116 PyObject *__pyx_t_1 = NULL;
4117 __Pyx_RefNannySetupContext("__get__", 0);
4118 __Pyx_XDECREF(__pyx_r);
4119 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->parent_grid_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 23, __pyx_L1_error)
4120 __Pyx_GOTREF(__pyx_t_1);
4121 __pyx_r = __pyx_t_1;
4122 __pyx_t_1 = 0;
4123 goto __pyx_L0;
4124
4125 /* function exit code */
4126 __pyx_L1_error:;
4127 __Pyx_XDECREF(__pyx_t_1);
4128 __Pyx_AddTraceback("yt.utilities.lib.partitioned_grid.PartitionedGrid.parent_grid_id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4129 __pyx_r = NULL;
4130 __pyx_L0:;
4131 __Pyx_XGIVEREF(__pyx_r);
4132 __Pyx_RefNannyFinishContext();
4133 return __pyx_r;
4134 }
4135
4136 /* Python wrapper */
4137 static int __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_14parent_grid_id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_14parent_grid_id_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)4138 static int __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_14parent_grid_id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4139 int __pyx_r;
4140 __Pyx_RefNannyDeclarations
4141 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
4142 __pyx_r = __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_14parent_grid_id_2__set__(((struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4143
4144 /* function exit code */
4145 __Pyx_RefNannyFinishContext();
4146 return __pyx_r;
4147 }
4148
__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_14parent_grid_id_2__set__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid * __pyx_v_self,PyObject * __pyx_v_value)4149 static int __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_14parent_grid_id_2__set__(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self, PyObject *__pyx_v_value) {
4150 int __pyx_r;
4151 __Pyx_RefNannyDeclarations
4152 int __pyx_t_1;
4153 __Pyx_RefNannySetupContext("__set__", 0);
4154 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 23, __pyx_L1_error)
4155 __pyx_v_self->parent_grid_id = __pyx_t_1;
4156
4157 /* function exit code */
4158 __pyx_r = 0;
4159 goto __pyx_L0;
4160 __pyx_L1_error:;
4161 __Pyx_AddTraceback("yt.utilities.lib.partitioned_grid.PartitionedGrid.parent_grid_id.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4162 __pyx_r = -1;
4163 __pyx_L0:;
4164 __Pyx_RefNannyFinishContext();
4165 return __pyx_r;
4166 }
4167
4168 /* "(tree fragment)":1
4169 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4170 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4171 * def __setstate_cython__(self, __pyx_state):
4172 */
4173
4174 /* Python wrapper */
4175 static PyObject *__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)4176 static PyObject *__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4177 PyObject *__pyx_r = 0;
4178 __Pyx_RefNannyDeclarations
4179 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
4180 __pyx_r = __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_6__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self));
4181
4182 /* function exit code */
4183 __Pyx_RefNannyFinishContext();
4184 return __pyx_r;
4185 }
4186
__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid * __pyx_v_self)4187 static PyObject *__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self) {
4188 PyObject *__pyx_r = NULL;
4189 __Pyx_RefNannyDeclarations
4190 PyObject *__pyx_t_1 = NULL;
4191 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
4192
4193 /* "(tree fragment)":2
4194 * def __reduce_cython__(self):
4195 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
4196 * def __setstate_cython__(self, __pyx_state):
4197 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4198 */
4199 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
4200 __Pyx_GOTREF(__pyx_t_1);
4201 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4202 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4203 __PYX_ERR(1, 2, __pyx_L1_error)
4204
4205 /* "(tree fragment)":1
4206 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4207 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4208 * def __setstate_cython__(self, __pyx_state):
4209 */
4210
4211 /* function exit code */
4212 __pyx_L1_error:;
4213 __Pyx_XDECREF(__pyx_t_1);
4214 __Pyx_AddTraceback("yt.utilities.lib.partitioned_grid.PartitionedGrid.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4215 __pyx_r = NULL;
4216 __Pyx_XGIVEREF(__pyx_r);
4217 __Pyx_RefNannyFinishContext();
4218 return __pyx_r;
4219 }
4220
4221 /* "(tree fragment)":3
4222 * def __reduce_cython__(self):
4223 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4224 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4225 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4226 */
4227
4228 /* Python wrapper */
4229 static PyObject *__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)4230 static PyObject *__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4231 PyObject *__pyx_r = 0;
4232 __Pyx_RefNannyDeclarations
4233 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
4234 __pyx_r = __pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4235
4236 /* function exit code */
4237 __Pyx_RefNannyFinishContext();
4238 return __pyx_r;
4239 }
4240
__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)4241 static PyObject *__pyx_pf_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
4242 PyObject *__pyx_r = NULL;
4243 __Pyx_RefNannyDeclarations
4244 PyObject *__pyx_t_1 = NULL;
4245 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
4246
4247 /* "(tree fragment)":4
4248 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4249 * def __setstate_cython__(self, __pyx_state):
4250 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
4251 */
4252 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
4253 __Pyx_GOTREF(__pyx_t_1);
4254 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4255 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4256 __PYX_ERR(1, 4, __pyx_L1_error)
4257
4258 /* "(tree fragment)":3
4259 * def __reduce_cython__(self):
4260 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4261 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4262 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4263 */
4264
4265 /* function exit code */
4266 __pyx_L1_error:;
4267 __Pyx_XDECREF(__pyx_t_1);
4268 __Pyx_AddTraceback("yt.utilities.lib.partitioned_grid.PartitionedGrid.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4269 __pyx_r = NULL;
4270 __Pyx_XGIVEREF(__pyx_r);
4271 __Pyx_RefNannyFinishContext();
4272 return __pyx_r;
4273 }
4274
4275 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
4276 * # experimental exception made for __getbuffer__ and __releasebuffer__
4277 * # -- the details of this may change.
4278 * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
4279 * # This implementation of getbuffer is geared towards Cython
4280 * # requirements, and does not yet fulfill the PEP.
4281 */
4282
4283 /* Python wrapper */
4284 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
__pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)4285 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
4286 int __pyx_r;
4287 __Pyx_RefNannyDeclarations
4288 __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
4289 __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
4290
4291 /* function exit code */
4292 __Pyx_RefNannyFinishContext();
4293 return __pyx_r;
4294 }
4295
__pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)4296 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
4297 int __pyx_v_i;
4298 int __pyx_v_ndim;
4299 int __pyx_v_endian_detector;
4300 int __pyx_v_little_endian;
4301 int __pyx_v_t;
4302 char *__pyx_v_f;
4303 PyArray_Descr *__pyx_v_descr = 0;
4304 int __pyx_v_offset;
4305 int __pyx_r;
4306 __Pyx_RefNannyDeclarations
4307 int __pyx_t_1;
4308 int __pyx_t_2;
4309 PyObject *__pyx_t_3 = NULL;
4310 int __pyx_t_4;
4311 int __pyx_t_5;
4312 int __pyx_t_6;
4313 PyArray_Descr *__pyx_t_7;
4314 PyObject *__pyx_t_8 = NULL;
4315 char *__pyx_t_9;
4316 if (__pyx_v_info == NULL) {
4317 PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
4318 return -1;
4319 }
4320 __Pyx_RefNannySetupContext("__getbuffer__", 0);
4321 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
4322 __Pyx_GIVEREF(__pyx_v_info->obj);
4323
4324 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265
4325 *
4326 * cdef int i, ndim
4327 * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
4328 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
4329 *
4330 */
4331 __pyx_v_endian_detector = 1;
4332
4333 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266
4334 * cdef int i, ndim
4335 * cdef int endian_detector = 1
4336 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
4337 *
4338 * ndim = PyArray_NDIM(self)
4339 */
4340 __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
4341
4342 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268
4343 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
4344 *
4345 * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
4346 *
4347 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
4348 */
4349 __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
4350
4351 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
4352 * ndim = PyArray_NDIM(self)
4353 *
4354 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
4355 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
4356 * raise ValueError(u"ndarray is not C contiguous")
4357 */
4358 __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
4359 if (__pyx_t_2) {
4360 } else {
4361 __pyx_t_1 = __pyx_t_2;
4362 goto __pyx_L4_bool_binop_done;
4363 }
4364
4365 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271
4366 *
4367 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
4368 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
4369 * raise ValueError(u"ndarray is not C contiguous")
4370 *
4371 */
4372 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
4373 __pyx_t_1 = __pyx_t_2;
4374 __pyx_L4_bool_binop_done:;
4375
4376 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
4377 * ndim = PyArray_NDIM(self)
4378 *
4379 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
4380 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
4381 * raise ValueError(u"ndarray is not C contiguous")
4382 */
4383 if (unlikely(__pyx_t_1)) {
4384
4385 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
4386 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
4387 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
4388 * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
4389 *
4390 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
4391 */
4392 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 272, __pyx_L1_error)
4393 __Pyx_GOTREF(__pyx_t_3);
4394 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4395 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4396 __PYX_ERR(3, 272, __pyx_L1_error)
4397
4398 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
4399 * ndim = PyArray_NDIM(self)
4400 *
4401 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
4402 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
4403 * raise ValueError(u"ndarray is not C contiguous")
4404 */
4405 }
4406
4407 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
4408 * raise ValueError(u"ndarray is not C contiguous")
4409 *
4410 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
4411 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
4412 * raise ValueError(u"ndarray is not Fortran contiguous")
4413 */
4414 __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
4415 if (__pyx_t_2) {
4416 } else {
4417 __pyx_t_1 = __pyx_t_2;
4418 goto __pyx_L7_bool_binop_done;
4419 }
4420
4421 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275
4422 *
4423 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
4424 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
4425 * raise ValueError(u"ndarray is not Fortran contiguous")
4426 *
4427 */
4428 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
4429 __pyx_t_1 = __pyx_t_2;
4430 __pyx_L7_bool_binop_done:;
4431
4432 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
4433 * raise ValueError(u"ndarray is not C contiguous")
4434 *
4435 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
4436 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
4437 * raise ValueError(u"ndarray is not Fortran contiguous")
4438 */
4439 if (unlikely(__pyx_t_1)) {
4440
4441 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
4442 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
4443 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
4444 * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
4445 *
4446 * info.buf = PyArray_DATA(self)
4447 */
4448 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 276, __pyx_L1_error)
4449 __Pyx_GOTREF(__pyx_t_3);
4450 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4451 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4452 __PYX_ERR(3, 276, __pyx_L1_error)
4453
4454 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
4455 * raise ValueError(u"ndarray is not C contiguous")
4456 *
4457 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
4458 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
4459 * raise ValueError(u"ndarray is not Fortran contiguous")
4460 */
4461 }
4462
4463 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278
4464 * raise ValueError(u"ndarray is not Fortran contiguous")
4465 *
4466 * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
4467 * info.ndim = ndim
4468 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
4469 */
4470 __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
4471
4472 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279
4473 *
4474 * info.buf = PyArray_DATA(self)
4475 * info.ndim = ndim # <<<<<<<<<<<<<<
4476 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
4477 * # Allocate new buffer for strides and shape info.
4478 */
4479 __pyx_v_info->ndim = __pyx_v_ndim;
4480
4481 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
4482 * info.buf = PyArray_DATA(self)
4483 * info.ndim = ndim
4484 * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
4485 * # Allocate new buffer for strides and shape info.
4486 * # This is allocated as one block, strides first.
4487 */
4488 __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
4489 if (__pyx_t_1) {
4490
4491 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283
4492 * # Allocate new buffer for strides and shape info.
4493 * # This is allocated as one block, strides first.
4494 * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim) # <<<<<<<<<<<<<<
4495 * info.shape = info.strides + ndim
4496 * for i in range(ndim):
4497 */
4498 __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
4499
4500 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284
4501 * # This is allocated as one block, strides first.
4502 * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
4503 * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
4504 * for i in range(ndim):
4505 * info.strides[i] = PyArray_STRIDES(self)[i]
4506 */
4507 __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
4508
4509 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":285
4510 * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
4511 * info.shape = info.strides + ndim
4512 * for i in range(ndim): # <<<<<<<<<<<<<<
4513 * info.strides[i] = PyArray_STRIDES(self)[i]
4514 * info.shape[i] = PyArray_DIMS(self)[i]
4515 */
4516 __pyx_t_4 = __pyx_v_ndim;
4517 __pyx_t_5 = __pyx_t_4;
4518 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
4519 __pyx_v_i = __pyx_t_6;
4520
4521 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286
4522 * info.shape = info.strides + ndim
4523 * for i in range(ndim):
4524 * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
4525 * info.shape[i] = PyArray_DIMS(self)[i]
4526 * else:
4527 */
4528 (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
4529
4530 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287
4531 * for i in range(ndim):
4532 * info.strides[i] = PyArray_STRIDES(self)[i]
4533 * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
4534 * else:
4535 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
4536 */
4537 (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
4538 }
4539
4540 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
4541 * info.buf = PyArray_DATA(self)
4542 * info.ndim = ndim
4543 * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
4544 * # Allocate new buffer for strides and shape info.
4545 * # This is allocated as one block, strides first.
4546 */
4547 goto __pyx_L9;
4548 }
4549
4550 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289
4551 * info.shape[i] = PyArray_DIMS(self)[i]
4552 * else:
4553 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
4554 * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
4555 * info.suboffsets = NULL
4556 */
4557 /*else*/ {
4558 __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
4559
4560 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":290
4561 * else:
4562 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
4563 * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
4564 * info.suboffsets = NULL
4565 * info.itemsize = PyArray_ITEMSIZE(self)
4566 */
4567 __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
4568 }
4569 __pyx_L9:;
4570
4571 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":291
4572 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
4573 * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
4574 * info.suboffsets = NULL # <<<<<<<<<<<<<<
4575 * info.itemsize = PyArray_ITEMSIZE(self)
4576 * info.readonly = not PyArray_ISWRITEABLE(self)
4577 */
4578 __pyx_v_info->suboffsets = NULL;
4579
4580 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292
4581 * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
4582 * info.suboffsets = NULL
4583 * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
4584 * info.readonly = not PyArray_ISWRITEABLE(self)
4585 *
4586 */
4587 __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
4588
4589 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":293
4590 * info.suboffsets = NULL
4591 * info.itemsize = PyArray_ITEMSIZE(self)
4592 * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
4593 *
4594 * cdef int t
4595 */
4596 __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
4597
4598 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296
4599 *
4600 * cdef int t
4601 * cdef char* f = NULL # <<<<<<<<<<<<<<
4602 * cdef dtype descr = <dtype>PyArray_DESCR(self)
4603 * cdef int offset
4604 */
4605 __pyx_v_f = NULL;
4606
4607 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297
4608 * cdef int t
4609 * cdef char* f = NULL
4610 * cdef dtype descr = <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
4611 * cdef int offset
4612 *
4613 */
4614 __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
4615 __pyx_t_3 = ((PyObject *)__pyx_t_7);
4616 __Pyx_INCREF(__pyx_t_3);
4617 __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
4618 __pyx_t_3 = 0;
4619
4620 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":300
4621 * cdef int offset
4622 *
4623 * info.obj = self # <<<<<<<<<<<<<<
4624 *
4625 * if not PyDataType_HASFIELDS(descr):
4626 */
4627 __Pyx_INCREF(((PyObject *)__pyx_v_self));
4628 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
4629 __Pyx_GOTREF(__pyx_v_info->obj);
4630 __Pyx_DECREF(__pyx_v_info->obj);
4631 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
4632
4633 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
4634 * info.obj = self
4635 *
4636 * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
4637 * t = descr.type_num
4638 * if ((descr.byteorder == c'>' and little_endian) or
4639 */
4640 __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
4641 if (__pyx_t_1) {
4642
4643 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":303
4644 *
4645 * if not PyDataType_HASFIELDS(descr):
4646 * t = descr.type_num # <<<<<<<<<<<<<<
4647 * if ((descr.byteorder == c'>' and little_endian) or
4648 * (descr.byteorder == c'<' and not little_endian)):
4649 */
4650 __pyx_t_4 = __pyx_v_descr->type_num;
4651 __pyx_v_t = __pyx_t_4;
4652
4653 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
4654 * if not PyDataType_HASFIELDS(descr):
4655 * t = descr.type_num
4656 * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
4657 * (descr.byteorder == c'<' and not little_endian)):
4658 * raise ValueError(u"Non-native byte order not supported")
4659 */
4660 __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
4661 if (!__pyx_t_2) {
4662 goto __pyx_L15_next_or;
4663 } else {
4664 }
4665 __pyx_t_2 = (__pyx_v_little_endian != 0);
4666 if (!__pyx_t_2) {
4667 } else {
4668 __pyx_t_1 = __pyx_t_2;
4669 goto __pyx_L14_bool_binop_done;
4670 }
4671 __pyx_L15_next_or:;
4672
4673 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":305
4674 * t = descr.type_num
4675 * if ((descr.byteorder == c'>' and little_endian) or
4676 * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
4677 * raise ValueError(u"Non-native byte order not supported")
4678 * if t == NPY_BYTE: f = "b"
4679 */
4680 __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
4681 if (__pyx_t_2) {
4682 } else {
4683 __pyx_t_1 = __pyx_t_2;
4684 goto __pyx_L14_bool_binop_done;
4685 }
4686 __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
4687 __pyx_t_1 = __pyx_t_2;
4688 __pyx_L14_bool_binop_done:;
4689
4690 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
4691 * if not PyDataType_HASFIELDS(descr):
4692 * t = descr.type_num
4693 * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
4694 * (descr.byteorder == c'<' and not little_endian)):
4695 * raise ValueError(u"Non-native byte order not supported")
4696 */
4697 if (unlikely(__pyx_t_1)) {
4698
4699 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
4700 * if ((descr.byteorder == c'>' and little_endian) or
4701 * (descr.byteorder == c'<' and not little_endian)):
4702 * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
4703 * if t == NPY_BYTE: f = "b"
4704 * elif t == NPY_UBYTE: f = "B"
4705 */
4706 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 306, __pyx_L1_error)
4707 __Pyx_GOTREF(__pyx_t_3);
4708 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4709 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4710 __PYX_ERR(3, 306, __pyx_L1_error)
4711
4712 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
4713 * if not PyDataType_HASFIELDS(descr):
4714 * t = descr.type_num
4715 * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
4716 * (descr.byteorder == c'<' and not little_endian)):
4717 * raise ValueError(u"Non-native byte order not supported")
4718 */
4719 }
4720
4721 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":307
4722 * (descr.byteorder == c'<' and not little_endian)):
4723 * raise ValueError(u"Non-native byte order not supported")
4724 * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
4725 * elif t == NPY_UBYTE: f = "B"
4726 * elif t == NPY_SHORT: f = "h"
4727 */
4728 switch (__pyx_v_t) {
4729 case NPY_BYTE:
4730 __pyx_v_f = ((char *)"b");
4731 break;
4732 case NPY_UBYTE:
4733
4734 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":308
4735 * raise ValueError(u"Non-native byte order not supported")
4736 * if t == NPY_BYTE: f = "b"
4737 * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
4738 * elif t == NPY_SHORT: f = "h"
4739 * elif t == NPY_USHORT: f = "H"
4740 */
4741 __pyx_v_f = ((char *)"B");
4742 break;
4743 case NPY_SHORT:
4744
4745 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":309
4746 * if t == NPY_BYTE: f = "b"
4747 * elif t == NPY_UBYTE: f = "B"
4748 * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
4749 * elif t == NPY_USHORT: f = "H"
4750 * elif t == NPY_INT: f = "i"
4751 */
4752 __pyx_v_f = ((char *)"h");
4753 break;
4754 case NPY_USHORT:
4755
4756 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":310
4757 * elif t == NPY_UBYTE: f = "B"
4758 * elif t == NPY_SHORT: f = "h"
4759 * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
4760 * elif t == NPY_INT: f = "i"
4761 * elif t == NPY_UINT: f = "I"
4762 */
4763 __pyx_v_f = ((char *)"H");
4764 break;
4765 case NPY_INT:
4766
4767 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":311
4768 * elif t == NPY_SHORT: f = "h"
4769 * elif t == NPY_USHORT: f = "H"
4770 * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
4771 * elif t == NPY_UINT: f = "I"
4772 * elif t == NPY_LONG: f = "l"
4773 */
4774 __pyx_v_f = ((char *)"i");
4775 break;
4776 case NPY_UINT:
4777
4778 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":312
4779 * elif t == NPY_USHORT: f = "H"
4780 * elif t == NPY_INT: f = "i"
4781 * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
4782 * elif t == NPY_LONG: f = "l"
4783 * elif t == NPY_ULONG: f = "L"
4784 */
4785 __pyx_v_f = ((char *)"I");
4786 break;
4787 case NPY_LONG:
4788
4789 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":313
4790 * elif t == NPY_INT: f = "i"
4791 * elif t == NPY_UINT: f = "I"
4792 * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
4793 * elif t == NPY_ULONG: f = "L"
4794 * elif t == NPY_LONGLONG: f = "q"
4795 */
4796 __pyx_v_f = ((char *)"l");
4797 break;
4798 case NPY_ULONG:
4799
4800 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":314
4801 * elif t == NPY_UINT: f = "I"
4802 * elif t == NPY_LONG: f = "l"
4803 * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
4804 * elif t == NPY_LONGLONG: f = "q"
4805 * elif t == NPY_ULONGLONG: f = "Q"
4806 */
4807 __pyx_v_f = ((char *)"L");
4808 break;
4809 case NPY_LONGLONG:
4810
4811 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":315
4812 * elif t == NPY_LONG: f = "l"
4813 * elif t == NPY_ULONG: f = "L"
4814 * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
4815 * elif t == NPY_ULONGLONG: f = "Q"
4816 * elif t == NPY_FLOAT: f = "f"
4817 */
4818 __pyx_v_f = ((char *)"q");
4819 break;
4820 case NPY_ULONGLONG:
4821
4822 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":316
4823 * elif t == NPY_ULONG: f = "L"
4824 * elif t == NPY_LONGLONG: f = "q"
4825 * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
4826 * elif t == NPY_FLOAT: f = "f"
4827 * elif t == NPY_DOUBLE: f = "d"
4828 */
4829 __pyx_v_f = ((char *)"Q");
4830 break;
4831 case NPY_FLOAT:
4832
4833 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":317
4834 * elif t == NPY_LONGLONG: f = "q"
4835 * elif t == NPY_ULONGLONG: f = "Q"
4836 * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
4837 * elif t == NPY_DOUBLE: f = "d"
4838 * elif t == NPY_LONGDOUBLE: f = "g"
4839 */
4840 __pyx_v_f = ((char *)"f");
4841 break;
4842 case NPY_DOUBLE:
4843
4844 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":318
4845 * elif t == NPY_ULONGLONG: f = "Q"
4846 * elif t == NPY_FLOAT: f = "f"
4847 * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
4848 * elif t == NPY_LONGDOUBLE: f = "g"
4849 * elif t == NPY_CFLOAT: f = "Zf"
4850 */
4851 __pyx_v_f = ((char *)"d");
4852 break;
4853 case NPY_LONGDOUBLE:
4854
4855 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":319
4856 * elif t == NPY_FLOAT: f = "f"
4857 * elif t == NPY_DOUBLE: f = "d"
4858 * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
4859 * elif t == NPY_CFLOAT: f = "Zf"
4860 * elif t == NPY_CDOUBLE: f = "Zd"
4861 */
4862 __pyx_v_f = ((char *)"g");
4863 break;
4864 case NPY_CFLOAT:
4865
4866 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":320
4867 * elif t == NPY_DOUBLE: f = "d"
4868 * elif t == NPY_LONGDOUBLE: f = "g"
4869 * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
4870 * elif t == NPY_CDOUBLE: f = "Zd"
4871 * elif t == NPY_CLONGDOUBLE: f = "Zg"
4872 */
4873 __pyx_v_f = ((char *)"Zf");
4874 break;
4875 case NPY_CDOUBLE:
4876
4877 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":321
4878 * elif t == NPY_LONGDOUBLE: f = "g"
4879 * elif t == NPY_CFLOAT: f = "Zf"
4880 * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
4881 * elif t == NPY_CLONGDOUBLE: f = "Zg"
4882 * elif t == NPY_OBJECT: f = "O"
4883 */
4884 __pyx_v_f = ((char *)"Zd");
4885 break;
4886 case NPY_CLONGDOUBLE:
4887
4888 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":322
4889 * elif t == NPY_CFLOAT: f = "Zf"
4890 * elif t == NPY_CDOUBLE: f = "Zd"
4891 * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
4892 * elif t == NPY_OBJECT: f = "O"
4893 * else:
4894 */
4895 __pyx_v_f = ((char *)"Zg");
4896 break;
4897 case NPY_OBJECT:
4898
4899 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":323
4900 * elif t == NPY_CDOUBLE: f = "Zd"
4901 * elif t == NPY_CLONGDOUBLE: f = "Zg"
4902 * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
4903 * else:
4904 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
4905 */
4906 __pyx_v_f = ((char *)"O");
4907 break;
4908 default:
4909
4910 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":325
4911 * elif t == NPY_OBJECT: f = "O"
4912 * else:
4913 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
4914 * info.format = f
4915 * return
4916 */
4917 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 325, __pyx_L1_error)
4918 __Pyx_GOTREF(__pyx_t_3);
4919 __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 325, __pyx_L1_error)
4920 __Pyx_GOTREF(__pyx_t_8);
4921 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4922 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 325, __pyx_L1_error)
4923 __Pyx_GOTREF(__pyx_t_3);
4924 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4925 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4926 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4927 __PYX_ERR(3, 325, __pyx_L1_error)
4928 break;
4929 }
4930
4931 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":326
4932 * else:
4933 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
4934 * info.format = f # <<<<<<<<<<<<<<
4935 * return
4936 * else:
4937 */
4938 __pyx_v_info->format = __pyx_v_f;
4939
4940 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":327
4941 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
4942 * info.format = f
4943 * return # <<<<<<<<<<<<<<
4944 * else:
4945 * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
4946 */
4947 __pyx_r = 0;
4948 goto __pyx_L0;
4949
4950 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
4951 * info.obj = self
4952 *
4953 * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
4954 * t = descr.type_num
4955 * if ((descr.byteorder == c'>' and little_endian) or
4956 */
4957 }
4958
4959 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":329
4960 * return
4961 * else:
4962 * info.format = <char*>PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
4963 * info.format[0] = c'^' # Native data types, manual alignment
4964 * offset = 0
4965 */
4966 /*else*/ {
4967 __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
4968
4969 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":330
4970 * else:
4971 * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
4972 * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
4973 * offset = 0
4974 * f = _util_dtypestring(descr, info.format + 1,
4975 */
4976 (__pyx_v_info->format[0]) = '^';
4977
4978 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":331
4979 * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
4980 * info.format[0] = c'^' # Native data types, manual alignment
4981 * offset = 0 # <<<<<<<<<<<<<<
4982 * f = _util_dtypestring(descr, info.format + 1,
4983 * info.format + _buffer_format_string_len,
4984 */
4985 __pyx_v_offset = 0;
4986
4987 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":332
4988 * info.format[0] = c'^' # Native data types, manual alignment
4989 * offset = 0
4990 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
4991 * info.format + _buffer_format_string_len,
4992 * &offset)
4993 */
4994 __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(3, 332, __pyx_L1_error)
4995 __pyx_v_f = __pyx_t_9;
4996
4997 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":335
4998 * info.format + _buffer_format_string_len,
4999 * &offset)
5000 * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
5001 *
5002 * def __releasebuffer__(ndarray self, Py_buffer* info):
5003 */
5004 (__pyx_v_f[0]) = '\x00';
5005 }
5006
5007 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
5008 * # experimental exception made for __getbuffer__ and __releasebuffer__
5009 * # -- the details of this may change.
5010 * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
5011 * # This implementation of getbuffer is geared towards Cython
5012 * # requirements, and does not yet fulfill the PEP.
5013 */
5014
5015 /* function exit code */
5016 __pyx_r = 0;
5017 goto __pyx_L0;
5018 __pyx_L1_error:;
5019 __Pyx_XDECREF(__pyx_t_3);
5020 __Pyx_XDECREF(__pyx_t_8);
5021 __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5022 __pyx_r = -1;
5023 if (__pyx_v_info->obj != NULL) {
5024 __Pyx_GOTREF(__pyx_v_info->obj);
5025 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5026 }
5027 goto __pyx_L2;
5028 __pyx_L0:;
5029 if (__pyx_v_info->obj == Py_None) {
5030 __Pyx_GOTREF(__pyx_v_info->obj);
5031 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5032 }
5033 __pyx_L2:;
5034 __Pyx_XDECREF((PyObject *)__pyx_v_descr);
5035 __Pyx_RefNannyFinishContext();
5036 return __pyx_r;
5037 }
5038
5039 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
5040 * f[0] = c'\0' # Terminate format string
5041 *
5042 * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
5043 * if PyArray_HASFIELDS(self):
5044 * PyObject_Free(info.format)
5045 */
5046
5047 /* Python wrapper */
5048 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
__pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject * __pyx_v_self,Py_buffer * __pyx_v_info)5049 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
5050 __Pyx_RefNannyDeclarations
5051 __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
5052 __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
5053
5054 /* function exit code */
5055 __Pyx_RefNannyFinishContext();
5056 }
5057
__pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info)5058 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
5059 __Pyx_RefNannyDeclarations
5060 int __pyx_t_1;
5061 __Pyx_RefNannySetupContext("__releasebuffer__", 0);
5062
5063 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
5064 *
5065 * def __releasebuffer__(ndarray self, Py_buffer* info):
5066 * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
5067 * PyObject_Free(info.format)
5068 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
5069 */
5070 __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
5071 if (__pyx_t_1) {
5072
5073 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":339
5074 * def __releasebuffer__(ndarray self, Py_buffer* info):
5075 * if PyArray_HASFIELDS(self):
5076 * PyObject_Free(info.format) # <<<<<<<<<<<<<<
5077 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
5078 * PyObject_Free(info.strides)
5079 */
5080 PyObject_Free(__pyx_v_info->format);
5081
5082 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
5083 *
5084 * def __releasebuffer__(ndarray self, Py_buffer* info):
5085 * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
5086 * PyObject_Free(info.format)
5087 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
5088 */
5089 }
5090
5091 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
5092 * if PyArray_HASFIELDS(self):
5093 * PyObject_Free(info.format)
5094 * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
5095 * PyObject_Free(info.strides)
5096 * # info.shape was stored after info.strides in the same block
5097 */
5098 __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
5099 if (__pyx_t_1) {
5100
5101 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":341
5102 * PyObject_Free(info.format)
5103 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
5104 * PyObject_Free(info.strides) # <<<<<<<<<<<<<<
5105 * # info.shape was stored after info.strides in the same block
5106 *
5107 */
5108 PyObject_Free(__pyx_v_info->strides);
5109
5110 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
5111 * if PyArray_HASFIELDS(self):
5112 * PyObject_Free(info.format)
5113 * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
5114 * PyObject_Free(info.strides)
5115 * # info.shape was stored after info.strides in the same block
5116 */
5117 }
5118
5119 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
5120 * f[0] = c'\0' # Terminate format string
5121 *
5122 * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
5123 * if PyArray_HASFIELDS(self):
5124 * PyObject_Free(info.format)
5125 */
5126
5127 /* function exit code */
5128 __Pyx_RefNannyFinishContext();
5129 }
5130
5131 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
5132 * ctypedef npy_cdouble complex_t
5133 *
5134 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
5135 * return PyArray_MultiIterNew(1, <void*>a)
5136 *
5137 */
5138
__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject * __pyx_v_a)5139 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
5140 PyObject *__pyx_r = NULL;
5141 __Pyx_RefNannyDeclarations
5142 PyObject *__pyx_t_1 = NULL;
5143 __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
5144
5145 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":822
5146 *
5147 * cdef inline object PyArray_MultiIterNew1(a):
5148 * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
5149 *
5150 * cdef inline object PyArray_MultiIterNew2(a, b):
5151 */
5152 __Pyx_XDECREF(__pyx_r);
5153 __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 822, __pyx_L1_error)
5154 __Pyx_GOTREF(__pyx_t_1);
5155 __pyx_r = __pyx_t_1;
5156 __pyx_t_1 = 0;
5157 goto __pyx_L0;
5158
5159 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
5160 * ctypedef npy_cdouble complex_t
5161 *
5162 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
5163 * return PyArray_MultiIterNew(1, <void*>a)
5164 *
5165 */
5166
5167 /* function exit code */
5168 __pyx_L1_error:;
5169 __Pyx_XDECREF(__pyx_t_1);
5170 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
5171 __pyx_r = 0;
5172 __pyx_L0:;
5173 __Pyx_XGIVEREF(__pyx_r);
5174 __Pyx_RefNannyFinishContext();
5175 return __pyx_r;
5176 }
5177
5178 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
5179 * return PyArray_MultiIterNew(1, <void*>a)
5180 *
5181 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
5182 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
5183 *
5184 */
5185
__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject * __pyx_v_a,PyObject * __pyx_v_b)5186 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
5187 PyObject *__pyx_r = NULL;
5188 __Pyx_RefNannyDeclarations
5189 PyObject *__pyx_t_1 = NULL;
5190 __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
5191
5192 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825
5193 *
5194 * cdef inline object PyArray_MultiIterNew2(a, b):
5195 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
5196 *
5197 * cdef inline object PyArray_MultiIterNew3(a, b, c):
5198 */
5199 __Pyx_XDECREF(__pyx_r);
5200 __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 825, __pyx_L1_error)
5201 __Pyx_GOTREF(__pyx_t_1);
5202 __pyx_r = __pyx_t_1;
5203 __pyx_t_1 = 0;
5204 goto __pyx_L0;
5205
5206 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
5207 * return PyArray_MultiIterNew(1, <void*>a)
5208 *
5209 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
5210 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
5211 *
5212 */
5213
5214 /* function exit code */
5215 __pyx_L1_error:;
5216 __Pyx_XDECREF(__pyx_t_1);
5217 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
5218 __pyx_r = 0;
5219 __pyx_L0:;
5220 __Pyx_XGIVEREF(__pyx_r);
5221 __Pyx_RefNannyFinishContext();
5222 return __pyx_r;
5223 }
5224
5225 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
5226 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
5227 *
5228 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
5229 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
5230 *
5231 */
5232
__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c)5233 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
5234 PyObject *__pyx_r = NULL;
5235 __Pyx_RefNannyDeclarations
5236 PyObject *__pyx_t_1 = NULL;
5237 __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
5238
5239 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":828
5240 *
5241 * cdef inline object PyArray_MultiIterNew3(a, b, c):
5242 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
5243 *
5244 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
5245 */
5246 __Pyx_XDECREF(__pyx_r);
5247 __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(3, 828, __pyx_L1_error)
5248 __Pyx_GOTREF(__pyx_t_1);
5249 __pyx_r = __pyx_t_1;
5250 __pyx_t_1 = 0;
5251 goto __pyx_L0;
5252
5253 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
5254 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
5255 *
5256 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
5257 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
5258 *
5259 */
5260
5261 /* function exit code */
5262 __pyx_L1_error:;
5263 __Pyx_XDECREF(__pyx_t_1);
5264 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
5265 __pyx_r = 0;
5266 __pyx_L0:;
5267 __Pyx_XGIVEREF(__pyx_r);
5268 __Pyx_RefNannyFinishContext();
5269 return __pyx_r;
5270 }
5271
5272 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
5273 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
5274 *
5275 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
5276 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
5277 *
5278 */
5279
__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d)5280 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) {
5281 PyObject *__pyx_r = NULL;
5282 __Pyx_RefNannyDeclarations
5283 PyObject *__pyx_t_1 = NULL;
5284 __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
5285
5286 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831
5287 *
5288 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
5289 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
5290 *
5291 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
5292 */
5293 __Pyx_XDECREF(__pyx_r);
5294 __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(3, 831, __pyx_L1_error)
5295 __Pyx_GOTREF(__pyx_t_1);
5296 __pyx_r = __pyx_t_1;
5297 __pyx_t_1 = 0;
5298 goto __pyx_L0;
5299
5300 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
5301 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
5302 *
5303 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
5304 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
5305 *
5306 */
5307
5308 /* function exit code */
5309 __pyx_L1_error:;
5310 __Pyx_XDECREF(__pyx_t_1);
5311 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
5312 __pyx_r = 0;
5313 __pyx_L0:;
5314 __Pyx_XGIVEREF(__pyx_r);
5315 __Pyx_RefNannyFinishContext();
5316 return __pyx_r;
5317 }
5318
5319 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
5320 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
5321 *
5322 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
5323 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5324 *
5325 */
5326
__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)5327 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) {
5328 PyObject *__pyx_r = NULL;
5329 __Pyx_RefNannyDeclarations
5330 PyObject *__pyx_t_1 = NULL;
5331 __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
5332
5333 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834
5334 *
5335 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
5336 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
5337 *
5338 * cdef inline tuple PyDataType_SHAPE(dtype d):
5339 */
5340 __Pyx_XDECREF(__pyx_r);
5341 __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(3, 834, __pyx_L1_error)
5342 __Pyx_GOTREF(__pyx_t_1);
5343 __pyx_r = __pyx_t_1;
5344 __pyx_t_1 = 0;
5345 goto __pyx_L0;
5346
5347 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
5348 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
5349 *
5350 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
5351 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5352 *
5353 */
5354
5355 /* function exit code */
5356 __pyx_L1_error:;
5357 __Pyx_XDECREF(__pyx_t_1);
5358 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
5359 __pyx_r = 0;
5360 __pyx_L0:;
5361 __Pyx_XGIVEREF(__pyx_r);
5362 __Pyx_RefNannyFinishContext();
5363 return __pyx_r;
5364 }
5365
5366 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
5367 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5368 *
5369 * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
5370 * if PyDataType_HASSUBARRAY(d):
5371 * return <tuple>d.subarray.shape
5372 */
5373
__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr * __pyx_v_d)5374 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
5375 PyObject *__pyx_r = NULL;
5376 __Pyx_RefNannyDeclarations
5377 int __pyx_t_1;
5378 __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
5379
5380 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
5381 *
5382 * cdef inline tuple PyDataType_SHAPE(dtype d):
5383 * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
5384 * return <tuple>d.subarray.shape
5385 * else:
5386 */
5387 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
5388 if (__pyx_t_1) {
5389
5390 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838
5391 * cdef inline tuple PyDataType_SHAPE(dtype d):
5392 * if PyDataType_HASSUBARRAY(d):
5393 * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
5394 * else:
5395 * return ()
5396 */
5397 __Pyx_XDECREF(__pyx_r);
5398 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
5399 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
5400 goto __pyx_L0;
5401
5402 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
5403 *
5404 * cdef inline tuple PyDataType_SHAPE(dtype d):
5405 * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
5406 * return <tuple>d.subarray.shape
5407 * else:
5408 */
5409 }
5410
5411 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840
5412 * return <tuple>d.subarray.shape
5413 * else:
5414 * return () # <<<<<<<<<<<<<<
5415 *
5416 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
5417 */
5418 /*else*/ {
5419 __Pyx_XDECREF(__pyx_r);
5420 __Pyx_INCREF(__pyx_empty_tuple);
5421 __pyx_r = __pyx_empty_tuple;
5422 goto __pyx_L0;
5423 }
5424
5425 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
5426 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5427 *
5428 * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
5429 * if PyDataType_HASSUBARRAY(d):
5430 * return <tuple>d.subarray.shape
5431 */
5432
5433 /* function exit code */
5434 __pyx_L0:;
5435 __Pyx_XGIVEREF(__pyx_r);
5436 __Pyx_RefNannyFinishContext();
5437 return __pyx_r;
5438 }
5439
5440 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
5441 * return ()
5442 *
5443 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
5444 * # Recursive utility function used in __getbuffer__ to get format
5445 * # string. The new location in the format string is returned.
5446 */
5447
__pyx_f_5numpy__util_dtypestring(PyArray_Descr * __pyx_v_descr,char * __pyx_v_f,char * __pyx_v_end,int * __pyx_v_offset)5448 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) {
5449 PyArray_Descr *__pyx_v_child = 0;
5450 int __pyx_v_endian_detector;
5451 int __pyx_v_little_endian;
5452 PyObject *__pyx_v_fields = 0;
5453 PyObject *__pyx_v_childname = NULL;
5454 PyObject *__pyx_v_new_offset = NULL;
5455 PyObject *__pyx_v_t = NULL;
5456 char *__pyx_r;
5457 __Pyx_RefNannyDeclarations
5458 PyObject *__pyx_t_1 = NULL;
5459 Py_ssize_t __pyx_t_2;
5460 PyObject *__pyx_t_3 = NULL;
5461 PyObject *__pyx_t_4 = NULL;
5462 int __pyx_t_5;
5463 int __pyx_t_6;
5464 int __pyx_t_7;
5465 long __pyx_t_8;
5466 char *__pyx_t_9;
5467 __Pyx_RefNannySetupContext("_util_dtypestring", 0);
5468
5469 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847
5470 *
5471 * cdef dtype child
5472 * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
5473 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
5474 * cdef tuple fields
5475 */
5476 __pyx_v_endian_detector = 1;
5477
5478 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848
5479 * cdef dtype child
5480 * cdef int endian_detector = 1
5481 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
5482 * cdef tuple fields
5483 *
5484 */
5485 __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
5486
5487 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
5488 * cdef tuple fields
5489 *
5490 * for childname in descr.names: # <<<<<<<<<<<<<<
5491 * fields = descr.fields[childname]
5492 * child, new_offset = fields
5493 */
5494 if (unlikely(__pyx_v_descr->names == Py_None)) {
5495 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
5496 __PYX_ERR(3, 851, __pyx_L1_error)
5497 }
5498 __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
5499 for (;;) {
5500 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
5501 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5502 __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(3, 851, __pyx_L1_error)
5503 #else
5504 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 851, __pyx_L1_error)
5505 __Pyx_GOTREF(__pyx_t_3);
5506 #endif
5507 __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
5508 __pyx_t_3 = 0;
5509
5510 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852
5511 *
5512 * for childname in descr.names:
5513 * fields = descr.fields[childname] # <<<<<<<<<<<<<<
5514 * child, new_offset = fields
5515 *
5516 */
5517 if (unlikely(__pyx_v_descr->fields == Py_None)) {
5518 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5519 __PYX_ERR(3, 852, __pyx_L1_error)
5520 }
5521 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 852, __pyx_L1_error)
5522 __Pyx_GOTREF(__pyx_t_3);
5523 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(3, 852, __pyx_L1_error)
5524 __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
5525 __pyx_t_3 = 0;
5526
5527 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853
5528 * for childname in descr.names:
5529 * fields = descr.fields[childname]
5530 * child, new_offset = fields # <<<<<<<<<<<<<<
5531 *
5532 * if (end - f) - <int>(new_offset - offset[0]) < 15:
5533 */
5534 if (likely(__pyx_v_fields != Py_None)) {
5535 PyObject* sequence = __pyx_v_fields;
5536 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
5537 if (unlikely(size != 2)) {
5538 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
5539 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
5540 __PYX_ERR(3, 853, __pyx_L1_error)
5541 }
5542 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5543 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
5544 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
5545 __Pyx_INCREF(__pyx_t_3);
5546 __Pyx_INCREF(__pyx_t_4);
5547 #else
5548 __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 853, __pyx_L1_error)
5549 __Pyx_GOTREF(__pyx_t_3);
5550 __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 853, __pyx_L1_error)
5551 __Pyx_GOTREF(__pyx_t_4);
5552 #endif
5553 } else {
5554 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 853, __pyx_L1_error)
5555 }
5556 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 853, __pyx_L1_error)
5557 __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
5558 __pyx_t_3 = 0;
5559 __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
5560 __pyx_t_4 = 0;
5561
5562 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
5563 * child, new_offset = fields
5564 *
5565 * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
5566 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
5567 *
5568 */
5569 __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 855, __pyx_L1_error)
5570 __Pyx_GOTREF(__pyx_t_4);
5571 __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 855, __pyx_L1_error)
5572 __Pyx_GOTREF(__pyx_t_3);
5573 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5574 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 855, __pyx_L1_error)
5575 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5576 __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
5577 if (unlikely(__pyx_t_6)) {
5578
5579 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
5580 *
5581 * if (end - f) - <int>(new_offset - offset[0]) < 15:
5582 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
5583 *
5584 * if ((child.byteorder == c'>' and little_endian) or
5585 */
5586 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 856, __pyx_L1_error)
5587 __Pyx_GOTREF(__pyx_t_3);
5588 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5589 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5590 __PYX_ERR(3, 856, __pyx_L1_error)
5591
5592 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
5593 * child, new_offset = fields
5594 *
5595 * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
5596 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
5597 *
5598 */
5599 }
5600
5601 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
5602 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
5603 *
5604 * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
5605 * (child.byteorder == c'<' and not little_endian)):
5606 * raise ValueError(u"Non-native byte order not supported")
5607 */
5608 __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
5609 if (!__pyx_t_7) {
5610 goto __pyx_L8_next_or;
5611 } else {
5612 }
5613 __pyx_t_7 = (__pyx_v_little_endian != 0);
5614 if (!__pyx_t_7) {
5615 } else {
5616 __pyx_t_6 = __pyx_t_7;
5617 goto __pyx_L7_bool_binop_done;
5618 }
5619 __pyx_L8_next_or:;
5620
5621 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":859
5622 *
5623 * if ((child.byteorder == c'>' and little_endian) or
5624 * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
5625 * raise ValueError(u"Non-native byte order not supported")
5626 * # One could encode it in the format string and have Cython
5627 */
5628 __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
5629 if (__pyx_t_7) {
5630 } else {
5631 __pyx_t_6 = __pyx_t_7;
5632 goto __pyx_L7_bool_binop_done;
5633 }
5634 __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
5635 __pyx_t_6 = __pyx_t_7;
5636 __pyx_L7_bool_binop_done:;
5637
5638 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
5639 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
5640 *
5641 * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
5642 * (child.byteorder == c'<' and not little_endian)):
5643 * raise ValueError(u"Non-native byte order not supported")
5644 */
5645 if (unlikely(__pyx_t_6)) {
5646
5647 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860
5648 * if ((child.byteorder == c'>' and little_endian) or
5649 * (child.byteorder == c'<' and not little_endian)):
5650 * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
5651 * # One could encode it in the format string and have Cython
5652 * # complain instead, BUT: < and > in format strings also imply
5653 */
5654 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 860, __pyx_L1_error)
5655 __Pyx_GOTREF(__pyx_t_3);
5656 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5657 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5658 __PYX_ERR(3, 860, __pyx_L1_error)
5659
5660 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
5661 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
5662 *
5663 * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
5664 * (child.byteorder == c'<' and not little_endian)):
5665 * raise ValueError(u"Non-native byte order not supported")
5666 */
5667 }
5668
5669 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":870
5670 *
5671 * # Output padding bytes
5672 * while offset[0] < new_offset: # <<<<<<<<<<<<<<
5673 * f[0] = 120 # "x"; pad byte
5674 * f += 1
5675 */
5676 while (1) {
5677 __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 870, __pyx_L1_error)
5678 __Pyx_GOTREF(__pyx_t_3);
5679 __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(3, 870, __pyx_L1_error)
5680 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5681 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 870, __pyx_L1_error)
5682 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5683 if (!__pyx_t_6) break;
5684
5685 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":871
5686 * # Output padding bytes
5687 * while offset[0] < new_offset:
5688 * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
5689 * f += 1
5690 * offset[0] += 1
5691 */
5692 (__pyx_v_f[0]) = 0x78;
5693
5694 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":872
5695 * while offset[0] < new_offset:
5696 * f[0] = 120 # "x"; pad byte
5697 * f += 1 # <<<<<<<<<<<<<<
5698 * offset[0] += 1
5699 *
5700 */
5701 __pyx_v_f = (__pyx_v_f + 1);
5702
5703 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":873
5704 * f[0] = 120 # "x"; pad byte
5705 * f += 1
5706 * offset[0] += 1 # <<<<<<<<<<<<<<
5707 *
5708 * offset[0] += child.itemsize
5709 */
5710 __pyx_t_8 = 0;
5711 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
5712 }
5713
5714 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":875
5715 * offset[0] += 1
5716 *
5717 * offset[0] += child.itemsize # <<<<<<<<<<<<<<
5718 *
5719 * if not PyDataType_HASFIELDS(child):
5720 */
5721 __pyx_t_8 = 0;
5722 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
5723
5724 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
5725 * offset[0] += child.itemsize
5726 *
5727 * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
5728 * t = child.type_num
5729 * if end - f < 5:
5730 */
5731 __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
5732 if (__pyx_t_6) {
5733
5734 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":878
5735 *
5736 * if not PyDataType_HASFIELDS(child):
5737 * t = child.type_num # <<<<<<<<<<<<<<
5738 * if end - f < 5:
5739 * raise RuntimeError(u"Format string allocated too short.")
5740 */
5741 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 878, __pyx_L1_error)
5742 __Pyx_GOTREF(__pyx_t_4);
5743 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
5744 __pyx_t_4 = 0;
5745
5746 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
5747 * if not PyDataType_HASFIELDS(child):
5748 * t = child.type_num
5749 * if end - f < 5: # <<<<<<<<<<<<<<
5750 * raise RuntimeError(u"Format string allocated too short.")
5751 *
5752 */
5753 __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
5754 if (unlikely(__pyx_t_6)) {
5755
5756 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
5757 * t = child.type_num
5758 * if end - f < 5:
5759 * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
5760 *
5761 * # Until ticket #99 is fixed, use integers to avoid warnings
5762 */
5763 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 880, __pyx_L1_error)
5764 __Pyx_GOTREF(__pyx_t_4);
5765 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
5766 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5767 __PYX_ERR(3, 880, __pyx_L1_error)
5768
5769 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
5770 * if not PyDataType_HASFIELDS(child):
5771 * t = child.type_num
5772 * if end - f < 5: # <<<<<<<<<<<<<<
5773 * raise RuntimeError(u"Format string allocated too short.")
5774 *
5775 */
5776 }
5777
5778 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":883
5779 *
5780 * # Until ticket #99 is fixed, use integers to avoid warnings
5781 * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
5782 * elif t == NPY_UBYTE: f[0] = 66 #"B"
5783 * elif t == NPY_SHORT: f[0] = 104 #"h"
5784 */
5785 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 883, __pyx_L1_error)
5786 __Pyx_GOTREF(__pyx_t_4);
5787 __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(3, 883, __pyx_L1_error)
5788 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5789 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 883, __pyx_L1_error)
5790 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5791 if (__pyx_t_6) {
5792 (__pyx_v_f[0]) = 98;
5793 goto __pyx_L15;
5794 }
5795
5796 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":884
5797 * # Until ticket #99 is fixed, use integers to avoid warnings
5798 * if t == NPY_BYTE: f[0] = 98 #"b"
5799 * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
5800 * elif t == NPY_SHORT: f[0] = 104 #"h"
5801 * elif t == NPY_USHORT: f[0] = 72 #"H"
5802 */
5803 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 884, __pyx_L1_error)
5804 __Pyx_GOTREF(__pyx_t_3);
5805 __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(3, 884, __pyx_L1_error)
5806 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5807 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 884, __pyx_L1_error)
5808 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5809 if (__pyx_t_6) {
5810 (__pyx_v_f[0]) = 66;
5811 goto __pyx_L15;
5812 }
5813
5814 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":885
5815 * if t == NPY_BYTE: f[0] = 98 #"b"
5816 * elif t == NPY_UBYTE: f[0] = 66 #"B"
5817 * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
5818 * elif t == NPY_USHORT: f[0] = 72 #"H"
5819 * elif t == NPY_INT: f[0] = 105 #"i"
5820 */
5821 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 885, __pyx_L1_error)
5822 __Pyx_GOTREF(__pyx_t_4);
5823 __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(3, 885, __pyx_L1_error)
5824 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5825 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 885, __pyx_L1_error)
5826 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5827 if (__pyx_t_6) {
5828 (__pyx_v_f[0]) = 0x68;
5829 goto __pyx_L15;
5830 }
5831
5832 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":886
5833 * elif t == NPY_UBYTE: f[0] = 66 #"B"
5834 * elif t == NPY_SHORT: f[0] = 104 #"h"
5835 * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
5836 * elif t == NPY_INT: f[0] = 105 #"i"
5837 * elif t == NPY_UINT: f[0] = 73 #"I"
5838 */
5839 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 886, __pyx_L1_error)
5840 __Pyx_GOTREF(__pyx_t_3);
5841 __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(3, 886, __pyx_L1_error)
5842 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5843 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 886, __pyx_L1_error)
5844 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5845 if (__pyx_t_6) {
5846 (__pyx_v_f[0]) = 72;
5847 goto __pyx_L15;
5848 }
5849
5850 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":887
5851 * elif t == NPY_SHORT: f[0] = 104 #"h"
5852 * elif t == NPY_USHORT: f[0] = 72 #"H"
5853 * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
5854 * elif t == NPY_UINT: f[0] = 73 #"I"
5855 * elif t == NPY_LONG: f[0] = 108 #"l"
5856 */
5857 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 887, __pyx_L1_error)
5858 __Pyx_GOTREF(__pyx_t_4);
5859 __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(3, 887, __pyx_L1_error)
5860 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5861 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 887, __pyx_L1_error)
5862 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5863 if (__pyx_t_6) {
5864 (__pyx_v_f[0]) = 0x69;
5865 goto __pyx_L15;
5866 }
5867
5868 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":888
5869 * elif t == NPY_USHORT: f[0] = 72 #"H"
5870 * elif t == NPY_INT: f[0] = 105 #"i"
5871 * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
5872 * elif t == NPY_LONG: f[0] = 108 #"l"
5873 * elif t == NPY_ULONG: f[0] = 76 #"L"
5874 */
5875 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 888, __pyx_L1_error)
5876 __Pyx_GOTREF(__pyx_t_3);
5877 __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(3, 888, __pyx_L1_error)
5878 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5879 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 888, __pyx_L1_error)
5880 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5881 if (__pyx_t_6) {
5882 (__pyx_v_f[0]) = 73;
5883 goto __pyx_L15;
5884 }
5885
5886 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":889
5887 * elif t == NPY_INT: f[0] = 105 #"i"
5888 * elif t == NPY_UINT: f[0] = 73 #"I"
5889 * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
5890 * elif t == NPY_ULONG: f[0] = 76 #"L"
5891 * elif t == NPY_LONGLONG: f[0] = 113 #"q"
5892 */
5893 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 889, __pyx_L1_error)
5894 __Pyx_GOTREF(__pyx_t_4);
5895 __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(3, 889, __pyx_L1_error)
5896 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5897 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 889, __pyx_L1_error)
5898 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5899 if (__pyx_t_6) {
5900 (__pyx_v_f[0]) = 0x6C;
5901 goto __pyx_L15;
5902 }
5903
5904 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":890
5905 * elif t == NPY_UINT: f[0] = 73 #"I"
5906 * elif t == NPY_LONG: f[0] = 108 #"l"
5907 * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
5908 * elif t == NPY_LONGLONG: f[0] = 113 #"q"
5909 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
5910 */
5911 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 890, __pyx_L1_error)
5912 __Pyx_GOTREF(__pyx_t_3);
5913 __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(3, 890, __pyx_L1_error)
5914 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5915 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 890, __pyx_L1_error)
5916 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5917 if (__pyx_t_6) {
5918 (__pyx_v_f[0]) = 76;
5919 goto __pyx_L15;
5920 }
5921
5922 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":891
5923 * elif t == NPY_LONG: f[0] = 108 #"l"
5924 * elif t == NPY_ULONG: f[0] = 76 #"L"
5925 * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
5926 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
5927 * elif t == NPY_FLOAT: f[0] = 102 #"f"
5928 */
5929 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 891, __pyx_L1_error)
5930 __Pyx_GOTREF(__pyx_t_4);
5931 __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(3, 891, __pyx_L1_error)
5932 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5933 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 891, __pyx_L1_error)
5934 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5935 if (__pyx_t_6) {
5936 (__pyx_v_f[0]) = 0x71;
5937 goto __pyx_L15;
5938 }
5939
5940 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":892
5941 * elif t == NPY_ULONG: f[0] = 76 #"L"
5942 * elif t == NPY_LONGLONG: f[0] = 113 #"q"
5943 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
5944 * elif t == NPY_FLOAT: f[0] = 102 #"f"
5945 * elif t == NPY_DOUBLE: f[0] = 100 #"d"
5946 */
5947 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 892, __pyx_L1_error)
5948 __Pyx_GOTREF(__pyx_t_3);
5949 __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(3, 892, __pyx_L1_error)
5950 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5951 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 892, __pyx_L1_error)
5952 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5953 if (__pyx_t_6) {
5954 (__pyx_v_f[0]) = 81;
5955 goto __pyx_L15;
5956 }
5957
5958 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":893
5959 * elif t == NPY_LONGLONG: f[0] = 113 #"q"
5960 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
5961 * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
5962 * elif t == NPY_DOUBLE: f[0] = 100 #"d"
5963 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
5964 */
5965 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 893, __pyx_L1_error)
5966 __Pyx_GOTREF(__pyx_t_4);
5967 __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(3, 893, __pyx_L1_error)
5968 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5969 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 893, __pyx_L1_error)
5970 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5971 if (__pyx_t_6) {
5972 (__pyx_v_f[0]) = 0x66;
5973 goto __pyx_L15;
5974 }
5975
5976 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":894
5977 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
5978 * elif t == NPY_FLOAT: f[0] = 102 #"f"
5979 * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
5980 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
5981 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
5982 */
5983 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 894, __pyx_L1_error)
5984 __Pyx_GOTREF(__pyx_t_3);
5985 __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(3, 894, __pyx_L1_error)
5986 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5987 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 894, __pyx_L1_error)
5988 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5989 if (__pyx_t_6) {
5990 (__pyx_v_f[0]) = 0x64;
5991 goto __pyx_L15;
5992 }
5993
5994 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":895
5995 * elif t == NPY_FLOAT: f[0] = 102 #"f"
5996 * elif t == NPY_DOUBLE: f[0] = 100 #"d"
5997 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
5998 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
5999 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
6000 */
6001 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 895, __pyx_L1_error)
6002 __Pyx_GOTREF(__pyx_t_4);
6003 __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(3, 895, __pyx_L1_error)
6004 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6005 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 895, __pyx_L1_error)
6006 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6007 if (__pyx_t_6) {
6008 (__pyx_v_f[0]) = 0x67;
6009 goto __pyx_L15;
6010 }
6011
6012 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":896
6013 * elif t == NPY_DOUBLE: f[0] = 100 #"d"
6014 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
6015 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
6016 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
6017 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
6018 */
6019 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 896, __pyx_L1_error)
6020 __Pyx_GOTREF(__pyx_t_3);
6021 __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(3, 896, __pyx_L1_error)
6022 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6023 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 896, __pyx_L1_error)
6024 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6025 if (__pyx_t_6) {
6026 (__pyx_v_f[0]) = 90;
6027 (__pyx_v_f[1]) = 0x66;
6028 __pyx_v_f = (__pyx_v_f + 1);
6029 goto __pyx_L15;
6030 }
6031
6032 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":897
6033 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
6034 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
6035 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
6036 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
6037 * elif t == NPY_OBJECT: f[0] = 79 #"O"
6038 */
6039 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 897, __pyx_L1_error)
6040 __Pyx_GOTREF(__pyx_t_4);
6041 __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(3, 897, __pyx_L1_error)
6042 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6043 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 897, __pyx_L1_error)
6044 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6045 if (__pyx_t_6) {
6046 (__pyx_v_f[0]) = 90;
6047 (__pyx_v_f[1]) = 0x64;
6048 __pyx_v_f = (__pyx_v_f + 1);
6049 goto __pyx_L15;
6050 }
6051
6052 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":898
6053 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
6054 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
6055 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
6056 * elif t == NPY_OBJECT: f[0] = 79 #"O"
6057 * else:
6058 */
6059 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 898, __pyx_L1_error)
6060 __Pyx_GOTREF(__pyx_t_3);
6061 __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(3, 898, __pyx_L1_error)
6062 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6063 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 898, __pyx_L1_error)
6064 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6065 if (__pyx_t_6) {
6066 (__pyx_v_f[0]) = 90;
6067 (__pyx_v_f[1]) = 0x67;
6068 __pyx_v_f = (__pyx_v_f + 1);
6069 goto __pyx_L15;
6070 }
6071
6072 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":899
6073 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
6074 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
6075 * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
6076 * else:
6077 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
6078 */
6079 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 899, __pyx_L1_error)
6080 __Pyx_GOTREF(__pyx_t_4);
6081 __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(3, 899, __pyx_L1_error)
6082 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6083 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 899, __pyx_L1_error)
6084 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6085 if (likely(__pyx_t_6)) {
6086 (__pyx_v_f[0]) = 79;
6087 goto __pyx_L15;
6088 }
6089
6090 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":901
6091 * elif t == NPY_OBJECT: f[0] = 79 #"O"
6092 * else:
6093 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
6094 * f += 1
6095 * else:
6096 */
6097 /*else*/ {
6098 __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(3, 901, __pyx_L1_error)
6099 __Pyx_GOTREF(__pyx_t_3);
6100 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 901, __pyx_L1_error)
6101 __Pyx_GOTREF(__pyx_t_4);
6102 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6103 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
6104 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6105 __PYX_ERR(3, 901, __pyx_L1_error)
6106 }
6107 __pyx_L15:;
6108
6109 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":902
6110 * else:
6111 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
6112 * f += 1 # <<<<<<<<<<<<<<
6113 * else:
6114 * # Cython ignores struct boundary information ("T{...}"),
6115 */
6116 __pyx_v_f = (__pyx_v_f + 1);
6117
6118 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
6119 * offset[0] += child.itemsize
6120 *
6121 * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
6122 * t = child.type_num
6123 * if end - f < 5:
6124 */
6125 goto __pyx_L13;
6126 }
6127
6128 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":906
6129 * # Cython ignores struct boundary information ("T{...}"),
6130 * # so don't output it
6131 * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
6132 * return f
6133 *
6134 */
6135 /*else*/ {
6136 __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(3, 906, __pyx_L1_error)
6137 __pyx_v_f = __pyx_t_9;
6138 }
6139 __pyx_L13:;
6140
6141 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
6142 * cdef tuple fields
6143 *
6144 * for childname in descr.names: # <<<<<<<<<<<<<<
6145 * fields = descr.fields[childname]
6146 * child, new_offset = fields
6147 */
6148 }
6149 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6150
6151 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":907
6152 * # so don't output it
6153 * f = _util_dtypestring(child, f, end, offset)
6154 * return f # <<<<<<<<<<<<<<
6155 *
6156 *
6157 */
6158 __pyx_r = __pyx_v_f;
6159 goto __pyx_L0;
6160
6161 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
6162 * return ()
6163 *
6164 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
6165 * # Recursive utility function used in __getbuffer__ to get format
6166 * # string. The new location in the format string is returned.
6167 */
6168
6169 /* function exit code */
6170 __pyx_L1_error:;
6171 __Pyx_XDECREF(__pyx_t_1);
6172 __Pyx_XDECREF(__pyx_t_3);
6173 __Pyx_XDECREF(__pyx_t_4);
6174 __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
6175 __pyx_r = NULL;
6176 __pyx_L0:;
6177 __Pyx_XDECREF((PyObject *)__pyx_v_child);
6178 __Pyx_XDECREF(__pyx_v_fields);
6179 __Pyx_XDECREF(__pyx_v_childname);
6180 __Pyx_XDECREF(__pyx_v_new_offset);
6181 __Pyx_XDECREF(__pyx_v_t);
6182 __Pyx_RefNannyFinishContext();
6183 return __pyx_r;
6184 }
6185
6186 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
6187 * int _import_umath() except -1
6188 *
6189 * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
6190 * Py_INCREF(base) # important to do this before stealing the reference below!
6191 * PyArray_SetBaseObject(arr, base)
6192 */
6193
__pyx_f_5numpy_set_array_base(PyArrayObject * __pyx_v_arr,PyObject * __pyx_v_base)6194 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
6195 __Pyx_RefNannyDeclarations
6196 __Pyx_RefNannySetupContext("set_array_base", 0);
6197
6198 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1023
6199 *
6200 * cdef inline void set_array_base(ndarray arr, object base):
6201 * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
6202 * PyArray_SetBaseObject(arr, base)
6203 *
6204 */
6205 Py_INCREF(__pyx_v_base);
6206
6207 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1024
6208 * cdef inline void set_array_base(ndarray arr, object base):
6209 * Py_INCREF(base) # important to do this before stealing the reference below!
6210 * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
6211 *
6212 * cdef inline object get_array_base(ndarray arr):
6213 */
6214 (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
6215
6216 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
6217 * int _import_umath() except -1
6218 *
6219 * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
6220 * Py_INCREF(base) # important to do this before stealing the reference below!
6221 * PyArray_SetBaseObject(arr, base)
6222 */
6223
6224 /* function exit code */
6225 __Pyx_RefNannyFinishContext();
6226 }
6227
6228 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
6229 * PyArray_SetBaseObject(arr, base)
6230 *
6231 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
6232 * base = PyArray_BASE(arr)
6233 * if base is NULL:
6234 */
6235
__pyx_f_5numpy_get_array_base(PyArrayObject * __pyx_v_arr)6236 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
6237 PyObject *__pyx_v_base;
6238 PyObject *__pyx_r = NULL;
6239 __Pyx_RefNannyDeclarations
6240 int __pyx_t_1;
6241 __Pyx_RefNannySetupContext("get_array_base", 0);
6242
6243 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1027
6244 *
6245 * cdef inline object get_array_base(ndarray arr):
6246 * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
6247 * if base is NULL:
6248 * return None
6249 */
6250 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
6251
6252 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
6253 * cdef inline object get_array_base(ndarray arr):
6254 * base = PyArray_BASE(arr)
6255 * if base is NULL: # <<<<<<<<<<<<<<
6256 * return None
6257 * return <object>base
6258 */
6259 __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
6260 if (__pyx_t_1) {
6261
6262 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1029
6263 * base = PyArray_BASE(arr)
6264 * if base is NULL:
6265 * return None # <<<<<<<<<<<<<<
6266 * return <object>base
6267 *
6268 */
6269 __Pyx_XDECREF(__pyx_r);
6270 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6271 goto __pyx_L0;
6272
6273 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
6274 * cdef inline object get_array_base(ndarray arr):
6275 * base = PyArray_BASE(arr)
6276 * if base is NULL: # <<<<<<<<<<<<<<
6277 * return None
6278 * return <object>base
6279 */
6280 }
6281
6282 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1030
6283 * if base is NULL:
6284 * return None
6285 * return <object>base # <<<<<<<<<<<<<<
6286 *
6287 * # Versions of the import_* functions which are more suitable for
6288 */
6289 __Pyx_XDECREF(__pyx_r);
6290 __Pyx_INCREF(((PyObject *)__pyx_v_base));
6291 __pyx_r = ((PyObject *)__pyx_v_base);
6292 goto __pyx_L0;
6293
6294 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
6295 * PyArray_SetBaseObject(arr, base)
6296 *
6297 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
6298 * base = PyArray_BASE(arr)
6299 * if base is NULL:
6300 */
6301
6302 /* function exit code */
6303 __pyx_L0:;
6304 __Pyx_XGIVEREF(__pyx_r);
6305 __Pyx_RefNannyFinishContext();
6306 return __pyx_r;
6307 }
6308
6309 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
6310 * # Versions of the import_* functions which are more suitable for
6311 * # Cython code.
6312 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
6313 * try:
6314 * _import_array()
6315 */
6316
__pyx_f_5numpy_import_array(void)6317 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
6318 int __pyx_r;
6319 __Pyx_RefNannyDeclarations
6320 PyObject *__pyx_t_1 = NULL;
6321 PyObject *__pyx_t_2 = NULL;
6322 PyObject *__pyx_t_3 = NULL;
6323 int __pyx_t_4;
6324 PyObject *__pyx_t_5 = NULL;
6325 PyObject *__pyx_t_6 = NULL;
6326 PyObject *__pyx_t_7 = NULL;
6327 PyObject *__pyx_t_8 = NULL;
6328 __Pyx_RefNannySetupContext("import_array", 0);
6329
6330 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
6331 * # Cython code.
6332 * cdef inline int import_array() except -1:
6333 * try: # <<<<<<<<<<<<<<
6334 * _import_array()
6335 * except Exception:
6336 */
6337 {
6338 __Pyx_PyThreadState_declare
6339 __Pyx_PyThreadState_assign
6340 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
6341 __Pyx_XGOTREF(__pyx_t_1);
6342 __Pyx_XGOTREF(__pyx_t_2);
6343 __Pyx_XGOTREF(__pyx_t_3);
6344 /*try:*/ {
6345
6346 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1036
6347 * cdef inline int import_array() except -1:
6348 * try:
6349 * _import_array() # <<<<<<<<<<<<<<
6350 * except Exception:
6351 * raise ImportError("numpy.core.multiarray failed to import")
6352 */
6353 __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 1036, __pyx_L3_error)
6354
6355 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
6356 * # Cython code.
6357 * cdef inline int import_array() except -1:
6358 * try: # <<<<<<<<<<<<<<
6359 * _import_array()
6360 * except Exception:
6361 */
6362 }
6363 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6364 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6365 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6366 goto __pyx_L8_try_end;
6367 __pyx_L3_error:;
6368
6369 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1037
6370 * try:
6371 * _import_array()
6372 * except Exception: # <<<<<<<<<<<<<<
6373 * raise ImportError("numpy.core.multiarray failed to import")
6374 *
6375 */
6376 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
6377 if (__pyx_t_4) {
6378 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
6379 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1037, __pyx_L5_except_error)
6380 __Pyx_GOTREF(__pyx_t_5);
6381 __Pyx_GOTREF(__pyx_t_6);
6382 __Pyx_GOTREF(__pyx_t_7);
6383
6384 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
6385 * _import_array()
6386 * except Exception:
6387 * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
6388 *
6389 * cdef inline int import_umath() except -1:
6390 */
6391 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1038, __pyx_L5_except_error)
6392 __Pyx_GOTREF(__pyx_t_8);
6393 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6394 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6395 __PYX_ERR(3, 1038, __pyx_L5_except_error)
6396 }
6397 goto __pyx_L5_except_error;
6398 __pyx_L5_except_error:;
6399
6400 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
6401 * # Cython code.
6402 * cdef inline int import_array() except -1:
6403 * try: # <<<<<<<<<<<<<<
6404 * _import_array()
6405 * except Exception:
6406 */
6407 __Pyx_XGIVEREF(__pyx_t_1);
6408 __Pyx_XGIVEREF(__pyx_t_2);
6409 __Pyx_XGIVEREF(__pyx_t_3);
6410 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
6411 goto __pyx_L1_error;
6412 __pyx_L8_try_end:;
6413 }
6414
6415 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
6416 * # Versions of the import_* functions which are more suitable for
6417 * # Cython code.
6418 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
6419 * try:
6420 * _import_array()
6421 */
6422
6423 /* function exit code */
6424 __pyx_r = 0;
6425 goto __pyx_L0;
6426 __pyx_L1_error:;
6427 __Pyx_XDECREF(__pyx_t_5);
6428 __Pyx_XDECREF(__pyx_t_6);
6429 __Pyx_XDECREF(__pyx_t_7);
6430 __Pyx_XDECREF(__pyx_t_8);
6431 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
6432 __pyx_r = -1;
6433 __pyx_L0:;
6434 __Pyx_RefNannyFinishContext();
6435 return __pyx_r;
6436 }
6437
6438 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
6439 * raise ImportError("numpy.core.multiarray failed to import")
6440 *
6441 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
6442 * try:
6443 * _import_umath()
6444 */
6445
__pyx_f_5numpy_import_umath(void)6446 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
6447 int __pyx_r;
6448 __Pyx_RefNannyDeclarations
6449 PyObject *__pyx_t_1 = NULL;
6450 PyObject *__pyx_t_2 = NULL;
6451 PyObject *__pyx_t_3 = NULL;
6452 int __pyx_t_4;
6453 PyObject *__pyx_t_5 = NULL;
6454 PyObject *__pyx_t_6 = NULL;
6455 PyObject *__pyx_t_7 = NULL;
6456 PyObject *__pyx_t_8 = NULL;
6457 __Pyx_RefNannySetupContext("import_umath", 0);
6458
6459 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
6460 *
6461 * cdef inline int import_umath() except -1:
6462 * try: # <<<<<<<<<<<<<<
6463 * _import_umath()
6464 * except Exception:
6465 */
6466 {
6467 __Pyx_PyThreadState_declare
6468 __Pyx_PyThreadState_assign
6469 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
6470 __Pyx_XGOTREF(__pyx_t_1);
6471 __Pyx_XGOTREF(__pyx_t_2);
6472 __Pyx_XGOTREF(__pyx_t_3);
6473 /*try:*/ {
6474
6475 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1042
6476 * cdef inline int import_umath() except -1:
6477 * try:
6478 * _import_umath() # <<<<<<<<<<<<<<
6479 * except Exception:
6480 * raise ImportError("numpy.core.umath failed to import")
6481 */
6482 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 1042, __pyx_L3_error)
6483
6484 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
6485 *
6486 * cdef inline int import_umath() except -1:
6487 * try: # <<<<<<<<<<<<<<
6488 * _import_umath()
6489 * except Exception:
6490 */
6491 }
6492 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6493 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6494 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6495 goto __pyx_L8_try_end;
6496 __pyx_L3_error:;
6497
6498 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1043
6499 * try:
6500 * _import_umath()
6501 * except Exception: # <<<<<<<<<<<<<<
6502 * raise ImportError("numpy.core.umath failed to import")
6503 *
6504 */
6505 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
6506 if (__pyx_t_4) {
6507 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
6508 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1043, __pyx_L5_except_error)
6509 __Pyx_GOTREF(__pyx_t_5);
6510 __Pyx_GOTREF(__pyx_t_6);
6511 __Pyx_GOTREF(__pyx_t_7);
6512
6513 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
6514 * _import_umath()
6515 * except Exception:
6516 * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
6517 *
6518 * cdef inline int import_ufunc() except -1:
6519 */
6520 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1044, __pyx_L5_except_error)
6521 __Pyx_GOTREF(__pyx_t_8);
6522 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6523 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6524 __PYX_ERR(3, 1044, __pyx_L5_except_error)
6525 }
6526 goto __pyx_L5_except_error;
6527 __pyx_L5_except_error:;
6528
6529 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
6530 *
6531 * cdef inline int import_umath() except -1:
6532 * try: # <<<<<<<<<<<<<<
6533 * _import_umath()
6534 * except Exception:
6535 */
6536 __Pyx_XGIVEREF(__pyx_t_1);
6537 __Pyx_XGIVEREF(__pyx_t_2);
6538 __Pyx_XGIVEREF(__pyx_t_3);
6539 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
6540 goto __pyx_L1_error;
6541 __pyx_L8_try_end:;
6542 }
6543
6544 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
6545 * raise ImportError("numpy.core.multiarray failed to import")
6546 *
6547 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
6548 * try:
6549 * _import_umath()
6550 */
6551
6552 /* function exit code */
6553 __pyx_r = 0;
6554 goto __pyx_L0;
6555 __pyx_L1_error:;
6556 __Pyx_XDECREF(__pyx_t_5);
6557 __Pyx_XDECREF(__pyx_t_6);
6558 __Pyx_XDECREF(__pyx_t_7);
6559 __Pyx_XDECREF(__pyx_t_8);
6560 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
6561 __pyx_r = -1;
6562 __pyx_L0:;
6563 __Pyx_RefNannyFinishContext();
6564 return __pyx_r;
6565 }
6566
6567 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
6568 * raise ImportError("numpy.core.umath failed to import")
6569 *
6570 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
6571 * try:
6572 * _import_umath()
6573 */
6574
__pyx_f_5numpy_import_ufunc(void)6575 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
6576 int __pyx_r;
6577 __Pyx_RefNannyDeclarations
6578 PyObject *__pyx_t_1 = NULL;
6579 PyObject *__pyx_t_2 = NULL;
6580 PyObject *__pyx_t_3 = NULL;
6581 int __pyx_t_4;
6582 PyObject *__pyx_t_5 = NULL;
6583 PyObject *__pyx_t_6 = NULL;
6584 PyObject *__pyx_t_7 = NULL;
6585 PyObject *__pyx_t_8 = NULL;
6586 __Pyx_RefNannySetupContext("import_ufunc", 0);
6587
6588 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
6589 *
6590 * cdef inline int import_ufunc() except -1:
6591 * try: # <<<<<<<<<<<<<<
6592 * _import_umath()
6593 * except Exception:
6594 */
6595 {
6596 __Pyx_PyThreadState_declare
6597 __Pyx_PyThreadState_assign
6598 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
6599 __Pyx_XGOTREF(__pyx_t_1);
6600 __Pyx_XGOTREF(__pyx_t_2);
6601 __Pyx_XGOTREF(__pyx_t_3);
6602 /*try:*/ {
6603
6604 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1048
6605 * cdef inline int import_ufunc() except -1:
6606 * try:
6607 * _import_umath() # <<<<<<<<<<<<<<
6608 * except Exception:
6609 * raise ImportError("numpy.core.umath failed to import")
6610 */
6611 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 1048, __pyx_L3_error)
6612
6613 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
6614 *
6615 * cdef inline int import_ufunc() except -1:
6616 * try: # <<<<<<<<<<<<<<
6617 * _import_umath()
6618 * except Exception:
6619 */
6620 }
6621 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6622 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6623 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6624 goto __pyx_L8_try_end;
6625 __pyx_L3_error:;
6626
6627 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1049
6628 * try:
6629 * _import_umath()
6630 * except Exception: # <<<<<<<<<<<<<<
6631 * raise ImportError("numpy.core.umath failed to import")
6632 */
6633 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
6634 if (__pyx_t_4) {
6635 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
6636 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1049, __pyx_L5_except_error)
6637 __Pyx_GOTREF(__pyx_t_5);
6638 __Pyx_GOTREF(__pyx_t_6);
6639 __Pyx_GOTREF(__pyx_t_7);
6640
6641 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1050
6642 * _import_umath()
6643 * except Exception:
6644 * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
6645 */
6646 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1050, __pyx_L5_except_error)
6647 __Pyx_GOTREF(__pyx_t_8);
6648 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6649 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6650 __PYX_ERR(3, 1050, __pyx_L5_except_error)
6651 }
6652 goto __pyx_L5_except_error;
6653 __pyx_L5_except_error:;
6654
6655 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
6656 *
6657 * cdef inline int import_ufunc() except -1:
6658 * try: # <<<<<<<<<<<<<<
6659 * _import_umath()
6660 * except Exception:
6661 */
6662 __Pyx_XGIVEREF(__pyx_t_1);
6663 __Pyx_XGIVEREF(__pyx_t_2);
6664 __Pyx_XGIVEREF(__pyx_t_3);
6665 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
6666 goto __pyx_L1_error;
6667 __pyx_L8_try_end:;
6668 }
6669
6670 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
6671 * raise ImportError("numpy.core.umath failed to import")
6672 *
6673 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
6674 * try:
6675 * _import_umath()
6676 */
6677
6678 /* function exit code */
6679 __pyx_r = 0;
6680 goto __pyx_L0;
6681 __pyx_L1_error:;
6682 __Pyx_XDECREF(__pyx_t_5);
6683 __Pyx_XDECREF(__pyx_t_6);
6684 __Pyx_XDECREF(__pyx_t_7);
6685 __Pyx_XDECREF(__pyx_t_8);
6686 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
6687 __pyx_r = -1;
6688 __pyx_L0:;
6689 __Pyx_RefNannyFinishContext();
6690 return __pyx_r;
6691 }
6692
6693 /* "volume_container.pxd":35
6694 * int dims[3]
6695 *
6696 * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<<
6697 * #-----------------------------------------------------------------------------
6698 * # vc_index(VolumeContainer *vc, int i, int j, int k)
6699 */
6700
__pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer * __pyx_v_vc,int __pyx_v_i,int __pyx_v_j,int __pyx_v_k)6701 static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) {
6702 int __pyx_r;
6703 __Pyx_RefNannyDeclarations
6704 __Pyx_RefNannySetupContext("vc_index", 0);
6705
6706 /* "volume_container.pxd":63
6707 * # The 3-dimensional case (presented below) is similar.
6708 * #-----------------------------------------------------------------------------
6709 * return (i*vc.dims[1]+j)*vc.dims[2]+k # <<<<<<<<<<<<<<
6710 *
6711 * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos):
6712 */
6713 __pyx_r = ((((__pyx_v_i * (__pyx_v_vc->dims[1])) + __pyx_v_j) * (__pyx_v_vc->dims[2])) + __pyx_v_k);
6714 goto __pyx_L0;
6715
6716 /* "volume_container.pxd":35
6717 * int dims[3]
6718 *
6719 * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k): # <<<<<<<<<<<<<<
6720 * #-----------------------------------------------------------------------------
6721 * # vc_index(VolumeContainer *vc, int i, int j, int k)
6722 */
6723
6724 /* function exit code */
6725 __pyx_L0:;
6726 __Pyx_RefNannyFinishContext();
6727 return __pyx_r;
6728 }
6729
6730 /* "volume_container.pxd":65
6731 * return (i*vc.dims[1]+j)*vc.dims[2]+k
6732 *
6733 * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<<
6734 * cdef int index[3]
6735 * cdef int i
6736 */
6737
__pyx_f_2yt_9utilities_3lib_16volume_container_vc_pos_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer * __pyx_v_vc,__pyx_t_5numpy_float64_t * __pyx_v_spos)6738 static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_pos_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_float64_t *__pyx_v_spos) {
6739 int __pyx_v_index[3];
6740 int __pyx_v_i;
6741 int __pyx_r;
6742 __Pyx_RefNannyDeclarations
6743 int __pyx_t_1;
6744 __Pyx_RefNannySetupContext("vc_pos_index", 0);
6745
6746 /* "volume_container.pxd":68
6747 * cdef int index[3]
6748 * cdef int i
6749 * for i in range(3): # <<<<<<<<<<<<<<
6750 * index[i] = <int> ((spos[i] - vc.left_edge[i]) * vc.idds[i])
6751 * return vc_index(vc, index[0], index[1], index[2])
6752 */
6753 for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
6754 __pyx_v_i = __pyx_t_1;
6755
6756 /* "volume_container.pxd":69
6757 * cdef int i
6758 * for i in range(3):
6759 * index[i] = <int> ((spos[i] - vc.left_edge[i]) * vc.idds[i]) # <<<<<<<<<<<<<<
6760 * return vc_index(vc, index[0], index[1], index[2])
6761 */
6762 (__pyx_v_index[__pyx_v_i]) = ((int)(((__pyx_v_spos[__pyx_v_i]) - (__pyx_v_vc->left_edge[__pyx_v_i])) * (__pyx_v_vc->idds[__pyx_v_i])));
6763 }
6764
6765 /* "volume_container.pxd":70
6766 * for i in range(3):
6767 * index[i] = <int> ((spos[i] - vc.left_edge[i]) * vc.idds[i])
6768 * return vc_index(vc, index[0], index[1], index[2]) # <<<<<<<<<<<<<<
6769 */
6770 __pyx_r = __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(__pyx_v_vc, (__pyx_v_index[0]), (__pyx_v_index[1]), (__pyx_v_index[2]));
6771 goto __pyx_L0;
6772
6773 /* "volume_container.pxd":65
6774 * return (i*vc.dims[1]+j)*vc.dims[2]+k
6775 *
6776 * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<<
6777 * cdef int index[3]
6778 * cdef int i
6779 */
6780
6781 /* function exit code */
6782 __pyx_L0:;
6783 __Pyx_RefNannyFinishContext();
6784 return __pyx_r;
6785 }
6786 static struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid __pyx_vtable_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid;
6787
__pyx_tp_new_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid(PyTypeObject * t,PyObject * a,PyObject * k)6788 static PyObject *__pyx_tp_new_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid(PyTypeObject *t, PyObject *a, PyObject *k) {
6789 struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *p;
6790 PyObject *o;
6791 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
6792 o = (*t->tp_alloc)(t, 0);
6793 } else {
6794 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
6795 }
6796 if (unlikely(!o)) return 0;
6797 p = ((struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)o);
6798 p->__pyx_vtab = __pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid;
6799 p->my_data = Py_None; Py_INCREF(Py_None);
6800 p->source_mask = Py_None; Py_INCREF(Py_None);
6801 p->LeftEdge = Py_None; Py_INCREF(Py_None);
6802 p->RightEdge = Py_None; Py_INCREF(Py_None);
6803 if (unlikely(__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_1__cinit__(o, a, k) < 0)) goto bad;
6804 return o;
6805 bad:
6806 Py_DECREF(o); o = 0;
6807 return NULL;
6808 }
6809
__pyx_tp_dealloc_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid(PyObject * o)6810 static void __pyx_tp_dealloc_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid(PyObject *o) {
6811 struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *p = (struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)o;
6812 #if CYTHON_USE_TP_FINALIZE
6813 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
6814 if (PyObject_CallFinalizerFromDealloc(o)) return;
6815 }
6816 #endif
6817 PyObject_GC_UnTrack(o);
6818 {
6819 PyObject *etype, *eval, *etb;
6820 PyErr_Fetch(&etype, &eval, &etb);
6821 ++Py_REFCNT(o);
6822 __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_3__dealloc__(o);
6823 --Py_REFCNT(o);
6824 PyErr_Restore(etype, eval, etb);
6825 }
6826 Py_CLEAR(p->my_data);
6827 Py_CLEAR(p->source_mask);
6828 Py_CLEAR(p->LeftEdge);
6829 Py_CLEAR(p->RightEdge);
6830 (*Py_TYPE(o)->tp_free)(o);
6831 }
6832
__pyx_tp_traverse_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid(PyObject * o,visitproc v,void * a)6833 static int __pyx_tp_traverse_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid(PyObject *o, visitproc v, void *a) {
6834 int e;
6835 struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *p = (struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)o;
6836 if (p->my_data) {
6837 e = (*v)(p->my_data, a); if (e) return e;
6838 }
6839 if (p->source_mask) {
6840 e = (*v)(p->source_mask, a); if (e) return e;
6841 }
6842 if (p->LeftEdge) {
6843 e = (*v)(p->LeftEdge, a); if (e) return e;
6844 }
6845 if (p->RightEdge) {
6846 e = (*v)(p->RightEdge, a); if (e) return e;
6847 }
6848 return 0;
6849 }
6850
__pyx_tp_clear_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid(PyObject * o)6851 static int __pyx_tp_clear_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid(PyObject *o) {
6852 PyObject* tmp;
6853 struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *p = (struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *)o;
6854 tmp = ((PyObject*)p->my_data);
6855 p->my_data = Py_None; Py_INCREF(Py_None);
6856 Py_XDECREF(tmp);
6857 tmp = ((PyObject*)p->source_mask);
6858 p->source_mask = Py_None; Py_INCREF(Py_None);
6859 Py_XDECREF(tmp);
6860 tmp = ((PyObject*)p->LeftEdge);
6861 p->LeftEdge = Py_None; Py_INCREF(Py_None);
6862 Py_XDECREF(tmp);
6863 tmp = ((PyObject*)p->RightEdge);
6864 p->RightEdge = Py_None; Py_INCREF(Py_None);
6865 Py_XDECREF(tmp);
6866 return 0;
6867 }
6868
__pyx_getprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_my_data(PyObject * o,CYTHON_UNUSED void * x)6869 static PyObject *__pyx_getprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_my_data(PyObject *o, CYTHON_UNUSED void *x) {
6870 return __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7my_data_1__get__(o);
6871 }
6872
__pyx_setprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_my_data(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)6873 static int __pyx_setprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_my_data(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
6874 if (v) {
6875 return __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7my_data_3__set__(o, v);
6876 }
6877 else {
6878 return __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7my_data_5__del__(o);
6879 }
6880 }
6881
__pyx_getprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_source_mask(PyObject * o,CYTHON_UNUSED void * x)6882 static PyObject *__pyx_getprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_source_mask(PyObject *o, CYTHON_UNUSED void *x) {
6883 return __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_11source_mask_1__get__(o);
6884 }
6885
__pyx_setprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_source_mask(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)6886 static int __pyx_setprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_source_mask(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
6887 if (v) {
6888 return __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_11source_mask_3__set__(o, v);
6889 }
6890 else {
6891 return __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_11source_mask_5__del__(o);
6892 }
6893 }
6894
__pyx_getprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_LeftEdge(PyObject * o,CYTHON_UNUSED void * x)6895 static PyObject *__pyx_getprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_LeftEdge(PyObject *o, CYTHON_UNUSED void *x) {
6896 return __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8LeftEdge_1__get__(o);
6897 }
6898
__pyx_setprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_LeftEdge(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)6899 static int __pyx_setprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_LeftEdge(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
6900 if (v) {
6901 return __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8LeftEdge_3__set__(o, v);
6902 }
6903 else {
6904 return __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_8LeftEdge_5__del__(o);
6905 }
6906 }
6907
__pyx_getprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_RightEdge(PyObject * o,CYTHON_UNUSED void * x)6908 static PyObject *__pyx_getprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_RightEdge(PyObject *o, CYTHON_UNUSED void *x) {
6909 return __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9RightEdge_1__get__(o);
6910 }
6911
__pyx_setprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_RightEdge(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)6912 static int __pyx_setprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_RightEdge(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
6913 if (v) {
6914 return __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9RightEdge_3__set__(o, v);
6915 }
6916 else {
6917 return __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9RightEdge_5__del__(o);
6918 }
6919 }
6920
__pyx_getprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_parent_grid_id(PyObject * o,CYTHON_UNUSED void * x)6921 static PyObject *__pyx_getprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_parent_grid_id(PyObject *o, CYTHON_UNUSED void *x) {
6922 return __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_14parent_grid_id_1__get__(o);
6923 }
6924
__pyx_setprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_parent_grid_id(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)6925 static int __pyx_setprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_parent_grid_id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
6926 if (v) {
6927 return __pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_14parent_grid_id_3__set__(o, v);
6928 }
6929 else {
6930 PyErr_SetString(PyExc_NotImplementedError, "__del__");
6931 return -1;
6932 }
6933 }
6934
6935 static PyMethodDef __pyx_methods_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid[] = {
6936 {"integrate_streamline", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_5integrate_streamline, METH_VARARGS|METH_KEYWORDS, 0},
6937 {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_7__reduce_cython__, METH_NOARGS, 0},
6938 {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_9__setstate_cython__, METH_O, 0},
6939 {0, 0, 0, 0}
6940 };
6941
6942 static struct PyGetSetDef __pyx_getsets_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid[] = {
6943 {(char *)"my_data", __pyx_getprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_my_data, __pyx_setprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_my_data, (char *)0, 0},
6944 {(char *)"source_mask", __pyx_getprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_source_mask, __pyx_setprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_source_mask, (char *)0, 0},
6945 {(char *)"LeftEdge", __pyx_getprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_LeftEdge, __pyx_setprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_LeftEdge, (char *)0, 0},
6946 {(char *)"RightEdge", __pyx_getprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_RightEdge, __pyx_setprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_RightEdge, (char *)0, 0},
6947 {(char *)"parent_grid_id", __pyx_getprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_parent_grid_id, __pyx_setprop_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_parent_grid_id, (char *)0, 0},
6948 {0, 0, 0, 0, 0}
6949 };
6950
6951 static PyTypeObject __pyx_type_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = {
6952 PyVarObject_HEAD_INIT(0, 0)
6953 "yt.utilities.lib.partitioned_grid.PartitionedGrid", /*tp_name*/
6954 sizeof(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid), /*tp_basicsize*/
6955 0, /*tp_itemsize*/
6956 __pyx_tp_dealloc_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid, /*tp_dealloc*/
6957 0, /*tp_print*/
6958 0, /*tp_getattr*/
6959 0, /*tp_setattr*/
6960 #if PY_MAJOR_VERSION < 3
6961 0, /*tp_compare*/
6962 #endif
6963 #if PY_MAJOR_VERSION >= 3
6964 0, /*tp_as_async*/
6965 #endif
6966 0, /*tp_repr*/
6967 0, /*tp_as_number*/
6968 0, /*tp_as_sequence*/
6969 0, /*tp_as_mapping*/
6970 0, /*tp_hash*/
6971 0, /*tp_call*/
6972 0, /*tp_str*/
6973 0, /*tp_getattro*/
6974 0, /*tp_setattro*/
6975 0, /*tp_as_buffer*/
6976 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
6977 0, /*tp_doc*/
6978 __pyx_tp_traverse_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid, /*tp_traverse*/
6979 __pyx_tp_clear_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid, /*tp_clear*/
6980 0, /*tp_richcompare*/
6981 0, /*tp_weaklistoffset*/
6982 0, /*tp_iter*/
6983 0, /*tp_iternext*/
6984 __pyx_methods_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid, /*tp_methods*/
6985 0, /*tp_members*/
6986 __pyx_getsets_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid, /*tp_getset*/
6987 0, /*tp_base*/
6988 0, /*tp_dict*/
6989 0, /*tp_descr_get*/
6990 0, /*tp_descr_set*/
6991 0, /*tp_dictoffset*/
6992 0, /*tp_init*/
6993 0, /*tp_alloc*/
6994 __pyx_tp_new_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid, /*tp_new*/
6995 0, /*tp_free*/
6996 0, /*tp_is_gc*/
6997 0, /*tp_bases*/
6998 0, /*tp_mro*/
6999 0, /*tp_cache*/
7000 0, /*tp_subclasses*/
7001 0, /*tp_weaklist*/
7002 0, /*tp_del*/
7003 0, /*tp_version_tag*/
7004 #if PY_VERSION_HEX >= 0x030400a1
7005 0, /*tp_finalize*/
7006 #endif
7007 #if PY_VERSION_HEX >= 0x030800b1
7008 0, /*tp_vectorcall*/
7009 #endif
7010 };
7011
7012 static PyMethodDef __pyx_methods[] = {
7013 {0, 0, 0, 0}
7014 };
7015
7016 #if PY_MAJOR_VERSION >= 3
7017 #if CYTHON_PEP489_MULTI_PHASE_INIT
7018 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
7019 static int __pyx_pymod_exec_partitioned_grid(PyObject* module); /*proto*/
7020 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
7021 {Py_mod_create, (void*)__pyx_pymod_create},
7022 {Py_mod_exec, (void*)__pyx_pymod_exec_partitioned_grid},
7023 {0, NULL}
7024 };
7025 #endif
7026
7027 static struct PyModuleDef __pyx_moduledef = {
7028 PyModuleDef_HEAD_INIT,
7029 "partitioned_grid",
7030 __pyx_k_Image_sampler_definitions, /* m_doc */
7031 #if CYTHON_PEP489_MULTI_PHASE_INIT
7032 0, /* m_size */
7033 #else
7034 -1, /* m_size */
7035 #endif
7036 __pyx_methods /* m_methods */,
7037 #if CYTHON_PEP489_MULTI_PHASE_INIT
7038 __pyx_moduledef_slots, /* m_slots */
7039 #else
7040 NULL, /* m_reload */
7041 #endif
7042 NULL, /* m_traverse */
7043 NULL, /* m_clear */
7044 NULL /* m_free */
7045 };
7046 #endif
7047 #ifndef CYTHON_SMALL_CODE
7048 #if defined(__clang__)
7049 #define CYTHON_SMALL_CODE
7050 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
7051 #define CYTHON_SMALL_CODE __attribute__((cold))
7052 #else
7053 #define CYTHON_SMALL_CODE
7054 #endif
7055 #endif
7056
7057 static __Pyx_StringTabEntry __pyx_string_tab[] = {
7058 {&__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},
7059 {&__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},
7060 {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
7061 {&__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},
7062 {&__pyx_n_s_PartitionedGrid, __pyx_k_PartitionedGrid, sizeof(__pyx_k_PartitionedGrid), 0, 0, 1, 1},
7063 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
7064 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
7065 {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
7066 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
7067 {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
7068 {&__pyx_n_s_dims, __pyx_k_dims, sizeof(__pyx_k_dims), 0, 0, 1, 1},
7069 {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
7070 {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1},
7071 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
7072 {&__pyx_n_s_left_edge, __pyx_k_left_edge, sizeof(__pyx_k_left_edge), 0, 0, 1, 1},
7073 {&__pyx_n_s_mag, __pyx_k_mag, sizeof(__pyx_k_mag), 0, 0, 1, 1},
7074 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
7075 {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1},
7076 {&__pyx_n_s_n_fields, __pyx_k_n_fields, sizeof(__pyx_k_n_fields), 0, 0, 1, 1},
7077 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
7078 {&__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},
7079 {&__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},
7080 {&__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},
7081 {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
7082 {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
7083 {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
7084 {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
7085 {&__pyx_n_s_parent_grid_id, __pyx_k_parent_grid_id, sizeof(__pyx_k_parent_grid_id), 0, 0, 1, 1},
7086 {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1},
7087 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
7088 {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
7089 {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
7090 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
7091 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
7092 {&__pyx_n_s_right_edge, __pyx_k_right_edge, sizeof(__pyx_k_right_edge), 0, 0, 1, 1},
7093 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
7094 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
7095 {&__pyx_n_s_sqrt, __pyx_k_sqrt, sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
7096 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
7097 {&__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},
7098 {0, 0, 0, 0, 0, 0, 0}
7099 };
__Pyx_InitCachedBuiltins(void)7100 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
7101 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 51, __pyx_L1_error)
7102 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
7103 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(3, 272, __pyx_L1_error)
7104 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(3, 856, __pyx_L1_error)
7105 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(3, 1038, __pyx_L1_error)
7106 return 0;
7107 __pyx_L1_error:;
7108 return -1;
7109 }
7110
__Pyx_InitCachedConstants(void)7111 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
7112 __Pyx_RefNannyDeclarations
7113 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
7114
7115 /* "(tree fragment)":2
7116 * def __reduce_cython__(self):
7117 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
7118 * def __setstate_cython__(self, __pyx_state):
7119 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7120 */
7121 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error)
7122 __Pyx_GOTREF(__pyx_tuple_);
7123 __Pyx_GIVEREF(__pyx_tuple_);
7124
7125 /* "(tree fragment)":4
7126 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7127 * def __setstate_cython__(self, __pyx_state):
7128 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
7129 */
7130 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error)
7131 __Pyx_GOTREF(__pyx_tuple__2);
7132 __Pyx_GIVEREF(__pyx_tuple__2);
7133
7134 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
7135 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
7136 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
7137 * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
7138 *
7139 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
7140 */
7141 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(3, 272, __pyx_L1_error)
7142 __Pyx_GOTREF(__pyx_tuple__3);
7143 __Pyx_GIVEREF(__pyx_tuple__3);
7144
7145 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
7146 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
7147 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
7148 * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
7149 *
7150 * info.buf = PyArray_DATA(self)
7151 */
7152 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(3, 276, __pyx_L1_error)
7153 __Pyx_GOTREF(__pyx_tuple__4);
7154 __Pyx_GIVEREF(__pyx_tuple__4);
7155
7156 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
7157 * if ((descr.byteorder == c'>' and little_endian) or
7158 * (descr.byteorder == c'<' and not little_endian)):
7159 * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
7160 * if t == NPY_BYTE: f = "b"
7161 * elif t == NPY_UBYTE: f = "B"
7162 */
7163 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(3, 306, __pyx_L1_error)
7164 __Pyx_GOTREF(__pyx_tuple__5);
7165 __Pyx_GIVEREF(__pyx_tuple__5);
7166
7167 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
7168 *
7169 * if (end - f) - <int>(new_offset - offset[0]) < 15:
7170 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
7171 *
7172 * if ((child.byteorder == c'>' and little_endian) or
7173 */
7174 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(3, 856, __pyx_L1_error)
7175 __Pyx_GOTREF(__pyx_tuple__6);
7176 __Pyx_GIVEREF(__pyx_tuple__6);
7177
7178 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
7179 * t = child.type_num
7180 * if end - f < 5:
7181 * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
7182 *
7183 * # Until ticket #99 is fixed, use integers to avoid warnings
7184 */
7185 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(3, 880, __pyx_L1_error)
7186 __Pyx_GOTREF(__pyx_tuple__7);
7187 __Pyx_GIVEREF(__pyx_tuple__7);
7188
7189 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
7190 * _import_array()
7191 * except Exception:
7192 * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
7193 *
7194 * cdef inline int import_umath() except -1:
7195 */
7196 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(3, 1038, __pyx_L1_error)
7197 __Pyx_GOTREF(__pyx_tuple__8);
7198 __Pyx_GIVEREF(__pyx_tuple__8);
7199
7200 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
7201 * _import_umath()
7202 * except Exception:
7203 * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
7204 *
7205 * cdef inline int import_ufunc() except -1:
7206 */
7207 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(3, 1044, __pyx_L1_error)
7208 __Pyx_GOTREF(__pyx_tuple__9);
7209 __Pyx_GIVEREF(__pyx_tuple__9);
7210 __Pyx_RefNannyFinishContext();
7211 return 0;
7212 __pyx_L1_error:;
7213 __Pyx_RefNannyFinishContext();
7214 return -1;
7215 }
7216
__Pyx_InitGlobals(void)7217 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
7218 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
7219 return 0;
7220 __pyx_L1_error:;
7221 return -1;
7222 }
7223
7224 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
7225 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
7226 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
7227 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
7228 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
7229 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
7230 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
7231
__Pyx_modinit_global_init_code(void)7232 static int __Pyx_modinit_global_init_code(void) {
7233 __Pyx_RefNannyDeclarations
7234 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
7235 /*--- Global init code ---*/
7236 __Pyx_RefNannyFinishContext();
7237 return 0;
7238 }
7239
__Pyx_modinit_variable_export_code(void)7240 static int __Pyx_modinit_variable_export_code(void) {
7241 __Pyx_RefNannyDeclarations
7242 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
7243 /*--- Variable export code ---*/
7244 __Pyx_RefNannyFinishContext();
7245 return 0;
7246 }
7247
__Pyx_modinit_function_export_code(void)7248 static int __Pyx_modinit_function_export_code(void) {
7249 __Pyx_RefNannyDeclarations
7250 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
7251 /*--- Function export code ---*/
7252 __Pyx_RefNannyFinishContext();
7253 return 0;
7254 }
7255
__Pyx_modinit_type_init_code(void)7256 static int __Pyx_modinit_type_init_code(void) {
7257 __Pyx_RefNannyDeclarations
7258 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
7259 /*--- Type init code ---*/
7260 __pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = &__pyx_vtable_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid;
7261 __pyx_vtable_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid.get_vector_field = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *))__pyx_f_2yt_9utilities_3lib_16partitioned_grid_15PartitionedGrid_get_vector_field;
7262 if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
7263 #if PY_VERSION_HEX < 0x030800B1
7264 __pyx_type_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid.tp_print = 0;
7265 #endif
7266 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid.tp_dictoffset && __pyx_type_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid.tp_getattro == PyObject_GenericGetAttr)) {
7267 __pyx_type_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid.tp_getattro = __Pyx_PyObject_GenericGetAttr;
7268 }
7269 if (__Pyx_SetVtable(__pyx_type_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid.tp_dict, __pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
7270 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PartitionedGrid, (PyObject *)&__pyx_type_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
7271 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
7272 __pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = &__pyx_type_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid;
7273 __Pyx_RefNannyFinishContext();
7274 return 0;
7275 __pyx_L1_error:;
7276 __Pyx_RefNannyFinishContext();
7277 return -1;
7278 }
7279
__Pyx_modinit_type_import_code(void)7280 static int __Pyx_modinit_type_import_code(void) {
7281 __Pyx_RefNannyDeclarations
7282 PyObject *__pyx_t_1 = NULL;
7283 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
7284 /*--- Type import code ---*/
7285 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
7286 __Pyx_GOTREF(__pyx_t_1);
7287 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
7288 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7289 sizeof(PyTypeObject),
7290 #else
7291 sizeof(PyHeapTypeObject),
7292 #endif
7293 __Pyx_ImportType_CheckSize_Warn);
7294 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(4, 9, __pyx_L1_error)
7295 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7296 __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 206, __pyx_L1_error)
7297 __Pyx_GOTREF(__pyx_t_1);
7298 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
7299 if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(3, 206, __pyx_L1_error)
7300 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
7301 if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(3, 229, __pyx_L1_error)
7302 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
7303 if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(3, 233, __pyx_L1_error)
7304 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
7305 if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(3, 242, __pyx_L1_error)
7306 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
7307 if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(3, 918, __pyx_L1_error)
7308 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7309 __Pyx_RefNannyFinishContext();
7310 return 0;
7311 __pyx_L1_error:;
7312 __Pyx_XDECREF(__pyx_t_1);
7313 __Pyx_RefNannyFinishContext();
7314 return -1;
7315 }
7316
__Pyx_modinit_variable_import_code(void)7317 static int __Pyx_modinit_variable_import_code(void) {
7318 __Pyx_RefNannyDeclarations
7319 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
7320 /*--- Variable import code ---*/
7321 __Pyx_RefNannyFinishContext();
7322 return 0;
7323 }
7324
__Pyx_modinit_function_import_code(void)7325 static int __Pyx_modinit_function_import_code(void) {
7326 __Pyx_RefNannyDeclarations
7327 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
7328 /*--- Function import code ---*/
7329 __Pyx_RefNannyFinishContext();
7330 return 0;
7331 }
7332
7333
7334 #if PY_MAJOR_VERSION < 3
7335 #ifdef CYTHON_NO_PYINIT_EXPORT
7336 #define __Pyx_PyMODINIT_FUNC void
7337 #else
7338 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
7339 #endif
7340 #else
7341 #ifdef CYTHON_NO_PYINIT_EXPORT
7342 #define __Pyx_PyMODINIT_FUNC PyObject *
7343 #else
7344 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
7345 #endif
7346 #endif
7347
7348
7349 #if PY_MAJOR_VERSION < 3
7350 __Pyx_PyMODINIT_FUNC initpartitioned_grid(void) CYTHON_SMALL_CODE; /*proto*/
initpartitioned_grid(void)7351 __Pyx_PyMODINIT_FUNC initpartitioned_grid(void)
7352 #else
7353 __Pyx_PyMODINIT_FUNC PyInit_partitioned_grid(void) CYTHON_SMALL_CODE; /*proto*/
7354 __Pyx_PyMODINIT_FUNC PyInit_partitioned_grid(void)
7355 #if CYTHON_PEP489_MULTI_PHASE_INIT
7356 {
7357 return PyModuleDef_Init(&__pyx_moduledef);
7358 }
7359 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
7360 #if PY_VERSION_HEX >= 0x030700A1
7361 static PY_INT64_T main_interpreter_id = -1;
7362 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
7363 if (main_interpreter_id == -1) {
7364 main_interpreter_id = current_id;
7365 return (unlikely(current_id == -1)) ? -1 : 0;
7366 } else if (unlikely(main_interpreter_id != current_id))
7367 #else
7368 static PyInterpreterState *main_interpreter = NULL;
7369 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
7370 if (!main_interpreter) {
7371 main_interpreter = current_interpreter;
7372 } else if (unlikely(main_interpreter != current_interpreter))
7373 #endif
7374 {
7375 PyErr_SetString(
7376 PyExc_ImportError,
7377 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
7378 return -1;
7379 }
7380 return 0;
7381 }
7382 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
7383 PyObject *value = PyObject_GetAttrString(spec, from_name);
7384 int result = 0;
7385 if (likely(value)) {
7386 if (allow_none || value != Py_None) {
7387 result = PyDict_SetItemString(moddict, to_name, value);
7388 }
7389 Py_DECREF(value);
7390 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
7391 PyErr_Clear();
7392 } else {
7393 result = -1;
7394 }
7395 return result;
7396 }
7397 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
7398 PyObject *module = NULL, *moddict, *modname;
7399 if (__Pyx_check_single_interpreter())
7400 return NULL;
7401 if (__pyx_m)
7402 return __Pyx_NewRef(__pyx_m);
7403 modname = PyObject_GetAttrString(spec, "name");
7404 if (unlikely(!modname)) goto bad;
7405 module = PyModule_NewObject(modname);
7406 Py_DECREF(modname);
7407 if (unlikely(!module)) goto bad;
7408 moddict = PyModule_GetDict(module);
7409 if (unlikely(!moddict)) goto bad;
7410 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
7411 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
7412 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
7413 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
7414 return module;
7415 bad:
7416 Py_XDECREF(module);
7417 return NULL;
7418 }
7419
7420
7421 static CYTHON_SMALL_CODE int __pyx_pymod_exec_partitioned_grid(PyObject *__pyx_pyinit_module)
7422 #endif
7423 #endif
7424 {
7425 PyObject *__pyx_t_1 = NULL;
7426 __Pyx_RefNannyDeclarations
7427 #if CYTHON_PEP489_MULTI_PHASE_INIT
7428 if (__pyx_m) {
7429 if (__pyx_m == __pyx_pyinit_module) return 0;
7430 PyErr_SetString(PyExc_RuntimeError, "Module 'partitioned_grid' has already been imported. Re-initialisation is not supported.");
7431 return -1;
7432 }
7433 #elif PY_MAJOR_VERSION >= 3
7434 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
7435 #endif
7436 #if CYTHON_REFNANNY
7437 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
7438 if (!__Pyx_RefNanny) {
7439 PyErr_Clear();
7440 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
7441 if (!__Pyx_RefNanny)
7442 Py_FatalError("failed to import 'refnanny' module");
7443 }
7444 #endif
7445 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_partitioned_grid(void)", 0);
7446 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7447 #ifdef __Pxy_PyFrame_Initialize_Offsets
7448 __Pxy_PyFrame_Initialize_Offsets();
7449 #endif
7450 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
7451 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
7452 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
7453 #ifdef __Pyx_CyFunction_USED
7454 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7455 #endif
7456 #ifdef __Pyx_FusedFunction_USED
7457 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7458 #endif
7459 #ifdef __Pyx_Coroutine_USED
7460 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7461 #endif
7462 #ifdef __Pyx_Generator_USED
7463 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7464 #endif
7465 #ifdef __Pyx_AsyncGen_USED
7466 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7467 #endif
7468 #ifdef __Pyx_StopAsyncIteration_USED
7469 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7470 #endif
7471 /*--- Library function declarations ---*/
7472 /*--- Threads initialization code ---*/
7473 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
7474 #ifdef WITH_THREAD /* Python build with threading support? */
7475 PyEval_InitThreads();
7476 #endif
7477 #endif
7478 /*--- Module creation code ---*/
7479 #if CYTHON_PEP489_MULTI_PHASE_INIT
7480 __pyx_m = __pyx_pyinit_module;
7481 Py_INCREF(__pyx_m);
7482 #else
7483 #if PY_MAJOR_VERSION < 3
7484 __pyx_m = Py_InitModule4("partitioned_grid", __pyx_methods, __pyx_k_Image_sampler_definitions, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
7485 #else
7486 __pyx_m = PyModule_Create(&__pyx_moduledef);
7487 #endif
7488 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
7489 #endif
7490 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
7491 Py_INCREF(__pyx_d);
7492 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
7493 Py_INCREF(__pyx_b);
7494 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
7495 Py_INCREF(__pyx_cython_runtime);
7496 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
7497 /*--- Initialize various global constants etc. ---*/
7498 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7499 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
7500 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7501 #endif
7502 if (__pyx_module_is_main_yt__utilities__lib__partitioned_grid) {
7503 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7504 }
7505 #if PY_MAJOR_VERSION >= 3
7506 {
7507 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
7508 if (!PyDict_GetItemString(modules, "yt.utilities.lib.partitioned_grid")) {
7509 if (unlikely(PyDict_SetItemString(modules, "yt.utilities.lib.partitioned_grid", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
7510 }
7511 }
7512 #endif
7513 /*--- Builtin init code ---*/
7514 if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
7515 /*--- Constants init code ---*/
7516 if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
7517 /*--- Global type/function init code ---*/
7518 (void)__Pyx_modinit_global_init_code();
7519 (void)__Pyx_modinit_variable_export_code();
7520 (void)__Pyx_modinit_function_export_code();
7521 if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
7522 if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
7523 (void)__Pyx_modinit_variable_import_code();
7524 (void)__Pyx_modinit_function_import_code();
7525 /*--- Execution code ---*/
7526 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
7527 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7528 #endif
7529
7530 /* "yt/utilities/lib/partitioned_grid.pyx":15
7531 *
7532 *
7533 * import numpy as np # <<<<<<<<<<<<<<
7534 *
7535 * cimport cython
7536 */
7537 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
7538 __Pyx_GOTREF(__pyx_t_1);
7539 if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
7540 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7541
7542 /* "yt/utilities/lib/partitioned_grid.pyx":1
7543 * # distutils: sources = FIXED_INTERP # <<<<<<<<<<<<<<
7544 * # distutils: include_dirs = LIB_DIR
7545 * # distutils: libraries = STD_LIBS
7546 */
7547 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
7548 __Pyx_GOTREF(__pyx_t_1);
7549 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7550 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7551
7552 /* "volume_container.pxd":65
7553 * return (i*vc.dims[1]+j)*vc.dims[2]+k
7554 *
7555 * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos): # <<<<<<<<<<<<<<
7556 * cdef int index[3]
7557 * cdef int i
7558 */
7559
7560 /*--- Wrapped vars code ---*/
7561
7562 goto __pyx_L0;
7563 __pyx_L1_error:;
7564 __Pyx_XDECREF(__pyx_t_1);
7565 if (__pyx_m) {
7566 if (__pyx_d) {
7567 __Pyx_AddTraceback("init yt.utilities.lib.partitioned_grid", __pyx_clineno, __pyx_lineno, __pyx_filename);
7568 }
7569 Py_CLEAR(__pyx_m);
7570 } else if (!PyErr_Occurred()) {
7571 PyErr_SetString(PyExc_ImportError, "init yt.utilities.lib.partitioned_grid");
7572 }
7573 __pyx_L0:;
7574 __Pyx_RefNannyFinishContext();
7575 #if CYTHON_PEP489_MULTI_PHASE_INIT
7576 return (__pyx_m != NULL) ? 0 : -1;
7577 #elif PY_MAJOR_VERSION >= 3
7578 return __pyx_m;
7579 #else
7580 return;
7581 #endif
7582 }
7583
7584 /* --- Runtime support code --- */
7585 /* Refnanny */
7586 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)7587 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
7588 PyObject *m = NULL, *p = NULL;
7589 void *r = NULL;
7590 m = PyImport_ImportModule(modname);
7591 if (!m) goto end;
7592 p = PyObject_GetAttrString(m, "RefNannyAPI");
7593 if (!p) goto end;
7594 r = PyLong_AsVoidPtr(p);
7595 end:
7596 Py_XDECREF(p);
7597 Py_XDECREF(m);
7598 return (__Pyx_RefNannyAPIStruct *)r;
7599 }
7600 #endif
7601
7602 /* PyObjectGetAttrStr */
7603 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)7604 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
7605 PyTypeObject* tp = Py_TYPE(obj);
7606 if (likely(tp->tp_getattro))
7607 return tp->tp_getattro(obj, attr_name);
7608 #if PY_MAJOR_VERSION < 3
7609 if (likely(tp->tp_getattr))
7610 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
7611 #endif
7612 return PyObject_GetAttr(obj, attr_name);
7613 }
7614 #endif
7615
7616 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)7617 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
7618 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
7619 if (unlikely(!result)) {
7620 PyErr_Format(PyExc_NameError,
7621 #if PY_MAJOR_VERSION >= 3
7622 "name '%U' is not defined", name);
7623 #else
7624 "name '%.200s' is not defined", PyString_AS_STRING(name));
7625 #endif
7626 }
7627 return result;
7628 }
7629
7630 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)7631 static void __Pyx_RaiseArgtupleInvalid(
7632 const char* func_name,
7633 int exact,
7634 Py_ssize_t num_min,
7635 Py_ssize_t num_max,
7636 Py_ssize_t num_found)
7637 {
7638 Py_ssize_t num_expected;
7639 const char *more_or_less;
7640 if (num_found < num_min) {
7641 num_expected = num_min;
7642 more_or_less = "at least";
7643 } else {
7644 num_expected = num_max;
7645 more_or_less = "at most";
7646 }
7647 if (exact) {
7648 more_or_less = "exactly";
7649 }
7650 PyErr_Format(PyExc_TypeError,
7651 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
7652 func_name, more_or_less, num_expected,
7653 (num_expected == 1) ? "" : "s", num_found);
7654 }
7655
7656 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)7657 static void __Pyx_RaiseDoubleKeywordsError(
7658 const char* func_name,
7659 PyObject* kw_name)
7660 {
7661 PyErr_Format(PyExc_TypeError,
7662 #if PY_MAJOR_VERSION >= 3
7663 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
7664 #else
7665 "%s() got multiple values for keyword argument '%s'", func_name,
7666 PyString_AsString(kw_name));
7667 #endif
7668 }
7669
7670 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)7671 static int __Pyx_ParseOptionalKeywords(
7672 PyObject *kwds,
7673 PyObject **argnames[],
7674 PyObject *kwds2,
7675 PyObject *values[],
7676 Py_ssize_t num_pos_args,
7677 const char* function_name)
7678 {
7679 PyObject *key = 0, *value = 0;
7680 Py_ssize_t pos = 0;
7681 PyObject*** name;
7682 PyObject*** first_kw_arg = argnames + num_pos_args;
7683 while (PyDict_Next(kwds, &pos, &key, &value)) {
7684 name = first_kw_arg;
7685 while (*name && (**name != key)) name++;
7686 if (*name) {
7687 values[name-argnames] = value;
7688 continue;
7689 }
7690 name = first_kw_arg;
7691 #if PY_MAJOR_VERSION < 3
7692 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
7693 while (*name) {
7694 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
7695 && _PyString_Eq(**name, key)) {
7696 values[name-argnames] = value;
7697 break;
7698 }
7699 name++;
7700 }
7701 if (*name) continue;
7702 else {
7703 PyObject*** argname = argnames;
7704 while (argname != first_kw_arg) {
7705 if ((**argname == key) || (
7706 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
7707 && _PyString_Eq(**argname, key))) {
7708 goto arg_passed_twice;
7709 }
7710 argname++;
7711 }
7712 }
7713 } else
7714 #endif
7715 if (likely(PyUnicode_Check(key))) {
7716 while (*name) {
7717 int cmp = (**name == key) ? 0 :
7718 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
7719 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
7720 #endif
7721 PyUnicode_Compare(**name, key);
7722 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
7723 if (cmp == 0) {
7724 values[name-argnames] = value;
7725 break;
7726 }
7727 name++;
7728 }
7729 if (*name) continue;
7730 else {
7731 PyObject*** argname = argnames;
7732 while (argname != first_kw_arg) {
7733 int cmp = (**argname == key) ? 0 :
7734 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
7735 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
7736 #endif
7737 PyUnicode_Compare(**argname, key);
7738 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
7739 if (cmp == 0) goto arg_passed_twice;
7740 argname++;
7741 }
7742 }
7743 } else
7744 goto invalid_keyword_type;
7745 if (kwds2) {
7746 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
7747 } else {
7748 goto invalid_keyword;
7749 }
7750 }
7751 return 0;
7752 arg_passed_twice:
7753 __Pyx_RaiseDoubleKeywordsError(function_name, key);
7754 goto bad;
7755 invalid_keyword_type:
7756 PyErr_Format(PyExc_TypeError,
7757 "%.200s() keywords must be strings", function_name);
7758 goto bad;
7759 invalid_keyword:
7760 PyErr_Format(PyExc_TypeError,
7761 #if PY_MAJOR_VERSION < 3
7762 "%.200s() got an unexpected keyword argument '%.200s'",
7763 function_name, PyString_AsString(key));
7764 #else
7765 "%s() got an unexpected keyword argument '%U'",
7766 function_name, key);
7767 #endif
7768 bad:
7769 return -1;
7770 }
7771
7772 /* ArgTypeTest */
__Pyx__ArgTypeTest(PyObject * obj,PyTypeObject * type,const char * name,int exact)7773 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
7774 {
7775 if (unlikely(!type)) {
7776 PyErr_SetString(PyExc_SystemError, "Missing type object");
7777 return 0;
7778 }
7779 else if (exact) {
7780 #if PY_MAJOR_VERSION == 2
7781 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
7782 #endif
7783 }
7784 else {
7785 if (likely(__Pyx_TypeCheck(obj, type))) return 1;
7786 }
7787 PyErr_Format(PyExc_TypeError,
7788 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
7789 name, type->tp_name, Py_TYPE(obj)->tp_name);
7790 return 0;
7791 }
7792
7793 /* IsLittleEndian */
__Pyx_Is_Little_Endian(void)7794 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
7795 {
7796 union {
7797 uint32_t u32;
7798 uint8_t u8[4];
7799 } S;
7800 S.u32 = 0x01020304;
7801 return S.u8[0] == 4;
7802 }
7803
7804 /* BufferFormatCheck */
__Pyx_BufFmt_Init(__Pyx_BufFmt_Context * ctx,__Pyx_BufFmt_StackElem * stack,__Pyx_TypeInfo * type)7805 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
7806 __Pyx_BufFmt_StackElem* stack,
7807 __Pyx_TypeInfo* type) {
7808 stack[0].field = &ctx->root;
7809 stack[0].parent_offset = 0;
7810 ctx->root.type = type;
7811 ctx->root.name = "buffer dtype";
7812 ctx->root.offset = 0;
7813 ctx->head = stack;
7814 ctx->head->field = &ctx->root;
7815 ctx->fmt_offset = 0;
7816 ctx->head->parent_offset = 0;
7817 ctx->new_packmode = '@';
7818 ctx->enc_packmode = '@';
7819 ctx->new_count = 1;
7820 ctx->enc_count = 0;
7821 ctx->enc_type = 0;
7822 ctx->is_complex = 0;
7823 ctx->is_valid_array = 0;
7824 ctx->struct_alignment = 0;
7825 while (type->typegroup == 'S') {
7826 ++ctx->head;
7827 ctx->head->field = type->fields;
7828 ctx->head->parent_offset = 0;
7829 type = type->fields->type;
7830 }
7831 }
__Pyx_BufFmt_ParseNumber(const char ** ts)7832 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
7833 int count;
7834 const char* t = *ts;
7835 if (*t < '0' || *t > '9') {
7836 return -1;
7837 } else {
7838 count = *t++ - '0';
7839 while (*t >= '0' && *t <= '9') {
7840 count *= 10;
7841 count += *t++ - '0';
7842 }
7843 }
7844 *ts = t;
7845 return count;
7846 }
__Pyx_BufFmt_ExpectNumber(const char ** ts)7847 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
7848 int number = __Pyx_BufFmt_ParseNumber(ts);
7849 if (number == -1)
7850 PyErr_Format(PyExc_ValueError,\
7851 "Does not understand character buffer dtype format string ('%c')", **ts);
7852 return number;
7853 }
__Pyx_BufFmt_RaiseUnexpectedChar(char ch)7854 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
7855 PyErr_Format(PyExc_ValueError,
7856 "Unexpected format string character: '%c'", ch);
7857 }
__Pyx_BufFmt_DescribeTypeChar(char ch,int is_complex)7858 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
7859 switch (ch) {
7860 case 'c': return "'char'";
7861 case 'b': return "'signed char'";
7862 case 'B': return "'unsigned char'";
7863 case 'h': return "'short'";
7864 case 'H': return "'unsigned short'";
7865 case 'i': return "'int'";
7866 case 'I': return "'unsigned int'";
7867 case 'l': return "'long'";
7868 case 'L': return "'unsigned long'";
7869 case 'q': return "'long long'";
7870 case 'Q': return "'unsigned long long'";
7871 case 'f': return (is_complex ? "'complex float'" : "'float'");
7872 case 'd': return (is_complex ? "'complex double'" : "'double'");
7873 case 'g': return (is_complex ? "'complex long double'" : "'long double'");
7874 case 'T': return "a struct";
7875 case 'O': return "Python object";
7876 case 'P': return "a pointer";
7877 case 's': case 'p': return "a string";
7878 case 0: return "end";
7879 default: return "unparseable format string";
7880 }
7881 }
__Pyx_BufFmt_TypeCharToStandardSize(char ch,int is_complex)7882 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
7883 switch (ch) {
7884 case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
7885 case 'h': case 'H': return 2;
7886 case 'i': case 'I': case 'l': case 'L': return 4;
7887 case 'q': case 'Q': return 8;
7888 case 'f': return (is_complex ? 8 : 4);
7889 case 'd': return (is_complex ? 16 : 8);
7890 case 'g': {
7891 PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
7892 return 0;
7893 }
7894 case 'O': case 'P': return sizeof(void*);
7895 default:
7896 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
7897 return 0;
7898 }
7899 }
__Pyx_BufFmt_TypeCharToNativeSize(char ch,int is_complex)7900 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
7901 switch (ch) {
7902 case 'c': case 'b': case 'B': case 's': case 'p': return 1;
7903 case 'h': case 'H': return sizeof(short);
7904 case 'i': case 'I': return sizeof(int);
7905 case 'l': case 'L': return sizeof(long);
7906 #ifdef HAVE_LONG_LONG
7907 case 'q': case 'Q': return sizeof(PY_LONG_LONG);
7908 #endif
7909 case 'f': return sizeof(float) * (is_complex ? 2 : 1);
7910 case 'd': return sizeof(double) * (is_complex ? 2 : 1);
7911 case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
7912 case 'O': case 'P': return sizeof(void*);
7913 default: {
7914 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
7915 return 0;
7916 }
7917 }
7918 }
7919 typedef struct { char c; short x; } __Pyx_st_short;
7920 typedef struct { char c; int x; } __Pyx_st_int;
7921 typedef struct { char c; long x; } __Pyx_st_long;
7922 typedef struct { char c; float x; } __Pyx_st_float;
7923 typedef struct { char c; double x; } __Pyx_st_double;
7924 typedef struct { char c; long double x; } __Pyx_st_longdouble;
7925 typedef struct { char c; void *x; } __Pyx_st_void_p;
7926 #ifdef HAVE_LONG_LONG
7927 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
7928 #endif
__Pyx_BufFmt_TypeCharToAlignment(char ch,CYTHON_UNUSED int is_complex)7929 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
7930 switch (ch) {
7931 case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
7932 case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
7933 case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
7934 case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
7935 #ifdef HAVE_LONG_LONG
7936 case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
7937 #endif
7938 case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
7939 case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
7940 case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
7941 case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
7942 default:
7943 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
7944 return 0;
7945 }
7946 }
7947 /* These are for computing the padding at the end of the struct to align
7948 on the first member of the struct. This will probably the same as above,
7949 but we don't have any guarantees.
7950 */
7951 typedef struct { short x; char c; } __Pyx_pad_short;
7952 typedef struct { int x; char c; } __Pyx_pad_int;
7953 typedef struct { long x; char c; } __Pyx_pad_long;
7954 typedef struct { float x; char c; } __Pyx_pad_float;
7955 typedef struct { double x; char c; } __Pyx_pad_double;
7956 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
7957 typedef struct { void *x; char c; } __Pyx_pad_void_p;
7958 #ifdef HAVE_LONG_LONG
7959 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
7960 #endif
__Pyx_BufFmt_TypeCharToPadding(char ch,CYTHON_UNUSED int is_complex)7961 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
7962 switch (ch) {
7963 case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
7964 case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
7965 case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
7966 case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
7967 #ifdef HAVE_LONG_LONG
7968 case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
7969 #endif
7970 case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
7971 case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
7972 case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
7973 case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
7974 default:
7975 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
7976 return 0;
7977 }
7978 }
__Pyx_BufFmt_TypeCharToGroup(char ch,int is_complex)7979 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
7980 switch (ch) {
7981 case 'c':
7982 return 'H';
7983 case 'b': case 'h': case 'i':
7984 case 'l': case 'q': case 's': case 'p':
7985 return 'I';
7986 case 'B': case 'H': case 'I': case 'L': case 'Q':
7987 return 'U';
7988 case 'f': case 'd': case 'g':
7989 return (is_complex ? 'C' : 'R');
7990 case 'O':
7991 return 'O';
7992 case 'P':
7993 return 'P';
7994 default: {
7995 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
7996 return 0;
7997 }
7998 }
7999 }
__Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context * ctx)8000 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
8001 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
8002 const char* expected;
8003 const char* quote;
8004 if (ctx->head == NULL) {
8005 expected = "end";
8006 quote = "";
8007 } else {
8008 expected = ctx->head->field->type->name;
8009 quote = "'";
8010 }
8011 PyErr_Format(PyExc_ValueError,
8012 "Buffer dtype mismatch, expected %s%s%s but got %s",
8013 quote, expected, quote,
8014 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
8015 } else {
8016 __Pyx_StructField* field = ctx->head->field;
8017 __Pyx_StructField* parent = (ctx->head - 1)->field;
8018 PyErr_Format(PyExc_ValueError,
8019 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
8020 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
8021 parent->type->name, field->name);
8022 }
8023 }
__Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context * ctx)8024 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
8025 char group;
8026 size_t size, offset, arraysize = 1;
8027 if (ctx->enc_type == 0) return 0;
8028 if (ctx->head->field->type->arraysize[0]) {
8029 int i, ndim = 0;
8030 if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
8031 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
8032 ndim = 1;
8033 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
8034 PyErr_Format(PyExc_ValueError,
8035 "Expected a dimension of size %zu, got %zu",
8036 ctx->head->field->type->arraysize[0], ctx->enc_count);
8037 return -1;
8038 }
8039 }
8040 if (!ctx->is_valid_array) {
8041 PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
8042 ctx->head->field->type->ndim, ndim);
8043 return -1;
8044 }
8045 for (i = 0; i < ctx->head->field->type->ndim; i++) {
8046 arraysize *= ctx->head->field->type->arraysize[i];
8047 }
8048 ctx->is_valid_array = 0;
8049 ctx->enc_count = 1;
8050 }
8051 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
8052 do {
8053 __Pyx_StructField* field = ctx->head->field;
8054 __Pyx_TypeInfo* type = field->type;
8055 if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
8056 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
8057 } else {
8058 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
8059 }
8060 if (ctx->enc_packmode == '@') {
8061 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
8062 size_t align_mod_offset;
8063 if (align_at == 0) return -1;
8064 align_mod_offset = ctx->fmt_offset % align_at;
8065 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
8066 if (ctx->struct_alignment == 0)
8067 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
8068 ctx->is_complex);
8069 }
8070 if (type->size != size || type->typegroup != group) {
8071 if (type->typegroup == 'C' && type->fields != NULL) {
8072 size_t parent_offset = ctx->head->parent_offset + field->offset;
8073 ++ctx->head;
8074 ctx->head->field = type->fields;
8075 ctx->head->parent_offset = parent_offset;
8076 continue;
8077 }
8078 if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
8079 } else {
8080 __Pyx_BufFmt_RaiseExpected(ctx);
8081 return -1;
8082 }
8083 }
8084 offset = ctx->head->parent_offset + field->offset;
8085 if (ctx->fmt_offset != offset) {
8086 PyErr_Format(PyExc_ValueError,
8087 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
8088 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
8089 return -1;
8090 }
8091 ctx->fmt_offset += size;
8092 if (arraysize)
8093 ctx->fmt_offset += (arraysize - 1) * size;
8094 --ctx->enc_count;
8095 while (1) {
8096 if (field == &ctx->root) {
8097 ctx->head = NULL;
8098 if (ctx->enc_count != 0) {
8099 __Pyx_BufFmt_RaiseExpected(ctx);
8100 return -1;
8101 }
8102 break;
8103 }
8104 ctx->head->field = ++field;
8105 if (field->type == NULL) {
8106 --ctx->head;
8107 field = ctx->head->field;
8108 continue;
8109 } else if (field->type->typegroup == 'S') {
8110 size_t parent_offset = ctx->head->parent_offset + field->offset;
8111 if (field->type->fields->type == NULL) continue;
8112 field = field->type->fields;
8113 ++ctx->head;
8114 ctx->head->field = field;
8115 ctx->head->parent_offset = parent_offset;
8116 break;
8117 } else {
8118 break;
8119 }
8120 }
8121 } while (ctx->enc_count);
8122 ctx->enc_type = 0;
8123 ctx->is_complex = 0;
8124 return 0;
8125 }
8126 static PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context * ctx,const char ** tsp)8127 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
8128 {
8129 const char *ts = *tsp;
8130 int i = 0, number;
8131 int ndim = ctx->head->field->type->ndim;
8132 ;
8133 ++ts;
8134 if (ctx->new_count != 1) {
8135 PyErr_SetString(PyExc_ValueError,
8136 "Cannot handle repeated arrays in format string");
8137 return NULL;
8138 }
8139 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
8140 while (*ts && *ts != ')') {
8141 switch (*ts) {
8142 case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
8143 default: break;
8144 }
8145 number = __Pyx_BufFmt_ExpectNumber(&ts);
8146 if (number == -1) return NULL;
8147 if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
8148 return PyErr_Format(PyExc_ValueError,
8149 "Expected a dimension of size %zu, got %d",
8150 ctx->head->field->type->arraysize[i], number);
8151 if (*ts != ',' && *ts != ')')
8152 return PyErr_Format(PyExc_ValueError,
8153 "Expected a comma in format string, got '%c'", *ts);
8154 if (*ts == ',') ts++;
8155 i++;
8156 }
8157 if (i != ndim)
8158 return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
8159 ctx->head->field->type->ndim, i);
8160 if (!*ts) {
8161 PyErr_SetString(PyExc_ValueError,
8162 "Unexpected end of format string, expected ')'");
8163 return NULL;
8164 }
8165 ctx->is_valid_array = 1;
8166 ctx->new_count = 1;
8167 *tsp = ++ts;
8168 return Py_None;
8169 }
__Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context * ctx,const char * ts)8170 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
8171 int got_Z = 0;
8172 while (1) {
8173 switch(*ts) {
8174 case 0:
8175 if (ctx->enc_type != 0 && ctx->head == NULL) {
8176 __Pyx_BufFmt_RaiseExpected(ctx);
8177 return NULL;
8178 }
8179 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
8180 if (ctx->head != NULL) {
8181 __Pyx_BufFmt_RaiseExpected(ctx);
8182 return NULL;
8183 }
8184 return ts;
8185 case ' ':
8186 case '\r':
8187 case '\n':
8188 ++ts;
8189 break;
8190 case '<':
8191 if (!__Pyx_Is_Little_Endian()) {
8192 PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
8193 return NULL;
8194 }
8195 ctx->new_packmode = '=';
8196 ++ts;
8197 break;
8198 case '>':
8199 case '!':
8200 if (__Pyx_Is_Little_Endian()) {
8201 PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
8202 return NULL;
8203 }
8204 ctx->new_packmode = '=';
8205 ++ts;
8206 break;
8207 case '=':
8208 case '@':
8209 case '^':
8210 ctx->new_packmode = *ts++;
8211 break;
8212 case 'T':
8213 {
8214 const char* ts_after_sub;
8215 size_t i, struct_count = ctx->new_count;
8216 size_t struct_alignment = ctx->struct_alignment;
8217 ctx->new_count = 1;
8218 ++ts;
8219 if (*ts != '{') {
8220 PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
8221 return NULL;
8222 }
8223 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
8224 ctx->enc_type = 0;
8225 ctx->enc_count = 0;
8226 ctx->struct_alignment = 0;
8227 ++ts;
8228 ts_after_sub = ts;
8229 for (i = 0; i != struct_count; ++i) {
8230 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
8231 if (!ts_after_sub) return NULL;
8232 }
8233 ts = ts_after_sub;
8234 if (struct_alignment) ctx->struct_alignment = struct_alignment;
8235 }
8236 break;
8237 case '}':
8238 {
8239 size_t alignment = ctx->struct_alignment;
8240 ++ts;
8241 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
8242 ctx->enc_type = 0;
8243 if (alignment && ctx->fmt_offset % alignment) {
8244 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
8245 }
8246 }
8247 return ts;
8248 case 'x':
8249 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
8250 ctx->fmt_offset += ctx->new_count;
8251 ctx->new_count = 1;
8252 ctx->enc_count = 0;
8253 ctx->enc_type = 0;
8254 ctx->enc_packmode = ctx->new_packmode;
8255 ++ts;
8256 break;
8257 case 'Z':
8258 got_Z = 1;
8259 ++ts;
8260 if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
8261 __Pyx_BufFmt_RaiseUnexpectedChar('Z');
8262 return NULL;
8263 }
8264 CYTHON_FALLTHROUGH;
8265 case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
8266 case 'l': case 'L': case 'q': case 'Q':
8267 case 'f': case 'd': case 'g':
8268 case 'O': case 'p':
8269 if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
8270 ctx->enc_packmode == ctx->new_packmode) {
8271 ctx->enc_count += ctx->new_count;
8272 ctx->new_count = 1;
8273 got_Z = 0;
8274 ++ts;
8275 break;
8276 }
8277 CYTHON_FALLTHROUGH;
8278 case 's':
8279 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
8280 ctx->enc_count = ctx->new_count;
8281 ctx->enc_packmode = ctx->new_packmode;
8282 ctx->enc_type = *ts;
8283 ctx->is_complex = got_Z;
8284 ++ts;
8285 ctx->new_count = 1;
8286 got_Z = 0;
8287 break;
8288 case ':':
8289 ++ts;
8290 while(*ts != ':') ++ts;
8291 ++ts;
8292 break;
8293 case '(':
8294 if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
8295 break;
8296 default:
8297 {
8298 int number = __Pyx_BufFmt_ExpectNumber(&ts);
8299 if (number == -1) return NULL;
8300 ctx->new_count = (size_t)number;
8301 }
8302 }
8303 }
8304 }
8305
8306 /* BufferGetAndValidate */
__Pyx_SafeReleaseBuffer(Py_buffer * info)8307 static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
8308 if (unlikely(info->buf == NULL)) return;
8309 if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
8310 __Pyx_ReleaseBuffer(info);
8311 }
__Pyx_ZeroBuffer(Py_buffer * buf)8312 static void __Pyx_ZeroBuffer(Py_buffer* buf) {
8313 buf->buf = NULL;
8314 buf->obj = NULL;
8315 buf->strides = __Pyx_zeros;
8316 buf->shape = __Pyx_zeros;
8317 buf->suboffsets = __Pyx_minusones;
8318 }
__Pyx__GetBufferAndValidate(Py_buffer * buf,PyObject * obj,__Pyx_TypeInfo * dtype,int flags,int nd,int cast,__Pyx_BufFmt_StackElem * stack)8319 static int __Pyx__GetBufferAndValidate(
8320 Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags,
8321 int nd, int cast, __Pyx_BufFmt_StackElem* stack)
8322 {
8323 buf->buf = NULL;
8324 if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
8325 __Pyx_ZeroBuffer(buf);
8326 return -1;
8327 }
8328 if (unlikely(buf->ndim != nd)) {
8329 PyErr_Format(PyExc_ValueError,
8330 "Buffer has wrong number of dimensions (expected %d, got %d)",
8331 nd, buf->ndim);
8332 goto fail;
8333 }
8334 if (!cast) {
8335 __Pyx_BufFmt_Context ctx;
8336 __Pyx_BufFmt_Init(&ctx, stack, dtype);
8337 if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
8338 }
8339 if (unlikely((size_t)buf->itemsize != dtype->size)) {
8340 PyErr_Format(PyExc_ValueError,
8341 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
8342 buf->itemsize, (buf->itemsize > 1) ? "s" : "",
8343 dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
8344 goto fail;
8345 }
8346 if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
8347 return 0;
8348 fail:;
8349 __Pyx_SafeReleaseBuffer(buf);
8350 return -1;
8351 }
8352
8353 /* ExtTypeTest */
__Pyx_TypeTest(PyObject * obj,PyTypeObject * type)8354 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
8355 if (unlikely(!type)) {
8356 PyErr_SetString(PyExc_SystemError, "Missing type object");
8357 return 0;
8358 }
8359 if (likely(__Pyx_TypeCheck(obj, type)))
8360 return 1;
8361 PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
8362 Py_TYPE(obj)->tp_name, type->tp_name);
8363 return 0;
8364 }
8365
8366 /* BufferFallbackError */
__Pyx_RaiseBufferFallbackError(void)8367 static void __Pyx_RaiseBufferFallbackError(void) {
8368 PyErr_SetString(PyExc_ValueError,
8369 "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
8370 }
8371
8372 /* GetItemInt */
__Pyx_GetItemInt_Generic(PyObject * o,PyObject * j)8373 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
8374 PyObject *r;
8375 if (!j) return NULL;
8376 r = PyObject_GetItem(o, j);
8377 Py_DECREF(j);
8378 return r;
8379 }
__Pyx_GetItemInt_List_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)8380 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
8381 CYTHON_NCP_UNUSED int wraparound,
8382 CYTHON_NCP_UNUSED int boundscheck) {
8383 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8384 Py_ssize_t wrapped_i = i;
8385 if (wraparound & unlikely(i < 0)) {
8386 wrapped_i += PyList_GET_SIZE(o);
8387 }
8388 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
8389 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
8390 Py_INCREF(r);
8391 return r;
8392 }
8393 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
8394 #else
8395 return PySequence_GetItem(o, i);
8396 #endif
8397 }
__Pyx_GetItemInt_Tuple_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)8398 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
8399 CYTHON_NCP_UNUSED int wraparound,
8400 CYTHON_NCP_UNUSED int boundscheck) {
8401 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8402 Py_ssize_t wrapped_i = i;
8403 if (wraparound & unlikely(i < 0)) {
8404 wrapped_i += PyTuple_GET_SIZE(o);
8405 }
8406 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
8407 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
8408 Py_INCREF(r);
8409 return r;
8410 }
8411 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
8412 #else
8413 return PySequence_GetItem(o, i);
8414 #endif
8415 }
__Pyx_GetItemInt_Fast(PyObject * o,Py_ssize_t i,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)8416 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
8417 CYTHON_NCP_UNUSED int wraparound,
8418 CYTHON_NCP_UNUSED int boundscheck) {
8419 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
8420 if (is_list || PyList_CheckExact(o)) {
8421 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
8422 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
8423 PyObject *r = PyList_GET_ITEM(o, n);
8424 Py_INCREF(r);
8425 return r;
8426 }
8427 }
8428 else if (PyTuple_CheckExact(o)) {
8429 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
8430 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
8431 PyObject *r = PyTuple_GET_ITEM(o, n);
8432 Py_INCREF(r);
8433 return r;
8434 }
8435 } else {
8436 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
8437 if (likely(m && m->sq_item)) {
8438 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
8439 Py_ssize_t l = m->sq_length(o);
8440 if (likely(l >= 0)) {
8441 i += l;
8442 } else {
8443 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
8444 return NULL;
8445 PyErr_Clear();
8446 }
8447 }
8448 return m->sq_item(o, i);
8449 }
8450 }
8451 #else
8452 if (is_list || PySequence_Check(o)) {
8453 return PySequence_GetItem(o, i);
8454 }
8455 #endif
8456 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
8457 }
8458
8459 /* PyErrFetchRestore */
8460 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)8461 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
8462 PyObject *tmp_type, *tmp_value, *tmp_tb;
8463 tmp_type = tstate->curexc_type;
8464 tmp_value = tstate->curexc_value;
8465 tmp_tb = tstate->curexc_traceback;
8466 tstate->curexc_type = type;
8467 tstate->curexc_value = value;
8468 tstate->curexc_traceback = tb;
8469 Py_XDECREF(tmp_type);
8470 Py_XDECREF(tmp_value);
8471 Py_XDECREF(tmp_tb);
8472 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)8473 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
8474 *type = tstate->curexc_type;
8475 *value = tstate->curexc_value;
8476 *tb = tstate->curexc_traceback;
8477 tstate->curexc_type = 0;
8478 tstate->curexc_value = 0;
8479 tstate->curexc_traceback = 0;
8480 }
8481 #endif
8482
8483 /* SetItemInt */
__Pyx_SetItemInt_Generic(PyObject * o,PyObject * j,PyObject * v)8484 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
8485 int r;
8486 if (!j) return -1;
8487 r = PyObject_SetItem(o, j, v);
8488 Py_DECREF(j);
8489 return r;
8490 }
__Pyx_SetItemInt_Fast(PyObject * o,Py_ssize_t i,PyObject * v,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)8491 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
8492 CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
8493 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
8494 if (is_list || PyList_CheckExact(o)) {
8495 Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
8496 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
8497 PyObject* old = PyList_GET_ITEM(o, n);
8498 Py_INCREF(v);
8499 PyList_SET_ITEM(o, n, v);
8500 Py_DECREF(old);
8501 return 1;
8502 }
8503 } else {
8504 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
8505 if (likely(m && m->sq_ass_item)) {
8506 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
8507 Py_ssize_t l = m->sq_length(o);
8508 if (likely(l >= 0)) {
8509 i += l;
8510 } else {
8511 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
8512 return -1;
8513 PyErr_Clear();
8514 }
8515 }
8516 return m->sq_ass_item(o, i, v);
8517 }
8518 }
8519 #else
8520 #if CYTHON_COMPILING_IN_PYPY
8521 if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
8522 #else
8523 if (is_list || PySequence_Check(o))
8524 #endif
8525 {
8526 return PySequence_SetItem(o, i, v);
8527 }
8528 #endif
8529 return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
8530 }
8531
8532 /* PyDictVersioning */
8533 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)8534 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
8535 PyObject *dict = Py_TYPE(obj)->tp_dict;
8536 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
8537 }
__Pyx_get_object_dict_version(PyObject * obj)8538 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
8539 PyObject **dictptr = NULL;
8540 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
8541 if (offset) {
8542 #if CYTHON_COMPILING_IN_CPYTHON
8543 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
8544 #else
8545 dictptr = _PyObject_GetDictPtr(obj);
8546 #endif
8547 }
8548 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
8549 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)8550 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
8551 PyObject *dict = Py_TYPE(obj)->tp_dict;
8552 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
8553 return 0;
8554 return obj_dict_version == __Pyx_get_object_dict_version(obj);
8555 }
8556 #endif
8557
8558 /* GetModuleGlobalName */
8559 #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)8560 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
8561 #else
8562 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
8563 #endif
8564 {
8565 PyObject *result;
8566 #if !CYTHON_AVOID_BORROWED_REFS
8567 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
8568 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
8569 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
8570 if (likely(result)) {
8571 return __Pyx_NewRef(result);
8572 } else if (unlikely(PyErr_Occurred())) {
8573 return NULL;
8574 }
8575 #else
8576 result = PyDict_GetItem(__pyx_d, name);
8577 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
8578 if (likely(result)) {
8579 return __Pyx_NewRef(result);
8580 }
8581 #endif
8582 #else
8583 result = PyObject_GetItem(__pyx_d, name);
8584 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
8585 if (likely(result)) {
8586 return __Pyx_NewRef(result);
8587 }
8588 PyErr_Clear();
8589 #endif
8590 return __Pyx_GetBuiltinName(name);
8591 }
8592
8593 /* PyCFunctionFastCall */
8594 #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)8595 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
8596 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
8597 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
8598 PyObject *self = PyCFunction_GET_SELF(func);
8599 int flags = PyCFunction_GET_FLAGS(func);
8600 assert(PyCFunction_Check(func));
8601 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
8602 assert(nargs >= 0);
8603 assert(nargs == 0 || args != NULL);
8604 /* _PyCFunction_FastCallDict() must not be called with an exception set,
8605 because it may clear it (directly or indirectly) and so the
8606 caller loses its exception */
8607 assert(!PyErr_Occurred());
8608 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
8609 return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
8610 } else {
8611 return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
8612 }
8613 }
8614 #endif
8615
8616 /* PyFunctionFastCall */
8617 #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)8618 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
8619 PyObject *globals) {
8620 PyFrameObject *f;
8621 PyThreadState *tstate = __Pyx_PyThreadState_Current;
8622 PyObject **fastlocals;
8623 Py_ssize_t i;
8624 PyObject *result;
8625 assert(globals != NULL);
8626 /* XXX Perhaps we should create a specialized
8627 PyFrame_New() that doesn't take locals, but does
8628 take builtins without sanity checking them.
8629 */
8630 assert(tstate != NULL);
8631 f = PyFrame_New(tstate, co, globals, NULL);
8632 if (f == NULL) {
8633 return NULL;
8634 }
8635 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
8636 for (i = 0; i < na; i++) {
8637 Py_INCREF(*args);
8638 fastlocals[i] = *args++;
8639 }
8640 result = PyEval_EvalFrameEx(f,0);
8641 ++tstate->recursion_depth;
8642 Py_DECREF(f);
8643 --tstate->recursion_depth;
8644 return result;
8645 }
8646 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)8647 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
8648 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
8649 PyObject *globals = PyFunction_GET_GLOBALS(func);
8650 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
8651 PyObject *closure;
8652 #if PY_MAJOR_VERSION >= 3
8653 PyObject *kwdefs;
8654 #endif
8655 PyObject *kwtuple, **k;
8656 PyObject **d;
8657 Py_ssize_t nd;
8658 Py_ssize_t nk;
8659 PyObject *result;
8660 assert(kwargs == NULL || PyDict_Check(kwargs));
8661 nk = kwargs ? PyDict_Size(kwargs) : 0;
8662 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
8663 return NULL;
8664 }
8665 if (
8666 #if PY_MAJOR_VERSION >= 3
8667 co->co_kwonlyargcount == 0 &&
8668 #endif
8669 likely(kwargs == NULL || nk == 0) &&
8670 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
8671 if (argdefs == NULL && co->co_argcount == nargs) {
8672 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
8673 goto done;
8674 }
8675 else if (nargs == 0 && argdefs != NULL
8676 && co->co_argcount == Py_SIZE(argdefs)) {
8677 /* function called with no arguments, but all parameters have
8678 a default value: use default values as arguments .*/
8679 args = &PyTuple_GET_ITEM(argdefs, 0);
8680 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
8681 goto done;
8682 }
8683 }
8684 if (kwargs != NULL) {
8685 Py_ssize_t pos, i;
8686 kwtuple = PyTuple_New(2 * nk);
8687 if (kwtuple == NULL) {
8688 result = NULL;
8689 goto done;
8690 }
8691 k = &PyTuple_GET_ITEM(kwtuple, 0);
8692 pos = i = 0;
8693 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
8694 Py_INCREF(k[i]);
8695 Py_INCREF(k[i+1]);
8696 i += 2;
8697 }
8698 nk = i / 2;
8699 }
8700 else {
8701 kwtuple = NULL;
8702 k = NULL;
8703 }
8704 closure = PyFunction_GET_CLOSURE(func);
8705 #if PY_MAJOR_VERSION >= 3
8706 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
8707 #endif
8708 if (argdefs != NULL) {
8709 d = &PyTuple_GET_ITEM(argdefs, 0);
8710 nd = Py_SIZE(argdefs);
8711 }
8712 else {
8713 d = NULL;
8714 nd = 0;
8715 }
8716 #if PY_MAJOR_VERSION >= 3
8717 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
8718 args, (int)nargs,
8719 k, (int)nk,
8720 d, (int)nd, kwdefs, closure);
8721 #else
8722 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
8723 args, (int)nargs,
8724 k, (int)nk,
8725 d, (int)nd, closure);
8726 #endif
8727 Py_XDECREF(kwtuple);
8728 done:
8729 Py_LeaveRecursiveCall();
8730 return result;
8731 }
8732 #endif
8733 #endif
8734
8735 /* PyObjectCall */
8736 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)8737 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
8738 PyObject *result;
8739 ternaryfunc call = func->ob_type->tp_call;
8740 if (unlikely(!call))
8741 return PyObject_Call(func, arg, kw);
8742 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
8743 return NULL;
8744 result = (*call)(func, arg, kw);
8745 Py_LeaveRecursiveCall();
8746 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
8747 PyErr_SetString(
8748 PyExc_SystemError,
8749 "NULL result without error in PyObject_Call");
8750 }
8751 return result;
8752 }
8753 #endif
8754
8755 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)8756 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
8757 PyObject *args, *result = NULL;
8758 #if CYTHON_FAST_PYCALL
8759 if (PyFunction_Check(function)) {
8760 PyObject *args[2] = {arg1, arg2};
8761 return __Pyx_PyFunction_FastCall(function, args, 2);
8762 }
8763 #endif
8764 #if CYTHON_FAST_PYCCALL
8765 if (__Pyx_PyFastCFunction_Check(function)) {
8766 PyObject *args[2] = {arg1, arg2};
8767 return __Pyx_PyCFunction_FastCall(function, args, 2);
8768 }
8769 #endif
8770 args = PyTuple_New(2);
8771 if (unlikely(!args)) goto done;
8772 Py_INCREF(arg1);
8773 PyTuple_SET_ITEM(args, 0, arg1);
8774 Py_INCREF(arg2);
8775 PyTuple_SET_ITEM(args, 1, arg2);
8776 Py_INCREF(function);
8777 result = __Pyx_PyObject_Call(function, args, NULL);
8778 Py_DECREF(args);
8779 Py_DECREF(function);
8780 done:
8781 return result;
8782 }
8783
8784 /* PyObjectCallMethO */
8785 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)8786 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
8787 PyObject *self, *result;
8788 PyCFunction cfunc;
8789 cfunc = PyCFunction_GET_FUNCTION(func);
8790 self = PyCFunction_GET_SELF(func);
8791 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
8792 return NULL;
8793 result = cfunc(self, arg);
8794 Py_LeaveRecursiveCall();
8795 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
8796 PyErr_SetString(
8797 PyExc_SystemError,
8798 "NULL result without error in PyObject_Call");
8799 }
8800 return result;
8801 }
8802 #endif
8803
8804 /* PyObjectCallOneArg */
8805 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)8806 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
8807 PyObject *result;
8808 PyObject *args = PyTuple_New(1);
8809 if (unlikely(!args)) return NULL;
8810 Py_INCREF(arg);
8811 PyTuple_SET_ITEM(args, 0, arg);
8812 result = __Pyx_PyObject_Call(func, args, NULL);
8813 Py_DECREF(args);
8814 return result;
8815 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)8816 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
8817 #if CYTHON_FAST_PYCALL
8818 if (PyFunction_Check(func)) {
8819 return __Pyx_PyFunction_FastCall(func, &arg, 1);
8820 }
8821 #endif
8822 if (likely(PyCFunction_Check(func))) {
8823 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
8824 return __Pyx_PyObject_CallMethO(func, arg);
8825 #if CYTHON_FAST_PYCCALL
8826 } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
8827 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
8828 #endif
8829 }
8830 }
8831 return __Pyx__PyObject_CallOneArg(func, arg);
8832 }
8833 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)8834 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
8835 PyObject *result;
8836 PyObject *args = PyTuple_Pack(1, arg);
8837 if (unlikely(!args)) return NULL;
8838 result = __Pyx_PyObject_Call(func, args, NULL);
8839 Py_DECREF(args);
8840 return result;
8841 }
8842 #endif
8843
8844 /* WriteUnraisableException */
__Pyx_WriteUnraisable(const char * name,CYTHON_UNUSED int clineno,CYTHON_UNUSED int lineno,CYTHON_UNUSED const char * filename,int full_traceback,CYTHON_UNUSED int nogil)8845 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
8846 CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
8847 int full_traceback, CYTHON_UNUSED int nogil) {
8848 PyObject *old_exc, *old_val, *old_tb;
8849 PyObject *ctx;
8850 __Pyx_PyThreadState_declare
8851 #ifdef WITH_THREAD
8852 PyGILState_STATE state;
8853 if (nogil)
8854 state = PyGILState_Ensure();
8855 #ifdef _MSC_VER
8856 else state = (PyGILState_STATE)-1;
8857 #endif
8858 #endif
8859 __Pyx_PyThreadState_assign
8860 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
8861 if (full_traceback) {
8862 Py_XINCREF(old_exc);
8863 Py_XINCREF(old_val);
8864 Py_XINCREF(old_tb);
8865 __Pyx_ErrRestore(old_exc, old_val, old_tb);
8866 PyErr_PrintEx(1);
8867 }
8868 #if PY_MAJOR_VERSION < 3
8869 ctx = PyString_FromString(name);
8870 #else
8871 ctx = PyUnicode_FromString(name);
8872 #endif
8873 __Pyx_ErrRestore(old_exc, old_val, old_tb);
8874 if (!ctx) {
8875 PyErr_WriteUnraisable(Py_None);
8876 } else {
8877 PyErr_WriteUnraisable(ctx);
8878 Py_DECREF(ctx);
8879 }
8880 #ifdef WITH_THREAD
8881 if (nogil)
8882 PyGILState_Release(state);
8883 #endif
8884 }
8885
8886 /* RaiseException */
8887 #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)8888 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
8889 CYTHON_UNUSED PyObject *cause) {
8890 __Pyx_PyThreadState_declare
8891 Py_XINCREF(type);
8892 if (!value || value == Py_None)
8893 value = NULL;
8894 else
8895 Py_INCREF(value);
8896 if (!tb || tb == Py_None)
8897 tb = NULL;
8898 else {
8899 Py_INCREF(tb);
8900 if (!PyTraceBack_Check(tb)) {
8901 PyErr_SetString(PyExc_TypeError,
8902 "raise: arg 3 must be a traceback or None");
8903 goto raise_error;
8904 }
8905 }
8906 if (PyType_Check(type)) {
8907 #if CYTHON_COMPILING_IN_PYPY
8908 if (!value) {
8909 Py_INCREF(Py_None);
8910 value = Py_None;
8911 }
8912 #endif
8913 PyErr_NormalizeException(&type, &value, &tb);
8914 } else {
8915 if (value) {
8916 PyErr_SetString(PyExc_TypeError,
8917 "instance exception may not have a separate value");
8918 goto raise_error;
8919 }
8920 value = type;
8921 type = (PyObject*) Py_TYPE(type);
8922 Py_INCREF(type);
8923 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
8924 PyErr_SetString(PyExc_TypeError,
8925 "raise: exception class must be a subclass of BaseException");
8926 goto raise_error;
8927 }
8928 }
8929 __Pyx_PyThreadState_assign
8930 __Pyx_ErrRestore(type, value, tb);
8931 return;
8932 raise_error:
8933 Py_XDECREF(value);
8934 Py_XDECREF(type);
8935 Py_XDECREF(tb);
8936 return;
8937 }
8938 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)8939 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
8940 PyObject* owned_instance = NULL;
8941 if (tb == Py_None) {
8942 tb = 0;
8943 } else if (tb && !PyTraceBack_Check(tb)) {
8944 PyErr_SetString(PyExc_TypeError,
8945 "raise: arg 3 must be a traceback or None");
8946 goto bad;
8947 }
8948 if (value == Py_None)
8949 value = 0;
8950 if (PyExceptionInstance_Check(type)) {
8951 if (value) {
8952 PyErr_SetString(PyExc_TypeError,
8953 "instance exception may not have a separate value");
8954 goto bad;
8955 }
8956 value = type;
8957 type = (PyObject*) Py_TYPE(value);
8958 } else if (PyExceptionClass_Check(type)) {
8959 PyObject *instance_class = NULL;
8960 if (value && PyExceptionInstance_Check(value)) {
8961 instance_class = (PyObject*) Py_TYPE(value);
8962 if (instance_class != type) {
8963 int is_subclass = PyObject_IsSubclass(instance_class, type);
8964 if (!is_subclass) {
8965 instance_class = NULL;
8966 } else if (unlikely(is_subclass == -1)) {
8967 goto bad;
8968 } else {
8969 type = instance_class;
8970 }
8971 }
8972 }
8973 if (!instance_class) {
8974 PyObject *args;
8975 if (!value)
8976 args = PyTuple_New(0);
8977 else if (PyTuple_Check(value)) {
8978 Py_INCREF(value);
8979 args = value;
8980 } else
8981 args = PyTuple_Pack(1, value);
8982 if (!args)
8983 goto bad;
8984 owned_instance = PyObject_Call(type, args, NULL);
8985 Py_DECREF(args);
8986 if (!owned_instance)
8987 goto bad;
8988 value = owned_instance;
8989 if (!PyExceptionInstance_Check(value)) {
8990 PyErr_Format(PyExc_TypeError,
8991 "calling %R should have returned an instance of "
8992 "BaseException, not %R",
8993 type, Py_TYPE(value));
8994 goto bad;
8995 }
8996 }
8997 } else {
8998 PyErr_SetString(PyExc_TypeError,
8999 "raise: exception class must be a subclass of BaseException");
9000 goto bad;
9001 }
9002 if (cause) {
9003 PyObject *fixed_cause;
9004 if (cause == Py_None) {
9005 fixed_cause = NULL;
9006 } else if (PyExceptionClass_Check(cause)) {
9007 fixed_cause = PyObject_CallObject(cause, NULL);
9008 if (fixed_cause == NULL)
9009 goto bad;
9010 } else if (PyExceptionInstance_Check(cause)) {
9011 fixed_cause = cause;
9012 Py_INCREF(fixed_cause);
9013 } else {
9014 PyErr_SetString(PyExc_TypeError,
9015 "exception causes must derive from "
9016 "BaseException");
9017 goto bad;
9018 }
9019 PyException_SetCause(value, fixed_cause);
9020 }
9021 PyErr_SetObject(type, value);
9022 if (tb) {
9023 #if CYTHON_COMPILING_IN_PYPY
9024 PyObject *tmp_type, *tmp_value, *tmp_tb;
9025 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
9026 Py_INCREF(tb);
9027 PyErr_Restore(tmp_type, tmp_value, tb);
9028 Py_XDECREF(tmp_tb);
9029 #else
9030 PyThreadState *tstate = __Pyx_PyThreadState_Current;
9031 PyObject* tmp_tb = tstate->curexc_traceback;
9032 if (tb != tmp_tb) {
9033 Py_INCREF(tb);
9034 tstate->curexc_traceback = tb;
9035 Py_XDECREF(tmp_tb);
9036 }
9037 #endif
9038 }
9039 bad:
9040 Py_XDECREF(owned_instance);
9041 return;
9042 }
9043 #endif
9044
9045 /* DictGetItem */
9046 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
__Pyx_PyDict_GetItem(PyObject * d,PyObject * key)9047 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
9048 PyObject *value;
9049 value = PyDict_GetItemWithError(d, key);
9050 if (unlikely(!value)) {
9051 if (!PyErr_Occurred()) {
9052 if (unlikely(PyTuple_Check(key))) {
9053 PyObject* args = PyTuple_Pack(1, key);
9054 if (likely(args)) {
9055 PyErr_SetObject(PyExc_KeyError, args);
9056 Py_DECREF(args);
9057 }
9058 } else {
9059 PyErr_SetObject(PyExc_KeyError, key);
9060 }
9061 }
9062 return NULL;
9063 }
9064 Py_INCREF(value);
9065 return value;
9066 }
9067 #endif
9068
9069 /* RaiseTooManyValuesToUnpack */
__Pyx_RaiseTooManyValuesError(Py_ssize_t expected)9070 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
9071 PyErr_Format(PyExc_ValueError,
9072 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
9073 }
9074
9075 /* RaiseNeedMoreValuesToUnpack */
__Pyx_RaiseNeedMoreValuesError(Py_ssize_t index)9076 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
9077 PyErr_Format(PyExc_ValueError,
9078 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
9079 index, (index == 1) ? "" : "s");
9080 }
9081
9082 /* RaiseNoneIterError */
__Pyx_RaiseNoneNotIterableError(void)9083 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
9084 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
9085 }
9086
9087 /* GetTopmostException */
9088 #if CYTHON_USE_EXC_INFO_STACK
9089 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)9090 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
9091 {
9092 _PyErr_StackItem *exc_info = tstate->exc_info;
9093 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
9094 exc_info->previous_item != NULL)
9095 {
9096 exc_info = exc_info->previous_item;
9097 }
9098 return exc_info;
9099 }
9100 #endif
9101
9102 /* SaveResetException */
9103 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSave(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)9104 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
9105 #if CYTHON_USE_EXC_INFO_STACK
9106 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
9107 *type = exc_info->exc_type;
9108 *value = exc_info->exc_value;
9109 *tb = exc_info->exc_traceback;
9110 #else
9111 *type = tstate->exc_type;
9112 *value = tstate->exc_value;
9113 *tb = tstate->exc_traceback;
9114 #endif
9115 Py_XINCREF(*type);
9116 Py_XINCREF(*value);
9117 Py_XINCREF(*tb);
9118 }
__Pyx__ExceptionReset(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)9119 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
9120 PyObject *tmp_type, *tmp_value, *tmp_tb;
9121 #if CYTHON_USE_EXC_INFO_STACK
9122 _PyErr_StackItem *exc_info = tstate->exc_info;
9123 tmp_type = exc_info->exc_type;
9124 tmp_value = exc_info->exc_value;
9125 tmp_tb = exc_info->exc_traceback;
9126 exc_info->exc_type = type;
9127 exc_info->exc_value = value;
9128 exc_info->exc_traceback = tb;
9129 #else
9130 tmp_type = tstate->exc_type;
9131 tmp_value = tstate->exc_value;
9132 tmp_tb = tstate->exc_traceback;
9133 tstate->exc_type = type;
9134 tstate->exc_value = value;
9135 tstate->exc_traceback = tb;
9136 #endif
9137 Py_XDECREF(tmp_type);
9138 Py_XDECREF(tmp_value);
9139 Py_XDECREF(tmp_tb);
9140 }
9141 #endif
9142
9143 /* PyErrExceptionMatches */
9144 #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)9145 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
9146 Py_ssize_t i, n;
9147 n = PyTuple_GET_SIZE(tuple);
9148 #if PY_MAJOR_VERSION >= 3
9149 for (i=0; i<n; i++) {
9150 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
9151 }
9152 #endif
9153 for (i=0; i<n; i++) {
9154 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
9155 }
9156 return 0;
9157 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)9158 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
9159 PyObject *exc_type = tstate->curexc_type;
9160 if (exc_type == err) return 1;
9161 if (unlikely(!exc_type)) return 0;
9162 if (unlikely(PyTuple_Check(err)))
9163 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
9164 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
9165 }
9166 #endif
9167
9168 /* GetException */
9169 #if CYTHON_FAST_THREAD_STATE
__Pyx__GetException(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)9170 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
9171 #else
9172 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
9173 #endif
9174 {
9175 PyObject *local_type, *local_value, *local_tb;
9176 #if CYTHON_FAST_THREAD_STATE
9177 PyObject *tmp_type, *tmp_value, *tmp_tb;
9178 local_type = tstate->curexc_type;
9179 local_value = tstate->curexc_value;
9180 local_tb = tstate->curexc_traceback;
9181 tstate->curexc_type = 0;
9182 tstate->curexc_value = 0;
9183 tstate->curexc_traceback = 0;
9184 #else
9185 PyErr_Fetch(&local_type, &local_value, &local_tb);
9186 #endif
9187 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
9188 #if CYTHON_FAST_THREAD_STATE
9189 if (unlikely(tstate->curexc_type))
9190 #else
9191 if (unlikely(PyErr_Occurred()))
9192 #endif
9193 goto bad;
9194 #if PY_MAJOR_VERSION >= 3
9195 if (local_tb) {
9196 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
9197 goto bad;
9198 }
9199 #endif
9200 Py_XINCREF(local_tb);
9201 Py_XINCREF(local_type);
9202 Py_XINCREF(local_value);
9203 *type = local_type;
9204 *value = local_value;
9205 *tb = local_tb;
9206 #if CYTHON_FAST_THREAD_STATE
9207 #if CYTHON_USE_EXC_INFO_STACK
9208 {
9209 _PyErr_StackItem *exc_info = tstate->exc_info;
9210 tmp_type = exc_info->exc_type;
9211 tmp_value = exc_info->exc_value;
9212 tmp_tb = exc_info->exc_traceback;
9213 exc_info->exc_type = local_type;
9214 exc_info->exc_value = local_value;
9215 exc_info->exc_traceback = local_tb;
9216 }
9217 #else
9218 tmp_type = tstate->exc_type;
9219 tmp_value = tstate->exc_value;
9220 tmp_tb = tstate->exc_traceback;
9221 tstate->exc_type = local_type;
9222 tstate->exc_value = local_value;
9223 tstate->exc_traceback = local_tb;
9224 #endif
9225 Py_XDECREF(tmp_type);
9226 Py_XDECREF(tmp_value);
9227 Py_XDECREF(tmp_tb);
9228 #else
9229 PyErr_SetExcInfo(local_type, local_value, local_tb);
9230 #endif
9231 return 0;
9232 bad:
9233 *type = 0;
9234 *value = 0;
9235 *tb = 0;
9236 Py_XDECREF(local_type);
9237 Py_XDECREF(local_value);
9238 Py_XDECREF(local_tb);
9239 return -1;
9240 }
9241
9242 /* PyObject_GenericGetAttrNoDict */
9243 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_RaiseGenericGetAttributeError(PyTypeObject * tp,PyObject * attr_name)9244 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
9245 PyErr_Format(PyExc_AttributeError,
9246 #if PY_MAJOR_VERSION >= 3
9247 "'%.50s' object has no attribute '%U'",
9248 tp->tp_name, attr_name);
9249 #else
9250 "'%.50s' object has no attribute '%.400s'",
9251 tp->tp_name, PyString_AS_STRING(attr_name));
9252 #endif
9253 return NULL;
9254 }
__Pyx_PyObject_GenericGetAttrNoDict(PyObject * obj,PyObject * attr_name)9255 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
9256 PyObject *descr;
9257 PyTypeObject *tp = Py_TYPE(obj);
9258 if (unlikely(!PyString_Check(attr_name))) {
9259 return PyObject_GenericGetAttr(obj, attr_name);
9260 }
9261 assert(!tp->tp_dictoffset);
9262 descr = _PyType_Lookup(tp, attr_name);
9263 if (unlikely(!descr)) {
9264 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
9265 }
9266 Py_INCREF(descr);
9267 #if PY_MAJOR_VERSION < 3
9268 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
9269 #endif
9270 {
9271 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
9272 if (unlikely(f)) {
9273 PyObject *res = f(descr, obj, (PyObject *)tp);
9274 Py_DECREF(descr);
9275 return res;
9276 }
9277 }
9278 return descr;
9279 }
9280 #endif
9281
9282 /* PyObject_GenericGetAttr */
9283 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_PyObject_GenericGetAttr(PyObject * obj,PyObject * attr_name)9284 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
9285 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
9286 return PyObject_GenericGetAttr(obj, attr_name);
9287 }
9288 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
9289 }
9290 #endif
9291
9292 /* SetVTable */
__Pyx_SetVtable(PyObject * dict,void * vtable)9293 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
9294 #if PY_VERSION_HEX >= 0x02070000
9295 PyObject *ob = PyCapsule_New(vtable, 0, 0);
9296 #else
9297 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
9298 #endif
9299 if (!ob)
9300 goto bad;
9301 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
9302 goto bad;
9303 Py_DECREF(ob);
9304 return 0;
9305 bad:
9306 Py_XDECREF(ob);
9307 return -1;
9308 }
9309
9310 /* SetupReduce */
__Pyx_setup_reduce_is_named(PyObject * meth,PyObject * name)9311 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
9312 int ret;
9313 PyObject *name_attr;
9314 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
9315 if (likely(name_attr)) {
9316 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
9317 } else {
9318 ret = -1;
9319 }
9320 if (unlikely(ret < 0)) {
9321 PyErr_Clear();
9322 ret = 0;
9323 }
9324 Py_XDECREF(name_attr);
9325 return ret;
9326 }
__Pyx_setup_reduce(PyObject * type_obj)9327 static int __Pyx_setup_reduce(PyObject* type_obj) {
9328 int ret = 0;
9329 PyObject *object_reduce = NULL;
9330 PyObject *object_reduce_ex = NULL;
9331 PyObject *reduce = NULL;
9332 PyObject *reduce_ex = NULL;
9333 PyObject *reduce_cython = NULL;
9334 PyObject *setstate = NULL;
9335 PyObject *setstate_cython = NULL;
9336 #if CYTHON_USE_PYTYPE_LOOKUP
9337 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
9338 #else
9339 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
9340 #endif
9341 #if CYTHON_USE_PYTYPE_LOOKUP
9342 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
9343 #else
9344 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
9345 #endif
9346 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
9347 if (reduce_ex == object_reduce_ex) {
9348 #if CYTHON_USE_PYTYPE_LOOKUP
9349 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
9350 #else
9351 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
9352 #endif
9353 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
9354 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
9355 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
9356 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
9357 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
9358 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
9359 if (!setstate) PyErr_Clear();
9360 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
9361 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
9362 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
9363 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
9364 }
9365 PyType_Modified((PyTypeObject*)type_obj);
9366 }
9367 }
9368 goto GOOD;
9369 BAD:
9370 if (!PyErr_Occurred())
9371 PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
9372 ret = -1;
9373 GOOD:
9374 #if !CYTHON_USE_PYTYPE_LOOKUP
9375 Py_XDECREF(object_reduce);
9376 Py_XDECREF(object_reduce_ex);
9377 #endif
9378 Py_XDECREF(reduce);
9379 Py_XDECREF(reduce_ex);
9380 Py_XDECREF(reduce_cython);
9381 Py_XDECREF(setstate);
9382 Py_XDECREF(setstate_cython);
9383 return ret;
9384 }
9385
9386 /* TypeImport */
9387 #ifndef __PYX_HAVE_RT_ImportType
9388 #define __PYX_HAVE_RT_ImportType
__Pyx_ImportType(PyObject * module,const char * module_name,const char * class_name,size_t size,enum __Pyx_ImportType_CheckSize check_size)9389 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
9390 size_t size, enum __Pyx_ImportType_CheckSize check_size)
9391 {
9392 PyObject *result = 0;
9393 char warning[200];
9394 Py_ssize_t basicsize;
9395 #ifdef Py_LIMITED_API
9396 PyObject *py_basicsize;
9397 #endif
9398 result = PyObject_GetAttrString(module, class_name);
9399 if (!result)
9400 goto bad;
9401 if (!PyType_Check(result)) {
9402 PyErr_Format(PyExc_TypeError,
9403 "%.200s.%.200s is not a type object",
9404 module_name, class_name);
9405 goto bad;
9406 }
9407 #ifndef Py_LIMITED_API
9408 basicsize = ((PyTypeObject *)result)->tp_basicsize;
9409 #else
9410 py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
9411 if (!py_basicsize)
9412 goto bad;
9413 basicsize = PyLong_AsSsize_t(py_basicsize);
9414 Py_DECREF(py_basicsize);
9415 py_basicsize = 0;
9416 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
9417 goto bad;
9418 #endif
9419 if ((size_t)basicsize < size) {
9420 PyErr_Format(PyExc_ValueError,
9421 "%.200s.%.200s size changed, may indicate binary incompatibility. "
9422 "Expected %zd from C header, got %zd from PyObject",
9423 module_name, class_name, size, basicsize);
9424 goto bad;
9425 }
9426 if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
9427 PyErr_Format(PyExc_ValueError,
9428 "%.200s.%.200s size changed, may indicate binary incompatibility. "
9429 "Expected %zd from C header, got %zd from PyObject",
9430 module_name, class_name, size, basicsize);
9431 goto bad;
9432 }
9433 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
9434 PyOS_snprintf(warning, sizeof(warning),
9435 "%s.%s size changed, may indicate binary incompatibility. "
9436 "Expected %zd from C header, got %zd from PyObject",
9437 module_name, class_name, size, basicsize);
9438 if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
9439 }
9440 return (PyTypeObject *)result;
9441 bad:
9442 Py_XDECREF(result);
9443 return NULL;
9444 }
9445 #endif
9446
9447 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)9448 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
9449 PyObject *empty_list = 0;
9450 PyObject *module = 0;
9451 PyObject *global_dict = 0;
9452 PyObject *empty_dict = 0;
9453 PyObject *list;
9454 #if PY_MAJOR_VERSION < 3
9455 PyObject *py_import;
9456 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
9457 if (!py_import)
9458 goto bad;
9459 #endif
9460 if (from_list)
9461 list = from_list;
9462 else {
9463 empty_list = PyList_New(0);
9464 if (!empty_list)
9465 goto bad;
9466 list = empty_list;
9467 }
9468 global_dict = PyModule_GetDict(__pyx_m);
9469 if (!global_dict)
9470 goto bad;
9471 empty_dict = PyDict_New();
9472 if (!empty_dict)
9473 goto bad;
9474 {
9475 #if PY_MAJOR_VERSION >= 3
9476 if (level == -1) {
9477 if (strchr(__Pyx_MODULE_NAME, '.')) {
9478 module = PyImport_ImportModuleLevelObject(
9479 name, global_dict, empty_dict, list, 1);
9480 if (!module) {
9481 if (!PyErr_ExceptionMatches(PyExc_ImportError))
9482 goto bad;
9483 PyErr_Clear();
9484 }
9485 }
9486 level = 0;
9487 }
9488 #endif
9489 if (!module) {
9490 #if PY_MAJOR_VERSION < 3
9491 PyObject *py_level = PyInt_FromLong(level);
9492 if (!py_level)
9493 goto bad;
9494 module = PyObject_CallFunctionObjArgs(py_import,
9495 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
9496 Py_DECREF(py_level);
9497 #else
9498 module = PyImport_ImportModuleLevelObject(
9499 name, global_dict, empty_dict, list, level);
9500 #endif
9501 }
9502 }
9503 bad:
9504 #if PY_MAJOR_VERSION < 3
9505 Py_XDECREF(py_import);
9506 #endif
9507 Py_XDECREF(empty_list);
9508 Py_XDECREF(empty_dict);
9509 return module;
9510 }
9511
9512 /* CLineInTraceback */
9513 #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(PyThreadState * tstate,int c_line)9514 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
9515 PyObject *use_cline;
9516 PyObject *ptype, *pvalue, *ptraceback;
9517 #if CYTHON_COMPILING_IN_CPYTHON
9518 PyObject **cython_runtime_dict;
9519 #endif
9520 if (unlikely(!__pyx_cython_runtime)) {
9521 return c_line;
9522 }
9523 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
9524 #if CYTHON_COMPILING_IN_CPYTHON
9525 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
9526 if (likely(cython_runtime_dict)) {
9527 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
9528 use_cline, *cython_runtime_dict,
9529 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
9530 } else
9531 #endif
9532 {
9533 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
9534 if (use_cline_obj) {
9535 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
9536 Py_DECREF(use_cline_obj);
9537 } else {
9538 PyErr_Clear();
9539 use_cline = NULL;
9540 }
9541 }
9542 if (!use_cline) {
9543 c_line = 0;
9544 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
9545 }
9546 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
9547 c_line = 0;
9548 }
9549 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
9550 return c_line;
9551 }
9552 #endif
9553
9554 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)9555 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
9556 int start = 0, mid = 0, end = count - 1;
9557 if (end >= 0 && code_line > entries[end].code_line) {
9558 return count;
9559 }
9560 while (start < end) {
9561 mid = start + (end - start) / 2;
9562 if (code_line < entries[mid].code_line) {
9563 end = mid;
9564 } else if (code_line > entries[mid].code_line) {
9565 start = mid + 1;
9566 } else {
9567 return mid;
9568 }
9569 }
9570 if (code_line <= entries[mid].code_line) {
9571 return mid;
9572 } else {
9573 return mid + 1;
9574 }
9575 }
__pyx_find_code_object(int code_line)9576 static PyCodeObject *__pyx_find_code_object(int code_line) {
9577 PyCodeObject* code_object;
9578 int pos;
9579 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
9580 return NULL;
9581 }
9582 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
9583 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
9584 return NULL;
9585 }
9586 code_object = __pyx_code_cache.entries[pos].code_object;
9587 Py_INCREF(code_object);
9588 return code_object;
9589 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)9590 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
9591 int pos, i;
9592 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
9593 if (unlikely(!code_line)) {
9594 return;
9595 }
9596 if (unlikely(!entries)) {
9597 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
9598 if (likely(entries)) {
9599 __pyx_code_cache.entries = entries;
9600 __pyx_code_cache.max_count = 64;
9601 __pyx_code_cache.count = 1;
9602 entries[0].code_line = code_line;
9603 entries[0].code_object = code_object;
9604 Py_INCREF(code_object);
9605 }
9606 return;
9607 }
9608 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
9609 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
9610 PyCodeObject* tmp = entries[pos].code_object;
9611 entries[pos].code_object = code_object;
9612 Py_DECREF(tmp);
9613 return;
9614 }
9615 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
9616 int new_max = __pyx_code_cache.max_count + 64;
9617 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
9618 __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
9619 if (unlikely(!entries)) {
9620 return;
9621 }
9622 __pyx_code_cache.entries = entries;
9623 __pyx_code_cache.max_count = new_max;
9624 }
9625 for (i=__pyx_code_cache.count; i>pos; i--) {
9626 entries[i] = entries[i-1];
9627 }
9628 entries[pos].code_line = code_line;
9629 entries[pos].code_object = code_object;
9630 __pyx_code_cache.count++;
9631 Py_INCREF(code_object);
9632 }
9633
9634 /* AddTraceback */
9635 #include "compile.h"
9636 #include "frameobject.h"
9637 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)9638 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
9639 const char *funcname, int c_line,
9640 int py_line, const char *filename) {
9641 PyCodeObject *py_code = 0;
9642 PyObject *py_srcfile = 0;
9643 PyObject *py_funcname = 0;
9644 #if PY_MAJOR_VERSION < 3
9645 py_srcfile = PyString_FromString(filename);
9646 #else
9647 py_srcfile = PyUnicode_FromString(filename);
9648 #endif
9649 if (!py_srcfile) goto bad;
9650 if (c_line) {
9651 #if PY_MAJOR_VERSION < 3
9652 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
9653 #else
9654 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
9655 #endif
9656 }
9657 else {
9658 #if PY_MAJOR_VERSION < 3
9659 py_funcname = PyString_FromString(funcname);
9660 #else
9661 py_funcname = PyUnicode_FromString(funcname);
9662 #endif
9663 }
9664 if (!py_funcname) goto bad;
9665 py_code = __Pyx_PyCode_New(
9666 0,
9667 0,
9668 0,
9669 0,
9670 0,
9671 __pyx_empty_bytes, /*PyObject *code,*/
9672 __pyx_empty_tuple, /*PyObject *consts,*/
9673 __pyx_empty_tuple, /*PyObject *names,*/
9674 __pyx_empty_tuple, /*PyObject *varnames,*/
9675 __pyx_empty_tuple, /*PyObject *freevars,*/
9676 __pyx_empty_tuple, /*PyObject *cellvars,*/
9677 py_srcfile, /*PyObject *filename,*/
9678 py_funcname, /*PyObject *name,*/
9679 py_line,
9680 __pyx_empty_bytes /*PyObject *lnotab*/
9681 );
9682 Py_DECREF(py_srcfile);
9683 Py_DECREF(py_funcname);
9684 return py_code;
9685 bad:
9686 Py_XDECREF(py_srcfile);
9687 Py_XDECREF(py_funcname);
9688 return NULL;
9689 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)9690 static void __Pyx_AddTraceback(const char *funcname, int c_line,
9691 int py_line, const char *filename) {
9692 PyCodeObject *py_code = 0;
9693 PyFrameObject *py_frame = 0;
9694 PyThreadState *tstate = __Pyx_PyThreadState_Current;
9695 if (c_line) {
9696 c_line = __Pyx_CLineForTraceback(tstate, c_line);
9697 }
9698 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
9699 if (!py_code) {
9700 py_code = __Pyx_CreateCodeObjectForTraceback(
9701 funcname, c_line, py_line, filename);
9702 if (!py_code) goto bad;
9703 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
9704 }
9705 py_frame = PyFrame_New(
9706 tstate, /*PyThreadState *tstate,*/
9707 py_code, /*PyCodeObject *code,*/
9708 __pyx_d, /*PyObject *globals,*/
9709 0 /*PyObject *locals*/
9710 );
9711 if (!py_frame) goto bad;
9712 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
9713 PyTraceBack_Here(py_frame);
9714 bad:
9715 Py_XDECREF(py_code);
9716 Py_XDECREF(py_frame);
9717 }
9718
9719 #if PY_MAJOR_VERSION < 3
__Pyx_GetBuffer(PyObject * obj,Py_buffer * view,int flags)9720 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
9721 if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
9722 if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
9723 PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
9724 return -1;
9725 }
__Pyx_ReleaseBuffer(Py_buffer * view)9726 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
9727 PyObject *obj = view->obj;
9728 if (!obj) return;
9729 if (PyObject_CheckBuffer(obj)) {
9730 PyBuffer_Release(view);
9731 return;
9732 }
9733 if ((0)) {}
9734 else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
9735 view->obj = NULL;
9736 Py_DECREF(obj);
9737 }
9738 #endif
9739
9740
9741 /* CIntFromPyVerify */
9742 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
9743 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
9744 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
9745 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
9746 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
9747 {\
9748 func_type value = func_value;\
9749 if (sizeof(target_type) < sizeof(func_type)) {\
9750 if (unlikely(value != (func_type) (target_type) value)) {\
9751 func_type zero = 0;\
9752 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
9753 return (target_type) -1;\
9754 if (is_unsigned && unlikely(value < zero))\
9755 goto raise_neg_overflow;\
9756 else\
9757 goto raise_overflow;\
9758 }\
9759 }\
9760 return (target_type) value;\
9761 }
9762
9763 /* CIntToPy */
__Pyx_PyInt_From_int(int value)9764 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
9765 const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
9766 const int is_unsigned = neg_one > const_zero;
9767 if (is_unsigned) {
9768 if (sizeof(int) < sizeof(long)) {
9769 return PyInt_FromLong((long) value);
9770 } else if (sizeof(int) <= sizeof(unsigned long)) {
9771 return PyLong_FromUnsignedLong((unsigned long) value);
9772 #ifdef HAVE_LONG_LONG
9773 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
9774 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
9775 #endif
9776 }
9777 } else {
9778 if (sizeof(int) <= sizeof(long)) {
9779 return PyInt_FromLong((long) value);
9780 #ifdef HAVE_LONG_LONG
9781 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
9782 return PyLong_FromLongLong((PY_LONG_LONG) value);
9783 #endif
9784 }
9785 }
9786 {
9787 int one = 1; int little = (int)*(unsigned char *)&one;
9788 unsigned char *bytes = (unsigned char *)&value;
9789 return _PyLong_FromByteArray(bytes, sizeof(int),
9790 little, !is_unsigned);
9791 }
9792 }
9793
9794 /* CIntToPy */
__Pyx_PyInt_From_long(long value)9795 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
9796 const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
9797 const int is_unsigned = neg_one > const_zero;
9798 if (is_unsigned) {
9799 if (sizeof(long) < sizeof(long)) {
9800 return PyInt_FromLong((long) value);
9801 } else if (sizeof(long) <= sizeof(unsigned long)) {
9802 return PyLong_FromUnsignedLong((unsigned long) value);
9803 #ifdef HAVE_LONG_LONG
9804 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
9805 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
9806 #endif
9807 }
9808 } else {
9809 if (sizeof(long) <= sizeof(long)) {
9810 return PyInt_FromLong((long) value);
9811 #ifdef HAVE_LONG_LONG
9812 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
9813 return PyLong_FromLongLong((PY_LONG_LONG) value);
9814 #endif
9815 }
9816 }
9817 {
9818 int one = 1; int little = (int)*(unsigned char *)&one;
9819 unsigned char *bytes = (unsigned char *)&value;
9820 return _PyLong_FromByteArray(bytes, sizeof(long),
9821 little, !is_unsigned);
9822 }
9823 }
9824
9825 /* Declarations */
9826 #if CYTHON_CCOMPLEX
9827 #ifdef __cplusplus
__pyx_t_float_complex_from_parts(float x,float y)9828 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
9829 return ::std::complex< float >(x, y);
9830 }
9831 #else
__pyx_t_float_complex_from_parts(float x,float y)9832 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
9833 return x + y*(__pyx_t_float_complex)_Complex_I;
9834 }
9835 #endif
9836 #else
__pyx_t_float_complex_from_parts(float x,float y)9837 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
9838 __pyx_t_float_complex z;
9839 z.real = x;
9840 z.imag = y;
9841 return z;
9842 }
9843 #endif
9844
9845 /* Arithmetic */
9846 #if CYTHON_CCOMPLEX
9847 #else
__Pyx_c_eq_float(__pyx_t_float_complex a,__pyx_t_float_complex b)9848 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
9849 return (a.real == b.real) && (a.imag == b.imag);
9850 }
__Pyx_c_sum_float(__pyx_t_float_complex a,__pyx_t_float_complex b)9851 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
9852 __pyx_t_float_complex z;
9853 z.real = a.real + b.real;
9854 z.imag = a.imag + b.imag;
9855 return z;
9856 }
__Pyx_c_diff_float(__pyx_t_float_complex a,__pyx_t_float_complex b)9857 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
9858 __pyx_t_float_complex z;
9859 z.real = a.real - b.real;
9860 z.imag = a.imag - b.imag;
9861 return z;
9862 }
__Pyx_c_prod_float(__pyx_t_float_complex a,__pyx_t_float_complex b)9863 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
9864 __pyx_t_float_complex z;
9865 z.real = a.real * b.real - a.imag * b.imag;
9866 z.imag = a.real * b.imag + a.imag * b.real;
9867 return z;
9868 }
9869 #if 1
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)9870 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
9871 if (b.imag == 0) {
9872 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
9873 } else if (fabsf(b.real) >= fabsf(b.imag)) {
9874 if (b.real == 0 && b.imag == 0) {
9875 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
9876 } else {
9877 float r = b.imag / b.real;
9878 float s = (float)(1.0) / (b.real + b.imag * r);
9879 return __pyx_t_float_complex_from_parts(
9880 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
9881 }
9882 } else {
9883 float r = b.real / b.imag;
9884 float s = (float)(1.0) / (b.imag + b.real * r);
9885 return __pyx_t_float_complex_from_parts(
9886 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
9887 }
9888 }
9889 #else
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)9890 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
9891 if (b.imag == 0) {
9892 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
9893 } else {
9894 float denom = b.real * b.real + b.imag * b.imag;
9895 return __pyx_t_float_complex_from_parts(
9896 (a.real * b.real + a.imag * b.imag) / denom,
9897 (a.imag * b.real - a.real * b.imag) / denom);
9898 }
9899 }
9900 #endif
__Pyx_c_neg_float(__pyx_t_float_complex a)9901 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
9902 __pyx_t_float_complex z;
9903 z.real = -a.real;
9904 z.imag = -a.imag;
9905 return z;
9906 }
__Pyx_c_is_zero_float(__pyx_t_float_complex a)9907 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
9908 return (a.real == 0) && (a.imag == 0);
9909 }
__Pyx_c_conj_float(__pyx_t_float_complex a)9910 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
9911 __pyx_t_float_complex z;
9912 z.real = a.real;
9913 z.imag = -a.imag;
9914 return z;
9915 }
9916 #if 1
__Pyx_c_abs_float(__pyx_t_float_complex z)9917 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
9918 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
9919 return sqrtf(z.real*z.real + z.imag*z.imag);
9920 #else
9921 return hypotf(z.real, z.imag);
9922 #endif
9923 }
__Pyx_c_pow_float(__pyx_t_float_complex a,__pyx_t_float_complex b)9924 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
9925 __pyx_t_float_complex z;
9926 float r, lnr, theta, z_r, z_theta;
9927 if (b.imag == 0 && b.real == (int)b.real) {
9928 if (b.real < 0) {
9929 float denom = a.real * a.real + a.imag * a.imag;
9930 a.real = a.real / denom;
9931 a.imag = -a.imag / denom;
9932 b.real = -b.real;
9933 }
9934 switch ((int)b.real) {
9935 case 0:
9936 z.real = 1;
9937 z.imag = 0;
9938 return z;
9939 case 1:
9940 return a;
9941 case 2:
9942 z = __Pyx_c_prod_float(a, a);
9943 return __Pyx_c_prod_float(a, a);
9944 case 3:
9945 z = __Pyx_c_prod_float(a, a);
9946 return __Pyx_c_prod_float(z, a);
9947 case 4:
9948 z = __Pyx_c_prod_float(a, a);
9949 return __Pyx_c_prod_float(z, z);
9950 }
9951 }
9952 if (a.imag == 0) {
9953 if (a.real == 0) {
9954 return a;
9955 } else if (b.imag == 0) {
9956 z.real = powf(a.real, b.real);
9957 z.imag = 0;
9958 return z;
9959 } else if (a.real > 0) {
9960 r = a.real;
9961 theta = 0;
9962 } else {
9963 r = -a.real;
9964 theta = atan2f(0.0, -1.0);
9965 }
9966 } else {
9967 r = __Pyx_c_abs_float(a);
9968 theta = atan2f(a.imag, a.real);
9969 }
9970 lnr = logf(r);
9971 z_r = expf(lnr * b.real - theta * b.imag);
9972 z_theta = theta * b.real + lnr * b.imag;
9973 z.real = z_r * cosf(z_theta);
9974 z.imag = z_r * sinf(z_theta);
9975 return z;
9976 }
9977 #endif
9978 #endif
9979
9980 /* Declarations */
9981 #if CYTHON_CCOMPLEX
9982 #ifdef __cplusplus
__pyx_t_double_complex_from_parts(double x,double y)9983 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
9984 return ::std::complex< double >(x, y);
9985 }
9986 #else
__pyx_t_double_complex_from_parts(double x,double y)9987 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
9988 return x + y*(__pyx_t_double_complex)_Complex_I;
9989 }
9990 #endif
9991 #else
__pyx_t_double_complex_from_parts(double x,double y)9992 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
9993 __pyx_t_double_complex z;
9994 z.real = x;
9995 z.imag = y;
9996 return z;
9997 }
9998 #endif
9999
10000 /* Arithmetic */
10001 #if CYTHON_CCOMPLEX
10002 #else
__Pyx_c_eq_double(__pyx_t_double_complex a,__pyx_t_double_complex b)10003 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
10004 return (a.real == b.real) && (a.imag == b.imag);
10005 }
__Pyx_c_sum_double(__pyx_t_double_complex a,__pyx_t_double_complex b)10006 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
10007 __pyx_t_double_complex z;
10008 z.real = a.real + b.real;
10009 z.imag = a.imag + b.imag;
10010 return z;
10011 }
__Pyx_c_diff_double(__pyx_t_double_complex a,__pyx_t_double_complex b)10012 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
10013 __pyx_t_double_complex z;
10014 z.real = a.real - b.real;
10015 z.imag = a.imag - b.imag;
10016 return z;
10017 }
__Pyx_c_prod_double(__pyx_t_double_complex a,__pyx_t_double_complex b)10018 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
10019 __pyx_t_double_complex z;
10020 z.real = a.real * b.real - a.imag * b.imag;
10021 z.imag = a.real * b.imag + a.imag * b.real;
10022 return z;
10023 }
10024 #if 1
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)10025 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
10026 if (b.imag == 0) {
10027 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
10028 } else if (fabs(b.real) >= fabs(b.imag)) {
10029 if (b.real == 0 && b.imag == 0) {
10030 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
10031 } else {
10032 double r = b.imag / b.real;
10033 double s = (double)(1.0) / (b.real + b.imag * r);
10034 return __pyx_t_double_complex_from_parts(
10035 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
10036 }
10037 } else {
10038 double r = b.real / b.imag;
10039 double s = (double)(1.0) / (b.imag + b.real * r);
10040 return __pyx_t_double_complex_from_parts(
10041 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
10042 }
10043 }
10044 #else
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)10045 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
10046 if (b.imag == 0) {
10047 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
10048 } else {
10049 double denom = b.real * b.real + b.imag * b.imag;
10050 return __pyx_t_double_complex_from_parts(
10051 (a.real * b.real + a.imag * b.imag) / denom,
10052 (a.imag * b.real - a.real * b.imag) / denom);
10053 }
10054 }
10055 #endif
__Pyx_c_neg_double(__pyx_t_double_complex a)10056 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
10057 __pyx_t_double_complex z;
10058 z.real = -a.real;
10059 z.imag = -a.imag;
10060 return z;
10061 }
__Pyx_c_is_zero_double(__pyx_t_double_complex a)10062 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
10063 return (a.real == 0) && (a.imag == 0);
10064 }
__Pyx_c_conj_double(__pyx_t_double_complex a)10065 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
10066 __pyx_t_double_complex z;
10067 z.real = a.real;
10068 z.imag = -a.imag;
10069 return z;
10070 }
10071 #if 1
__Pyx_c_abs_double(__pyx_t_double_complex z)10072 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
10073 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
10074 return sqrt(z.real*z.real + z.imag*z.imag);
10075 #else
10076 return hypot(z.real, z.imag);
10077 #endif
10078 }
__Pyx_c_pow_double(__pyx_t_double_complex a,__pyx_t_double_complex b)10079 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
10080 __pyx_t_double_complex z;
10081 double r, lnr, theta, z_r, z_theta;
10082 if (b.imag == 0 && b.real == (int)b.real) {
10083 if (b.real < 0) {
10084 double denom = a.real * a.real + a.imag * a.imag;
10085 a.real = a.real / denom;
10086 a.imag = -a.imag / denom;
10087 b.real = -b.real;
10088 }
10089 switch ((int)b.real) {
10090 case 0:
10091 z.real = 1;
10092 z.imag = 0;
10093 return z;
10094 case 1:
10095 return a;
10096 case 2:
10097 z = __Pyx_c_prod_double(a, a);
10098 return __Pyx_c_prod_double(a, a);
10099 case 3:
10100 z = __Pyx_c_prod_double(a, a);
10101 return __Pyx_c_prod_double(z, a);
10102 case 4:
10103 z = __Pyx_c_prod_double(a, a);
10104 return __Pyx_c_prod_double(z, z);
10105 }
10106 }
10107 if (a.imag == 0) {
10108 if (a.real == 0) {
10109 return a;
10110 } else if (b.imag == 0) {
10111 z.real = pow(a.real, b.real);
10112 z.imag = 0;
10113 return z;
10114 } else if (a.real > 0) {
10115 r = a.real;
10116 theta = 0;
10117 } else {
10118 r = -a.real;
10119 theta = atan2(0.0, -1.0);
10120 }
10121 } else {
10122 r = __Pyx_c_abs_double(a);
10123 theta = atan2(a.imag, a.real);
10124 }
10125 lnr = log(r);
10126 z_r = exp(lnr * b.real - theta * b.imag);
10127 z_theta = theta * b.real + lnr * b.imag;
10128 z.real = z_r * cos(z_theta);
10129 z.imag = z_r * sin(z_theta);
10130 return z;
10131 }
10132 #endif
10133 #endif
10134
10135 /* CIntToPy */
__Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value)10136 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
10137 const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
10138 const int is_unsigned = neg_one > const_zero;
10139 if (is_unsigned) {
10140 if (sizeof(enum NPY_TYPES) < sizeof(long)) {
10141 return PyInt_FromLong((long) value);
10142 } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
10143 return PyLong_FromUnsignedLong((unsigned long) value);
10144 #ifdef HAVE_LONG_LONG
10145 } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
10146 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
10147 #endif
10148 }
10149 } else {
10150 if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
10151 return PyInt_FromLong((long) value);
10152 #ifdef HAVE_LONG_LONG
10153 } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
10154 return PyLong_FromLongLong((PY_LONG_LONG) value);
10155 #endif
10156 }
10157 }
10158 {
10159 int one = 1; int little = (int)*(unsigned char *)&one;
10160 unsigned char *bytes = (unsigned char *)&value;
10161 return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
10162 little, !is_unsigned);
10163 }
10164 }
10165
10166 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)10167 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
10168 const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
10169 const int is_unsigned = neg_one > const_zero;
10170 #if PY_MAJOR_VERSION < 3
10171 if (likely(PyInt_Check(x))) {
10172 if (sizeof(int) < sizeof(long)) {
10173 __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
10174 } else {
10175 long val = PyInt_AS_LONG(x);
10176 if (is_unsigned && unlikely(val < 0)) {
10177 goto raise_neg_overflow;
10178 }
10179 return (int) val;
10180 }
10181 } else
10182 #endif
10183 if (likely(PyLong_Check(x))) {
10184 if (is_unsigned) {
10185 #if CYTHON_USE_PYLONG_INTERNALS
10186 const digit* digits = ((PyLongObject*)x)->ob_digit;
10187 switch (Py_SIZE(x)) {
10188 case 0: return (int) 0;
10189 case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
10190 case 2:
10191 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
10192 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10193 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10194 } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
10195 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
10196 }
10197 }
10198 break;
10199 case 3:
10200 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
10201 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10202 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10203 } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
10204 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
10205 }
10206 }
10207 break;
10208 case 4:
10209 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
10210 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10211 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10212 } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
10213 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
10214 }
10215 }
10216 break;
10217 }
10218 #endif
10219 #if CYTHON_COMPILING_IN_CPYTHON
10220 if (unlikely(Py_SIZE(x) < 0)) {
10221 goto raise_neg_overflow;
10222 }
10223 #else
10224 {
10225 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
10226 if (unlikely(result < 0))
10227 return (int) -1;
10228 if (unlikely(result == 1))
10229 goto raise_neg_overflow;
10230 }
10231 #endif
10232 if (sizeof(int) <= sizeof(unsigned long)) {
10233 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
10234 #ifdef HAVE_LONG_LONG
10235 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
10236 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
10237 #endif
10238 }
10239 } else {
10240 #if CYTHON_USE_PYLONG_INTERNALS
10241 const digit* digits = ((PyLongObject*)x)->ob_digit;
10242 switch (Py_SIZE(x)) {
10243 case 0: return (int) 0;
10244 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
10245 case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
10246 case -2:
10247 if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
10248 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10249 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10250 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
10251 return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10252 }
10253 }
10254 break;
10255 case 2:
10256 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
10257 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10258 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10259 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
10260 return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10261 }
10262 }
10263 break;
10264 case -3:
10265 if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
10266 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10267 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10268 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
10269 return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10270 }
10271 }
10272 break;
10273 case 3:
10274 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
10275 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10276 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10277 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
10278 return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10279 }
10280 }
10281 break;
10282 case -4:
10283 if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
10284 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10285 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10286 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
10287 return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10288 }
10289 }
10290 break;
10291 case 4:
10292 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
10293 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10294 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10295 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
10296 return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10297 }
10298 }
10299 break;
10300 }
10301 #endif
10302 if (sizeof(int) <= sizeof(long)) {
10303 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
10304 #ifdef HAVE_LONG_LONG
10305 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
10306 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
10307 #endif
10308 }
10309 }
10310 {
10311 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
10312 PyErr_SetString(PyExc_RuntimeError,
10313 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
10314 #else
10315 int val;
10316 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
10317 #if PY_MAJOR_VERSION < 3
10318 if (likely(v) && !PyLong_Check(v)) {
10319 PyObject *tmp = v;
10320 v = PyNumber_Long(tmp);
10321 Py_DECREF(tmp);
10322 }
10323 #endif
10324 if (likely(v)) {
10325 int one = 1; int is_little = (int)*(unsigned char *)&one;
10326 unsigned char *bytes = (unsigned char *)&val;
10327 int ret = _PyLong_AsByteArray((PyLongObject *)v,
10328 bytes, sizeof(val),
10329 is_little, !is_unsigned);
10330 Py_DECREF(v);
10331 if (likely(!ret))
10332 return val;
10333 }
10334 #endif
10335 return (int) -1;
10336 }
10337 } else {
10338 int val;
10339 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
10340 if (!tmp) return (int) -1;
10341 val = __Pyx_PyInt_As_int(tmp);
10342 Py_DECREF(tmp);
10343 return val;
10344 }
10345 raise_overflow:
10346 PyErr_SetString(PyExc_OverflowError,
10347 "value too large to convert to int");
10348 return (int) -1;
10349 raise_neg_overflow:
10350 PyErr_SetString(PyExc_OverflowError,
10351 "can't convert negative value to int");
10352 return (int) -1;
10353 }
10354
10355 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)10356 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
10357 const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
10358 const int is_unsigned = neg_one > const_zero;
10359 #if PY_MAJOR_VERSION < 3
10360 if (likely(PyInt_Check(x))) {
10361 if (sizeof(long) < sizeof(long)) {
10362 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
10363 } else {
10364 long val = PyInt_AS_LONG(x);
10365 if (is_unsigned && unlikely(val < 0)) {
10366 goto raise_neg_overflow;
10367 }
10368 return (long) val;
10369 }
10370 } else
10371 #endif
10372 if (likely(PyLong_Check(x))) {
10373 if (is_unsigned) {
10374 #if CYTHON_USE_PYLONG_INTERNALS
10375 const digit* digits = ((PyLongObject*)x)->ob_digit;
10376 switch (Py_SIZE(x)) {
10377 case 0: return (long) 0;
10378 case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
10379 case 2:
10380 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
10381 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10382 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10383 } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
10384 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
10385 }
10386 }
10387 break;
10388 case 3:
10389 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
10390 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10391 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10392 } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
10393 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
10394 }
10395 }
10396 break;
10397 case 4:
10398 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
10399 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10400 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10401 } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
10402 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
10403 }
10404 }
10405 break;
10406 }
10407 #endif
10408 #if CYTHON_COMPILING_IN_CPYTHON
10409 if (unlikely(Py_SIZE(x) < 0)) {
10410 goto raise_neg_overflow;
10411 }
10412 #else
10413 {
10414 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
10415 if (unlikely(result < 0))
10416 return (long) -1;
10417 if (unlikely(result == 1))
10418 goto raise_neg_overflow;
10419 }
10420 #endif
10421 if (sizeof(long) <= sizeof(unsigned long)) {
10422 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
10423 #ifdef HAVE_LONG_LONG
10424 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
10425 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
10426 #endif
10427 }
10428 } else {
10429 #if CYTHON_USE_PYLONG_INTERNALS
10430 const digit* digits = ((PyLongObject*)x)->ob_digit;
10431 switch (Py_SIZE(x)) {
10432 case 0: return (long) 0;
10433 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
10434 case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
10435 case -2:
10436 if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
10437 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10438 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10439 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
10440 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10441 }
10442 }
10443 break;
10444 case 2:
10445 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
10446 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10447 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10448 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
10449 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10450 }
10451 }
10452 break;
10453 case -3:
10454 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
10455 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10456 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10457 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
10458 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10459 }
10460 }
10461 break;
10462 case 3:
10463 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
10464 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10465 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10466 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
10467 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10468 }
10469 }
10470 break;
10471 case -4:
10472 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
10473 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10474 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10475 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
10476 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10477 }
10478 }
10479 break;
10480 case 4:
10481 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
10482 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10483 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10484 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
10485 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10486 }
10487 }
10488 break;
10489 }
10490 #endif
10491 if (sizeof(long) <= sizeof(long)) {
10492 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
10493 #ifdef HAVE_LONG_LONG
10494 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
10495 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
10496 #endif
10497 }
10498 }
10499 {
10500 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
10501 PyErr_SetString(PyExc_RuntimeError,
10502 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
10503 #else
10504 long val;
10505 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
10506 #if PY_MAJOR_VERSION < 3
10507 if (likely(v) && !PyLong_Check(v)) {
10508 PyObject *tmp = v;
10509 v = PyNumber_Long(tmp);
10510 Py_DECREF(tmp);
10511 }
10512 #endif
10513 if (likely(v)) {
10514 int one = 1; int is_little = (int)*(unsigned char *)&one;
10515 unsigned char *bytes = (unsigned char *)&val;
10516 int ret = _PyLong_AsByteArray((PyLongObject *)v,
10517 bytes, sizeof(val),
10518 is_little, !is_unsigned);
10519 Py_DECREF(v);
10520 if (likely(!ret))
10521 return val;
10522 }
10523 #endif
10524 return (long) -1;
10525 }
10526 } else {
10527 long val;
10528 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
10529 if (!tmp) return (long) -1;
10530 val = __Pyx_PyInt_As_long(tmp);
10531 Py_DECREF(tmp);
10532 return val;
10533 }
10534 raise_overflow:
10535 PyErr_SetString(PyExc_OverflowError,
10536 "value too large to convert to long");
10537 return (long) -1;
10538 raise_neg_overflow:
10539 PyErr_SetString(PyExc_OverflowError,
10540 "can't convert negative value to long");
10541 return (long) -1;
10542 }
10543
10544 /* FastTypeChecks */
10545 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)10546 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
10547 while (a) {
10548 a = a->tp_base;
10549 if (a == b)
10550 return 1;
10551 }
10552 return b == &PyBaseObject_Type;
10553 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)10554 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
10555 PyObject *mro;
10556 if (a == b) return 1;
10557 mro = a->tp_mro;
10558 if (likely(mro)) {
10559 Py_ssize_t i, n;
10560 n = PyTuple_GET_SIZE(mro);
10561 for (i = 0; i < n; i++) {
10562 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
10563 return 1;
10564 }
10565 return 0;
10566 }
10567 return __Pyx_InBases(a, b);
10568 }
10569 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)10570 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
10571 PyObject *exception, *value, *tb;
10572 int res;
10573 __Pyx_PyThreadState_declare
10574 __Pyx_PyThreadState_assign
10575 __Pyx_ErrFetch(&exception, &value, &tb);
10576 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
10577 if (unlikely(res == -1)) {
10578 PyErr_WriteUnraisable(err);
10579 res = 0;
10580 }
10581 if (!res) {
10582 res = PyObject_IsSubclass(err, exc_type2);
10583 if (unlikely(res == -1)) {
10584 PyErr_WriteUnraisable(err);
10585 res = 0;
10586 }
10587 }
10588 __Pyx_ErrRestore(exception, value, tb);
10589 return res;
10590 }
10591 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)10592 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
10593 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
10594 if (!res) {
10595 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
10596 }
10597 return res;
10598 }
10599 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)10600 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
10601 Py_ssize_t i, n;
10602 assert(PyExceptionClass_Check(exc_type));
10603 n = PyTuple_GET_SIZE(tuple);
10604 #if PY_MAJOR_VERSION >= 3
10605 for (i=0; i<n; i++) {
10606 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
10607 }
10608 #endif
10609 for (i=0; i<n; i++) {
10610 PyObject *t = PyTuple_GET_ITEM(tuple, i);
10611 #if PY_MAJOR_VERSION < 3
10612 if (likely(exc_type == t)) return 1;
10613 #endif
10614 if (likely(PyExceptionClass_Check(t))) {
10615 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
10616 } else {
10617 }
10618 }
10619 return 0;
10620 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)10621 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
10622 if (likely(err == exc_type)) return 1;
10623 if (likely(PyExceptionClass_Check(err))) {
10624 if (likely(PyExceptionClass_Check(exc_type))) {
10625 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
10626 } else if (likely(PyTuple_Check(exc_type))) {
10627 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
10628 } else {
10629 }
10630 }
10631 return PyErr_GivenExceptionMatches(err, exc_type);
10632 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)10633 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
10634 assert(PyExceptionClass_Check(exc_type1));
10635 assert(PyExceptionClass_Check(exc_type2));
10636 if (likely(err == exc_type1 || err == exc_type2)) return 1;
10637 if (likely(PyExceptionClass_Check(err))) {
10638 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
10639 }
10640 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
10641 }
10642 #endif
10643
10644 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)10645 static int __Pyx_check_binary_version(void) {
10646 char ctversion[4], rtversion[4];
10647 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
10648 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
10649 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
10650 char message[200];
10651 PyOS_snprintf(message, sizeof(message),
10652 "compiletime version %s of module '%.100s' "
10653 "does not match runtime version %s",
10654 ctversion, __Pyx_MODULE_NAME, rtversion);
10655 return PyErr_WarnEx(NULL, message, 1);
10656 }
10657 return 0;
10658 }
10659
10660 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)10661 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
10662 while (t->p) {
10663 #if PY_MAJOR_VERSION < 3
10664 if (t->is_unicode) {
10665 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
10666 } else if (t->intern) {
10667 *t->p = PyString_InternFromString(t->s);
10668 } else {
10669 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
10670 }
10671 #else
10672 if (t->is_unicode | t->is_str) {
10673 if (t->intern) {
10674 *t->p = PyUnicode_InternFromString(t->s);
10675 } else if (t->encoding) {
10676 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
10677 } else {
10678 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
10679 }
10680 } else {
10681 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
10682 }
10683 #endif
10684 if (!*t->p)
10685 return -1;
10686 if (PyObject_Hash(*t->p) == -1)
10687 return -1;
10688 ++t;
10689 }
10690 return 0;
10691 }
10692
__Pyx_PyUnicode_FromString(const char * c_str)10693 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
10694 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
10695 }
__Pyx_PyObject_AsString(PyObject * o)10696 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
10697 Py_ssize_t ignore;
10698 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
10699 }
10700 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
10701 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)10702 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
10703 char* defenc_c;
10704 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
10705 if (!defenc) return NULL;
10706 defenc_c = PyBytes_AS_STRING(defenc);
10707 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
10708 {
10709 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
10710 char* c;
10711 for (c = defenc_c; c < end; c++) {
10712 if ((unsigned char) (*c) >= 128) {
10713 PyUnicode_AsASCIIString(o);
10714 return NULL;
10715 }
10716 }
10717 }
10718 #endif
10719 *length = PyBytes_GET_SIZE(defenc);
10720 return defenc_c;
10721 }
10722 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)10723 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
10724 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
10725 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
10726 if (likely(PyUnicode_IS_ASCII(o))) {
10727 *length = PyUnicode_GET_LENGTH(o);
10728 return PyUnicode_AsUTF8(o);
10729 } else {
10730 PyUnicode_AsASCIIString(o);
10731 return NULL;
10732 }
10733 #else
10734 return PyUnicode_AsUTF8AndSize(o, length);
10735 #endif
10736 }
10737 #endif
10738 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)10739 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
10740 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
10741 if (
10742 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
10743 __Pyx_sys_getdefaultencoding_not_ascii &&
10744 #endif
10745 PyUnicode_Check(o)) {
10746 return __Pyx_PyUnicode_AsStringAndSize(o, length);
10747 } else
10748 #endif
10749 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
10750 if (PyByteArray_Check(o)) {
10751 *length = PyByteArray_GET_SIZE(o);
10752 return PyByteArray_AS_STRING(o);
10753 } else
10754 #endif
10755 {
10756 char* result;
10757 int r = PyBytes_AsStringAndSize(o, &result, length);
10758 if (unlikely(r < 0)) {
10759 return NULL;
10760 } else {
10761 return result;
10762 }
10763 }
10764 }
__Pyx_PyObject_IsTrue(PyObject * x)10765 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
10766 int is_true = x == Py_True;
10767 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
10768 else return PyObject_IsTrue(x);
10769 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)10770 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
10771 int retval;
10772 if (unlikely(!x)) return -1;
10773 retval = __Pyx_PyObject_IsTrue(x);
10774 Py_DECREF(x);
10775 return retval;
10776 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)10777 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
10778 #if PY_MAJOR_VERSION >= 3
10779 if (PyLong_Check(result)) {
10780 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
10781 "__int__ returned non-int (type %.200s). "
10782 "The ability to return an instance of a strict subclass of int "
10783 "is deprecated, and may be removed in a future version of Python.",
10784 Py_TYPE(result)->tp_name)) {
10785 Py_DECREF(result);
10786 return NULL;
10787 }
10788 return result;
10789 }
10790 #endif
10791 PyErr_Format(PyExc_TypeError,
10792 "__%.4s__ returned non-%.4s (type %.200s)",
10793 type_name, type_name, Py_TYPE(result)->tp_name);
10794 Py_DECREF(result);
10795 return NULL;
10796 }
__Pyx_PyNumber_IntOrLong(PyObject * x)10797 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
10798 #if CYTHON_USE_TYPE_SLOTS
10799 PyNumberMethods *m;
10800 #endif
10801 const char *name = NULL;
10802 PyObject *res = NULL;
10803 #if PY_MAJOR_VERSION < 3
10804 if (likely(PyInt_Check(x) || PyLong_Check(x)))
10805 #else
10806 if (likely(PyLong_Check(x)))
10807 #endif
10808 return __Pyx_NewRef(x);
10809 #if CYTHON_USE_TYPE_SLOTS
10810 m = Py_TYPE(x)->tp_as_number;
10811 #if PY_MAJOR_VERSION < 3
10812 if (m && m->nb_int) {
10813 name = "int";
10814 res = m->nb_int(x);
10815 }
10816 else if (m && m->nb_long) {
10817 name = "long";
10818 res = m->nb_long(x);
10819 }
10820 #else
10821 if (likely(m && m->nb_int)) {
10822 name = "int";
10823 res = m->nb_int(x);
10824 }
10825 #endif
10826 #else
10827 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
10828 res = PyNumber_Int(x);
10829 }
10830 #endif
10831 if (likely(res)) {
10832 #if PY_MAJOR_VERSION < 3
10833 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
10834 #else
10835 if (unlikely(!PyLong_CheckExact(res))) {
10836 #endif
10837 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
10838 }
10839 }
10840 else if (!PyErr_Occurred()) {
10841 PyErr_SetString(PyExc_TypeError,
10842 "an integer is required");
10843 }
10844 return res;
10845 }
10846 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
10847 Py_ssize_t ival;
10848 PyObject *x;
10849 #if PY_MAJOR_VERSION < 3
10850 if (likely(PyInt_CheckExact(b))) {
10851 if (sizeof(Py_ssize_t) >= sizeof(long))
10852 return PyInt_AS_LONG(b);
10853 else
10854 return PyInt_AsSsize_t(b);
10855 }
10856 #endif
10857 if (likely(PyLong_CheckExact(b))) {
10858 #if CYTHON_USE_PYLONG_INTERNALS
10859 const digit* digits = ((PyLongObject*)b)->ob_digit;
10860 const Py_ssize_t size = Py_SIZE(b);
10861 if (likely(__Pyx_sst_abs(size) <= 1)) {
10862 ival = likely(size) ? digits[0] : 0;
10863 if (size == -1) ival = -ival;
10864 return ival;
10865 } else {
10866 switch (size) {
10867 case 2:
10868 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
10869 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
10870 }
10871 break;
10872 case -2:
10873 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
10874 return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
10875 }
10876 break;
10877 case 3:
10878 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
10879 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
10880 }
10881 break;
10882 case -3:
10883 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
10884 return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
10885 }
10886 break;
10887 case 4:
10888 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
10889 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
10890 }
10891 break;
10892 case -4:
10893 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
10894 return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
10895 }
10896 break;
10897 }
10898 }
10899 #endif
10900 return PyLong_AsSsize_t(b);
10901 }
10902 x = PyNumber_Index(b);
10903 if (!x) return -1;
10904 ival = PyInt_AsSsize_t(x);
10905 Py_DECREF(x);
10906 return ival;
10907 }
10908 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
10909 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
10910 }
10911 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
10912 return PyInt_FromSize_t(ival);
10913 }
10914
10915
10916 #endif /* Py_PYTHON_H */
10917