1 /* Generated by Cython 0.29.12 */
2
3 /* BEGIN: Cython Metadata
4 {
5 "distutils": {
6 "depends": [],
7 "libraries": [
8 "m"
9 ],
10 "name": "yt.utilities.lib.depth_first_octree",
11 "sources": [
12 "yt/utilities/lib/depth_first_octree.pyx"
13 ]
14 },
15 "module_name": "yt.utilities.lib.depth_first_octree"
16 }
17 END: Cython Metadata */
18
19 #define PY_SSIZE_T_CLEAN
20 #include "Python.h"
21 #ifndef Py_PYTHON_H
22 #error Python headers needed to compile C extensions, please install development version of Python.
23 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
24 #error Cython requires Python 2.6+ or Python 3.3+.
25 #else
26 #define CYTHON_ABI "0_29_12"
27 #define CYTHON_HEX_VERSION 0x001D0CF0
28 #define CYTHON_FUTURE_DIVISION 0
29 #include <stddef.h>
30 #ifndef offsetof
31 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
32 #endif
33 #if !defined(WIN32) && !defined(MS_WINDOWS)
34 #ifndef __stdcall
35 #define __stdcall
36 #endif
37 #ifndef __cdecl
38 #define __cdecl
39 #endif
40 #ifndef __fastcall
41 #define __fastcall
42 #endif
43 #endif
44 #ifndef DL_IMPORT
45 #define DL_IMPORT(t) t
46 #endif
47 #ifndef DL_EXPORT
48 #define DL_EXPORT(t) t
49 #endif
50 #define __PYX_COMMA ,
51 #ifndef HAVE_LONG_LONG
52 #if PY_VERSION_HEX >= 0x02070000
53 #define HAVE_LONG_LONG
54 #endif
55 #endif
56 #ifndef PY_LONG_LONG
57 #define PY_LONG_LONG LONG_LONG
58 #endif
59 #ifndef Py_HUGE_VAL
60 #define Py_HUGE_VAL HUGE_VAL
61 #endif
62 #ifdef PYPY_VERSION
63 #define CYTHON_COMPILING_IN_PYPY 1
64 #define CYTHON_COMPILING_IN_PYSTON 0
65 #define CYTHON_COMPILING_IN_CPYTHON 0
66 #undef CYTHON_USE_TYPE_SLOTS
67 #define CYTHON_USE_TYPE_SLOTS 0
68 #undef CYTHON_USE_PYTYPE_LOOKUP
69 #define CYTHON_USE_PYTYPE_LOOKUP 0
70 #if PY_VERSION_HEX < 0x03050000
71 #undef CYTHON_USE_ASYNC_SLOTS
72 #define CYTHON_USE_ASYNC_SLOTS 0
73 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
74 #define CYTHON_USE_ASYNC_SLOTS 1
75 #endif
76 #undef CYTHON_USE_PYLIST_INTERNALS
77 #define CYTHON_USE_PYLIST_INTERNALS 0
78 #undef CYTHON_USE_UNICODE_INTERNALS
79 #define CYTHON_USE_UNICODE_INTERNALS 0
80 #undef CYTHON_USE_UNICODE_WRITER
81 #define CYTHON_USE_UNICODE_WRITER 0
82 #undef CYTHON_USE_PYLONG_INTERNALS
83 #define CYTHON_USE_PYLONG_INTERNALS 0
84 #undef CYTHON_AVOID_BORROWED_REFS
85 #define CYTHON_AVOID_BORROWED_REFS 1
86 #undef CYTHON_ASSUME_SAFE_MACROS
87 #define CYTHON_ASSUME_SAFE_MACROS 0
88 #undef CYTHON_UNPACK_METHODS
89 #define CYTHON_UNPACK_METHODS 0
90 #undef CYTHON_FAST_THREAD_STATE
91 #define CYTHON_FAST_THREAD_STATE 0
92 #undef CYTHON_FAST_PYCALL
93 #define CYTHON_FAST_PYCALL 0
94 #undef CYTHON_PEP489_MULTI_PHASE_INIT
95 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
96 #undef CYTHON_USE_TP_FINALIZE
97 #define CYTHON_USE_TP_FINALIZE 0
98 #undef CYTHON_USE_DICT_VERSIONS
99 #define CYTHON_USE_DICT_VERSIONS 0
100 #undef CYTHON_USE_EXC_INFO_STACK
101 #define CYTHON_USE_EXC_INFO_STACK 0
102 #elif defined(PYSTON_VERSION)
103 #define CYTHON_COMPILING_IN_PYPY 0
104 #define CYTHON_COMPILING_IN_PYSTON 1
105 #define CYTHON_COMPILING_IN_CPYTHON 0
106 #ifndef CYTHON_USE_TYPE_SLOTS
107 #define CYTHON_USE_TYPE_SLOTS 1
108 #endif
109 #undef CYTHON_USE_PYTYPE_LOOKUP
110 #define CYTHON_USE_PYTYPE_LOOKUP 0
111 #undef CYTHON_USE_ASYNC_SLOTS
112 #define CYTHON_USE_ASYNC_SLOTS 0
113 #undef CYTHON_USE_PYLIST_INTERNALS
114 #define CYTHON_USE_PYLIST_INTERNALS 0
115 #ifndef CYTHON_USE_UNICODE_INTERNALS
116 #define CYTHON_USE_UNICODE_INTERNALS 1
117 #endif
118 #undef CYTHON_USE_UNICODE_WRITER
119 #define CYTHON_USE_UNICODE_WRITER 0
120 #undef CYTHON_USE_PYLONG_INTERNALS
121 #define CYTHON_USE_PYLONG_INTERNALS 0
122 #ifndef CYTHON_AVOID_BORROWED_REFS
123 #define CYTHON_AVOID_BORROWED_REFS 0
124 #endif
125 #ifndef CYTHON_ASSUME_SAFE_MACROS
126 #define CYTHON_ASSUME_SAFE_MACROS 1
127 #endif
128 #ifndef CYTHON_UNPACK_METHODS
129 #define CYTHON_UNPACK_METHODS 1
130 #endif
131 #undef CYTHON_FAST_THREAD_STATE
132 #define CYTHON_FAST_THREAD_STATE 0
133 #undef CYTHON_FAST_PYCALL
134 #define CYTHON_FAST_PYCALL 0
135 #undef CYTHON_PEP489_MULTI_PHASE_INIT
136 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
137 #undef CYTHON_USE_TP_FINALIZE
138 #define CYTHON_USE_TP_FINALIZE 0
139 #undef CYTHON_USE_DICT_VERSIONS
140 #define CYTHON_USE_DICT_VERSIONS 0
141 #undef CYTHON_USE_EXC_INFO_STACK
142 #define CYTHON_USE_EXC_INFO_STACK 0
143 #else
144 #define CYTHON_COMPILING_IN_PYPY 0
145 #define CYTHON_COMPILING_IN_PYSTON 0
146 #define CYTHON_COMPILING_IN_CPYTHON 1
147 #ifndef CYTHON_USE_TYPE_SLOTS
148 #define CYTHON_USE_TYPE_SLOTS 1
149 #endif
150 #if PY_VERSION_HEX < 0x02070000
151 #undef CYTHON_USE_PYTYPE_LOOKUP
152 #define CYTHON_USE_PYTYPE_LOOKUP 0
153 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
154 #define CYTHON_USE_PYTYPE_LOOKUP 1
155 #endif
156 #if PY_MAJOR_VERSION < 3
157 #undef CYTHON_USE_ASYNC_SLOTS
158 #define CYTHON_USE_ASYNC_SLOTS 0
159 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
160 #define CYTHON_USE_ASYNC_SLOTS 1
161 #endif
162 #if PY_VERSION_HEX < 0x02070000
163 #undef CYTHON_USE_PYLONG_INTERNALS
164 #define CYTHON_USE_PYLONG_INTERNALS 0
165 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
166 #define CYTHON_USE_PYLONG_INTERNALS 1
167 #endif
168 #ifndef CYTHON_USE_PYLIST_INTERNALS
169 #define CYTHON_USE_PYLIST_INTERNALS 1
170 #endif
171 #ifndef CYTHON_USE_UNICODE_INTERNALS
172 #define CYTHON_USE_UNICODE_INTERNALS 1
173 #endif
174 #if PY_VERSION_HEX < 0x030300F0
175 #undef CYTHON_USE_UNICODE_WRITER
176 #define CYTHON_USE_UNICODE_WRITER 0
177 #elif !defined(CYTHON_USE_UNICODE_WRITER)
178 #define CYTHON_USE_UNICODE_WRITER 1
179 #endif
180 #ifndef CYTHON_AVOID_BORROWED_REFS
181 #define CYTHON_AVOID_BORROWED_REFS 0
182 #endif
183 #ifndef CYTHON_ASSUME_SAFE_MACROS
184 #define CYTHON_ASSUME_SAFE_MACROS 1
185 #endif
186 #ifndef CYTHON_UNPACK_METHODS
187 #define CYTHON_UNPACK_METHODS 1
188 #endif
189 #ifndef CYTHON_FAST_THREAD_STATE
190 #define CYTHON_FAST_THREAD_STATE 1
191 #endif
192 #ifndef CYTHON_FAST_PYCALL
193 #define CYTHON_FAST_PYCALL 1
194 #endif
195 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
196 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
197 #endif
198 #ifndef CYTHON_USE_TP_FINALIZE
199 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
200 #endif
201 #ifndef CYTHON_USE_DICT_VERSIONS
202 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
203 #endif
204 #ifndef CYTHON_USE_EXC_INFO_STACK
205 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
206 #endif
207 #endif
208 #if !defined(CYTHON_FAST_PYCCALL)
209 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
210 #endif
211 #if CYTHON_USE_PYLONG_INTERNALS
212 #include "longintrepr.h"
213 #undef SHIFT
214 #undef BASE
215 #undef MASK
216 #ifdef SIZEOF_VOID_P
217 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
218 #endif
219 #endif
220 #ifndef __has_attribute
221 #define __has_attribute(x) 0
222 #endif
223 #ifndef __has_cpp_attribute
224 #define __has_cpp_attribute(x) 0
225 #endif
226 #ifndef CYTHON_RESTRICT
227 #if defined(__GNUC__)
228 #define CYTHON_RESTRICT __restrict__
229 #elif defined(_MSC_VER) && _MSC_VER >= 1400
230 #define CYTHON_RESTRICT __restrict
231 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
232 #define CYTHON_RESTRICT restrict
233 #else
234 #define CYTHON_RESTRICT
235 #endif
236 #endif
237 #ifndef CYTHON_UNUSED
238 # if defined(__GNUC__)
239 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
240 # define CYTHON_UNUSED __attribute__ ((__unused__))
241 # else
242 # define CYTHON_UNUSED
243 # endif
244 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
245 # define CYTHON_UNUSED __attribute__ ((__unused__))
246 # else
247 # define CYTHON_UNUSED
248 # endif
249 #endif
250 #ifndef CYTHON_MAYBE_UNUSED_VAR
251 # if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)252 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
253 # else
254 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
255 # endif
256 #endif
257 #ifndef CYTHON_NCP_UNUSED
258 # if CYTHON_COMPILING_IN_CPYTHON
259 # define CYTHON_NCP_UNUSED
260 # else
261 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
262 # endif
263 #endif
264 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
265 #ifdef _MSC_VER
266 #ifndef _MSC_STDINT_H_
267 #if _MSC_VER < 1300
268 typedef unsigned char uint8_t;
269 typedef unsigned int uint32_t;
270 #else
271 typedef unsigned __int8 uint8_t;
272 typedef unsigned __int32 uint32_t;
273 #endif
274 #endif
275 #else
276 #include <stdint.h>
277 #endif
278 #ifndef CYTHON_FALLTHROUGH
279 #if defined(__cplusplus) && __cplusplus >= 201103L
280 #if __has_cpp_attribute(fallthrough)
281 #define CYTHON_FALLTHROUGH [[fallthrough]]
282 #elif __has_cpp_attribute(clang::fallthrough)
283 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
284 #elif __has_cpp_attribute(gnu::fallthrough)
285 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
286 #endif
287 #endif
288 #ifndef CYTHON_FALLTHROUGH
289 #if __has_attribute(fallthrough)
290 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
291 #else
292 #define CYTHON_FALLTHROUGH
293 #endif
294 #endif
295 #if defined(__clang__ ) && defined(__apple_build_version__)
296 #if __apple_build_version__ < 7000000
297 #undef CYTHON_FALLTHROUGH
298 #define CYTHON_FALLTHROUGH
299 #endif
300 #endif
301 #endif
302
303 #ifndef CYTHON_INLINE
304 #if defined(__clang__)
305 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
306 #elif defined(__GNUC__)
307 #define CYTHON_INLINE __inline__
308 #elif defined(_MSC_VER)
309 #define CYTHON_INLINE __inline
310 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
311 #define CYTHON_INLINE inline
312 #else
313 #define CYTHON_INLINE
314 #endif
315 #endif
316
317 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
318 #define Py_OptimizeFlag 0
319 #endif
320 #define __PYX_BUILD_PY_SSIZE_T "n"
321 #define CYTHON_FORMAT_SSIZE_T "z"
322 #if PY_MAJOR_VERSION < 3
323 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
324 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
325 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
326 #define __Pyx_DefaultClassType PyClass_Type
327 #else
328 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
329 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
330 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
331 PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
332 #else
333 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
334 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
335 #endif
336 #define __Pyx_DefaultClassType PyType_Type
337 #endif
338 #ifndef Py_TPFLAGS_CHECKTYPES
339 #define Py_TPFLAGS_CHECKTYPES 0
340 #endif
341 #ifndef Py_TPFLAGS_HAVE_INDEX
342 #define Py_TPFLAGS_HAVE_INDEX 0
343 #endif
344 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
345 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
346 #endif
347 #ifndef Py_TPFLAGS_HAVE_FINALIZE
348 #define Py_TPFLAGS_HAVE_FINALIZE 0
349 #endif
350 #ifndef METH_STACKLESS
351 #define METH_STACKLESS 0
352 #endif
353 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
354 #ifndef METH_FASTCALL
355 #define METH_FASTCALL 0x80
356 #endif
357 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
358 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
359 Py_ssize_t nargs, PyObject *kwnames);
360 #else
361 #define __Pyx_PyCFunctionFast _PyCFunctionFast
362 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
363 #endif
364 #if CYTHON_FAST_PYCCALL
365 #define __Pyx_PyFastCFunction_Check(func)\
366 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
367 #else
368 #define __Pyx_PyFastCFunction_Check(func) 0
369 #endif
370 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
371 #define PyObject_Malloc(s) PyMem_Malloc(s)
372 #define PyObject_Free(p) PyMem_Free(p)
373 #define PyObject_Realloc(p) PyMem_Realloc(p)
374 #endif
375 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
376 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
377 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
378 #define PyMem_RawFree(p) PyMem_Free(p)
379 #endif
380 #if CYTHON_COMPILING_IN_PYSTON
381 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
382 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
383 #else
384 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
385 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
386 #endif
387 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
388 #define __Pyx_PyThreadState_Current PyThreadState_GET()
389 #elif PY_VERSION_HEX >= 0x03060000
390 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
391 #elif PY_VERSION_HEX >= 0x03000000
392 #define __Pyx_PyThreadState_Current PyThreadState_GET()
393 #else
394 #define __Pyx_PyThreadState_Current _PyThreadState_Current
395 #endif
396 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
397 #include "pythread.h"
398 #define Py_tss_NEEDS_INIT 0
399 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)400 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
401 *key = PyThread_create_key();
402 return 0;
403 }
PyThread_tss_alloc(void)404 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
405 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
406 *key = Py_tss_NEEDS_INIT;
407 return key;
408 }
PyThread_tss_free(Py_tss_t * key)409 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
410 PyObject_Free(key);
411 }
PyThread_tss_is_created(Py_tss_t * key)412 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
413 return *key != Py_tss_NEEDS_INIT;
414 }
PyThread_tss_delete(Py_tss_t * key)415 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
416 PyThread_delete_key(*key);
417 *key = Py_tss_NEEDS_INIT;
418 }
PyThread_tss_set(Py_tss_t * key,void * value)419 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
420 return PyThread_set_key_value(*key, value);
421 }
PyThread_tss_get(Py_tss_t * key)422 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
423 return PyThread_get_key_value(*key);
424 }
425 #endif
426 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
427 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
428 #else
429 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
430 #endif
431 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
432 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
433 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
434 #else
435 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
436 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
437 #endif
438 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
439 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
440 #else
441 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
442 #endif
443 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
444 #define CYTHON_PEP393_ENABLED 1
445 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
446 0 : _PyUnicode_Ready((PyObject *)(op)))
447 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
448 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
449 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
450 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
451 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
452 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
453 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
454 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
455 #else
456 #define CYTHON_PEP393_ENABLED 0
457 #define PyUnicode_1BYTE_KIND 1
458 #define PyUnicode_2BYTE_KIND 2
459 #define PyUnicode_4BYTE_KIND 4
460 #define __Pyx_PyUnicode_READY(op) (0)
461 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
462 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
463 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
464 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
465 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
466 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
467 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
468 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
469 #endif
470 #if CYTHON_COMPILING_IN_PYPY
471 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
472 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
473 #else
474 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
475 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
476 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
477 #endif
478 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
479 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
480 #endif
481 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
482 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
483 #endif
484 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
485 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
486 #endif
487 #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))
488 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
489 #if PY_MAJOR_VERSION >= 3
490 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
491 #else
492 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
493 #endif
494 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
495 #define PyObject_ASCII(o) PyObject_Repr(o)
496 #endif
497 #if PY_MAJOR_VERSION >= 3
498 #define PyBaseString_Type PyUnicode_Type
499 #define PyStringObject PyUnicodeObject
500 #define PyString_Type PyUnicode_Type
501 #define PyString_Check PyUnicode_Check
502 #define PyString_CheckExact PyUnicode_CheckExact
503 #define PyObject_Unicode PyObject_Str
504 #endif
505 #if PY_MAJOR_VERSION >= 3
506 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
507 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
508 #else
509 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
510 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
511 #endif
512 #ifndef PySet_CheckExact
513 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
514 #endif
515 #if CYTHON_ASSUME_SAFE_MACROS
516 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
517 #else
518 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
519 #endif
520 #if PY_MAJOR_VERSION >= 3
521 #define PyIntObject PyLongObject
522 #define PyInt_Type PyLong_Type
523 #define PyInt_Check(op) PyLong_Check(op)
524 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
525 #define PyInt_FromString PyLong_FromString
526 #define PyInt_FromUnicode PyLong_FromUnicode
527 #define PyInt_FromLong PyLong_FromLong
528 #define PyInt_FromSize_t PyLong_FromSize_t
529 #define PyInt_FromSsize_t PyLong_FromSsize_t
530 #define PyInt_AsLong PyLong_AsLong
531 #define PyInt_AS_LONG PyLong_AS_LONG
532 #define PyInt_AsSsize_t PyLong_AsSsize_t
533 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
534 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
535 #define PyNumber_Int PyNumber_Long
536 #endif
537 #if PY_MAJOR_VERSION >= 3
538 #define PyBoolObject PyLongObject
539 #endif
540 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
541 #ifndef PyUnicode_InternFromString
542 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
543 #endif
544 #endif
545 #if PY_VERSION_HEX < 0x030200A4
546 typedef long Py_hash_t;
547 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
548 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
549 #else
550 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
551 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
552 #endif
553 #if PY_MAJOR_VERSION >= 3
554 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
555 #else
556 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
557 #endif
558 #if CYTHON_USE_ASYNC_SLOTS
559 #if PY_VERSION_HEX >= 0x030500B1
560 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
561 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
562 #else
563 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
564 #endif
565 #else
566 #define __Pyx_PyType_AsAsync(obj) NULL
567 #endif
568 #ifndef __Pyx_PyAsyncMethodsStruct
569 typedef struct {
570 unaryfunc am_await;
571 unaryfunc am_aiter;
572 unaryfunc am_anext;
573 } __Pyx_PyAsyncMethodsStruct;
574 #endif
575
576 #if defined(WIN32) || defined(MS_WINDOWS)
577 #define _USE_MATH_DEFINES
578 #endif
579 #include <math.h>
580 #ifdef NAN
581 #define __PYX_NAN() ((float) NAN)
582 #else
__PYX_NAN()583 static CYTHON_INLINE float __PYX_NAN() {
584 float value;
585 memset(&value, 0xFF, sizeof(value));
586 return value;
587 }
588 #endif
589 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
590 #define __Pyx_truncl trunc
591 #else
592 #define __Pyx_truncl truncl
593 #endif
594
595
596 #define __PYX_ERR(f_index, lineno, Ln_error) \
597 { \
598 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
599 }
600
601 #ifndef __PYX_EXTERN_C
602 #ifdef __cplusplus
603 #define __PYX_EXTERN_C extern "C"
604 #else
605 #define __PYX_EXTERN_C extern
606 #endif
607 #endif
608
609 #define __PYX_HAVE__yt__utilities__lib__depth_first_octree
610 #define __PYX_HAVE_API__yt__utilities__lib__depth_first_octree
611 /* Early includes */
612 #include <string.h>
613 #include <stdio.h>
614 #include "numpy/arrayobject.h"
615 #include "numpy/ufuncobject.h"
616 #ifdef _OPENMP
617 #include <omp.h>
618 #endif /* _OPENMP */
619
620 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
621 #define CYTHON_WITHOUT_ASSERTIONS
622 #endif
623
624 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
625 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
626
627 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
628 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
629 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
630 #define __PYX_DEFAULT_STRING_ENCODING ""
631 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
632 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
633 #define __Pyx_uchar_cast(c) ((unsigned char)c)
634 #define __Pyx_long_cast(x) ((long)x)
635 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
636 (sizeof(type) < sizeof(Py_ssize_t)) ||\
637 (sizeof(type) > sizeof(Py_ssize_t) &&\
638 likely(v < (type)PY_SSIZE_T_MAX ||\
639 v == (type)PY_SSIZE_T_MAX) &&\
640 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
641 v == (type)PY_SSIZE_T_MIN))) ||\
642 (sizeof(type) == sizeof(Py_ssize_t) &&\
643 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
644 v == (type)PY_SSIZE_T_MAX))) )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)645 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
646 return (size_t) i < (size_t) limit;
647 }
648 #if defined (__cplusplus) && __cplusplus >= 201103L
649 #include <cstdlib>
650 #define __Pyx_sst_abs(value) std::abs(value)
651 #elif SIZEOF_INT >= SIZEOF_SIZE_T
652 #define __Pyx_sst_abs(value) abs(value)
653 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
654 #define __Pyx_sst_abs(value) labs(value)
655 #elif defined (_MSC_VER)
656 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
657 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
658 #define __Pyx_sst_abs(value) llabs(value)
659 #elif defined (__GNUC__)
660 #define __Pyx_sst_abs(value) __builtin_llabs(value)
661 #else
662 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
663 #endif
664 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
665 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
666 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
667 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
668 #define __Pyx_PyBytes_FromString PyBytes_FromString
669 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
670 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
671 #if PY_MAJOR_VERSION < 3
672 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
673 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
674 #else
675 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
676 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
677 #endif
678 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
679 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
680 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
681 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
682 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
683 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
684 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
685 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
686 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
687 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
688 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
689 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
690 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
691 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
692 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
693 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)694 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
695 const Py_UNICODE *u_end = u;
696 while (*u_end++) ;
697 return (size_t)(u_end - u - 1);
698 }
699 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
700 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
701 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
702 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
703 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
704 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
705 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
706 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
707 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
708 #define __Pyx_PySequence_Tuple(obj)\
709 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
710 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
711 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
712 #if CYTHON_ASSUME_SAFE_MACROS
713 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
714 #else
715 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
716 #endif
717 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
718 #if PY_MAJOR_VERSION >= 3
719 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
720 #else
721 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
722 #endif
723 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
724 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
725 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)726 static int __Pyx_init_sys_getdefaultencoding_params(void) {
727 PyObject* sys;
728 PyObject* default_encoding = NULL;
729 PyObject* ascii_chars_u = NULL;
730 PyObject* ascii_chars_b = NULL;
731 const char* default_encoding_c;
732 sys = PyImport_ImportModule("sys");
733 if (!sys) goto bad;
734 default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
735 Py_DECREF(sys);
736 if (!default_encoding) goto bad;
737 default_encoding_c = PyBytes_AsString(default_encoding);
738 if (!default_encoding_c) goto bad;
739 if (strcmp(default_encoding_c, "ascii") == 0) {
740 __Pyx_sys_getdefaultencoding_not_ascii = 0;
741 } else {
742 char ascii_chars[128];
743 int c;
744 for (c = 0; c < 128; c++) {
745 ascii_chars[c] = c;
746 }
747 __Pyx_sys_getdefaultencoding_not_ascii = 1;
748 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
749 if (!ascii_chars_u) goto bad;
750 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
751 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
752 PyErr_Format(
753 PyExc_ValueError,
754 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
755 default_encoding_c);
756 goto bad;
757 }
758 Py_DECREF(ascii_chars_u);
759 Py_DECREF(ascii_chars_b);
760 }
761 Py_DECREF(default_encoding);
762 return 0;
763 bad:
764 Py_XDECREF(default_encoding);
765 Py_XDECREF(ascii_chars_u);
766 Py_XDECREF(ascii_chars_b);
767 return -1;
768 }
769 #endif
770 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
771 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
772 #else
773 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
774 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
775 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)776 static int __Pyx_init_sys_getdefaultencoding_params(void) {
777 PyObject* sys;
778 PyObject* default_encoding = NULL;
779 char* default_encoding_c;
780 sys = PyImport_ImportModule("sys");
781 if (!sys) goto bad;
782 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
783 Py_DECREF(sys);
784 if (!default_encoding) goto bad;
785 default_encoding_c = PyBytes_AsString(default_encoding);
786 if (!default_encoding_c) goto bad;
787 __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
788 if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
789 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
790 Py_DECREF(default_encoding);
791 return 0;
792 bad:
793 Py_XDECREF(default_encoding);
794 return -1;
795 }
796 #endif
797 #endif
798
799
800 /* Test for GCC > 2.95 */
801 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
802 #define likely(x) __builtin_expect(!!(x), 1)
803 #define unlikely(x) __builtin_expect(!!(x), 0)
804 #else /* !__GNUC__ or GCC < 2.95 */
805 #define likely(x) (x)
806 #define unlikely(x) (x)
807 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)808 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
809
810 static PyObject *__pyx_m = NULL;
811 static PyObject *__pyx_d;
812 static PyObject *__pyx_b;
813 static PyObject *__pyx_cython_runtime = NULL;
814 static PyObject *__pyx_empty_tuple;
815 static PyObject *__pyx_empty_bytes;
816 static PyObject *__pyx_empty_unicode;
817 static int __pyx_lineno;
818 static int __pyx_clineno = 0;
819 static const char * __pyx_cfilenm= __FILE__;
820 static const char *__pyx_filename;
821
822 /* Header.proto */
823 #if !defined(CYTHON_CCOMPLEX)
824 #if defined(__cplusplus)
825 #define CYTHON_CCOMPLEX 1
826 #elif defined(_Complex_I)
827 #define CYTHON_CCOMPLEX 1
828 #else
829 #define CYTHON_CCOMPLEX 0
830 #endif
831 #endif
832 #if CYTHON_CCOMPLEX
833 #ifdef __cplusplus
834 #include <complex>
835 #else
836 #include <complex.h>
837 #endif
838 #endif
839 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
840 #undef _Complex_I
841 #define _Complex_I 1.0fj
842 #endif
843
844
845 static const char *__pyx_f[] = {
846 "stringsource",
847 "yt/utilities/lib/depth_first_octree.pyx",
848 "__init__.pxd",
849 "type.pxd",
850 };
851 /* BufferFormatStructs.proto */
852 #define IS_UNSIGNED(type) (((type) -1) > 0)
853 struct __Pyx_StructField_;
854 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
855 typedef struct {
856 const char* name;
857 struct __Pyx_StructField_* fields;
858 size_t size;
859 size_t arraysize[8];
860 int ndim;
861 char typegroup;
862 char is_unsigned;
863 int flags;
864 } __Pyx_TypeInfo;
865 typedef struct __Pyx_StructField_ {
866 __Pyx_TypeInfo* type;
867 const char* name;
868 size_t offset;
869 } __Pyx_StructField;
870 typedef struct {
871 __Pyx_StructField* field;
872 size_t parent_offset;
873 } __Pyx_BufFmt_StackElem;
874 typedef struct {
875 __Pyx_StructField root;
876 __Pyx_BufFmt_StackElem* head;
877 size_t fmt_offset;
878 size_t new_count, enc_count;
879 size_t struct_alignment;
880 int is_complex;
881 char enc_type;
882 char new_packmode;
883 char enc_packmode;
884 char is_valid_array;
885 } __Pyx_BufFmt_Context;
886
887
888 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776
889 * # in Cython to enable them only on the right systems.
890 *
891 * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
892 * ctypedef npy_int16 int16_t
893 * ctypedef npy_int32 int32_t
894 */
895 typedef npy_int8 __pyx_t_5numpy_int8_t;
896
897 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":777
898 *
899 * ctypedef npy_int8 int8_t
900 * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
901 * ctypedef npy_int32 int32_t
902 * ctypedef npy_int64 int64_t
903 */
904 typedef npy_int16 __pyx_t_5numpy_int16_t;
905
906 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778
907 * ctypedef npy_int8 int8_t
908 * ctypedef npy_int16 int16_t
909 * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
910 * ctypedef npy_int64 int64_t
911 * #ctypedef npy_int96 int96_t
912 */
913 typedef npy_int32 __pyx_t_5numpy_int32_t;
914
915 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779
916 * ctypedef npy_int16 int16_t
917 * ctypedef npy_int32 int32_t
918 * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
919 * #ctypedef npy_int96 int96_t
920 * #ctypedef npy_int128 int128_t
921 */
922 typedef npy_int64 __pyx_t_5numpy_int64_t;
923
924 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":783
925 * #ctypedef npy_int128 int128_t
926 *
927 * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
928 * ctypedef npy_uint16 uint16_t
929 * ctypedef npy_uint32 uint32_t
930 */
931 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
932
933 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784
934 *
935 * ctypedef npy_uint8 uint8_t
936 * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
937 * ctypedef npy_uint32 uint32_t
938 * ctypedef npy_uint64 uint64_t
939 */
940 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
941
942 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785
943 * ctypedef npy_uint8 uint8_t
944 * ctypedef npy_uint16 uint16_t
945 * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
946 * ctypedef npy_uint64 uint64_t
947 * #ctypedef npy_uint96 uint96_t
948 */
949 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
950
951 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":786
952 * ctypedef npy_uint16 uint16_t
953 * ctypedef npy_uint32 uint32_t
954 * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
955 * #ctypedef npy_uint96 uint96_t
956 * #ctypedef npy_uint128 uint128_t
957 */
958 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
959
960 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790
961 * #ctypedef npy_uint128 uint128_t
962 *
963 * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
964 * ctypedef npy_float64 float64_t
965 * #ctypedef npy_float80 float80_t
966 */
967 typedef npy_float32 __pyx_t_5numpy_float32_t;
968
969 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791
970 *
971 * ctypedef npy_float32 float32_t
972 * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
973 * #ctypedef npy_float80 float80_t
974 * #ctypedef npy_float128 float128_t
975 */
976 typedef npy_float64 __pyx_t_5numpy_float64_t;
977
978 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":800
979 * # The int types are mapped a bit surprising --
980 * # numpy.int corresponds to 'l' and numpy.long to 'q'
981 * ctypedef npy_long int_t # <<<<<<<<<<<<<<
982 * ctypedef npy_longlong long_t
983 * ctypedef npy_longlong longlong_t
984 */
985 typedef npy_long __pyx_t_5numpy_int_t;
986
987 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801
988 * # numpy.int corresponds to 'l' and numpy.long to 'q'
989 * ctypedef npy_long int_t
990 * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
991 * ctypedef npy_longlong longlong_t
992 *
993 */
994 typedef npy_longlong __pyx_t_5numpy_long_t;
995
996 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802
997 * ctypedef npy_long int_t
998 * ctypedef npy_longlong long_t
999 * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1000 *
1001 * ctypedef npy_ulong uint_t
1002 */
1003 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1004
1005 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":804
1006 * ctypedef npy_longlong longlong_t
1007 *
1008 * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1009 * ctypedef npy_ulonglong ulong_t
1010 * ctypedef npy_ulonglong ulonglong_t
1011 */
1012 typedef npy_ulong __pyx_t_5numpy_uint_t;
1013
1014 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805
1015 *
1016 * ctypedef npy_ulong uint_t
1017 * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1018 * ctypedef npy_ulonglong ulonglong_t
1019 *
1020 */
1021 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1022
1023 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806
1024 * ctypedef npy_ulong uint_t
1025 * ctypedef npy_ulonglong ulong_t
1026 * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1027 *
1028 * ctypedef npy_intp intp_t
1029 */
1030 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1031
1032 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":808
1033 * ctypedef npy_ulonglong ulonglong_t
1034 *
1035 * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1036 * ctypedef npy_uintp uintp_t
1037 *
1038 */
1039 typedef npy_intp __pyx_t_5numpy_intp_t;
1040
1041 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809
1042 *
1043 * ctypedef npy_intp intp_t
1044 * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1045 *
1046 * ctypedef npy_double float_t
1047 */
1048 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1049
1050 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":811
1051 * ctypedef npy_uintp uintp_t
1052 *
1053 * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1054 * ctypedef npy_double double_t
1055 * ctypedef npy_longdouble longdouble_t
1056 */
1057 typedef npy_double __pyx_t_5numpy_float_t;
1058
1059 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812
1060 *
1061 * ctypedef npy_double float_t
1062 * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1063 * ctypedef npy_longdouble longdouble_t
1064 *
1065 */
1066 typedef npy_double __pyx_t_5numpy_double_t;
1067
1068 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813
1069 * ctypedef npy_double float_t
1070 * ctypedef npy_double double_t
1071 * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1072 *
1073 * ctypedef npy_cfloat cfloat_t
1074 */
1075 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1076 /* Declarations.proto */
1077 #if CYTHON_CCOMPLEX
1078 #ifdef __cplusplus
1079 typedef ::std::complex< float > __pyx_t_float_complex;
1080 #else
1081 typedef float _Complex __pyx_t_float_complex;
1082 #endif
1083 #else
1084 typedef struct { float real, imag; } __pyx_t_float_complex;
1085 #endif
1086 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1087
1088 /* Declarations.proto */
1089 #if CYTHON_CCOMPLEX
1090 #ifdef __cplusplus
1091 typedef ::std::complex< double > __pyx_t_double_complex;
1092 #else
1093 typedef double _Complex __pyx_t_double_complex;
1094 #endif
1095 #else
1096 typedef struct { double real, imag; } __pyx_t_double_complex;
1097 #endif
1098 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1099
1100
1101 /*--- Type declarations ---*/
1102 struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position;
1103 struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid;
1104 struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList;
1105
1106 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":815
1107 * ctypedef npy_longdouble longdouble_t
1108 *
1109 * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1110 * ctypedef npy_cdouble cdouble_t
1111 * ctypedef npy_clongdouble clongdouble_t
1112 */
1113 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1114
1115 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":816
1116 *
1117 * ctypedef npy_cfloat cfloat_t
1118 * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1119 * ctypedef npy_clongdouble clongdouble_t
1120 *
1121 */
1122 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1123
1124 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":817
1125 * ctypedef npy_cfloat cfloat_t
1126 * ctypedef npy_cdouble cdouble_t
1127 * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1128 *
1129 * ctypedef npy_cdouble complex_t
1130 */
1131 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1132
1133 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":819
1134 * ctypedef npy_clongdouble clongdouble_t
1135 *
1136 * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1137 *
1138 * cdef inline object PyArray_MultiIterNew1(a):
1139 */
1140 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1141
1142 /* "yt/utilities/lib/depth_first_octree.pyx":17
1143 *
1144 *
1145 * cdef class position: # <<<<<<<<<<<<<<
1146 * cdef public int output_pos, refined_pos
1147 * def __cinit__(self):
1148 */
1149 struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position {
1150 PyObject_HEAD
1151 int output_pos;
1152 int refined_pos;
1153 };
1154
1155
1156 /* "yt/utilities/lib/depth_first_octree.pyx":23
1157 * self.refined_pos = 0
1158 *
1159 * cdef class OctreeGrid: # <<<<<<<<<<<<<<
1160 * cdef public object child_indices, fields, left_edges, dimensions, dx
1161 * cdef public int level, offset
1162 */
1163 struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid {
1164 PyObject_HEAD
1165 PyObject *child_indices;
1166 PyObject *fields;
1167 PyObject *left_edges;
1168 PyObject *dimensions;
1169 PyObject *dx;
1170 int level;
1171 int offset;
1172 };
1173
1174
1175 /* "yt/utilities/lib/depth_first_octree.pyx":41
1176 * self.offset = offset
1177 *
1178 * cdef class OctreeGridList: # <<<<<<<<<<<<<<
1179 * cdef public object grids
1180 * def __cinit__(self, grids):
1181 */
1182 struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList {
1183 PyObject_HEAD
1184 PyObject *grids;
1185 };
1186
1187
1188 /* --- Runtime support code (head) --- */
1189 /* Refnanny.proto */
1190 #ifndef CYTHON_REFNANNY
1191 #define CYTHON_REFNANNY 0
1192 #endif
1193 #if CYTHON_REFNANNY
1194 typedef struct {
1195 void (*INCREF)(void*, PyObject*, int);
1196 void (*DECREF)(void*, PyObject*, int);
1197 void (*GOTREF)(void*, PyObject*, int);
1198 void (*GIVEREF)(void*, PyObject*, int);
1199 void* (*SetupContext)(const char*, int, const char*);
1200 void (*FinishContext)(void**);
1201 } __Pyx_RefNannyAPIStruct;
1202 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1203 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1204 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1205 #ifdef WITH_THREAD
1206 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1207 if (acquire_gil) {\
1208 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1209 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1210 PyGILState_Release(__pyx_gilstate_save);\
1211 } else {\
1212 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1213 }
1214 #else
1215 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1216 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1217 #endif
1218 #define __Pyx_RefNannyFinishContext()\
1219 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1220 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1221 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1222 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1223 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1224 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1225 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1226 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1227 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1228 #else
1229 #define __Pyx_RefNannyDeclarations
1230 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1231 #define __Pyx_RefNannyFinishContext()
1232 #define __Pyx_INCREF(r) Py_INCREF(r)
1233 #define __Pyx_DECREF(r) Py_DECREF(r)
1234 #define __Pyx_GOTREF(r)
1235 #define __Pyx_GIVEREF(r)
1236 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1237 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1238 #define __Pyx_XGOTREF(r)
1239 #define __Pyx_XGIVEREF(r)
1240 #endif
1241 #define __Pyx_XDECREF_SET(r, v) do {\
1242 PyObject *tmp = (PyObject *) r;\
1243 r = v; __Pyx_XDECREF(tmp);\
1244 } while (0)
1245 #define __Pyx_DECREF_SET(r, v) do {\
1246 PyObject *tmp = (PyObject *) r;\
1247 r = v; __Pyx_DECREF(tmp);\
1248 } while (0)
1249 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1250 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1251
1252 /* PyObjectGetAttrStr.proto */
1253 #if CYTHON_USE_TYPE_SLOTS
1254 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1255 #else
1256 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1257 #endif
1258
1259 /* GetBuiltinName.proto */
1260 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1261
1262 /* RaiseArgTupleInvalid.proto */
1263 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1264 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1265
1266 /* KeywordStringCheck.proto */
1267 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
1268
1269 /* PyObjectCall.proto */
1270 #if CYTHON_COMPILING_IN_CPYTHON
1271 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1272 #else
1273 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1274 #endif
1275
1276 /* PyThreadStateGet.proto */
1277 #if CYTHON_FAST_THREAD_STATE
1278 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1279 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1280 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1281 #else
1282 #define __Pyx_PyThreadState_declare
1283 #define __Pyx_PyThreadState_assign
1284 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1285 #endif
1286
1287 /* PyErrFetchRestore.proto */
1288 #if CYTHON_FAST_THREAD_STATE
1289 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1290 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1291 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1292 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1293 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1294 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1295 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1296 #if CYTHON_COMPILING_IN_CPYTHON
1297 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1298 #else
1299 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1300 #endif
1301 #else
1302 #define __Pyx_PyErr_Clear() PyErr_Clear()
1303 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1304 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1305 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1306 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1307 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1308 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1309 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1310 #endif
1311
1312 /* RaiseException.proto */
1313 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1314
1315 /* RaiseDoubleKeywords.proto */
1316 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1317
1318 /* ParseKeywords.proto */
1319 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1320 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1321 const char* function_name);
1322
1323 /* ArgTypeTest.proto */
1324 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1325 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1326 __Pyx__ArgTypeTest(obj, type, name, exact))
1327 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1328
1329 /* IsLittleEndian.proto */
1330 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
1331
1332 /* BufferFormatCheck.proto */
1333 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
1334 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
1335 __Pyx_BufFmt_StackElem* stack,
1336 __Pyx_TypeInfo* type);
1337
1338 /* BufferGetAndValidate.proto */
1339 #define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
1340 ((obj == Py_None || obj == NULL) ?\
1341 (__Pyx_ZeroBuffer(buf), 0) :\
1342 __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
1343 static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
1344 __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
1345 static void __Pyx_ZeroBuffer(Py_buffer* buf);
1346 static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
1347 static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
1348 static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
1349
1350 /* GetItemInt.proto */
1351 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1352 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1353 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1354 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1355 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1356 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1357 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1358 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1359 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1360 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1361 int wraparound, int boundscheck);
1362 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1363 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1364 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1365 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1366 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1367 int wraparound, int boundscheck);
1368 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1369 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1370 int is_list, int wraparound, int boundscheck);
1371
1372 /* ExtTypeTest.proto */
1373 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1374
1375 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
1376 /* ObjectGetItem.proto */
1377 #if CYTHON_USE_TYPE_SLOTS
1378 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1379 #else
1380 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1381 #endif
1382
1383 #define __Pyx_BufPtrStrided4d(type, buf, i0, s0, i1, s1, i2, s2, i3, s3) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2 + i3 * s3)
1384 #define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
1385 /* BufferFallbackError.proto */
1386 static void __Pyx_RaiseBufferFallbackError(void);
1387
1388 /* PyDictVersioning.proto */
1389 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1390 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1391 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1392 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1393 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1394 (cache_var) = (value);
1395 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1396 static PY_UINT64_T __pyx_dict_version = 0;\
1397 static PyObject *__pyx_dict_cached_value = NULL;\
1398 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1399 (VAR) = __pyx_dict_cached_value;\
1400 } else {\
1401 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1402 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1403 }\
1404 }
1405 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1406 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1407 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1408 #else
1409 #define __PYX_GET_DICT_VERSION(dict) (0)
1410 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1411 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1412 #endif
1413
1414 /* GetModuleGlobalName.proto */
1415 #if CYTHON_USE_DICT_VERSIONS
1416 #define __Pyx_GetModuleGlobalName(var, name) {\
1417 static PY_UINT64_T __pyx_dict_version = 0;\
1418 static PyObject *__pyx_dict_cached_value = NULL;\
1419 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1420 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1421 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1422 }
1423 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1424 PY_UINT64_T __pyx_dict_version;\
1425 PyObject *__pyx_dict_cached_value;\
1426 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1427 }
1428 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1429 #else
1430 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1431 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1432 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1433 #endif
1434
1435 /* PyFunctionFastCall.proto */
1436 #if CYTHON_FAST_PYCALL
1437 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1438 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1439 #if 1 || PY_VERSION_HEX < 0x030600B1
1440 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1441 #else
1442 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1443 #endif
1444 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1445 (sizeof(char [1 - 2*!(cond)]) - 1)
1446 #ifndef Py_MEMBER_SIZE
1447 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1448 #endif
1449 static size_t __pyx_pyframe_localsplus_offset = 0;
1450 #include "frameobject.h"
1451 #define __Pxy_PyFrame_Initialize_Offsets()\
1452 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1453 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1454 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1455 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1456 #endif
1457
1458 /* PyCFunctionFastCall.proto */
1459 #if CYTHON_FAST_PYCCALL
1460 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1461 #else
1462 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1463 #endif
1464
1465 #define __Pyx_BufPtrStrided3d(type, buf, i0, s0, i1, s1, i2, s2) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2)
1466 /* PyObjectCallMethO.proto */
1467 #if CYTHON_COMPILING_IN_CPYTHON
1468 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1469 #endif
1470
1471 /* PyObjectCallOneArg.proto */
1472 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1473
1474 /* DictGetItem.proto */
1475 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1476 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1477 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1478 (likely(PyDict_CheckExact(obj)) ?\
1479 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1480 #else
1481 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1482 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1483 #endif
1484
1485 /* RaiseTooManyValuesToUnpack.proto */
1486 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1487
1488 /* RaiseNeedMoreValuesToUnpack.proto */
1489 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1490
1491 /* RaiseNoneIterError.proto */
1492 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1493
1494 /* GetTopmostException.proto */
1495 #if CYTHON_USE_EXC_INFO_STACK
1496 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1497 #endif
1498
1499 /* SaveResetException.proto */
1500 #if CYTHON_FAST_THREAD_STATE
1501 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1502 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1503 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1504 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1505 #else
1506 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1507 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1508 #endif
1509
1510 /* PyErrExceptionMatches.proto */
1511 #if CYTHON_FAST_THREAD_STATE
1512 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1513 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1514 #else
1515 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1516 #endif
1517
1518 /* GetException.proto */
1519 #if CYTHON_FAST_THREAD_STATE
1520 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1521 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1522 #else
1523 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1524 #endif
1525
1526 /* PyObject_GenericGetAttrNoDict.proto */
1527 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1528 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1529 #else
1530 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1531 #endif
1532
1533 /* PyObject_GenericGetAttr.proto */
1534 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1535 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1536 #else
1537 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1538 #endif
1539
1540 /* SetupReduce.proto */
1541 static int __Pyx_setup_reduce(PyObject* type_obj);
1542
1543 /* TypeImport.proto */
1544 #ifndef __PYX_HAVE_RT_ImportType_proto
1545 #define __PYX_HAVE_RT_ImportType_proto
1546 enum __Pyx_ImportType_CheckSize {
1547 __Pyx_ImportType_CheckSize_Error = 0,
1548 __Pyx_ImportType_CheckSize_Warn = 1,
1549 __Pyx_ImportType_CheckSize_Ignore = 2
1550 };
1551 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1552 #endif
1553
1554 /* Import.proto */
1555 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1556
1557 /* CLineInTraceback.proto */
1558 #ifdef CYTHON_CLINE_IN_TRACEBACK
1559 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1560 #else
1561 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1562 #endif
1563
1564 /* CodeObjectCache.proto */
1565 typedef struct {
1566 PyCodeObject* code_object;
1567 int code_line;
1568 } __Pyx_CodeObjectCacheEntry;
1569 struct __Pyx_CodeObjectCache {
1570 int count;
1571 int max_count;
1572 __Pyx_CodeObjectCacheEntry* entries;
1573 };
1574 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1575 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1576 static PyCodeObject *__pyx_find_code_object(int code_line);
1577 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1578
1579 /* AddTraceback.proto */
1580 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1581 int py_line, const char *filename);
1582
1583 /* BufferStructDeclare.proto */
1584 typedef struct {
1585 Py_ssize_t shape, strides, suboffsets;
1586 } __Pyx_Buf_DimInfo;
1587 typedef struct {
1588 size_t refcount;
1589 Py_buffer pybuffer;
1590 } __Pyx_Buffer;
1591 typedef struct {
1592 __Pyx_Buffer *rcbuffer;
1593 char *data;
1594 __Pyx_Buf_DimInfo diminfo[8];
1595 } __Pyx_LocalBuf_ND;
1596
1597 #if PY_MAJOR_VERSION < 3
1598 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
1599 static void __Pyx_ReleaseBuffer(Py_buffer *view);
1600 #else
1601 #define __Pyx_GetBuffer PyObject_GetBuffer
1602 #define __Pyx_ReleaseBuffer PyBuffer_Release
1603 #endif
1604
1605
1606 /* CIntToPy.proto */
1607 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
1608
1609 /* CIntToPy.proto */
1610 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1611
1612 /* CIntToPy.proto */
1613 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);
1614
1615 /* CIntToPy.proto */
1616 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value);
1617
1618 /* RealImag.proto */
1619 #if CYTHON_CCOMPLEX
1620 #ifdef __cplusplus
1621 #define __Pyx_CREAL(z) ((z).real())
1622 #define __Pyx_CIMAG(z) ((z).imag())
1623 #else
1624 #define __Pyx_CREAL(z) (__real__(z))
1625 #define __Pyx_CIMAG(z) (__imag__(z))
1626 #endif
1627 #else
1628 #define __Pyx_CREAL(z) ((z).real)
1629 #define __Pyx_CIMAG(z) ((z).imag)
1630 #endif
1631 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1632 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1633 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1634 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1635 #else
1636 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1637 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1638 #endif
1639
1640 /* Arithmetic.proto */
1641 #if CYTHON_CCOMPLEX
1642 #define __Pyx_c_eq_float(a, b) ((a)==(b))
1643 #define __Pyx_c_sum_float(a, b) ((a)+(b))
1644 #define __Pyx_c_diff_float(a, b) ((a)-(b))
1645 #define __Pyx_c_prod_float(a, b) ((a)*(b))
1646 #define __Pyx_c_quot_float(a, b) ((a)/(b))
1647 #define __Pyx_c_neg_float(a) (-(a))
1648 #ifdef __cplusplus
1649 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
1650 #define __Pyx_c_conj_float(z) (::std::conj(z))
1651 #if 1
1652 #define __Pyx_c_abs_float(z) (::std::abs(z))
1653 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
1654 #endif
1655 #else
1656 #define __Pyx_c_is_zero_float(z) ((z)==0)
1657 #define __Pyx_c_conj_float(z) (conjf(z))
1658 #if 1
1659 #define __Pyx_c_abs_float(z) (cabsf(z))
1660 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
1661 #endif
1662 #endif
1663 #else
1664 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1665 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1666 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1667 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1668 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1669 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1670 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1671 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1672 #if 1
1673 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
1674 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1675 #endif
1676 #endif
1677
1678 /* Arithmetic.proto */
1679 #if CYTHON_CCOMPLEX
1680 #define __Pyx_c_eq_double(a, b) ((a)==(b))
1681 #define __Pyx_c_sum_double(a, b) ((a)+(b))
1682 #define __Pyx_c_diff_double(a, b) ((a)-(b))
1683 #define __Pyx_c_prod_double(a, b) ((a)*(b))
1684 #define __Pyx_c_quot_double(a, b) ((a)/(b))
1685 #define __Pyx_c_neg_double(a) (-(a))
1686 #ifdef __cplusplus
1687 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
1688 #define __Pyx_c_conj_double(z) (::std::conj(z))
1689 #if 1
1690 #define __Pyx_c_abs_double(z) (::std::abs(z))
1691 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
1692 #endif
1693 #else
1694 #define __Pyx_c_is_zero_double(z) ((z)==0)
1695 #define __Pyx_c_conj_double(z) (conj(z))
1696 #if 1
1697 #define __Pyx_c_abs_double(z) (cabs(z))
1698 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
1699 #endif
1700 #endif
1701 #else
1702 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1703 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1704 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1705 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1706 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1707 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1708 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1709 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1710 #if 1
1711 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
1712 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1713 #endif
1714 #endif
1715
1716 /* CIntToPy.proto */
1717 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
1718
1719 /* CIntFromPy.proto */
1720 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1721
1722 /* CIntFromPy.proto */
1723 static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *);
1724
1725 /* CIntFromPy.proto */
1726 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1727
1728 /* FastTypeChecks.proto */
1729 #if CYTHON_COMPILING_IN_CPYTHON
1730 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1731 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1732 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1733 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1734 #else
1735 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1736 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1737 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1738 #endif
1739 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1740
1741 /* CheckBinaryVersion.proto */
1742 static int __Pyx_check_binary_version(void);
1743
1744 /* InitStrings.proto */
1745 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1746
1747
1748 /* Module declarations from 'cython' */
1749
1750 /* Module declarations from 'cpython.buffer' */
1751
1752 /* Module declarations from 'libc.string' */
1753
1754 /* Module declarations from 'libc.stdio' */
1755
1756 /* Module declarations from '__builtin__' */
1757
1758 /* Module declarations from 'cpython.type' */
1759 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
1760
1761 /* Module declarations from 'cpython' */
1762
1763 /* Module declarations from 'cpython.object' */
1764
1765 /* Module declarations from 'cpython.ref' */
1766
1767 /* Module declarations from 'cpython.mem' */
1768
1769 /* Module declarations from 'numpy' */
1770
1771 /* Module declarations from 'numpy' */
1772 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
1773 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
1774 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
1775 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
1776 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
1777 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
1778
1779 /* Module declarations from 'yt.utilities.lib.depth_first_octree' */
1780 static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_position = 0;
1781 static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid = 0;
1782 static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList = 0;
1783 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 };
1784 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 };
1785 #define __Pyx_MODULE_NAME "yt.utilities.lib.depth_first_octree"
1786 extern int __pyx_module_is_main_yt__utilities__lib__depth_first_octree;
1787 int __pyx_module_is_main_yt__utilities__lib__depth_first_octree = 0;
1788
1789 /* Implementation of 'yt.utilities.lib.depth_first_octree' */
1790 static PyObject *__pyx_builtin_TypeError;
1791 static PyObject *__pyx_builtin_range;
1792 static PyObject *__pyx_builtin_ValueError;
1793 static PyObject *__pyx_builtin_RuntimeError;
1794 static PyObject *__pyx_builtin_ImportError;
1795 static const char __pyx_k_i[] = "i";
1796 static const char __pyx_k_j[] = "j";
1797 static const char __pyx_k_k[] = "k";
1798 static const char __pyx_k_s[] = "s";
1799 static const char __pyx_k_ci[] = "ci";
1800 static const char __pyx_k_cp[] = "cp";
1801 static const char __pyx_k_cx[] = "cx";
1802 static const char __pyx_k_cy[] = "cy";
1803 static const char __pyx_k_cz[] = "cz";
1804 static const char __pyx_k_dx[] = "dx";
1805 static const char __pyx_k_fi[] = "fi";
1806 static const char __pyx_k_gi[] = "gi";
1807 static const char __pyx_k_np[] = "np";
1808 static const char __pyx_k_i_f[] = "i_f";
1809 static const char __pyx_k_i_i[] = "i_i";
1810 static const char __pyx_k_j_f[] = "j_f";
1811 static const char __pyx_k_j_i[] = "j_i";
1812 static const char __pyx_k_k_f[] = "k_f";
1813 static const char __pyx_k_k_i[] = "k_i";
1814 static const char __pyx_k_grid[] = "grid";
1815 static const char __pyx_k_main[] = "__main__";
1816 static const char __pyx_k_name[] = "__name__";
1817 static const char __pyx_k_test[] = "__test__";
1818 static const char __pyx_k_grids[] = "grids";
1819 static const char __pyx_k_i_off[] = "i_off";
1820 static const char __pyx_k_j_off[] = "j_off";
1821 static const char __pyx_k_k_off[] = "k_off";
1822 static const char __pyx_k_level[] = "level";
1823 static const char __pyx_k_numpy[] = "numpy";
1824 static const char __pyx_k_range[] = "range";
1825 static const char __pyx_k_curpos[] = "curpos";
1826 static const char __pyx_k_fields[] = "fields";
1827 static const char __pyx_k_import[] = "__import__";
1828 static const char __pyx_k_offset[] = "offset";
1829 static const char __pyx_k_output[] = "output";
1830 static const char __pyx_k_reduce[] = "__reduce__";
1831 static const char __pyx_k_child_i[] = "child_i";
1832 static const char __pyx_k_child_j[] = "child_j";
1833 static const char __pyx_k_child_k[] = "child_k";
1834 static const char __pyx_k_corners[] = "corners";
1835 static const char __pyx_k_refined[] = "refined";
1836 static const char __pyx_k_child_dx[] = "child_dx";
1837 static const char __pyx_k_getstate[] = "__getstate__";
1838 static const char __pyx_k_position[] = "position";
1839 static const char __pyx_k_setstate[] = "__setstate__";
1840 static const char __pyx_k_TypeError[] = "TypeError";
1841 static const char __pyx_k_genealogy[] = "genealogy";
1842 static const char __pyx_k_leftedges[] = "leftedges";
1843 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
1844 static const char __pyx_k_OctreeGrid[] = "OctreeGrid";
1845 static const char __pyx_k_ValueError[] = "ValueError";
1846 static const char __pyx_k_child_grid[] = "child_grid";
1847 static const char __pyx_k_dimensions[] = "dimensions";
1848 static const char __pyx_k_left_edges[] = "left_edges";
1849 static const char __pyx_k_ImportError[] = "ImportError";
1850 static const char __pyx_k_RuntimeError[] = "RuntimeError";
1851 static const char __pyx_k_child_indices[] = "child_indices";
1852 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
1853 static const char __pyx_k_OctreeGridList[] = "OctreeGridList";
1854 static const char __pyx_k_child_leftedges[] = "child_leftedges";
1855 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
1856 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
1857 static const char __pyx_k_RecurseOctreeByLevels[] = "RecurseOctreeByLevels";
1858 static const char __pyx_k_RecurseOctreeDepthFirst[] = "RecurseOctreeDepthFirst";
1859 static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
1860 static const char __pyx_k_This_is_a_recursive_function_to[] = "\nThis is a recursive function to return a depth-first octree\n\n\n\n";
1861 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
1862 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
1863 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
1864 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
1865 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
1866 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
1867 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
1868 static const char __pyx_k_yt_utilities_lib_depth_first_oct[] = "yt/utilities/lib/depth_first_octree.pyx";
1869 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
1870 static const char __pyx_k_yt_utilities_lib_depth_first_oct_2[] = "yt.utilities.lib.depth_first_octree";
1871 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
1872 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
1873 static PyObject *__pyx_n_s_ImportError;
1874 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
1875 static PyObject *__pyx_n_s_OctreeGrid;
1876 static PyObject *__pyx_n_s_OctreeGridList;
1877 static PyObject *__pyx_n_s_RecurseOctreeByLevels;
1878 static PyObject *__pyx_n_s_RecurseOctreeDepthFirst;
1879 static PyObject *__pyx_n_s_RuntimeError;
1880 static PyObject *__pyx_n_s_TypeError;
1881 static PyObject *__pyx_n_s_ValueError;
1882 static PyObject *__pyx_n_s_child_dx;
1883 static PyObject *__pyx_n_s_child_grid;
1884 static PyObject *__pyx_n_s_child_i;
1885 static PyObject *__pyx_n_s_child_indices;
1886 static PyObject *__pyx_n_s_child_j;
1887 static PyObject *__pyx_n_s_child_k;
1888 static PyObject *__pyx_n_s_child_leftedges;
1889 static PyObject *__pyx_n_s_ci;
1890 static PyObject *__pyx_n_s_cline_in_traceback;
1891 static PyObject *__pyx_n_s_corners;
1892 static PyObject *__pyx_n_s_cp;
1893 static PyObject *__pyx_n_s_curpos;
1894 static PyObject *__pyx_n_s_cx;
1895 static PyObject *__pyx_n_s_cy;
1896 static PyObject *__pyx_n_s_cz;
1897 static PyObject *__pyx_n_s_dimensions;
1898 static PyObject *__pyx_n_s_dx;
1899 static PyObject *__pyx_n_s_fi;
1900 static PyObject *__pyx_n_s_fields;
1901 static PyObject *__pyx_n_s_genealogy;
1902 static PyObject *__pyx_n_s_getstate;
1903 static PyObject *__pyx_n_s_gi;
1904 static PyObject *__pyx_n_s_grid;
1905 static PyObject *__pyx_n_s_grids;
1906 static PyObject *__pyx_n_s_i;
1907 static PyObject *__pyx_n_s_i_f;
1908 static PyObject *__pyx_n_s_i_i;
1909 static PyObject *__pyx_n_s_i_off;
1910 static PyObject *__pyx_n_s_import;
1911 static PyObject *__pyx_n_s_j;
1912 static PyObject *__pyx_n_s_j_f;
1913 static PyObject *__pyx_n_s_j_i;
1914 static PyObject *__pyx_n_s_j_off;
1915 static PyObject *__pyx_n_s_k;
1916 static PyObject *__pyx_n_s_k_f;
1917 static PyObject *__pyx_n_s_k_i;
1918 static PyObject *__pyx_n_s_k_off;
1919 static PyObject *__pyx_n_s_left_edges;
1920 static PyObject *__pyx_n_s_leftedges;
1921 static PyObject *__pyx_n_s_level;
1922 static PyObject *__pyx_n_s_main;
1923 static PyObject *__pyx_n_s_name;
1924 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
1925 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
1926 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
1927 static PyObject *__pyx_n_s_np;
1928 static PyObject *__pyx_n_s_numpy;
1929 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
1930 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
1931 static PyObject *__pyx_n_s_offset;
1932 static PyObject *__pyx_n_s_output;
1933 static PyObject *__pyx_n_s_position;
1934 static PyObject *__pyx_n_s_range;
1935 static PyObject *__pyx_n_s_reduce;
1936 static PyObject *__pyx_n_s_reduce_cython;
1937 static PyObject *__pyx_n_s_reduce_ex;
1938 static PyObject *__pyx_n_s_refined;
1939 static PyObject *__pyx_n_s_s;
1940 static PyObject *__pyx_n_s_setstate;
1941 static PyObject *__pyx_n_s_setstate_cython;
1942 static PyObject *__pyx_n_s_test;
1943 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
1944 static PyObject *__pyx_kp_s_yt_utilities_lib_depth_first_oct;
1945 static PyObject *__pyx_n_s_yt_utilities_lib_depth_first_oct_2;
1946 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position___cinit__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__pyx_v_self); /* proto */
1947 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_10output_pos___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__pyx_v_self); /* proto */
1948 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_10output_pos_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
1949 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_11refined_pos___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__pyx_v_self); /* proto */
1950 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_11refined_pos_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
1951 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__pyx_v_self); /* proto */
1952 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
1953 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid___cinit__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self, PyArrayObject *__pyx_v_child_indices, PyArrayObject *__pyx_v_fields, PyArrayObject *__pyx_v_left_edges, PyArrayObject *__pyx_v_dimensions, PyArrayObject *__pyx_v_dx, int __pyx_v_level, int __pyx_v_offset); /* proto */
1954 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self); /* proto */
1955 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
1956 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices_4__del__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self); /* proto */
1957 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6fields___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self); /* proto */
1958 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6fields_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
1959 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6fields_4__del__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self); /* proto */
1960 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10left_edges___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self); /* proto */
1961 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10left_edges_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
1962 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10left_edges_4__del__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self); /* proto */
1963 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10dimensions___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self); /* proto */
1964 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10dimensions_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
1965 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10dimensions_4__del__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self); /* proto */
1966 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2dx___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self); /* proto */
1967 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2dx_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
1968 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2dx_4__del__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self); /* proto */
1969 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_5level___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self); /* proto */
1970 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_5level_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
1971 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6offset___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self); /* proto */
1972 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6offset_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
1973 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self); /* proto */
1974 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
1975 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList___cinit__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_self, PyObject *__pyx_v_grids); /* proto */
1976 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_2__getitem__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_self, int __pyx_v_item); /* proto */
1977 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_self); /* proto */
1978 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
1979 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids_4__del__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_self); /* proto */
1980 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_self); /* proto */
1981 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
1982 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_RecurseOctreeDepthFirst(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_i_i, int __pyx_v_j_i, int __pyx_v_k_i, int __pyx_v_i_f, int __pyx_v_j_f, int __pyx_v_k_f, struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__pyx_v_curpos, int __pyx_v_gi, PyArrayObject *__pyx_v_output, PyArrayObject *__pyx_v_refined, struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_grids); /* proto */
1983 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_2RecurseOctreeByLevels(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_i_i, int __pyx_v_j_i, int __pyx_v_k_i, int __pyx_v_i_f, int __pyx_v_j_f, int __pyx_v_k_f, PyArrayObject *__pyx_v_curpos, int __pyx_v_gi, PyArrayObject *__pyx_v_output, PyArrayObject *__pyx_v_genealogy, PyArrayObject *__pyx_v_corners, struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_grids); /* proto */
1984 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
1985 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
1986 static PyObject *__pyx_tp_new_2yt_9utilities_3lib_18depth_first_octree_position(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
1987 static PyObject *__pyx_tp_new_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
1988 static PyObject *__pyx_tp_new_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
1989 static PyObject *__pyx_int_1;
1990 static PyObject *__pyx_int_2;
1991 static PyObject *__pyx_tuple_;
1992 static PyObject *__pyx_tuple__2;
1993 static PyObject *__pyx_tuple__3;
1994 static PyObject *__pyx_tuple__4;
1995 static PyObject *__pyx_tuple__5;
1996 static PyObject *__pyx_tuple__6;
1997 static PyObject *__pyx_tuple__7;
1998 static PyObject *__pyx_tuple__8;
1999 static PyObject *__pyx_tuple__9;
2000 static PyObject *__pyx_tuple__10;
2001 static PyObject *__pyx_tuple__11;
2002 static PyObject *__pyx_tuple__12;
2003 static PyObject *__pyx_tuple__13;
2004 static PyObject *__pyx_tuple__14;
2005 static PyObject *__pyx_tuple__16;
2006 static PyObject *__pyx_codeobj__15;
2007 static PyObject *__pyx_codeobj__17;
2008 /* Late includes */
2009
2010 /* "yt/utilities/lib/depth_first_octree.pyx":19
2011 * cdef class position:
2012 * cdef public int output_pos, refined_pos
2013 * def __cinit__(self): # <<<<<<<<<<<<<<
2014 * self.output_pos = 0
2015 * self.refined_pos = 0
2016 */
2017
2018 /* Python wrapper */
2019 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_1__cinit__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2020 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2021 int __pyx_r;
2022 __Pyx_RefNannyDeclarations
2023 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
2024 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
2025 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
2026 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
2027 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position___cinit__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *)__pyx_v_self));
2028
2029 /* function exit code */
2030 __Pyx_RefNannyFinishContext();
2031 return __pyx_r;
2032 }
2033
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position___cinit__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position * __pyx_v_self)2034 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position___cinit__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__pyx_v_self) {
2035 int __pyx_r;
2036 __Pyx_RefNannyDeclarations
2037 __Pyx_RefNannySetupContext("__cinit__", 0);
2038
2039 /* "yt/utilities/lib/depth_first_octree.pyx":20
2040 * cdef public int output_pos, refined_pos
2041 * def __cinit__(self):
2042 * self.output_pos = 0 # <<<<<<<<<<<<<<
2043 * self.refined_pos = 0
2044 *
2045 */
2046 __pyx_v_self->output_pos = 0;
2047
2048 /* "yt/utilities/lib/depth_first_octree.pyx":21
2049 * def __cinit__(self):
2050 * self.output_pos = 0
2051 * self.refined_pos = 0 # <<<<<<<<<<<<<<
2052 *
2053 * cdef class OctreeGrid:
2054 */
2055 __pyx_v_self->refined_pos = 0;
2056
2057 /* "yt/utilities/lib/depth_first_octree.pyx":19
2058 * cdef class position:
2059 * cdef public int output_pos, refined_pos
2060 * def __cinit__(self): # <<<<<<<<<<<<<<
2061 * self.output_pos = 0
2062 * self.refined_pos = 0
2063 */
2064
2065 /* function exit code */
2066 __pyx_r = 0;
2067 __Pyx_RefNannyFinishContext();
2068 return __pyx_r;
2069 }
2070
2071 /* "yt/utilities/lib/depth_first_octree.pyx":18
2072 *
2073 * cdef class position:
2074 * cdef public int output_pos, refined_pos # <<<<<<<<<<<<<<
2075 * def __cinit__(self):
2076 * self.output_pos = 0
2077 */
2078
2079 /* Python wrapper */
2080 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_10output_pos_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_10output_pos_1__get__(PyObject * __pyx_v_self)2081 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_10output_pos_1__get__(PyObject *__pyx_v_self) {
2082 PyObject *__pyx_r = 0;
2083 __Pyx_RefNannyDeclarations
2084 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2085 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_10output_pos___get__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *)__pyx_v_self));
2086
2087 /* function exit code */
2088 __Pyx_RefNannyFinishContext();
2089 return __pyx_r;
2090 }
2091
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_10output_pos___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position * __pyx_v_self)2092 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_10output_pos___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__pyx_v_self) {
2093 PyObject *__pyx_r = NULL;
2094 __Pyx_RefNannyDeclarations
2095 PyObject *__pyx_t_1 = NULL;
2096 __Pyx_RefNannySetupContext("__get__", 0);
2097 __Pyx_XDECREF(__pyx_r);
2098 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->output_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 18, __pyx_L1_error)
2099 __Pyx_GOTREF(__pyx_t_1);
2100 __pyx_r = __pyx_t_1;
2101 __pyx_t_1 = 0;
2102 goto __pyx_L0;
2103
2104 /* function exit code */
2105 __pyx_L1_error:;
2106 __Pyx_XDECREF(__pyx_t_1);
2107 __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.position.output_pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2108 __pyx_r = NULL;
2109 __pyx_L0:;
2110 __Pyx_XGIVEREF(__pyx_r);
2111 __Pyx_RefNannyFinishContext();
2112 return __pyx_r;
2113 }
2114
2115 /* Python wrapper */
2116 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_10output_pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_10output_pos_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)2117 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_10output_pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
2118 int __pyx_r;
2119 __Pyx_RefNannyDeclarations
2120 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
2121 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_10output_pos_2__set__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *)__pyx_v_self), ((PyObject *)__pyx_v_value));
2122
2123 /* function exit code */
2124 __Pyx_RefNannyFinishContext();
2125 return __pyx_r;
2126 }
2127
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_10output_pos_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position * __pyx_v_self,PyObject * __pyx_v_value)2128 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_10output_pos_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__pyx_v_self, PyObject *__pyx_v_value) {
2129 int __pyx_r;
2130 __Pyx_RefNannyDeclarations
2131 int __pyx_t_1;
2132 __Pyx_RefNannySetupContext("__set__", 0);
2133 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 18, __pyx_L1_error)
2134 __pyx_v_self->output_pos = __pyx_t_1;
2135
2136 /* function exit code */
2137 __pyx_r = 0;
2138 goto __pyx_L0;
2139 __pyx_L1_error:;
2140 __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.position.output_pos.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2141 __pyx_r = -1;
2142 __pyx_L0:;
2143 __Pyx_RefNannyFinishContext();
2144 return __pyx_r;
2145 }
2146
2147 /* Python wrapper */
2148 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_11refined_pos_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_11refined_pos_1__get__(PyObject * __pyx_v_self)2149 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_11refined_pos_1__get__(PyObject *__pyx_v_self) {
2150 PyObject *__pyx_r = 0;
2151 __Pyx_RefNannyDeclarations
2152 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2153 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_11refined_pos___get__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *)__pyx_v_self));
2154
2155 /* function exit code */
2156 __Pyx_RefNannyFinishContext();
2157 return __pyx_r;
2158 }
2159
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_11refined_pos___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position * __pyx_v_self)2160 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_11refined_pos___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__pyx_v_self) {
2161 PyObject *__pyx_r = NULL;
2162 __Pyx_RefNannyDeclarations
2163 PyObject *__pyx_t_1 = NULL;
2164 __Pyx_RefNannySetupContext("__get__", 0);
2165 __Pyx_XDECREF(__pyx_r);
2166 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->refined_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 18, __pyx_L1_error)
2167 __Pyx_GOTREF(__pyx_t_1);
2168 __pyx_r = __pyx_t_1;
2169 __pyx_t_1 = 0;
2170 goto __pyx_L0;
2171
2172 /* function exit code */
2173 __pyx_L1_error:;
2174 __Pyx_XDECREF(__pyx_t_1);
2175 __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.position.refined_pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2176 __pyx_r = NULL;
2177 __pyx_L0:;
2178 __Pyx_XGIVEREF(__pyx_r);
2179 __Pyx_RefNannyFinishContext();
2180 return __pyx_r;
2181 }
2182
2183 /* Python wrapper */
2184 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_11refined_pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_11refined_pos_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)2185 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_11refined_pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
2186 int __pyx_r;
2187 __Pyx_RefNannyDeclarations
2188 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
2189 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_11refined_pos_2__set__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *)__pyx_v_self), ((PyObject *)__pyx_v_value));
2190
2191 /* function exit code */
2192 __Pyx_RefNannyFinishContext();
2193 return __pyx_r;
2194 }
2195
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_11refined_pos_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position * __pyx_v_self,PyObject * __pyx_v_value)2196 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_11refined_pos_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__pyx_v_self, PyObject *__pyx_v_value) {
2197 int __pyx_r;
2198 __Pyx_RefNannyDeclarations
2199 int __pyx_t_1;
2200 __Pyx_RefNannySetupContext("__set__", 0);
2201 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 18, __pyx_L1_error)
2202 __pyx_v_self->refined_pos = __pyx_t_1;
2203
2204 /* function exit code */
2205 __pyx_r = 0;
2206 goto __pyx_L0;
2207 __pyx_L1_error:;
2208 __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.position.refined_pos.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2209 __pyx_r = -1;
2210 __pyx_L0:;
2211 __Pyx_RefNannyFinishContext();
2212 return __pyx_r;
2213 }
2214
2215 /* "(tree fragment)":1
2216 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
2217 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2218 * def __setstate_cython__(self, __pyx_state):
2219 */
2220
2221 /* Python wrapper */
2222 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_3__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)2223 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2224 PyObject *__pyx_r = 0;
2225 __Pyx_RefNannyDeclarations
2226 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
2227 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_2__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *)__pyx_v_self));
2228
2229 /* function exit code */
2230 __Pyx_RefNannyFinishContext();
2231 return __pyx_r;
2232 }
2233
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position * __pyx_v_self)2234 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__pyx_v_self) {
2235 PyObject *__pyx_r = NULL;
2236 __Pyx_RefNannyDeclarations
2237 PyObject *__pyx_t_1 = NULL;
2238 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
2239
2240 /* "(tree fragment)":2
2241 * def __reduce_cython__(self):
2242 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
2243 * def __setstate_cython__(self, __pyx_state):
2244 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2245 */
2246 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
2247 __Pyx_GOTREF(__pyx_t_1);
2248 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
2249 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2250 __PYX_ERR(0, 2, __pyx_L1_error)
2251
2252 /* "(tree fragment)":1
2253 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
2254 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2255 * def __setstate_cython__(self, __pyx_state):
2256 */
2257
2258 /* function exit code */
2259 __pyx_L1_error:;
2260 __Pyx_XDECREF(__pyx_t_1);
2261 __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.position.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2262 __pyx_r = NULL;
2263 __Pyx_XGIVEREF(__pyx_r);
2264 __Pyx_RefNannyFinishContext();
2265 return __pyx_r;
2266 }
2267
2268 /* "(tree fragment)":3
2269 * def __reduce_cython__(self):
2270 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2271 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
2272 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2273 */
2274
2275 /* Python wrapper */
2276 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_5__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)2277 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
2278 PyObject *__pyx_r = 0;
2279 __Pyx_RefNannyDeclarations
2280 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
2281 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_4__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
2282
2283 /* function exit code */
2284 __Pyx_RefNannyFinishContext();
2285 return __pyx_r;
2286 }
2287
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)2288 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_8position_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
2289 PyObject *__pyx_r = NULL;
2290 __Pyx_RefNannyDeclarations
2291 PyObject *__pyx_t_1 = NULL;
2292 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
2293
2294 /* "(tree fragment)":4
2295 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2296 * def __setstate_cython__(self, __pyx_state):
2297 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
2298 */
2299 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
2300 __Pyx_GOTREF(__pyx_t_1);
2301 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
2302 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2303 __PYX_ERR(0, 4, __pyx_L1_error)
2304
2305 /* "(tree fragment)":3
2306 * def __reduce_cython__(self):
2307 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2308 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
2309 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2310 */
2311
2312 /* function exit code */
2313 __pyx_L1_error:;
2314 __Pyx_XDECREF(__pyx_t_1);
2315 __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.position.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2316 __pyx_r = NULL;
2317 __Pyx_XGIVEREF(__pyx_r);
2318 __Pyx_RefNannyFinishContext();
2319 return __pyx_r;
2320 }
2321
2322 /* "yt/utilities/lib/depth_first_octree.pyx":26
2323 * cdef public object child_indices, fields, left_edges, dimensions, dx
2324 * cdef public int level, offset
2325 * def __cinit__(self, # <<<<<<<<<<<<<<
2326 * np.ndarray[np.int32_t, ndim=3] child_indices,
2327 * np.ndarray[np.float64_t, ndim=4] fields,
2328 */
2329
2330 /* Python wrapper */
2331 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_1__cinit__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2332 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2333 PyArrayObject *__pyx_v_child_indices = 0;
2334 PyArrayObject *__pyx_v_fields = 0;
2335 PyArrayObject *__pyx_v_left_edges = 0;
2336 PyArrayObject *__pyx_v_dimensions = 0;
2337 PyArrayObject *__pyx_v_dx = 0;
2338 int __pyx_v_level;
2339 int __pyx_v_offset;
2340 int __pyx_r;
2341 __Pyx_RefNannyDeclarations
2342 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
2343 {
2344 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_child_indices,&__pyx_n_s_fields,&__pyx_n_s_left_edges,&__pyx_n_s_dimensions,&__pyx_n_s_dx,&__pyx_n_s_level,&__pyx_n_s_offset,0};
2345 PyObject* values[7] = {0,0,0,0,0,0,0};
2346 if (unlikely(__pyx_kwds)) {
2347 Py_ssize_t kw_args;
2348 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2349 switch (pos_args) {
2350 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2351 CYTHON_FALLTHROUGH;
2352 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2353 CYTHON_FALLTHROUGH;
2354 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2355 CYTHON_FALLTHROUGH;
2356 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2357 CYTHON_FALLTHROUGH;
2358 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2359 CYTHON_FALLTHROUGH;
2360 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2361 CYTHON_FALLTHROUGH;
2362 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2363 CYTHON_FALLTHROUGH;
2364 case 0: break;
2365 default: goto __pyx_L5_argtuple_error;
2366 }
2367 kw_args = PyDict_Size(__pyx_kwds);
2368 switch (pos_args) {
2369 case 0:
2370 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_child_indices)) != 0)) kw_args--;
2371 else goto __pyx_L5_argtuple_error;
2372 CYTHON_FALLTHROUGH;
2373 case 1:
2374 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fields)) != 0)) kw_args--;
2375 else {
2376 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 1); __PYX_ERR(1, 26, __pyx_L3_error)
2377 }
2378 CYTHON_FALLTHROUGH;
2379 case 2:
2380 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_left_edges)) != 0)) kw_args--;
2381 else {
2382 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 2); __PYX_ERR(1, 26, __pyx_L3_error)
2383 }
2384 CYTHON_FALLTHROUGH;
2385 case 3:
2386 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dimensions)) != 0)) kw_args--;
2387 else {
2388 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 3); __PYX_ERR(1, 26, __pyx_L3_error)
2389 }
2390 CYTHON_FALLTHROUGH;
2391 case 4:
2392 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dx)) != 0)) kw_args--;
2393 else {
2394 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 4); __PYX_ERR(1, 26, __pyx_L3_error)
2395 }
2396 CYTHON_FALLTHROUGH;
2397 case 5:
2398 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
2399 else {
2400 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 5); __PYX_ERR(1, 26, __pyx_L3_error)
2401 }
2402 CYTHON_FALLTHROUGH;
2403 case 6:
2404 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset)) != 0)) kw_args--;
2405 else {
2406 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 6); __PYX_ERR(1, 26, __pyx_L3_error)
2407 }
2408 }
2409 if (unlikely(kw_args > 0)) {
2410 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 26, __pyx_L3_error)
2411 }
2412 } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
2413 goto __pyx_L5_argtuple_error;
2414 } else {
2415 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2416 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2417 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2418 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2419 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2420 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2421 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2422 }
2423 __pyx_v_child_indices = ((PyArrayObject *)values[0]);
2424 __pyx_v_fields = ((PyArrayObject *)values[1]);
2425 __pyx_v_left_edges = ((PyArrayObject *)values[2]);
2426 __pyx_v_dimensions = ((PyArrayObject *)values[3]);
2427 __pyx_v_dx = ((PyArrayObject *)values[4]);
2428 __pyx_v_level = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_level == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 32, __pyx_L3_error)
2429 __pyx_v_offset = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 32, __pyx_L3_error)
2430 }
2431 goto __pyx_L4_argument_unpacking_done;
2432 __pyx_L5_argtuple_error:;
2433 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 26, __pyx_L3_error)
2434 __pyx_L3_error:;
2435 __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.OctreeGrid.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2436 __Pyx_RefNannyFinishContext();
2437 return -1;
2438 __pyx_L4_argument_unpacking_done:;
2439 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_child_indices), __pyx_ptype_5numpy_ndarray, 1, "child_indices", 0))) __PYX_ERR(1, 27, __pyx_L1_error)
2440 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fields), __pyx_ptype_5numpy_ndarray, 1, "fields", 0))) __PYX_ERR(1, 28, __pyx_L1_error)
2441 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) __PYX_ERR(1, 29, __pyx_L1_error)
2442 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dimensions), __pyx_ptype_5numpy_ndarray, 1, "dimensions", 0))) __PYX_ERR(1, 30, __pyx_L1_error)
2443 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dx), __pyx_ptype_5numpy_ndarray, 1, "dx", 0))) __PYX_ERR(1, 31, __pyx_L1_error)
2444 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid___cinit__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_v_self), __pyx_v_child_indices, __pyx_v_fields, __pyx_v_left_edges, __pyx_v_dimensions, __pyx_v_dx, __pyx_v_level, __pyx_v_offset);
2445
2446 /* function exit code */
2447 goto __pyx_L0;
2448 __pyx_L1_error:;
2449 __pyx_r = -1;
2450 __pyx_L0:;
2451 __Pyx_RefNannyFinishContext();
2452 return __pyx_r;
2453 }
2454
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid___cinit__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid * __pyx_v_self,PyArrayObject * __pyx_v_child_indices,PyArrayObject * __pyx_v_fields,PyArrayObject * __pyx_v_left_edges,PyArrayObject * __pyx_v_dimensions,PyArrayObject * __pyx_v_dx,int __pyx_v_level,int __pyx_v_offset)2455 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid___cinit__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self, PyArrayObject *__pyx_v_child_indices, PyArrayObject *__pyx_v_fields, PyArrayObject *__pyx_v_left_edges, PyArrayObject *__pyx_v_dimensions, PyArrayObject *__pyx_v_dx, int __pyx_v_level, int __pyx_v_offset) {
2456 __Pyx_LocalBuf_ND __pyx_pybuffernd_child_indices;
2457 __Pyx_Buffer __pyx_pybuffer_child_indices;
2458 __Pyx_LocalBuf_ND __pyx_pybuffernd_dimensions;
2459 __Pyx_Buffer __pyx_pybuffer_dimensions;
2460 __Pyx_LocalBuf_ND __pyx_pybuffernd_dx;
2461 __Pyx_Buffer __pyx_pybuffer_dx;
2462 __Pyx_LocalBuf_ND __pyx_pybuffernd_fields;
2463 __Pyx_Buffer __pyx_pybuffer_fields;
2464 __Pyx_LocalBuf_ND __pyx_pybuffernd_left_edges;
2465 __Pyx_Buffer __pyx_pybuffer_left_edges;
2466 int __pyx_r;
2467 __Pyx_RefNannyDeclarations
2468 __Pyx_RefNannySetupContext("__cinit__", 0);
2469 __pyx_pybuffer_child_indices.pybuffer.buf = NULL;
2470 __pyx_pybuffer_child_indices.refcount = 0;
2471 __pyx_pybuffernd_child_indices.data = NULL;
2472 __pyx_pybuffernd_child_indices.rcbuffer = &__pyx_pybuffer_child_indices;
2473 __pyx_pybuffer_fields.pybuffer.buf = NULL;
2474 __pyx_pybuffer_fields.refcount = 0;
2475 __pyx_pybuffernd_fields.data = NULL;
2476 __pyx_pybuffernd_fields.rcbuffer = &__pyx_pybuffer_fields;
2477 __pyx_pybuffer_left_edges.pybuffer.buf = NULL;
2478 __pyx_pybuffer_left_edges.refcount = 0;
2479 __pyx_pybuffernd_left_edges.data = NULL;
2480 __pyx_pybuffernd_left_edges.rcbuffer = &__pyx_pybuffer_left_edges;
2481 __pyx_pybuffer_dimensions.pybuffer.buf = NULL;
2482 __pyx_pybuffer_dimensions.refcount = 0;
2483 __pyx_pybuffernd_dimensions.data = NULL;
2484 __pyx_pybuffernd_dimensions.rcbuffer = &__pyx_pybuffer_dimensions;
2485 __pyx_pybuffer_dx.pybuffer.buf = NULL;
2486 __pyx_pybuffer_dx.refcount = 0;
2487 __pyx_pybuffernd_dx.data = NULL;
2488 __pyx_pybuffernd_dx.rcbuffer = &__pyx_pybuffer_dx;
2489 {
2490 __Pyx_BufFmt_StackElem __pyx_stack[1];
2491 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_child_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_child_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(1, 26, __pyx_L1_error)
2492 }
2493 __pyx_pybuffernd_child_indices.diminfo[0].strides = __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_child_indices.diminfo[0].shape = __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_child_indices.diminfo[1].strides = __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_child_indices.diminfo[1].shape = __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_child_indices.diminfo[2].strides = __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_child_indices.diminfo[2].shape = __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.shape[2];
2494 {
2495 __Pyx_BufFmt_StackElem __pyx_stack[1];
2496 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fields.rcbuffer->pybuffer, (PyObject*)__pyx_v_fields, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(1, 26, __pyx_L1_error)
2497 }
2498 __pyx_pybuffernd_fields.diminfo[0].strides = __pyx_pybuffernd_fields.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fields.diminfo[0].shape = __pyx_pybuffernd_fields.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_fields.diminfo[1].strides = __pyx_pybuffernd_fields.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_fields.diminfo[1].shape = __pyx_pybuffernd_fields.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_fields.diminfo[2].strides = __pyx_pybuffernd_fields.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_fields.diminfo[2].shape = __pyx_pybuffernd_fields.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_fields.diminfo[3].strides = __pyx_pybuffernd_fields.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_fields.diminfo[3].shape = __pyx_pybuffernd_fields.rcbuffer->pybuffer.shape[3];
2499 {
2500 __Pyx_BufFmt_StackElem __pyx_stack[1];
2501 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(1, 26, __pyx_L1_error)
2502 }
2503 __pyx_pybuffernd_left_edges.diminfo[0].strides = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edges.diminfo[0].shape = __pyx_pybuffernd_left_edges.rcbuffer->pybuffer.shape[0];
2504 {
2505 __Pyx_BufFmt_StackElem __pyx_stack[1];
2506 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dimensions.rcbuffer->pybuffer, (PyObject*)__pyx_v_dimensions, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(1, 26, __pyx_L1_error)
2507 }
2508 __pyx_pybuffernd_dimensions.diminfo[0].strides = __pyx_pybuffernd_dimensions.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dimensions.diminfo[0].shape = __pyx_pybuffernd_dimensions.rcbuffer->pybuffer.shape[0];
2509 {
2510 __Pyx_BufFmt_StackElem __pyx_stack[1];
2511 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dx.rcbuffer->pybuffer, (PyObject*)__pyx_v_dx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(1, 26, __pyx_L1_error)
2512 }
2513 __pyx_pybuffernd_dx.diminfo[0].strides = __pyx_pybuffernd_dx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dx.diminfo[0].shape = __pyx_pybuffernd_dx.rcbuffer->pybuffer.shape[0];
2514
2515 /* "yt/utilities/lib/depth_first_octree.pyx":33
2516 * np.ndarray[np.float64_t, ndim=1] dx,
2517 * int level, int offset):
2518 * self.child_indices = child_indices # <<<<<<<<<<<<<<
2519 * self.fields = fields
2520 * self.left_edges = left_edges
2521 */
2522 __Pyx_INCREF(((PyObject *)__pyx_v_child_indices));
2523 __Pyx_GIVEREF(((PyObject *)__pyx_v_child_indices));
2524 __Pyx_GOTREF(__pyx_v_self->child_indices);
2525 __Pyx_DECREF(__pyx_v_self->child_indices);
2526 __pyx_v_self->child_indices = ((PyObject *)__pyx_v_child_indices);
2527
2528 /* "yt/utilities/lib/depth_first_octree.pyx":34
2529 * int level, int offset):
2530 * self.child_indices = child_indices
2531 * self.fields = fields # <<<<<<<<<<<<<<
2532 * self.left_edges = left_edges
2533 * self.dimensions = dimensions
2534 */
2535 __Pyx_INCREF(((PyObject *)__pyx_v_fields));
2536 __Pyx_GIVEREF(((PyObject *)__pyx_v_fields));
2537 __Pyx_GOTREF(__pyx_v_self->fields);
2538 __Pyx_DECREF(__pyx_v_self->fields);
2539 __pyx_v_self->fields = ((PyObject *)__pyx_v_fields);
2540
2541 /* "yt/utilities/lib/depth_first_octree.pyx":35
2542 * self.child_indices = child_indices
2543 * self.fields = fields
2544 * self.left_edges = left_edges # <<<<<<<<<<<<<<
2545 * self.dimensions = dimensions
2546 * self.dx = dx
2547 */
2548 __Pyx_INCREF(((PyObject *)__pyx_v_left_edges));
2549 __Pyx_GIVEREF(((PyObject *)__pyx_v_left_edges));
2550 __Pyx_GOTREF(__pyx_v_self->left_edges);
2551 __Pyx_DECREF(__pyx_v_self->left_edges);
2552 __pyx_v_self->left_edges = ((PyObject *)__pyx_v_left_edges);
2553
2554 /* "yt/utilities/lib/depth_first_octree.pyx":36
2555 * self.fields = fields
2556 * self.left_edges = left_edges
2557 * self.dimensions = dimensions # <<<<<<<<<<<<<<
2558 * self.dx = dx
2559 * self.level = level
2560 */
2561 __Pyx_INCREF(((PyObject *)__pyx_v_dimensions));
2562 __Pyx_GIVEREF(((PyObject *)__pyx_v_dimensions));
2563 __Pyx_GOTREF(__pyx_v_self->dimensions);
2564 __Pyx_DECREF(__pyx_v_self->dimensions);
2565 __pyx_v_self->dimensions = ((PyObject *)__pyx_v_dimensions);
2566
2567 /* "yt/utilities/lib/depth_first_octree.pyx":37
2568 * self.left_edges = left_edges
2569 * self.dimensions = dimensions
2570 * self.dx = dx # <<<<<<<<<<<<<<
2571 * self.level = level
2572 * self.offset = offset
2573 */
2574 __Pyx_INCREF(((PyObject *)__pyx_v_dx));
2575 __Pyx_GIVEREF(((PyObject *)__pyx_v_dx));
2576 __Pyx_GOTREF(__pyx_v_self->dx);
2577 __Pyx_DECREF(__pyx_v_self->dx);
2578 __pyx_v_self->dx = ((PyObject *)__pyx_v_dx);
2579
2580 /* "yt/utilities/lib/depth_first_octree.pyx":38
2581 * self.dimensions = dimensions
2582 * self.dx = dx
2583 * self.level = level # <<<<<<<<<<<<<<
2584 * self.offset = offset
2585 *
2586 */
2587 __pyx_v_self->level = __pyx_v_level;
2588
2589 /* "yt/utilities/lib/depth_first_octree.pyx":39
2590 * self.dx = dx
2591 * self.level = level
2592 * self.offset = offset # <<<<<<<<<<<<<<
2593 *
2594 * cdef class OctreeGridList:
2595 */
2596 __pyx_v_self->offset = __pyx_v_offset;
2597
2598 /* "yt/utilities/lib/depth_first_octree.pyx":26
2599 * cdef public object child_indices, fields, left_edges, dimensions, dx
2600 * cdef public int level, offset
2601 * def __cinit__(self, # <<<<<<<<<<<<<<
2602 * np.ndarray[np.int32_t, ndim=3] child_indices,
2603 * np.ndarray[np.float64_t, ndim=4] fields,
2604 */
2605
2606 /* function exit code */
2607 __pyx_r = 0;
2608 goto __pyx_L0;
2609 __pyx_L1_error:;
2610 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
2611 __Pyx_PyThreadState_declare
2612 __Pyx_PyThreadState_assign
2613 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
2614 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_child_indices.rcbuffer->pybuffer);
2615 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dimensions.rcbuffer->pybuffer);
2616 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dx.rcbuffer->pybuffer);
2617 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_fields.rcbuffer->pybuffer);
2618 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer);
2619 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
2620 __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.OctreeGrid.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2621 __pyx_r = -1;
2622 goto __pyx_L2;
2623 __pyx_L0:;
2624 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_child_indices.rcbuffer->pybuffer);
2625 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dimensions.rcbuffer->pybuffer);
2626 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dx.rcbuffer->pybuffer);
2627 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_fields.rcbuffer->pybuffer);
2628 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_edges.rcbuffer->pybuffer);
2629 __pyx_L2:;
2630 __Pyx_RefNannyFinishContext();
2631 return __pyx_r;
2632 }
2633
2634 /* "yt/utilities/lib/depth_first_octree.pyx":24
2635 *
2636 * cdef class OctreeGrid:
2637 * cdef public object child_indices, fields, left_edges, dimensions, dx # <<<<<<<<<<<<<<
2638 * cdef public int level, offset
2639 * def __cinit__(self,
2640 */
2641
2642 /* Python wrapper */
2643 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices_1__get__(PyObject * __pyx_v_self)2644 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices_1__get__(PyObject *__pyx_v_self) {
2645 PyObject *__pyx_r = 0;
2646 __Pyx_RefNannyDeclarations
2647 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2648 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices___get__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_v_self));
2649
2650 /* function exit code */
2651 __Pyx_RefNannyFinishContext();
2652 return __pyx_r;
2653 }
2654
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid * __pyx_v_self)2655 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self) {
2656 PyObject *__pyx_r = NULL;
2657 __Pyx_RefNannyDeclarations
2658 __Pyx_RefNannySetupContext("__get__", 0);
2659 __Pyx_XDECREF(__pyx_r);
2660 __Pyx_INCREF(__pyx_v_self->child_indices);
2661 __pyx_r = __pyx_v_self->child_indices;
2662 goto __pyx_L0;
2663
2664 /* function exit code */
2665 __pyx_L0:;
2666 __Pyx_XGIVEREF(__pyx_r);
2667 __Pyx_RefNannyFinishContext();
2668 return __pyx_r;
2669 }
2670
2671 /* Python wrapper */
2672 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)2673 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
2674 int __pyx_r;
2675 __Pyx_RefNannyDeclarations
2676 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
2677 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices_2__set__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_v_self), ((PyObject *)__pyx_v_value));
2678
2679 /* function exit code */
2680 __Pyx_RefNannyFinishContext();
2681 return __pyx_r;
2682 }
2683
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid * __pyx_v_self,PyObject * __pyx_v_value)2684 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self, PyObject *__pyx_v_value) {
2685 int __pyx_r;
2686 __Pyx_RefNannyDeclarations
2687 __Pyx_RefNannySetupContext("__set__", 0);
2688 __Pyx_INCREF(__pyx_v_value);
2689 __Pyx_GIVEREF(__pyx_v_value);
2690 __Pyx_GOTREF(__pyx_v_self->child_indices);
2691 __Pyx_DECREF(__pyx_v_self->child_indices);
2692 __pyx_v_self->child_indices = __pyx_v_value;
2693
2694 /* function exit code */
2695 __pyx_r = 0;
2696 __Pyx_RefNannyFinishContext();
2697 return __pyx_r;
2698 }
2699
2700 /* Python wrapper */
2701 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices_5__del__(PyObject * __pyx_v_self)2702 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices_5__del__(PyObject *__pyx_v_self) {
2703 int __pyx_r;
2704 __Pyx_RefNannyDeclarations
2705 __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
2706 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices_4__del__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_v_self));
2707
2708 /* function exit code */
2709 __Pyx_RefNannyFinishContext();
2710 return __pyx_r;
2711 }
2712
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices_4__del__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid * __pyx_v_self)2713 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices_4__del__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self) {
2714 int __pyx_r;
2715 __Pyx_RefNannyDeclarations
2716 __Pyx_RefNannySetupContext("__del__", 0);
2717 __Pyx_INCREF(Py_None);
2718 __Pyx_GIVEREF(Py_None);
2719 __Pyx_GOTREF(__pyx_v_self->child_indices);
2720 __Pyx_DECREF(__pyx_v_self->child_indices);
2721 __pyx_v_self->child_indices = Py_None;
2722
2723 /* function exit code */
2724 __pyx_r = 0;
2725 __Pyx_RefNannyFinishContext();
2726 return __pyx_r;
2727 }
2728
2729 /* Python wrapper */
2730 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6fields_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6fields_1__get__(PyObject * __pyx_v_self)2731 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6fields_1__get__(PyObject *__pyx_v_self) {
2732 PyObject *__pyx_r = 0;
2733 __Pyx_RefNannyDeclarations
2734 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2735 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6fields___get__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_v_self));
2736
2737 /* function exit code */
2738 __Pyx_RefNannyFinishContext();
2739 return __pyx_r;
2740 }
2741
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6fields___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid * __pyx_v_self)2742 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6fields___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self) {
2743 PyObject *__pyx_r = NULL;
2744 __Pyx_RefNannyDeclarations
2745 __Pyx_RefNannySetupContext("__get__", 0);
2746 __Pyx_XDECREF(__pyx_r);
2747 __Pyx_INCREF(__pyx_v_self->fields);
2748 __pyx_r = __pyx_v_self->fields;
2749 goto __pyx_L0;
2750
2751 /* function exit code */
2752 __pyx_L0:;
2753 __Pyx_XGIVEREF(__pyx_r);
2754 __Pyx_RefNannyFinishContext();
2755 return __pyx_r;
2756 }
2757
2758 /* Python wrapper */
2759 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6fields_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6fields_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)2760 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6fields_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
2761 int __pyx_r;
2762 __Pyx_RefNannyDeclarations
2763 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
2764 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6fields_2__set__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_v_self), ((PyObject *)__pyx_v_value));
2765
2766 /* function exit code */
2767 __Pyx_RefNannyFinishContext();
2768 return __pyx_r;
2769 }
2770
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6fields_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid * __pyx_v_self,PyObject * __pyx_v_value)2771 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6fields_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self, PyObject *__pyx_v_value) {
2772 int __pyx_r;
2773 __Pyx_RefNannyDeclarations
2774 __Pyx_RefNannySetupContext("__set__", 0);
2775 __Pyx_INCREF(__pyx_v_value);
2776 __Pyx_GIVEREF(__pyx_v_value);
2777 __Pyx_GOTREF(__pyx_v_self->fields);
2778 __Pyx_DECREF(__pyx_v_self->fields);
2779 __pyx_v_self->fields = __pyx_v_value;
2780
2781 /* function exit code */
2782 __pyx_r = 0;
2783 __Pyx_RefNannyFinishContext();
2784 return __pyx_r;
2785 }
2786
2787 /* Python wrapper */
2788 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6fields_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6fields_5__del__(PyObject * __pyx_v_self)2789 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6fields_5__del__(PyObject *__pyx_v_self) {
2790 int __pyx_r;
2791 __Pyx_RefNannyDeclarations
2792 __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
2793 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6fields_4__del__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_v_self));
2794
2795 /* function exit code */
2796 __Pyx_RefNannyFinishContext();
2797 return __pyx_r;
2798 }
2799
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6fields_4__del__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid * __pyx_v_self)2800 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6fields_4__del__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self) {
2801 int __pyx_r;
2802 __Pyx_RefNannyDeclarations
2803 __Pyx_RefNannySetupContext("__del__", 0);
2804 __Pyx_INCREF(Py_None);
2805 __Pyx_GIVEREF(Py_None);
2806 __Pyx_GOTREF(__pyx_v_self->fields);
2807 __Pyx_DECREF(__pyx_v_self->fields);
2808 __pyx_v_self->fields = Py_None;
2809
2810 /* function exit code */
2811 __pyx_r = 0;
2812 __Pyx_RefNannyFinishContext();
2813 return __pyx_r;
2814 }
2815
2816 /* Python wrapper */
2817 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10left_edges_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10left_edges_1__get__(PyObject * __pyx_v_self)2818 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10left_edges_1__get__(PyObject *__pyx_v_self) {
2819 PyObject *__pyx_r = 0;
2820 __Pyx_RefNannyDeclarations
2821 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2822 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10left_edges___get__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_v_self));
2823
2824 /* function exit code */
2825 __Pyx_RefNannyFinishContext();
2826 return __pyx_r;
2827 }
2828
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10left_edges___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid * __pyx_v_self)2829 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10left_edges___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self) {
2830 PyObject *__pyx_r = NULL;
2831 __Pyx_RefNannyDeclarations
2832 __Pyx_RefNannySetupContext("__get__", 0);
2833 __Pyx_XDECREF(__pyx_r);
2834 __Pyx_INCREF(__pyx_v_self->left_edges);
2835 __pyx_r = __pyx_v_self->left_edges;
2836 goto __pyx_L0;
2837
2838 /* function exit code */
2839 __pyx_L0:;
2840 __Pyx_XGIVEREF(__pyx_r);
2841 __Pyx_RefNannyFinishContext();
2842 return __pyx_r;
2843 }
2844
2845 /* Python wrapper */
2846 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10left_edges_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10left_edges_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)2847 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10left_edges_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
2848 int __pyx_r;
2849 __Pyx_RefNannyDeclarations
2850 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
2851 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10left_edges_2__set__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_v_self), ((PyObject *)__pyx_v_value));
2852
2853 /* function exit code */
2854 __Pyx_RefNannyFinishContext();
2855 return __pyx_r;
2856 }
2857
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10left_edges_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid * __pyx_v_self,PyObject * __pyx_v_value)2858 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10left_edges_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self, PyObject *__pyx_v_value) {
2859 int __pyx_r;
2860 __Pyx_RefNannyDeclarations
2861 __Pyx_RefNannySetupContext("__set__", 0);
2862 __Pyx_INCREF(__pyx_v_value);
2863 __Pyx_GIVEREF(__pyx_v_value);
2864 __Pyx_GOTREF(__pyx_v_self->left_edges);
2865 __Pyx_DECREF(__pyx_v_self->left_edges);
2866 __pyx_v_self->left_edges = __pyx_v_value;
2867
2868 /* function exit code */
2869 __pyx_r = 0;
2870 __Pyx_RefNannyFinishContext();
2871 return __pyx_r;
2872 }
2873
2874 /* Python wrapper */
2875 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10left_edges_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10left_edges_5__del__(PyObject * __pyx_v_self)2876 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10left_edges_5__del__(PyObject *__pyx_v_self) {
2877 int __pyx_r;
2878 __Pyx_RefNannyDeclarations
2879 __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
2880 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10left_edges_4__del__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_v_self));
2881
2882 /* function exit code */
2883 __Pyx_RefNannyFinishContext();
2884 return __pyx_r;
2885 }
2886
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10left_edges_4__del__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid * __pyx_v_self)2887 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10left_edges_4__del__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self) {
2888 int __pyx_r;
2889 __Pyx_RefNannyDeclarations
2890 __Pyx_RefNannySetupContext("__del__", 0);
2891 __Pyx_INCREF(Py_None);
2892 __Pyx_GIVEREF(Py_None);
2893 __Pyx_GOTREF(__pyx_v_self->left_edges);
2894 __Pyx_DECREF(__pyx_v_self->left_edges);
2895 __pyx_v_self->left_edges = Py_None;
2896
2897 /* function exit code */
2898 __pyx_r = 0;
2899 __Pyx_RefNannyFinishContext();
2900 return __pyx_r;
2901 }
2902
2903 /* Python wrapper */
2904 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10dimensions_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10dimensions_1__get__(PyObject * __pyx_v_self)2905 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10dimensions_1__get__(PyObject *__pyx_v_self) {
2906 PyObject *__pyx_r = 0;
2907 __Pyx_RefNannyDeclarations
2908 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2909 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10dimensions___get__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_v_self));
2910
2911 /* function exit code */
2912 __Pyx_RefNannyFinishContext();
2913 return __pyx_r;
2914 }
2915
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10dimensions___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid * __pyx_v_self)2916 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10dimensions___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self) {
2917 PyObject *__pyx_r = NULL;
2918 __Pyx_RefNannyDeclarations
2919 __Pyx_RefNannySetupContext("__get__", 0);
2920 __Pyx_XDECREF(__pyx_r);
2921 __Pyx_INCREF(__pyx_v_self->dimensions);
2922 __pyx_r = __pyx_v_self->dimensions;
2923 goto __pyx_L0;
2924
2925 /* function exit code */
2926 __pyx_L0:;
2927 __Pyx_XGIVEREF(__pyx_r);
2928 __Pyx_RefNannyFinishContext();
2929 return __pyx_r;
2930 }
2931
2932 /* Python wrapper */
2933 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10dimensions_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10dimensions_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)2934 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10dimensions_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
2935 int __pyx_r;
2936 __Pyx_RefNannyDeclarations
2937 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
2938 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10dimensions_2__set__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_v_self), ((PyObject *)__pyx_v_value));
2939
2940 /* function exit code */
2941 __Pyx_RefNannyFinishContext();
2942 return __pyx_r;
2943 }
2944
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10dimensions_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid * __pyx_v_self,PyObject * __pyx_v_value)2945 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10dimensions_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self, PyObject *__pyx_v_value) {
2946 int __pyx_r;
2947 __Pyx_RefNannyDeclarations
2948 __Pyx_RefNannySetupContext("__set__", 0);
2949 __Pyx_INCREF(__pyx_v_value);
2950 __Pyx_GIVEREF(__pyx_v_value);
2951 __Pyx_GOTREF(__pyx_v_self->dimensions);
2952 __Pyx_DECREF(__pyx_v_self->dimensions);
2953 __pyx_v_self->dimensions = __pyx_v_value;
2954
2955 /* function exit code */
2956 __pyx_r = 0;
2957 __Pyx_RefNannyFinishContext();
2958 return __pyx_r;
2959 }
2960
2961 /* Python wrapper */
2962 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10dimensions_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10dimensions_5__del__(PyObject * __pyx_v_self)2963 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10dimensions_5__del__(PyObject *__pyx_v_self) {
2964 int __pyx_r;
2965 __Pyx_RefNannyDeclarations
2966 __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
2967 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10dimensions_4__del__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_v_self));
2968
2969 /* function exit code */
2970 __Pyx_RefNannyFinishContext();
2971 return __pyx_r;
2972 }
2973
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10dimensions_4__del__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid * __pyx_v_self)2974 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10dimensions_4__del__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self) {
2975 int __pyx_r;
2976 __Pyx_RefNannyDeclarations
2977 __Pyx_RefNannySetupContext("__del__", 0);
2978 __Pyx_INCREF(Py_None);
2979 __Pyx_GIVEREF(Py_None);
2980 __Pyx_GOTREF(__pyx_v_self->dimensions);
2981 __Pyx_DECREF(__pyx_v_self->dimensions);
2982 __pyx_v_self->dimensions = Py_None;
2983
2984 /* function exit code */
2985 __pyx_r = 0;
2986 __Pyx_RefNannyFinishContext();
2987 return __pyx_r;
2988 }
2989
2990 /* Python wrapper */
2991 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2dx_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2dx_1__get__(PyObject * __pyx_v_self)2992 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2dx_1__get__(PyObject *__pyx_v_self) {
2993 PyObject *__pyx_r = 0;
2994 __Pyx_RefNannyDeclarations
2995 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2996 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2dx___get__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_v_self));
2997
2998 /* function exit code */
2999 __Pyx_RefNannyFinishContext();
3000 return __pyx_r;
3001 }
3002
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2dx___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid * __pyx_v_self)3003 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2dx___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self) {
3004 PyObject *__pyx_r = NULL;
3005 __Pyx_RefNannyDeclarations
3006 __Pyx_RefNannySetupContext("__get__", 0);
3007 __Pyx_XDECREF(__pyx_r);
3008 __Pyx_INCREF(__pyx_v_self->dx);
3009 __pyx_r = __pyx_v_self->dx;
3010 goto __pyx_L0;
3011
3012 /* function exit code */
3013 __pyx_L0:;
3014 __Pyx_XGIVEREF(__pyx_r);
3015 __Pyx_RefNannyFinishContext();
3016 return __pyx_r;
3017 }
3018
3019 /* Python wrapper */
3020 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2dx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2dx_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)3021 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2dx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3022 int __pyx_r;
3023 __Pyx_RefNannyDeclarations
3024 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3025 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2dx_2__set__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3026
3027 /* function exit code */
3028 __Pyx_RefNannyFinishContext();
3029 return __pyx_r;
3030 }
3031
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2dx_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid * __pyx_v_self,PyObject * __pyx_v_value)3032 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2dx_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self, PyObject *__pyx_v_value) {
3033 int __pyx_r;
3034 __Pyx_RefNannyDeclarations
3035 __Pyx_RefNannySetupContext("__set__", 0);
3036 __Pyx_INCREF(__pyx_v_value);
3037 __Pyx_GIVEREF(__pyx_v_value);
3038 __Pyx_GOTREF(__pyx_v_self->dx);
3039 __Pyx_DECREF(__pyx_v_self->dx);
3040 __pyx_v_self->dx = __pyx_v_value;
3041
3042 /* function exit code */
3043 __pyx_r = 0;
3044 __Pyx_RefNannyFinishContext();
3045 return __pyx_r;
3046 }
3047
3048 /* Python wrapper */
3049 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2dx_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2dx_5__del__(PyObject * __pyx_v_self)3050 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2dx_5__del__(PyObject *__pyx_v_self) {
3051 int __pyx_r;
3052 __Pyx_RefNannyDeclarations
3053 __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
3054 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2dx_4__del__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_v_self));
3055
3056 /* function exit code */
3057 __Pyx_RefNannyFinishContext();
3058 return __pyx_r;
3059 }
3060
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2dx_4__del__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid * __pyx_v_self)3061 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2dx_4__del__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self) {
3062 int __pyx_r;
3063 __Pyx_RefNannyDeclarations
3064 __Pyx_RefNannySetupContext("__del__", 0);
3065 __Pyx_INCREF(Py_None);
3066 __Pyx_GIVEREF(Py_None);
3067 __Pyx_GOTREF(__pyx_v_self->dx);
3068 __Pyx_DECREF(__pyx_v_self->dx);
3069 __pyx_v_self->dx = Py_None;
3070
3071 /* function exit code */
3072 __pyx_r = 0;
3073 __Pyx_RefNannyFinishContext();
3074 return __pyx_r;
3075 }
3076
3077 /* "yt/utilities/lib/depth_first_octree.pyx":25
3078 * cdef class OctreeGrid:
3079 * cdef public object child_indices, fields, left_edges, dimensions, dx
3080 * cdef public int level, offset # <<<<<<<<<<<<<<
3081 * def __cinit__(self,
3082 * np.ndarray[np.int32_t, ndim=3] child_indices,
3083 */
3084
3085 /* Python wrapper */
3086 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_5level_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_5level_1__get__(PyObject * __pyx_v_self)3087 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_5level_1__get__(PyObject *__pyx_v_self) {
3088 PyObject *__pyx_r = 0;
3089 __Pyx_RefNannyDeclarations
3090 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3091 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_5level___get__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_v_self));
3092
3093 /* function exit code */
3094 __Pyx_RefNannyFinishContext();
3095 return __pyx_r;
3096 }
3097
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_5level___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid * __pyx_v_self)3098 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_5level___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self) {
3099 PyObject *__pyx_r = NULL;
3100 __Pyx_RefNannyDeclarations
3101 PyObject *__pyx_t_1 = NULL;
3102 __Pyx_RefNannySetupContext("__get__", 0);
3103 __Pyx_XDECREF(__pyx_r);
3104 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->level); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 25, __pyx_L1_error)
3105 __Pyx_GOTREF(__pyx_t_1);
3106 __pyx_r = __pyx_t_1;
3107 __pyx_t_1 = 0;
3108 goto __pyx_L0;
3109
3110 /* function exit code */
3111 __pyx_L1_error:;
3112 __Pyx_XDECREF(__pyx_t_1);
3113 __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.OctreeGrid.level.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3114 __pyx_r = NULL;
3115 __pyx_L0:;
3116 __Pyx_XGIVEREF(__pyx_r);
3117 __Pyx_RefNannyFinishContext();
3118 return __pyx_r;
3119 }
3120
3121 /* Python wrapper */
3122 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_5level_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_5level_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)3123 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_5level_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3124 int __pyx_r;
3125 __Pyx_RefNannyDeclarations
3126 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3127 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_5level_2__set__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3128
3129 /* function exit code */
3130 __Pyx_RefNannyFinishContext();
3131 return __pyx_r;
3132 }
3133
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_5level_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid * __pyx_v_self,PyObject * __pyx_v_value)3134 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_5level_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self, PyObject *__pyx_v_value) {
3135 int __pyx_r;
3136 __Pyx_RefNannyDeclarations
3137 int __pyx_t_1;
3138 __Pyx_RefNannySetupContext("__set__", 0);
3139 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 25, __pyx_L1_error)
3140 __pyx_v_self->level = __pyx_t_1;
3141
3142 /* function exit code */
3143 __pyx_r = 0;
3144 goto __pyx_L0;
3145 __pyx_L1_error:;
3146 __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.OctreeGrid.level.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3147 __pyx_r = -1;
3148 __pyx_L0:;
3149 __Pyx_RefNannyFinishContext();
3150 return __pyx_r;
3151 }
3152
3153 /* Python wrapper */
3154 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6offset_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6offset_1__get__(PyObject * __pyx_v_self)3155 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6offset_1__get__(PyObject *__pyx_v_self) {
3156 PyObject *__pyx_r = 0;
3157 __Pyx_RefNannyDeclarations
3158 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3159 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6offset___get__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_v_self));
3160
3161 /* function exit code */
3162 __Pyx_RefNannyFinishContext();
3163 return __pyx_r;
3164 }
3165
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6offset___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid * __pyx_v_self)3166 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6offset___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self) {
3167 PyObject *__pyx_r = NULL;
3168 __Pyx_RefNannyDeclarations
3169 PyObject *__pyx_t_1 = NULL;
3170 __Pyx_RefNannySetupContext("__get__", 0);
3171 __Pyx_XDECREF(__pyx_r);
3172 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 25, __pyx_L1_error)
3173 __Pyx_GOTREF(__pyx_t_1);
3174 __pyx_r = __pyx_t_1;
3175 __pyx_t_1 = 0;
3176 goto __pyx_L0;
3177
3178 /* function exit code */
3179 __pyx_L1_error:;
3180 __Pyx_XDECREF(__pyx_t_1);
3181 __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.OctreeGrid.offset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3182 __pyx_r = NULL;
3183 __pyx_L0:;
3184 __Pyx_XGIVEREF(__pyx_r);
3185 __Pyx_RefNannyFinishContext();
3186 return __pyx_r;
3187 }
3188
3189 /* Python wrapper */
3190 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6offset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6offset_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)3191 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6offset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3192 int __pyx_r;
3193 __Pyx_RefNannyDeclarations
3194 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3195 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6offset_2__set__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3196
3197 /* function exit code */
3198 __Pyx_RefNannyFinishContext();
3199 return __pyx_r;
3200 }
3201
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6offset_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid * __pyx_v_self,PyObject * __pyx_v_value)3202 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6offset_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self, PyObject *__pyx_v_value) {
3203 int __pyx_r;
3204 __Pyx_RefNannyDeclarations
3205 int __pyx_t_1;
3206 __Pyx_RefNannySetupContext("__set__", 0);
3207 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 25, __pyx_L1_error)
3208 __pyx_v_self->offset = __pyx_t_1;
3209
3210 /* function exit code */
3211 __pyx_r = 0;
3212 goto __pyx_L0;
3213 __pyx_L1_error:;
3214 __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.OctreeGrid.offset.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3215 __pyx_r = -1;
3216 __pyx_L0:;
3217 __Pyx_RefNannyFinishContext();
3218 return __pyx_r;
3219 }
3220
3221 /* "(tree fragment)":1
3222 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3223 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3224 * def __setstate_cython__(self, __pyx_state):
3225 */
3226
3227 /* Python wrapper */
3228 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_3__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)3229 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3230 PyObject *__pyx_r = 0;
3231 __Pyx_RefNannyDeclarations
3232 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3233 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_v_self));
3234
3235 /* function exit code */
3236 __Pyx_RefNannyFinishContext();
3237 return __pyx_r;
3238 }
3239
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid * __pyx_v_self)3240 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self) {
3241 PyObject *__pyx_r = NULL;
3242 __Pyx_RefNannyDeclarations
3243 PyObject *__pyx_t_1 = NULL;
3244 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3245
3246 /* "(tree fragment)":2
3247 * def __reduce_cython__(self):
3248 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3249 * def __setstate_cython__(self, __pyx_state):
3250 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3251 */
3252 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
3253 __Pyx_GOTREF(__pyx_t_1);
3254 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3255 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3256 __PYX_ERR(0, 2, __pyx_L1_error)
3257
3258 /* "(tree fragment)":1
3259 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3260 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3261 * def __setstate_cython__(self, __pyx_state):
3262 */
3263
3264 /* function exit code */
3265 __pyx_L1_error:;
3266 __Pyx_XDECREF(__pyx_t_1);
3267 __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.OctreeGrid.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3268 __pyx_r = NULL;
3269 __Pyx_XGIVEREF(__pyx_r);
3270 __Pyx_RefNannyFinishContext();
3271 return __pyx_r;
3272 }
3273
3274 /* "(tree fragment)":3
3275 * def __reduce_cython__(self):
3276 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3277 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3278 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3279 */
3280
3281 /* Python wrapper */
3282 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_5__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)3283 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3284 PyObject *__pyx_r = 0;
3285 __Pyx_RefNannyDeclarations
3286 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3287 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_4__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3288
3289 /* function exit code */
3290 __Pyx_RefNannyFinishContext();
3291 return __pyx_r;
3292 }
3293
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)3294 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3295 PyObject *__pyx_r = NULL;
3296 __Pyx_RefNannyDeclarations
3297 PyObject *__pyx_t_1 = NULL;
3298 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3299
3300 /* "(tree fragment)":4
3301 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3302 * def __setstate_cython__(self, __pyx_state):
3303 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3304 */
3305 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
3306 __Pyx_GOTREF(__pyx_t_1);
3307 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3308 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3309 __PYX_ERR(0, 4, __pyx_L1_error)
3310
3311 /* "(tree fragment)":3
3312 * def __reduce_cython__(self):
3313 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3314 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3315 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3316 */
3317
3318 /* function exit code */
3319 __pyx_L1_error:;
3320 __Pyx_XDECREF(__pyx_t_1);
3321 __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.OctreeGrid.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3322 __pyx_r = NULL;
3323 __Pyx_XGIVEREF(__pyx_r);
3324 __Pyx_RefNannyFinishContext();
3325 return __pyx_r;
3326 }
3327
3328 /* "yt/utilities/lib/depth_first_octree.pyx":43
3329 * cdef class OctreeGridList:
3330 * cdef public object grids
3331 * def __cinit__(self, grids): # <<<<<<<<<<<<<<
3332 * self.grids = grids
3333 *
3334 */
3335
3336 /* Python wrapper */
3337 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_1__cinit__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3338 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3339 PyObject *__pyx_v_grids = 0;
3340 int __pyx_r;
3341 __Pyx_RefNannyDeclarations
3342 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
3343 {
3344 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_grids,0};
3345 PyObject* values[1] = {0};
3346 if (unlikely(__pyx_kwds)) {
3347 Py_ssize_t kw_args;
3348 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3349 switch (pos_args) {
3350 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3351 CYTHON_FALLTHROUGH;
3352 case 0: break;
3353 default: goto __pyx_L5_argtuple_error;
3354 }
3355 kw_args = PyDict_Size(__pyx_kwds);
3356 switch (pos_args) {
3357 case 0:
3358 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grids)) != 0)) kw_args--;
3359 else goto __pyx_L5_argtuple_error;
3360 }
3361 if (unlikely(kw_args > 0)) {
3362 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 43, __pyx_L3_error)
3363 }
3364 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
3365 goto __pyx_L5_argtuple_error;
3366 } else {
3367 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3368 }
3369 __pyx_v_grids = values[0];
3370 }
3371 goto __pyx_L4_argument_unpacking_done;
3372 __pyx_L5_argtuple_error:;
3373 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 43, __pyx_L3_error)
3374 __pyx_L3_error:;
3375 __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.OctreeGridList.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3376 __Pyx_RefNannyFinishContext();
3377 return -1;
3378 __pyx_L4_argument_unpacking_done:;
3379 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList___cinit__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *)__pyx_v_self), __pyx_v_grids);
3380
3381 /* function exit code */
3382 __Pyx_RefNannyFinishContext();
3383 return __pyx_r;
3384 }
3385
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList___cinit__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList * __pyx_v_self,PyObject * __pyx_v_grids)3386 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList___cinit__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_self, PyObject *__pyx_v_grids) {
3387 int __pyx_r;
3388 __Pyx_RefNannyDeclarations
3389 __Pyx_RefNannySetupContext("__cinit__", 0);
3390
3391 /* "yt/utilities/lib/depth_first_octree.pyx":44
3392 * cdef public object grids
3393 * def __cinit__(self, grids):
3394 * self.grids = grids # <<<<<<<<<<<<<<
3395 *
3396 * def __getitem__(self, int item):
3397 */
3398 __Pyx_INCREF(__pyx_v_grids);
3399 __Pyx_GIVEREF(__pyx_v_grids);
3400 __Pyx_GOTREF(__pyx_v_self->grids);
3401 __Pyx_DECREF(__pyx_v_self->grids);
3402 __pyx_v_self->grids = __pyx_v_grids;
3403
3404 /* "yt/utilities/lib/depth_first_octree.pyx":43
3405 * cdef class OctreeGridList:
3406 * cdef public object grids
3407 * def __cinit__(self, grids): # <<<<<<<<<<<<<<
3408 * self.grids = grids
3409 *
3410 */
3411
3412 /* function exit code */
3413 __pyx_r = 0;
3414 __Pyx_RefNannyFinishContext();
3415 return __pyx_r;
3416 }
3417
3418 /* "yt/utilities/lib/depth_first_octree.pyx":46
3419 * self.grids = grids
3420 *
3421 * def __getitem__(self, int item): # <<<<<<<<<<<<<<
3422 * return self.grids[item]
3423 *
3424 */
3425
3426 /* Python wrapper */
3427 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_item); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_3__getitem__(PyObject * __pyx_v_self,PyObject * __pyx_arg_item)3428 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_item) {
3429 int __pyx_v_item;
3430 PyObject *__pyx_r = 0;
3431 __Pyx_RefNannyDeclarations
3432 __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
3433 assert(__pyx_arg_item); {
3434 __pyx_v_item = __Pyx_PyInt_As_int(__pyx_arg_item); if (unlikely((__pyx_v_item == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 46, __pyx_L3_error)
3435 }
3436 goto __pyx_L4_argument_unpacking_done;
3437 __pyx_L3_error:;
3438 __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.OctreeGridList.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3439 __Pyx_RefNannyFinishContext();
3440 return NULL;
3441 __pyx_L4_argument_unpacking_done:;
3442 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_2__getitem__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *)__pyx_v_self), ((int)__pyx_v_item));
3443
3444 /* function exit code */
3445 __Pyx_RefNannyFinishContext();
3446 return __pyx_r;
3447 }
3448
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_2__getitem__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList * __pyx_v_self,int __pyx_v_item)3449 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_2__getitem__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_self, int __pyx_v_item) {
3450 PyObject *__pyx_r = NULL;
3451 __Pyx_RefNannyDeclarations
3452 PyObject *__pyx_t_1 = NULL;
3453 __Pyx_RefNannySetupContext("__getitem__", 0);
3454
3455 /* "yt/utilities/lib/depth_first_octree.pyx":47
3456 *
3457 * def __getitem__(self, int item):
3458 * return self.grids[item] # <<<<<<<<<<<<<<
3459 *
3460 * @cython.boundscheck(False)
3461 */
3462 __Pyx_XDECREF(__pyx_r);
3463 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->grids, __pyx_v_item, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
3464 __Pyx_GOTREF(__pyx_t_1);
3465 __pyx_r = __pyx_t_1;
3466 __pyx_t_1 = 0;
3467 goto __pyx_L0;
3468
3469 /* "yt/utilities/lib/depth_first_octree.pyx":46
3470 * self.grids = grids
3471 *
3472 * def __getitem__(self, int item): # <<<<<<<<<<<<<<
3473 * return self.grids[item]
3474 *
3475 */
3476
3477 /* function exit code */
3478 __pyx_L1_error:;
3479 __Pyx_XDECREF(__pyx_t_1);
3480 __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.OctreeGridList.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3481 __pyx_r = NULL;
3482 __pyx_L0:;
3483 __Pyx_XGIVEREF(__pyx_r);
3484 __Pyx_RefNannyFinishContext();
3485 return __pyx_r;
3486 }
3487
3488 /* "yt/utilities/lib/depth_first_octree.pyx":42
3489 *
3490 * cdef class OctreeGridList:
3491 * cdef public object grids # <<<<<<<<<<<<<<
3492 * def __cinit__(self, grids):
3493 * self.grids = grids
3494 */
3495
3496 /* Python wrapper */
3497 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids_1__get__(PyObject * __pyx_v_self)3498 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids_1__get__(PyObject *__pyx_v_self) {
3499 PyObject *__pyx_r = 0;
3500 __Pyx_RefNannyDeclarations
3501 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3502 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids___get__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *)__pyx_v_self));
3503
3504 /* function exit code */
3505 __Pyx_RefNannyFinishContext();
3506 return __pyx_r;
3507 }
3508
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList * __pyx_v_self)3509 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids___get__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_self) {
3510 PyObject *__pyx_r = NULL;
3511 __Pyx_RefNannyDeclarations
3512 __Pyx_RefNannySetupContext("__get__", 0);
3513 __Pyx_XDECREF(__pyx_r);
3514 __Pyx_INCREF(__pyx_v_self->grids);
3515 __pyx_r = __pyx_v_self->grids;
3516 goto __pyx_L0;
3517
3518 /* function exit code */
3519 __pyx_L0:;
3520 __Pyx_XGIVEREF(__pyx_r);
3521 __Pyx_RefNannyFinishContext();
3522 return __pyx_r;
3523 }
3524
3525 /* Python wrapper */
3526 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)3527 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3528 int __pyx_r;
3529 __Pyx_RefNannyDeclarations
3530 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3531 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids_2__set__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3532
3533 /* function exit code */
3534 __Pyx_RefNannyFinishContext();
3535 return __pyx_r;
3536 }
3537
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList * __pyx_v_self,PyObject * __pyx_v_value)3538 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids_2__set__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_self, PyObject *__pyx_v_value) {
3539 int __pyx_r;
3540 __Pyx_RefNannyDeclarations
3541 __Pyx_RefNannySetupContext("__set__", 0);
3542 __Pyx_INCREF(__pyx_v_value);
3543 __Pyx_GIVEREF(__pyx_v_value);
3544 __Pyx_GOTREF(__pyx_v_self->grids);
3545 __Pyx_DECREF(__pyx_v_self->grids);
3546 __pyx_v_self->grids = __pyx_v_value;
3547
3548 /* function exit code */
3549 __pyx_r = 0;
3550 __Pyx_RefNannyFinishContext();
3551 return __pyx_r;
3552 }
3553
3554 /* Python wrapper */
3555 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids_5__del__(PyObject * __pyx_v_self)3556 static int __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids_5__del__(PyObject *__pyx_v_self) {
3557 int __pyx_r;
3558 __Pyx_RefNannyDeclarations
3559 __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
3560 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids_4__del__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *)__pyx_v_self));
3561
3562 /* function exit code */
3563 __Pyx_RefNannyFinishContext();
3564 return __pyx_r;
3565 }
3566
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids_4__del__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList * __pyx_v_self)3567 static int __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids_4__del__(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_self) {
3568 int __pyx_r;
3569 __Pyx_RefNannyDeclarations
3570 __Pyx_RefNannySetupContext("__del__", 0);
3571 __Pyx_INCREF(Py_None);
3572 __Pyx_GIVEREF(Py_None);
3573 __Pyx_GOTREF(__pyx_v_self->grids);
3574 __Pyx_DECREF(__pyx_v_self->grids);
3575 __pyx_v_self->grids = Py_None;
3576
3577 /* function exit code */
3578 __pyx_r = 0;
3579 __Pyx_RefNannyFinishContext();
3580 return __pyx_r;
3581 }
3582
3583 /* "(tree fragment)":1
3584 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3585 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3586 * def __setstate_cython__(self, __pyx_state):
3587 */
3588
3589 /* Python wrapper */
3590 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)3591 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3592 PyObject *__pyx_r = 0;
3593 __Pyx_RefNannyDeclarations
3594 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3595 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_4__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *)__pyx_v_self));
3596
3597 /* function exit code */
3598 __Pyx_RefNannyFinishContext();
3599 return __pyx_r;
3600 }
3601
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList * __pyx_v_self)3602 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_self) {
3603 PyObject *__pyx_r = NULL;
3604 __Pyx_RefNannyDeclarations
3605 PyObject *__pyx_t_1 = NULL;
3606 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3607
3608 /* "(tree fragment)":2
3609 * def __reduce_cython__(self):
3610 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3611 * def __setstate_cython__(self, __pyx_state):
3612 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3613 */
3614 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
3615 __Pyx_GOTREF(__pyx_t_1);
3616 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3617 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3618 __PYX_ERR(0, 2, __pyx_L1_error)
3619
3620 /* "(tree fragment)":1
3621 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3622 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3623 * def __setstate_cython__(self, __pyx_state):
3624 */
3625
3626 /* function exit code */
3627 __pyx_L1_error:;
3628 __Pyx_XDECREF(__pyx_t_1);
3629 __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.OctreeGridList.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3630 __pyx_r = NULL;
3631 __Pyx_XGIVEREF(__pyx_r);
3632 __Pyx_RefNannyFinishContext();
3633 return __pyx_r;
3634 }
3635
3636 /* "(tree fragment)":3
3637 * def __reduce_cython__(self):
3638 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3639 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3640 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3641 */
3642
3643 /* Python wrapper */
3644 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_7__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)3645 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3646 PyObject *__pyx_r = 0;
3647 __Pyx_RefNannyDeclarations
3648 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3649 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_6__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3650
3651 /* function exit code */
3652 __Pyx_RefNannyFinishContext();
3653 return __pyx_r;
3654 }
3655
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)3656 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3657 PyObject *__pyx_r = NULL;
3658 __Pyx_RefNannyDeclarations
3659 PyObject *__pyx_t_1 = NULL;
3660 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3661
3662 /* "(tree fragment)":4
3663 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3664 * def __setstate_cython__(self, __pyx_state):
3665 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3666 */
3667 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
3668 __Pyx_GOTREF(__pyx_t_1);
3669 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3670 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3671 __PYX_ERR(0, 4, __pyx_L1_error)
3672
3673 /* "(tree fragment)":3
3674 * def __reduce_cython__(self):
3675 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3676 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3677 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3678 */
3679
3680 /* function exit code */
3681 __pyx_L1_error:;
3682 __Pyx_XDECREF(__pyx_t_1);
3683 __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.OctreeGridList.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3684 __pyx_r = NULL;
3685 __Pyx_XGIVEREF(__pyx_r);
3686 __Pyx_RefNannyFinishContext();
3687 return __pyx_r;
3688 }
3689
3690 /* "yt/utilities/lib/depth_first_octree.pyx":50
3691 *
3692 * @cython.boundscheck(False)
3693 * def RecurseOctreeDepthFirst(int i_i, int j_i, int k_i, # <<<<<<<<<<<<<<
3694 * int i_f, int j_f, int k_f,
3695 * position curpos, int gi,
3696 */
3697
3698 /* Python wrapper */
3699 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_1RecurseOctreeDepthFirst(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3700 static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_18depth_first_octree_1RecurseOctreeDepthFirst = {"RecurseOctreeDepthFirst", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_1RecurseOctreeDepthFirst, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_1RecurseOctreeDepthFirst(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3701 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_1RecurseOctreeDepthFirst(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3702 int __pyx_v_i_i;
3703 int __pyx_v_j_i;
3704 int __pyx_v_k_i;
3705 int __pyx_v_i_f;
3706 int __pyx_v_j_f;
3707 int __pyx_v_k_f;
3708 struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__pyx_v_curpos = 0;
3709 int __pyx_v_gi;
3710 PyArrayObject *__pyx_v_output = 0;
3711 PyArrayObject *__pyx_v_refined = 0;
3712 struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_grids = 0;
3713 PyObject *__pyx_r = 0;
3714 __Pyx_RefNannyDeclarations
3715 __Pyx_RefNannySetupContext("RecurseOctreeDepthFirst (wrapper)", 0);
3716 {
3717 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i_i,&__pyx_n_s_j_i,&__pyx_n_s_k_i,&__pyx_n_s_i_f,&__pyx_n_s_j_f,&__pyx_n_s_k_f,&__pyx_n_s_curpos,&__pyx_n_s_gi,&__pyx_n_s_output,&__pyx_n_s_refined,&__pyx_n_s_grids,0};
3718 PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
3719 if (unlikely(__pyx_kwds)) {
3720 Py_ssize_t kw_args;
3721 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3722 switch (pos_args) {
3723 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
3724 CYTHON_FALLTHROUGH;
3725 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3726 CYTHON_FALLTHROUGH;
3727 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3728 CYTHON_FALLTHROUGH;
3729 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3730 CYTHON_FALLTHROUGH;
3731 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3732 CYTHON_FALLTHROUGH;
3733 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3734 CYTHON_FALLTHROUGH;
3735 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3736 CYTHON_FALLTHROUGH;
3737 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3738 CYTHON_FALLTHROUGH;
3739 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3740 CYTHON_FALLTHROUGH;
3741 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3742 CYTHON_FALLTHROUGH;
3743 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3744 CYTHON_FALLTHROUGH;
3745 case 0: break;
3746 default: goto __pyx_L5_argtuple_error;
3747 }
3748 kw_args = PyDict_Size(__pyx_kwds);
3749 switch (pos_args) {
3750 case 0:
3751 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i_i)) != 0)) kw_args--;
3752 else goto __pyx_L5_argtuple_error;
3753 CYTHON_FALLTHROUGH;
3754 case 1:
3755 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_j_i)) != 0)) kw_args--;
3756 else {
3757 __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 1); __PYX_ERR(1, 50, __pyx_L3_error)
3758 }
3759 CYTHON_FALLTHROUGH;
3760 case 2:
3761 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k_i)) != 0)) kw_args--;
3762 else {
3763 __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 2); __PYX_ERR(1, 50, __pyx_L3_error)
3764 }
3765 CYTHON_FALLTHROUGH;
3766 case 3:
3767 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i_f)) != 0)) kw_args--;
3768 else {
3769 __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 3); __PYX_ERR(1, 50, __pyx_L3_error)
3770 }
3771 CYTHON_FALLTHROUGH;
3772 case 4:
3773 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_j_f)) != 0)) kw_args--;
3774 else {
3775 __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 4); __PYX_ERR(1, 50, __pyx_L3_error)
3776 }
3777 CYTHON_FALLTHROUGH;
3778 case 5:
3779 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k_f)) != 0)) kw_args--;
3780 else {
3781 __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 5); __PYX_ERR(1, 50, __pyx_L3_error)
3782 }
3783 CYTHON_FALLTHROUGH;
3784 case 6:
3785 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_curpos)) != 0)) kw_args--;
3786 else {
3787 __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 6); __PYX_ERR(1, 50, __pyx_L3_error)
3788 }
3789 CYTHON_FALLTHROUGH;
3790 case 7:
3791 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gi)) != 0)) kw_args--;
3792 else {
3793 __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 7); __PYX_ERR(1, 50, __pyx_L3_error)
3794 }
3795 CYTHON_FALLTHROUGH;
3796 case 8:
3797 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_output)) != 0)) kw_args--;
3798 else {
3799 __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 8); __PYX_ERR(1, 50, __pyx_L3_error)
3800 }
3801 CYTHON_FALLTHROUGH;
3802 case 9:
3803 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_refined)) != 0)) kw_args--;
3804 else {
3805 __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 9); __PYX_ERR(1, 50, __pyx_L3_error)
3806 }
3807 CYTHON_FALLTHROUGH;
3808 case 10:
3809 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grids)) != 0)) kw_args--;
3810 else {
3811 __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 10); __PYX_ERR(1, 50, __pyx_L3_error)
3812 }
3813 }
3814 if (unlikely(kw_args > 0)) {
3815 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "RecurseOctreeDepthFirst") < 0)) __PYX_ERR(1, 50, __pyx_L3_error)
3816 }
3817 } else if (PyTuple_GET_SIZE(__pyx_args) != 11) {
3818 goto __pyx_L5_argtuple_error;
3819 } else {
3820 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3821 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3822 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3823 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3824 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3825 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3826 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3827 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3828 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3829 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3830 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
3831 }
3832 __pyx_v_i_i = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_i_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 50, __pyx_L3_error)
3833 __pyx_v_j_i = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_j_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 50, __pyx_L3_error)
3834 __pyx_v_k_i = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_k_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 50, __pyx_L3_error)
3835 __pyx_v_i_f = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_i_f == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 51, __pyx_L3_error)
3836 __pyx_v_j_f = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_j_f == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 51, __pyx_L3_error)
3837 __pyx_v_k_f = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_k_f == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 51, __pyx_L3_error)
3838 __pyx_v_curpos = ((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *)values[6]);
3839 __pyx_v_gi = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_gi == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 52, __pyx_L3_error)
3840 __pyx_v_output = ((PyArrayObject *)values[8]);
3841 __pyx_v_refined = ((PyArrayObject *)values[9]);
3842 __pyx_v_grids = ((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *)values[10]);
3843 }
3844 goto __pyx_L4_argument_unpacking_done;
3845 __pyx_L5_argtuple_error:;
3846 __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 50, __pyx_L3_error)
3847 __pyx_L3_error:;
3848 __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.RecurseOctreeDepthFirst", __pyx_clineno, __pyx_lineno, __pyx_filename);
3849 __Pyx_RefNannyFinishContext();
3850 return NULL;
3851 __pyx_L4_argument_unpacking_done:;
3852 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_curpos), __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_position, 1, "curpos", 0))) __PYX_ERR(1, 52, __pyx_L1_error)
3853 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_output), __pyx_ptype_5numpy_ndarray, 1, "output", 0))) __PYX_ERR(1, 53, __pyx_L1_error)
3854 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_refined), __pyx_ptype_5numpy_ndarray, 1, "refined", 0))) __PYX_ERR(1, 54, __pyx_L1_error)
3855 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grids), __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList, 1, "grids", 0))) __PYX_ERR(1, 55, __pyx_L1_error)
3856 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_RecurseOctreeDepthFirst(__pyx_self, __pyx_v_i_i, __pyx_v_j_i, __pyx_v_k_i, __pyx_v_i_f, __pyx_v_j_f, __pyx_v_k_f, __pyx_v_curpos, __pyx_v_gi, __pyx_v_output, __pyx_v_refined, __pyx_v_grids);
3857
3858 /* function exit code */
3859 goto __pyx_L0;
3860 __pyx_L1_error:;
3861 __pyx_r = NULL;
3862 __pyx_L0:;
3863 __Pyx_RefNannyFinishContext();
3864 return __pyx_r;
3865 }
3866
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_RecurseOctreeDepthFirst(CYTHON_UNUSED PyObject * __pyx_self,int __pyx_v_i_i,int __pyx_v_j_i,int __pyx_v_k_i,int __pyx_v_i_f,int __pyx_v_j_f,int __pyx_v_k_f,struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position * __pyx_v_curpos,int __pyx_v_gi,PyArrayObject * __pyx_v_output,PyArrayObject * __pyx_v_refined,struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList * __pyx_v_grids)3867 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_RecurseOctreeDepthFirst(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_i_i, int __pyx_v_j_i, int __pyx_v_k_i, int __pyx_v_i_f, int __pyx_v_j_f, int __pyx_v_k_f, struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position *__pyx_v_curpos, int __pyx_v_gi, PyArrayObject *__pyx_v_output, PyArrayObject *__pyx_v_refined, struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_grids) {
3868 int __pyx_v_i;
3869 int __pyx_v_i_off;
3870 int __pyx_v_j;
3871 int __pyx_v_j_off;
3872 int __pyx_v_k;
3873 int __pyx_v_k_off;
3874 int __pyx_v_ci;
3875 int __pyx_v_fi;
3876 int __pyx_v_child_i;
3877 int __pyx_v_child_j;
3878 int __pyx_v_child_k;
3879 struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_child_grid = 0;
3880 struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_grid = 0;
3881 PyArrayObject *__pyx_v_fields = 0;
3882 PyArrayObject *__pyx_v_leftedges = 0;
3883 __pyx_t_5numpy_float64_t __pyx_v_dx;
3884 __pyx_t_5numpy_float64_t __pyx_v_child_dx;
3885 PyArrayObject *__pyx_v_child_leftedges = 0;
3886 __pyx_t_5numpy_float64_t __pyx_v_cx;
3887 __pyx_t_5numpy_float64_t __pyx_v_cy;
3888 __pyx_t_5numpy_float64_t __pyx_v_cz;
3889 __Pyx_LocalBuf_ND __pyx_pybuffernd_child_leftedges;
3890 __Pyx_Buffer __pyx_pybuffer_child_leftedges;
3891 __Pyx_LocalBuf_ND __pyx_pybuffernd_fields;
3892 __Pyx_Buffer __pyx_pybuffer_fields;
3893 __Pyx_LocalBuf_ND __pyx_pybuffernd_leftedges;
3894 __Pyx_Buffer __pyx_pybuffer_leftedges;
3895 __Pyx_LocalBuf_ND __pyx_pybuffernd_output;
3896 __Pyx_Buffer __pyx_pybuffer_output;
3897 __Pyx_LocalBuf_ND __pyx_pybuffernd_refined;
3898 __Pyx_Buffer __pyx_pybuffer_refined;
3899 PyObject *__pyx_r = NULL;
3900 __Pyx_RefNannyDeclarations
3901 PyObject *__pyx_t_1 = NULL;
3902 __pyx_t_5numpy_float64_t __pyx_t_2;
3903 int __pyx_t_3;
3904 int __pyx_t_4;
3905 int __pyx_t_5;
3906 Py_ssize_t __pyx_t_6;
3907 int __pyx_t_7;
3908 int __pyx_t_8;
3909 int __pyx_t_9;
3910 Py_ssize_t __pyx_t_10;
3911 int __pyx_t_11;
3912 int __pyx_t_12;
3913 int __pyx_t_13;
3914 Py_ssize_t __pyx_t_14;
3915 PyObject *__pyx_t_15 = NULL;
3916 PyObject *__pyx_t_16 = NULL;
3917 PyObject *__pyx_t_17 = NULL;
3918 int __pyx_t_18;
3919 int __pyx_t_19;
3920 npy_intp __pyx_t_20;
3921 npy_intp __pyx_t_21;
3922 Py_ssize_t __pyx_t_22;
3923 Py_ssize_t __pyx_t_23;
3924 Py_ssize_t __pyx_t_24;
3925 Py_ssize_t __pyx_t_25;
3926 Py_ssize_t __pyx_t_26;
3927 Py_ssize_t __pyx_t_27;
3928 Py_ssize_t __pyx_t_28;
3929 Py_ssize_t __pyx_t_29;
3930 PyObject *__pyx_t_30 = NULL;
3931 PyObject *__pyx_t_31 = NULL;
3932 PyObject *__pyx_t_32 = NULL;
3933 Py_ssize_t __pyx_t_33;
3934 Py_ssize_t __pyx_t_34;
3935 Py_ssize_t __pyx_t_35;
3936 PyObject *__pyx_t_36 = NULL;
3937 PyObject *__pyx_t_37 = NULL;
3938 PyObject *__pyx_t_38 = NULL;
3939 PyObject *__pyx_t_39 = NULL;
3940 __Pyx_RefNannySetupContext("RecurseOctreeDepthFirst", 0);
3941 __pyx_pybuffer_fields.pybuffer.buf = NULL;
3942 __pyx_pybuffer_fields.refcount = 0;
3943 __pyx_pybuffernd_fields.data = NULL;
3944 __pyx_pybuffernd_fields.rcbuffer = &__pyx_pybuffer_fields;
3945 __pyx_pybuffer_leftedges.pybuffer.buf = NULL;
3946 __pyx_pybuffer_leftedges.refcount = 0;
3947 __pyx_pybuffernd_leftedges.data = NULL;
3948 __pyx_pybuffernd_leftedges.rcbuffer = &__pyx_pybuffer_leftedges;
3949 __pyx_pybuffer_child_leftedges.pybuffer.buf = NULL;
3950 __pyx_pybuffer_child_leftedges.refcount = 0;
3951 __pyx_pybuffernd_child_leftedges.data = NULL;
3952 __pyx_pybuffernd_child_leftedges.rcbuffer = &__pyx_pybuffer_child_leftedges;
3953 __pyx_pybuffer_output.pybuffer.buf = NULL;
3954 __pyx_pybuffer_output.refcount = 0;
3955 __pyx_pybuffernd_output.data = NULL;
3956 __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output;
3957 __pyx_pybuffer_refined.pybuffer.buf = NULL;
3958 __pyx_pybuffer_refined.refcount = 0;
3959 __pyx_pybuffernd_refined.data = NULL;
3960 __pyx_pybuffernd_refined.rcbuffer = &__pyx_pybuffer_refined;
3961 {
3962 __Pyx_BufFmt_StackElem __pyx_stack[1];
3963 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_v_output, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(1, 50, __pyx_L1_error)
3964 }
3965 __pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_output.diminfo[1].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_output.diminfo[1].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[1];
3966 {
3967 __Pyx_BufFmt_StackElem __pyx_stack[1];
3968 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_refined.rcbuffer->pybuffer, (PyObject*)__pyx_v_refined, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(1, 50, __pyx_L1_error)
3969 }
3970 __pyx_pybuffernd_refined.diminfo[0].strides = __pyx_pybuffernd_refined.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_refined.diminfo[0].shape = __pyx_pybuffernd_refined.rcbuffer->pybuffer.shape[0];
3971
3972 /* "yt/utilities/lib/depth_first_octree.pyx":60
3973 * cdef int child_i, child_j, child_k
3974 * cdef OctreeGrid child_grid
3975 * cdef OctreeGrid grid = grids[gi] # <<<<<<<<<<<<<<
3976 * cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields
3977 * cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges
3978 */
3979 __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_grids), __pyx_v_gi, int, 1, __Pyx_PyInt_From_int, 0, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 60, __pyx_L1_error)
3980 __Pyx_GOTREF(__pyx_t_1);
3981 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid))))) __PYX_ERR(1, 60, __pyx_L1_error)
3982 __pyx_v_grid = ((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_t_1);
3983 __pyx_t_1 = 0;
3984
3985 /* "yt/utilities/lib/depth_first_octree.pyx":61
3986 * cdef OctreeGrid child_grid
3987 * cdef OctreeGrid grid = grids[gi]
3988 * cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields # <<<<<<<<<<<<<<
3989 * cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges
3990 * cdef np.float64_t dx = grid.dx[0]
3991 */
3992 if (!(likely(((__pyx_v_grid->fields) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_grid->fields, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 61, __pyx_L1_error)
3993 __pyx_t_1 = __pyx_v_grid->fields;
3994 __Pyx_INCREF(__pyx_t_1);
3995 {
3996 __Pyx_BufFmt_StackElem __pyx_stack[1];
3997 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fields.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) {
3998 __pyx_v_fields = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_fields.rcbuffer->pybuffer.buf = NULL;
3999 __PYX_ERR(1, 61, __pyx_L1_error)
4000 } else {__pyx_pybuffernd_fields.diminfo[0].strides = __pyx_pybuffernd_fields.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fields.diminfo[0].shape = __pyx_pybuffernd_fields.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_fields.diminfo[1].strides = __pyx_pybuffernd_fields.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_fields.diminfo[1].shape = __pyx_pybuffernd_fields.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_fields.diminfo[2].strides = __pyx_pybuffernd_fields.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_fields.diminfo[2].shape = __pyx_pybuffernd_fields.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_fields.diminfo[3].strides = __pyx_pybuffernd_fields.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_fields.diminfo[3].shape = __pyx_pybuffernd_fields.rcbuffer->pybuffer.shape[3];
4001 }
4002 }
4003 __pyx_v_fields = ((PyArrayObject *)__pyx_t_1);
4004 __pyx_t_1 = 0;
4005
4006 /* "yt/utilities/lib/depth_first_octree.pyx":62
4007 * cdef OctreeGrid grid = grids[gi]
4008 * cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields
4009 * cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges # <<<<<<<<<<<<<<
4010 * cdef np.float64_t dx = grid.dx[0]
4011 * cdef np.float64_t child_dx
4012 */
4013 if (!(likely(((__pyx_v_grid->left_edges) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_grid->left_edges, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 62, __pyx_L1_error)
4014 __pyx_t_1 = __pyx_v_grid->left_edges;
4015 __Pyx_INCREF(__pyx_t_1);
4016 {
4017 __Pyx_BufFmt_StackElem __pyx_stack[1];
4018 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_leftedges.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
4019 __pyx_v_leftedges = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_leftedges.rcbuffer->pybuffer.buf = NULL;
4020 __PYX_ERR(1, 62, __pyx_L1_error)
4021 } else {__pyx_pybuffernd_leftedges.diminfo[0].strides = __pyx_pybuffernd_leftedges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_leftedges.diminfo[0].shape = __pyx_pybuffernd_leftedges.rcbuffer->pybuffer.shape[0];
4022 }
4023 }
4024 __pyx_v_leftedges = ((PyArrayObject *)__pyx_t_1);
4025 __pyx_t_1 = 0;
4026
4027 /* "yt/utilities/lib/depth_first_octree.pyx":63
4028 * cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields
4029 * cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges
4030 * cdef np.float64_t dx = grid.dx[0] # <<<<<<<<<<<<<<
4031 * cdef np.float64_t child_dx
4032 * cdef np.ndarray[np.float64_t, ndim=1] child_leftedges
4033 */
4034 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_grid->dx, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 63, __pyx_L1_error)
4035 __Pyx_GOTREF(__pyx_t_1);
4036 __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 63, __pyx_L1_error)
4037 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4038 __pyx_v_dx = __pyx_t_2;
4039
4040 /* "yt/utilities/lib/depth_first_octree.pyx":72
4041 * #so we find the int float center (cxyz) of each child cell
4042 * # and from that find the child cell indices
4043 * for i_off in range(i_f): # <<<<<<<<<<<<<<
4044 * i = i_off + i_i #index
4045 * cx = (leftedges[0] + i*dx)
4046 */
4047 __pyx_t_3 = __pyx_v_i_f;
4048 __pyx_t_4 = __pyx_t_3;
4049 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
4050 __pyx_v_i_off = __pyx_t_5;
4051
4052 /* "yt/utilities/lib/depth_first_octree.pyx":73
4053 * # and from that find the child cell indices
4054 * for i_off in range(i_f):
4055 * i = i_off + i_i #index # <<<<<<<<<<<<<<
4056 * cx = (leftedges[0] + i*dx)
4057 * for j_off in range(j_f):
4058 */
4059 __pyx_v_i = (__pyx_v_i_off + __pyx_v_i_i);
4060
4061 /* "yt/utilities/lib/depth_first_octree.pyx":74
4062 * for i_off in range(i_f):
4063 * i = i_off + i_i #index
4064 * cx = (leftedges[0] + i*dx) # <<<<<<<<<<<<<<
4065 * for j_off in range(j_f):
4066 * j = j_off + j_i
4067 */
4068 __pyx_t_6 = 0;
4069 if (__pyx_t_6 < 0) __pyx_t_6 += __pyx_pybuffernd_leftedges.diminfo[0].shape;
4070 __pyx_v_cx = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_leftedges.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_leftedges.diminfo[0].strides)) + (__pyx_v_i * __pyx_v_dx));
4071
4072 /* "yt/utilities/lib/depth_first_octree.pyx":75
4073 * i = i_off + i_i #index
4074 * cx = (leftedges[0] + i*dx)
4075 * for j_off in range(j_f): # <<<<<<<<<<<<<<
4076 * j = j_off + j_i
4077 * cy = (leftedges[1] + j*dx)
4078 */
4079 __pyx_t_7 = __pyx_v_j_f;
4080 __pyx_t_8 = __pyx_t_7;
4081 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
4082 __pyx_v_j_off = __pyx_t_9;
4083
4084 /* "yt/utilities/lib/depth_first_octree.pyx":76
4085 * cx = (leftedges[0] + i*dx)
4086 * for j_off in range(j_f):
4087 * j = j_off + j_i # <<<<<<<<<<<<<<
4088 * cy = (leftedges[1] + j*dx)
4089 * for k_off in range(k_f):
4090 */
4091 __pyx_v_j = (__pyx_v_j_off + __pyx_v_j_i);
4092
4093 /* "yt/utilities/lib/depth_first_octree.pyx":77
4094 * for j_off in range(j_f):
4095 * j = j_off + j_i
4096 * cy = (leftedges[1] + j*dx) # <<<<<<<<<<<<<<
4097 * for k_off in range(k_f):
4098 * k = k_off + k_i
4099 */
4100 __pyx_t_10 = 1;
4101 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_pybuffernd_leftedges.diminfo[0].shape;
4102 __pyx_v_cy = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_leftedges.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_leftedges.diminfo[0].strides)) + (__pyx_v_j * __pyx_v_dx));
4103
4104 /* "yt/utilities/lib/depth_first_octree.pyx":78
4105 * j = j_off + j_i
4106 * cy = (leftedges[1] + j*dx)
4107 * for k_off in range(k_f): # <<<<<<<<<<<<<<
4108 * k = k_off + k_i
4109 * cz = (leftedges[2] + k*dx)
4110 */
4111 __pyx_t_11 = __pyx_v_k_f;
4112 __pyx_t_12 = __pyx_t_11;
4113 for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
4114 __pyx_v_k_off = __pyx_t_13;
4115
4116 /* "yt/utilities/lib/depth_first_octree.pyx":79
4117 * cy = (leftedges[1] + j*dx)
4118 * for k_off in range(k_f):
4119 * k = k_off + k_i # <<<<<<<<<<<<<<
4120 * cz = (leftedges[2] + k*dx)
4121 * ci = grid.child_indices[i,j,k]
4122 */
4123 __pyx_v_k = (__pyx_v_k_off + __pyx_v_k_i);
4124
4125 /* "yt/utilities/lib/depth_first_octree.pyx":80
4126 * for k_off in range(k_f):
4127 * k = k_off + k_i
4128 * cz = (leftedges[2] + k*dx) # <<<<<<<<<<<<<<
4129 * ci = grid.child_indices[i,j,k]
4130 * if ci == -1:
4131 */
4132 __pyx_t_14 = 2;
4133 if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_pybuffernd_leftedges.diminfo[0].shape;
4134 __pyx_v_cz = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_leftedges.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_leftedges.diminfo[0].strides)) + (__pyx_v_k * __pyx_v_dx));
4135
4136 /* "yt/utilities/lib/depth_first_octree.pyx":81
4137 * k = k_off + k_i
4138 * cz = (leftedges[2] + k*dx)
4139 * ci = grid.child_indices[i,j,k] # <<<<<<<<<<<<<<
4140 * if ci == -1:
4141 * for fi in range(fields.shape[0]):
4142 */
4143 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 81, __pyx_L1_error)
4144 __Pyx_GOTREF(__pyx_t_1);
4145 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 81, __pyx_L1_error)
4146 __Pyx_GOTREF(__pyx_t_15);
4147 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 81, __pyx_L1_error)
4148 __Pyx_GOTREF(__pyx_t_16);
4149 __pyx_t_17 = PyTuple_New(3); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 81, __pyx_L1_error)
4150 __Pyx_GOTREF(__pyx_t_17);
4151 __Pyx_GIVEREF(__pyx_t_1);
4152 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_1);
4153 __Pyx_GIVEREF(__pyx_t_15);
4154 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_15);
4155 __Pyx_GIVEREF(__pyx_t_16);
4156 PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_t_16);
4157 __pyx_t_1 = 0;
4158 __pyx_t_15 = 0;
4159 __pyx_t_16 = 0;
4160 __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_v_grid->child_indices, __pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 81, __pyx_L1_error)
4161 __Pyx_GOTREF(__pyx_t_16);
4162 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
4163 __pyx_t_18 = __Pyx_PyInt_As_int(__pyx_t_16); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 81, __pyx_L1_error)
4164 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4165 __pyx_v_ci = __pyx_t_18;
4166
4167 /* "yt/utilities/lib/depth_first_octree.pyx":82
4168 * cz = (leftedges[2] + k*dx)
4169 * ci = grid.child_indices[i,j,k]
4170 * if ci == -1: # <<<<<<<<<<<<<<
4171 * for fi in range(fields.shape[0]):
4172 * output[curpos.output_pos,fi] = fields[fi,i,j,k]
4173 */
4174 __pyx_t_19 = ((__pyx_v_ci == -1L) != 0);
4175 if (__pyx_t_19) {
4176
4177 /* "yt/utilities/lib/depth_first_octree.pyx":83
4178 * ci = grid.child_indices[i,j,k]
4179 * if ci == -1:
4180 * for fi in range(fields.shape[0]): # <<<<<<<<<<<<<<
4181 * output[curpos.output_pos,fi] = fields[fi,i,j,k]
4182 * refined[curpos.refined_pos] = 0
4183 */
4184 __pyx_t_20 = (__pyx_v_fields->dimensions[0]);
4185 __pyx_t_21 = __pyx_t_20;
4186 for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_21; __pyx_t_18+=1) {
4187 __pyx_v_fi = __pyx_t_18;
4188
4189 /* "yt/utilities/lib/depth_first_octree.pyx":84
4190 * if ci == -1:
4191 * for fi in range(fields.shape[0]):
4192 * output[curpos.output_pos,fi] = fields[fi,i,j,k] # <<<<<<<<<<<<<<
4193 * refined[curpos.refined_pos] = 0
4194 * curpos.output_pos += 1
4195 */
4196 __pyx_t_22 = __pyx_v_fi;
4197 __pyx_t_23 = __pyx_v_i;
4198 __pyx_t_24 = __pyx_v_j;
4199 __pyx_t_25 = __pyx_v_k;
4200 if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_pybuffernd_fields.diminfo[0].shape;
4201 if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_pybuffernd_fields.diminfo[1].shape;
4202 if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_pybuffernd_fields.diminfo[2].shape;
4203 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_pybuffernd_fields.diminfo[3].shape;
4204 __pyx_t_26 = __pyx_v_curpos->output_pos;
4205 __pyx_t_27 = __pyx_v_fi;
4206 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_pybuffernd_output.diminfo[0].shape;
4207 if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_pybuffernd_output.diminfo[1].shape;
4208 *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_output.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_output.diminfo[1].strides) = (*__Pyx_BufPtrStrided4d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_fields.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_fields.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_fields.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_fields.diminfo[2].strides, __pyx_t_25, __pyx_pybuffernd_fields.diminfo[3].strides));
4209 }
4210
4211 /* "yt/utilities/lib/depth_first_octree.pyx":85
4212 * for fi in range(fields.shape[0]):
4213 * output[curpos.output_pos,fi] = fields[fi,i,j,k]
4214 * refined[curpos.refined_pos] = 0 # <<<<<<<<<<<<<<
4215 * curpos.output_pos += 1
4216 * curpos.refined_pos += 1
4217 */
4218 __pyx_t_28 = __pyx_v_curpos->refined_pos;
4219 if (__pyx_t_28 < 0) __pyx_t_28 += __pyx_pybuffernd_refined.diminfo[0].shape;
4220 *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_refined.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_refined.diminfo[0].strides) = 0;
4221
4222 /* "yt/utilities/lib/depth_first_octree.pyx":86
4223 * output[curpos.output_pos,fi] = fields[fi,i,j,k]
4224 * refined[curpos.refined_pos] = 0
4225 * curpos.output_pos += 1 # <<<<<<<<<<<<<<
4226 * curpos.refined_pos += 1
4227 * else:
4228 */
4229 __pyx_v_curpos->output_pos = (__pyx_v_curpos->output_pos + 1);
4230
4231 /* "yt/utilities/lib/depth_first_octree.pyx":87
4232 * refined[curpos.refined_pos] = 0
4233 * curpos.output_pos += 1
4234 * curpos.refined_pos += 1 # <<<<<<<<<<<<<<
4235 * else:
4236 * refined[curpos.refined_pos] = 1
4237 */
4238 __pyx_v_curpos->refined_pos = (__pyx_v_curpos->refined_pos + 1);
4239
4240 /* "yt/utilities/lib/depth_first_octree.pyx":82
4241 * cz = (leftedges[2] + k*dx)
4242 * ci = grid.child_indices[i,j,k]
4243 * if ci == -1: # <<<<<<<<<<<<<<
4244 * for fi in range(fields.shape[0]):
4245 * output[curpos.output_pos,fi] = fields[fi,i,j,k]
4246 */
4247 goto __pyx_L9;
4248 }
4249
4250 /* "yt/utilities/lib/depth_first_octree.pyx":89
4251 * curpos.refined_pos += 1
4252 * else:
4253 * refined[curpos.refined_pos] = 1 # <<<<<<<<<<<<<<
4254 * curpos.refined_pos += 1
4255 * child_grid = grids[ci-grid.offset]
4256 */
4257 /*else*/ {
4258 __pyx_t_29 = __pyx_v_curpos->refined_pos;
4259 if (__pyx_t_29 < 0) __pyx_t_29 += __pyx_pybuffernd_refined.diminfo[0].shape;
4260 *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_refined.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_refined.diminfo[0].strides) = 1;
4261
4262 /* "yt/utilities/lib/depth_first_octree.pyx":90
4263 * else:
4264 * refined[curpos.refined_pos] = 1
4265 * curpos.refined_pos += 1 # <<<<<<<<<<<<<<
4266 * child_grid = grids[ci-grid.offset]
4267 * child_dx = child_grid.dx[0]
4268 */
4269 __pyx_v_curpos->refined_pos = (__pyx_v_curpos->refined_pos + 1);
4270
4271 /* "yt/utilities/lib/depth_first_octree.pyx":91
4272 * refined[curpos.refined_pos] = 1
4273 * curpos.refined_pos += 1
4274 * child_grid = grids[ci-grid.offset] # <<<<<<<<<<<<<<
4275 * child_dx = child_grid.dx[0]
4276 * child_leftedges = child_grid.left_edges
4277 */
4278 __pyx_t_18 = (__pyx_v_ci - __pyx_v_grid->offset);
4279 __pyx_t_16 = __Pyx_GetItemInt(((PyObject *)__pyx_v_grids), __pyx_t_18, int, 1, __Pyx_PyInt_From_int, 0, 1, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 91, __pyx_L1_error)
4280 __Pyx_GOTREF(__pyx_t_16);
4281 if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid))))) __PYX_ERR(1, 91, __pyx_L1_error)
4282 __Pyx_XDECREF_SET(__pyx_v_child_grid, ((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_t_16));
4283 __pyx_t_16 = 0;
4284
4285 /* "yt/utilities/lib/depth_first_octree.pyx":92
4286 * curpos.refined_pos += 1
4287 * child_grid = grids[ci-grid.offset]
4288 * child_dx = child_grid.dx[0] # <<<<<<<<<<<<<<
4289 * child_leftedges = child_grid.left_edges
4290 * child_i = int((cx - child_leftedges[0])/child_dx)
4291 */
4292 __pyx_t_16 = __Pyx_GetItemInt(__pyx_v_child_grid->dx, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 92, __pyx_L1_error)
4293 __Pyx_GOTREF(__pyx_t_16);
4294 __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_16); if (unlikely((__pyx_t_2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 92, __pyx_L1_error)
4295 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4296 __pyx_v_child_dx = __pyx_t_2;
4297
4298 /* "yt/utilities/lib/depth_first_octree.pyx":93
4299 * child_grid = grids[ci-grid.offset]
4300 * child_dx = child_grid.dx[0]
4301 * child_leftedges = child_grid.left_edges # <<<<<<<<<<<<<<
4302 * child_i = int((cx - child_leftedges[0])/child_dx)
4303 * child_j = int((cy - child_leftedges[1])/child_dx)
4304 */
4305 if (!(likely(((__pyx_v_child_grid->left_edges) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_child_grid->left_edges, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 93, __pyx_L1_error)
4306 __pyx_t_16 = __pyx_v_child_grid->left_edges;
4307 __Pyx_INCREF(__pyx_t_16);
4308 {
4309 __Pyx_BufFmt_StackElem __pyx_stack[1];
4310 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer);
4311 __pyx_t_18 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_16), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
4312 if (unlikely(__pyx_t_18 < 0)) {
4313 PyErr_Fetch(&__pyx_t_30, &__pyx_t_31, &__pyx_t_32);
4314 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer, (PyObject*)__pyx_v_child_leftedges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
4315 Py_XDECREF(__pyx_t_30); Py_XDECREF(__pyx_t_31); Py_XDECREF(__pyx_t_32);
4316 __Pyx_RaiseBufferFallbackError();
4317 } else {
4318 PyErr_Restore(__pyx_t_30, __pyx_t_31, __pyx_t_32);
4319 }
4320 __pyx_t_30 = __pyx_t_31 = __pyx_t_32 = 0;
4321 }
4322 __pyx_pybuffernd_child_leftedges.diminfo[0].strides = __pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_child_leftedges.diminfo[0].shape = __pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer.shape[0];
4323 if (unlikely(__pyx_t_18 < 0)) __PYX_ERR(1, 93, __pyx_L1_error)
4324 }
4325 __Pyx_XDECREF_SET(__pyx_v_child_leftedges, ((PyArrayObject *)__pyx_t_16));
4326 __pyx_t_16 = 0;
4327
4328 /* "yt/utilities/lib/depth_first_octree.pyx":94
4329 * child_dx = child_grid.dx[0]
4330 * child_leftedges = child_grid.left_edges
4331 * child_i = int((cx - child_leftedges[0])/child_dx) # <<<<<<<<<<<<<<
4332 * child_j = int((cy - child_leftedges[1])/child_dx)
4333 * child_k = int((cz - child_leftedges[2])/child_dx)
4334 */
4335 __pyx_t_33 = 0;
4336 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_pybuffernd_child_leftedges.diminfo[0].shape;
4337 __pyx_t_2 = (__pyx_v_cx - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_child_leftedges.diminfo[0].strides)));
4338 if (unlikely(__pyx_v_child_dx == 0)) {
4339 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
4340 __PYX_ERR(1, 94, __pyx_L1_error)
4341 }
4342 __pyx_v_child_i = ((int)(__pyx_t_2 / __pyx_v_child_dx));
4343
4344 /* "yt/utilities/lib/depth_first_octree.pyx":95
4345 * child_leftedges = child_grid.left_edges
4346 * child_i = int((cx - child_leftedges[0])/child_dx)
4347 * child_j = int((cy - child_leftedges[1])/child_dx) # <<<<<<<<<<<<<<
4348 * child_k = int((cz - child_leftedges[2])/child_dx)
4349 * # s = Recurs.....
4350 */
4351 __pyx_t_34 = 1;
4352 if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_pybuffernd_child_leftedges.diminfo[0].shape;
4353 __pyx_t_2 = (__pyx_v_cy - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_child_leftedges.diminfo[0].strides)));
4354 if (unlikely(__pyx_v_child_dx == 0)) {
4355 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
4356 __PYX_ERR(1, 95, __pyx_L1_error)
4357 }
4358 __pyx_v_child_j = ((int)(__pyx_t_2 / __pyx_v_child_dx));
4359
4360 /* "yt/utilities/lib/depth_first_octree.pyx":96
4361 * child_i = int((cx - child_leftedges[0])/child_dx)
4362 * child_j = int((cy - child_leftedges[1])/child_dx)
4363 * child_k = int((cz - child_leftedges[2])/child_dx) # <<<<<<<<<<<<<<
4364 * # s = Recurs.....
4365 * RecurseOctreeDepthFirst(child_i, child_j, child_k, 2, 2, 2,
4366 */
4367 __pyx_t_35 = 2;
4368 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_pybuffernd_child_leftedges.diminfo[0].shape;
4369 __pyx_t_2 = (__pyx_v_cz - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_child_leftedges.diminfo[0].strides)));
4370 if (unlikely(__pyx_v_child_dx == 0)) {
4371 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
4372 __PYX_ERR(1, 96, __pyx_L1_error)
4373 }
4374 __pyx_v_child_k = ((int)(__pyx_t_2 / __pyx_v_child_dx));
4375
4376 /* "yt/utilities/lib/depth_first_octree.pyx":98
4377 * child_k = int((cz - child_leftedges[2])/child_dx)
4378 * # s = Recurs.....
4379 * RecurseOctreeDepthFirst(child_i, child_j, child_k, 2, 2, 2, # <<<<<<<<<<<<<<
4380 * curpos, ci - grid.offset, output, refined, grids)
4381 *
4382 */
4383 __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_RecurseOctreeDepthFirst); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 98, __pyx_L1_error)
4384 __Pyx_GOTREF(__pyx_t_17);
4385 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_child_i); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 98, __pyx_L1_error)
4386 __Pyx_GOTREF(__pyx_t_15);
4387 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_child_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 98, __pyx_L1_error)
4388 __Pyx_GOTREF(__pyx_t_1);
4389 __pyx_t_36 = __Pyx_PyInt_From_int(__pyx_v_child_k); if (unlikely(!__pyx_t_36)) __PYX_ERR(1, 98, __pyx_L1_error)
4390 __Pyx_GOTREF(__pyx_t_36);
4391
4392 /* "yt/utilities/lib/depth_first_octree.pyx":99
4393 * # s = Recurs.....
4394 * RecurseOctreeDepthFirst(child_i, child_j, child_k, 2, 2, 2,
4395 * curpos, ci - grid.offset, output, refined, grids) # <<<<<<<<<<<<<<
4396 *
4397 * @cython.boundscheck(False)
4398 */
4399 __pyx_t_37 = __Pyx_PyInt_From_int((__pyx_v_ci - __pyx_v_grid->offset)); if (unlikely(!__pyx_t_37)) __PYX_ERR(1, 99, __pyx_L1_error)
4400 __Pyx_GOTREF(__pyx_t_37);
4401 __pyx_t_38 = NULL;
4402 __pyx_t_18 = 0;
4403 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
4404 __pyx_t_38 = PyMethod_GET_SELF(__pyx_t_17);
4405 if (likely(__pyx_t_38)) {
4406 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
4407 __Pyx_INCREF(__pyx_t_38);
4408 __Pyx_INCREF(function);
4409 __Pyx_DECREF_SET(__pyx_t_17, function);
4410 __pyx_t_18 = 1;
4411 }
4412 }
4413 #if CYTHON_FAST_PYCALL
4414 if (PyFunction_Check(__pyx_t_17)) {
4415 PyObject *__pyx_temp[12] = {__pyx_t_38, __pyx_t_15, __pyx_t_1, __pyx_t_36, __pyx_int_2, __pyx_int_2, __pyx_int_2, ((PyObject *)__pyx_v_curpos), __pyx_t_37, ((PyObject *)__pyx_v_output), ((PyObject *)__pyx_v_refined), ((PyObject *)__pyx_v_grids)};
4416 __pyx_t_16 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_18, 11+__pyx_t_18); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 98, __pyx_L1_error)
4417 __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0;
4418 __Pyx_GOTREF(__pyx_t_16);
4419 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
4420 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4421 __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
4422 __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
4423 } else
4424 #endif
4425 #if CYTHON_FAST_PYCCALL
4426 if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
4427 PyObject *__pyx_temp[12] = {__pyx_t_38, __pyx_t_15, __pyx_t_1, __pyx_t_36, __pyx_int_2, __pyx_int_2, __pyx_int_2, ((PyObject *)__pyx_v_curpos), __pyx_t_37, ((PyObject *)__pyx_v_output), ((PyObject *)__pyx_v_refined), ((PyObject *)__pyx_v_grids)};
4428 __pyx_t_16 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_18, 11+__pyx_t_18); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 98, __pyx_L1_error)
4429 __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0;
4430 __Pyx_GOTREF(__pyx_t_16);
4431 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
4432 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4433 __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
4434 __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
4435 } else
4436 #endif
4437 {
4438 __pyx_t_39 = PyTuple_New(11+__pyx_t_18); if (unlikely(!__pyx_t_39)) __PYX_ERR(1, 98, __pyx_L1_error)
4439 __Pyx_GOTREF(__pyx_t_39);
4440 if (__pyx_t_38) {
4441 __Pyx_GIVEREF(__pyx_t_38); PyTuple_SET_ITEM(__pyx_t_39, 0, __pyx_t_38); __pyx_t_38 = NULL;
4442 }
4443 __Pyx_GIVEREF(__pyx_t_15);
4444 PyTuple_SET_ITEM(__pyx_t_39, 0+__pyx_t_18, __pyx_t_15);
4445 __Pyx_GIVEREF(__pyx_t_1);
4446 PyTuple_SET_ITEM(__pyx_t_39, 1+__pyx_t_18, __pyx_t_1);
4447 __Pyx_GIVEREF(__pyx_t_36);
4448 PyTuple_SET_ITEM(__pyx_t_39, 2+__pyx_t_18, __pyx_t_36);
4449 __Pyx_INCREF(__pyx_int_2);
4450 __Pyx_GIVEREF(__pyx_int_2);
4451 PyTuple_SET_ITEM(__pyx_t_39, 3+__pyx_t_18, __pyx_int_2);
4452 __Pyx_INCREF(__pyx_int_2);
4453 __Pyx_GIVEREF(__pyx_int_2);
4454 PyTuple_SET_ITEM(__pyx_t_39, 4+__pyx_t_18, __pyx_int_2);
4455 __Pyx_INCREF(__pyx_int_2);
4456 __Pyx_GIVEREF(__pyx_int_2);
4457 PyTuple_SET_ITEM(__pyx_t_39, 5+__pyx_t_18, __pyx_int_2);
4458 __Pyx_INCREF(((PyObject *)__pyx_v_curpos));
4459 __Pyx_GIVEREF(((PyObject *)__pyx_v_curpos));
4460 PyTuple_SET_ITEM(__pyx_t_39, 6+__pyx_t_18, ((PyObject *)__pyx_v_curpos));
4461 __Pyx_GIVEREF(__pyx_t_37);
4462 PyTuple_SET_ITEM(__pyx_t_39, 7+__pyx_t_18, __pyx_t_37);
4463 __Pyx_INCREF(((PyObject *)__pyx_v_output));
4464 __Pyx_GIVEREF(((PyObject *)__pyx_v_output));
4465 PyTuple_SET_ITEM(__pyx_t_39, 8+__pyx_t_18, ((PyObject *)__pyx_v_output));
4466 __Pyx_INCREF(((PyObject *)__pyx_v_refined));
4467 __Pyx_GIVEREF(((PyObject *)__pyx_v_refined));
4468 PyTuple_SET_ITEM(__pyx_t_39, 9+__pyx_t_18, ((PyObject *)__pyx_v_refined));
4469 __Pyx_INCREF(((PyObject *)__pyx_v_grids));
4470 __Pyx_GIVEREF(((PyObject *)__pyx_v_grids));
4471 PyTuple_SET_ITEM(__pyx_t_39, 10+__pyx_t_18, ((PyObject *)__pyx_v_grids));
4472 __pyx_t_15 = 0;
4473 __pyx_t_1 = 0;
4474 __pyx_t_36 = 0;
4475 __pyx_t_37 = 0;
4476 __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_39, NULL); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 98, __pyx_L1_error)
4477 __Pyx_GOTREF(__pyx_t_16);
4478 __Pyx_DECREF(__pyx_t_39); __pyx_t_39 = 0;
4479 }
4480 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
4481 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4482 }
4483 __pyx_L9:;
4484 }
4485 }
4486 }
4487
4488 /* "yt/utilities/lib/depth_first_octree.pyx":50
4489 *
4490 * @cython.boundscheck(False)
4491 * def RecurseOctreeDepthFirst(int i_i, int j_i, int k_i, # <<<<<<<<<<<<<<
4492 * int i_f, int j_f, int k_f,
4493 * position curpos, int gi,
4494 */
4495
4496 /* function exit code */
4497 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4498 goto __pyx_L0;
4499 __pyx_L1_error:;
4500 __Pyx_XDECREF(__pyx_t_1);
4501 __Pyx_XDECREF(__pyx_t_15);
4502 __Pyx_XDECREF(__pyx_t_16);
4503 __Pyx_XDECREF(__pyx_t_17);
4504 __Pyx_XDECREF(__pyx_t_36);
4505 __Pyx_XDECREF(__pyx_t_37);
4506 __Pyx_XDECREF(__pyx_t_38);
4507 __Pyx_XDECREF(__pyx_t_39);
4508 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
4509 __Pyx_PyThreadState_declare
4510 __Pyx_PyThreadState_assign
4511 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
4512 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer);
4513 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_fields.rcbuffer->pybuffer);
4514 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_leftedges.rcbuffer->pybuffer);
4515 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
4516 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_refined.rcbuffer->pybuffer);
4517 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
4518 __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.RecurseOctreeDepthFirst", __pyx_clineno, __pyx_lineno, __pyx_filename);
4519 __pyx_r = NULL;
4520 goto __pyx_L2;
4521 __pyx_L0:;
4522 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer);
4523 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_fields.rcbuffer->pybuffer);
4524 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_leftedges.rcbuffer->pybuffer);
4525 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
4526 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_refined.rcbuffer->pybuffer);
4527 __pyx_L2:;
4528 __Pyx_XDECREF((PyObject *)__pyx_v_child_grid);
4529 __Pyx_XDECREF((PyObject *)__pyx_v_grid);
4530 __Pyx_XDECREF((PyObject *)__pyx_v_fields);
4531 __Pyx_XDECREF((PyObject *)__pyx_v_leftedges);
4532 __Pyx_XDECREF((PyObject *)__pyx_v_child_leftedges);
4533 __Pyx_XGIVEREF(__pyx_r);
4534 __Pyx_RefNannyFinishContext();
4535 return __pyx_r;
4536 }
4537
4538 /* "yt/utilities/lib/depth_first_octree.pyx":102
4539 *
4540 * @cython.boundscheck(False)
4541 * def RecurseOctreeByLevels(int i_i, int j_i, int k_i, # <<<<<<<<<<<<<<
4542 * int i_f, int j_f, int k_f,
4543 * np.ndarray[np.int32_t, ndim=1] curpos,
4544 */
4545
4546 /* Python wrapper */
4547 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_3RecurseOctreeByLevels(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4548 static PyMethodDef __pyx_mdef_2yt_9utilities_3lib_18depth_first_octree_3RecurseOctreeByLevels = {"RecurseOctreeByLevels", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_3RecurseOctreeByLevels, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_3RecurseOctreeByLevels(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4549 static PyObject *__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_3RecurseOctreeByLevels(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4550 int __pyx_v_i_i;
4551 int __pyx_v_j_i;
4552 int __pyx_v_k_i;
4553 int __pyx_v_i_f;
4554 int __pyx_v_j_f;
4555 int __pyx_v_k_f;
4556 PyArrayObject *__pyx_v_curpos = 0;
4557 int __pyx_v_gi;
4558 PyArrayObject *__pyx_v_output = 0;
4559 PyArrayObject *__pyx_v_genealogy = 0;
4560 PyArrayObject *__pyx_v_corners = 0;
4561 struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_grids = 0;
4562 PyObject *__pyx_r = 0;
4563 __Pyx_RefNannyDeclarations
4564 __Pyx_RefNannySetupContext("RecurseOctreeByLevels (wrapper)", 0);
4565 {
4566 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i_i,&__pyx_n_s_j_i,&__pyx_n_s_k_i,&__pyx_n_s_i_f,&__pyx_n_s_j_f,&__pyx_n_s_k_f,&__pyx_n_s_curpos,&__pyx_n_s_gi,&__pyx_n_s_output,&__pyx_n_s_genealogy,&__pyx_n_s_corners,&__pyx_n_s_grids,0};
4567 PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
4568 if (unlikely(__pyx_kwds)) {
4569 Py_ssize_t kw_args;
4570 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4571 switch (pos_args) {
4572 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
4573 CYTHON_FALLTHROUGH;
4574 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
4575 CYTHON_FALLTHROUGH;
4576 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
4577 CYTHON_FALLTHROUGH;
4578 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
4579 CYTHON_FALLTHROUGH;
4580 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
4581 CYTHON_FALLTHROUGH;
4582 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4583 CYTHON_FALLTHROUGH;
4584 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4585 CYTHON_FALLTHROUGH;
4586 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4587 CYTHON_FALLTHROUGH;
4588 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4589 CYTHON_FALLTHROUGH;
4590 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4591 CYTHON_FALLTHROUGH;
4592 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4593 CYTHON_FALLTHROUGH;
4594 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4595 CYTHON_FALLTHROUGH;
4596 case 0: break;
4597 default: goto __pyx_L5_argtuple_error;
4598 }
4599 kw_args = PyDict_Size(__pyx_kwds);
4600 switch (pos_args) {
4601 case 0:
4602 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i_i)) != 0)) kw_args--;
4603 else goto __pyx_L5_argtuple_error;
4604 CYTHON_FALLTHROUGH;
4605 case 1:
4606 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_j_i)) != 0)) kw_args--;
4607 else {
4608 __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 1); __PYX_ERR(1, 102, __pyx_L3_error)
4609 }
4610 CYTHON_FALLTHROUGH;
4611 case 2:
4612 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k_i)) != 0)) kw_args--;
4613 else {
4614 __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 2); __PYX_ERR(1, 102, __pyx_L3_error)
4615 }
4616 CYTHON_FALLTHROUGH;
4617 case 3:
4618 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i_f)) != 0)) kw_args--;
4619 else {
4620 __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 3); __PYX_ERR(1, 102, __pyx_L3_error)
4621 }
4622 CYTHON_FALLTHROUGH;
4623 case 4:
4624 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_j_f)) != 0)) kw_args--;
4625 else {
4626 __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 4); __PYX_ERR(1, 102, __pyx_L3_error)
4627 }
4628 CYTHON_FALLTHROUGH;
4629 case 5:
4630 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k_f)) != 0)) kw_args--;
4631 else {
4632 __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 5); __PYX_ERR(1, 102, __pyx_L3_error)
4633 }
4634 CYTHON_FALLTHROUGH;
4635 case 6:
4636 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_curpos)) != 0)) kw_args--;
4637 else {
4638 __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 6); __PYX_ERR(1, 102, __pyx_L3_error)
4639 }
4640 CYTHON_FALLTHROUGH;
4641 case 7:
4642 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gi)) != 0)) kw_args--;
4643 else {
4644 __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 7); __PYX_ERR(1, 102, __pyx_L3_error)
4645 }
4646 CYTHON_FALLTHROUGH;
4647 case 8:
4648 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_output)) != 0)) kw_args--;
4649 else {
4650 __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 8); __PYX_ERR(1, 102, __pyx_L3_error)
4651 }
4652 CYTHON_FALLTHROUGH;
4653 case 9:
4654 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_genealogy)) != 0)) kw_args--;
4655 else {
4656 __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 9); __PYX_ERR(1, 102, __pyx_L3_error)
4657 }
4658 CYTHON_FALLTHROUGH;
4659 case 10:
4660 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_corners)) != 0)) kw_args--;
4661 else {
4662 __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 10); __PYX_ERR(1, 102, __pyx_L3_error)
4663 }
4664 CYTHON_FALLTHROUGH;
4665 case 11:
4666 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grids)) != 0)) kw_args--;
4667 else {
4668 __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 11); __PYX_ERR(1, 102, __pyx_L3_error)
4669 }
4670 }
4671 if (unlikely(kw_args > 0)) {
4672 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "RecurseOctreeByLevels") < 0)) __PYX_ERR(1, 102, __pyx_L3_error)
4673 }
4674 } else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
4675 goto __pyx_L5_argtuple_error;
4676 } else {
4677 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4678 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4679 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4680 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4681 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4682 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4683 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4684 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
4685 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
4686 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
4687 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
4688 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
4689 }
4690 __pyx_v_i_i = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_i_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 102, __pyx_L3_error)
4691 __pyx_v_j_i = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_j_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 102, __pyx_L3_error)
4692 __pyx_v_k_i = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_k_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 102, __pyx_L3_error)
4693 __pyx_v_i_f = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_i_f == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 103, __pyx_L3_error)
4694 __pyx_v_j_f = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_j_f == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 103, __pyx_L3_error)
4695 __pyx_v_k_f = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_k_f == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 103, __pyx_L3_error)
4696 __pyx_v_curpos = ((PyArrayObject *)values[6]);
4697 __pyx_v_gi = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_gi == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 105, __pyx_L3_error)
4698 __pyx_v_output = ((PyArrayObject *)values[8]);
4699 __pyx_v_genealogy = ((PyArrayObject *)values[9]);
4700 __pyx_v_corners = ((PyArrayObject *)values[10]);
4701 __pyx_v_grids = ((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *)values[11]);
4702 }
4703 goto __pyx_L4_argument_unpacking_done;
4704 __pyx_L5_argtuple_error:;
4705 __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 102, __pyx_L3_error)
4706 __pyx_L3_error:;
4707 __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.RecurseOctreeByLevels", __pyx_clineno, __pyx_lineno, __pyx_filename);
4708 __Pyx_RefNannyFinishContext();
4709 return NULL;
4710 __pyx_L4_argument_unpacking_done:;
4711 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_curpos), __pyx_ptype_5numpy_ndarray, 1, "curpos", 0))) __PYX_ERR(1, 104, __pyx_L1_error)
4712 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_output), __pyx_ptype_5numpy_ndarray, 1, "output", 0))) __PYX_ERR(1, 106, __pyx_L1_error)
4713 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_genealogy), __pyx_ptype_5numpy_ndarray, 1, "genealogy", 0))) __PYX_ERR(1, 107, __pyx_L1_error)
4714 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_corners), __pyx_ptype_5numpy_ndarray, 1, "corners", 0))) __PYX_ERR(1, 108, __pyx_L1_error)
4715 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grids), __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList, 1, "grids", 0))) __PYX_ERR(1, 109, __pyx_L1_error)
4716 __pyx_r = __pyx_pf_2yt_9utilities_3lib_18depth_first_octree_2RecurseOctreeByLevels(__pyx_self, __pyx_v_i_i, __pyx_v_j_i, __pyx_v_k_i, __pyx_v_i_f, __pyx_v_j_f, __pyx_v_k_f, __pyx_v_curpos, __pyx_v_gi, __pyx_v_output, __pyx_v_genealogy, __pyx_v_corners, __pyx_v_grids);
4717
4718 /* function exit code */
4719 goto __pyx_L0;
4720 __pyx_L1_error:;
4721 __pyx_r = NULL;
4722 __pyx_L0:;
4723 __Pyx_RefNannyFinishContext();
4724 return __pyx_r;
4725 }
4726
__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_2RecurseOctreeByLevels(CYTHON_UNUSED PyObject * __pyx_self,int __pyx_v_i_i,int __pyx_v_j_i,int __pyx_v_k_i,int __pyx_v_i_f,int __pyx_v_j_f,int __pyx_v_k_f,PyArrayObject * __pyx_v_curpos,int __pyx_v_gi,PyArrayObject * __pyx_v_output,PyArrayObject * __pyx_v_genealogy,PyArrayObject * __pyx_v_corners,struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList * __pyx_v_grids)4727 static PyObject *__pyx_pf_2yt_9utilities_3lib_18depth_first_octree_2RecurseOctreeByLevels(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_i_i, int __pyx_v_j_i, int __pyx_v_k_i, int __pyx_v_i_f, int __pyx_v_j_f, int __pyx_v_k_f, PyArrayObject *__pyx_v_curpos, int __pyx_v_gi, PyArrayObject *__pyx_v_output, PyArrayObject *__pyx_v_genealogy, PyArrayObject *__pyx_v_corners, struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *__pyx_v_grids) {
4728 __pyx_t_5numpy_int32_t __pyx_v_i;
4729 __pyx_t_5numpy_int32_t __pyx_v_i_off;
4730 __pyx_t_5numpy_int32_t __pyx_v_j;
4731 __pyx_t_5numpy_int32_t __pyx_v_j_off;
4732 __pyx_t_5numpy_int32_t __pyx_v_k;
4733 __pyx_t_5numpy_int32_t __pyx_v_k_off;
4734 __pyx_t_5numpy_int32_t __pyx_v_ci;
4735 __pyx_t_5numpy_int32_t __pyx_v_fi;
4736 int __pyx_v_child_i;
4737 int __pyx_v_child_j;
4738 int __pyx_v_child_k;
4739 struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_child_grid = 0;
4740 struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *__pyx_v_grid = 0;
4741 int __pyx_v_level;
4742 PyArrayObject *__pyx_v_child_indices = 0;
4743 PyArrayObject *__pyx_v_fields = 0;
4744 PyArrayObject *__pyx_v_leftedges = 0;
4745 __pyx_t_5numpy_float64_t __pyx_v_dx;
4746 __pyx_t_5numpy_float64_t __pyx_v_child_dx;
4747 PyArrayObject *__pyx_v_child_leftedges = 0;
4748 __pyx_t_5numpy_float64_t __pyx_v_cx;
4749 __pyx_t_5numpy_float64_t __pyx_v_cy;
4750 __pyx_t_5numpy_float64_t __pyx_v_cz;
4751 int __pyx_v_cp;
4752 PyObject *__pyx_v_s = NULL;
4753 __Pyx_LocalBuf_ND __pyx_pybuffernd_child_indices;
4754 __Pyx_Buffer __pyx_pybuffer_child_indices;
4755 __Pyx_LocalBuf_ND __pyx_pybuffernd_child_leftedges;
4756 __Pyx_Buffer __pyx_pybuffer_child_leftedges;
4757 __Pyx_LocalBuf_ND __pyx_pybuffernd_corners;
4758 __Pyx_Buffer __pyx_pybuffer_corners;
4759 __Pyx_LocalBuf_ND __pyx_pybuffernd_curpos;
4760 __Pyx_Buffer __pyx_pybuffer_curpos;
4761 __Pyx_LocalBuf_ND __pyx_pybuffernd_fields;
4762 __Pyx_Buffer __pyx_pybuffer_fields;
4763 __Pyx_LocalBuf_ND __pyx_pybuffernd_genealogy;
4764 __Pyx_Buffer __pyx_pybuffer_genealogy;
4765 __Pyx_LocalBuf_ND __pyx_pybuffernd_leftedges;
4766 __Pyx_Buffer __pyx_pybuffer_leftedges;
4767 __Pyx_LocalBuf_ND __pyx_pybuffernd_output;
4768 __Pyx_Buffer __pyx_pybuffer_output;
4769 PyObject *__pyx_r = NULL;
4770 __Pyx_RefNannyDeclarations
4771 long __pyx_t_1;
4772 PyObject *__pyx_t_2 = NULL;
4773 int __pyx_t_3;
4774 __pyx_t_5numpy_float64_t __pyx_t_4;
4775 int __pyx_t_5;
4776 __pyx_t_5numpy_int32_t __pyx_t_6;
4777 Py_ssize_t __pyx_t_7;
4778 int __pyx_t_8;
4779 int __pyx_t_9;
4780 __pyx_t_5numpy_int32_t __pyx_t_10;
4781 Py_ssize_t __pyx_t_11;
4782 int __pyx_t_12;
4783 int __pyx_t_13;
4784 __pyx_t_5numpy_int32_t __pyx_t_14;
4785 Py_ssize_t __pyx_t_15;
4786 Py_ssize_t __pyx_t_16;
4787 Py_ssize_t __pyx_t_17;
4788 Py_ssize_t __pyx_t_18;
4789 Py_ssize_t __pyx_t_19;
4790 Py_ssize_t __pyx_t_20;
4791 Py_ssize_t __pyx_t_21;
4792 Py_ssize_t __pyx_t_22;
4793 Py_ssize_t __pyx_t_23;
4794 Py_ssize_t __pyx_t_24;
4795 Py_ssize_t __pyx_t_25;
4796 npy_intp __pyx_t_26;
4797 npy_intp __pyx_t_27;
4798 __pyx_t_5numpy_int32_t __pyx_t_28;
4799 Py_ssize_t __pyx_t_29;
4800 Py_ssize_t __pyx_t_30;
4801 Py_ssize_t __pyx_t_31;
4802 Py_ssize_t __pyx_t_32;
4803 Py_ssize_t __pyx_t_33;
4804 Py_ssize_t __pyx_t_34;
4805 Py_ssize_t __pyx_t_35;
4806 Py_ssize_t __pyx_t_36;
4807 Py_ssize_t __pyx_t_37;
4808 int __pyx_t_38;
4809 int __pyx_t_39;
4810 PyObject *__pyx_t_40 = NULL;
4811 PyObject *__pyx_t_41 = NULL;
4812 PyObject *__pyx_t_42 = NULL;
4813 Py_ssize_t __pyx_t_43;
4814 Py_ssize_t __pyx_t_44;
4815 Py_ssize_t __pyx_t_45;
4816 Py_ssize_t __pyx_t_46;
4817 Py_ssize_t __pyx_t_47;
4818 Py_ssize_t __pyx_t_48;
4819 Py_ssize_t __pyx_t_49;
4820 PyObject *__pyx_t_50 = NULL;
4821 Py_ssize_t __pyx_t_51;
4822 PyObject *__pyx_t_52 = NULL;
4823 PyObject *__pyx_t_53 = NULL;
4824 PyObject *__pyx_t_54 = NULL;
4825 PyObject *__pyx_t_55 = NULL;
4826 PyObject *__pyx_t_56 = NULL;
4827 PyObject *__pyx_t_57 = NULL;
4828 Py_ssize_t __pyx_t_58;
4829 __Pyx_RefNannySetupContext("RecurseOctreeByLevels", 0);
4830 __pyx_pybuffer_child_indices.pybuffer.buf = NULL;
4831 __pyx_pybuffer_child_indices.refcount = 0;
4832 __pyx_pybuffernd_child_indices.data = NULL;
4833 __pyx_pybuffernd_child_indices.rcbuffer = &__pyx_pybuffer_child_indices;
4834 __pyx_pybuffer_fields.pybuffer.buf = NULL;
4835 __pyx_pybuffer_fields.refcount = 0;
4836 __pyx_pybuffernd_fields.data = NULL;
4837 __pyx_pybuffernd_fields.rcbuffer = &__pyx_pybuffer_fields;
4838 __pyx_pybuffer_leftedges.pybuffer.buf = NULL;
4839 __pyx_pybuffer_leftedges.refcount = 0;
4840 __pyx_pybuffernd_leftedges.data = NULL;
4841 __pyx_pybuffernd_leftedges.rcbuffer = &__pyx_pybuffer_leftedges;
4842 __pyx_pybuffer_child_leftedges.pybuffer.buf = NULL;
4843 __pyx_pybuffer_child_leftedges.refcount = 0;
4844 __pyx_pybuffernd_child_leftedges.data = NULL;
4845 __pyx_pybuffernd_child_leftedges.rcbuffer = &__pyx_pybuffer_child_leftedges;
4846 __pyx_pybuffer_curpos.pybuffer.buf = NULL;
4847 __pyx_pybuffer_curpos.refcount = 0;
4848 __pyx_pybuffernd_curpos.data = NULL;
4849 __pyx_pybuffernd_curpos.rcbuffer = &__pyx_pybuffer_curpos;
4850 __pyx_pybuffer_output.pybuffer.buf = NULL;
4851 __pyx_pybuffer_output.refcount = 0;
4852 __pyx_pybuffernd_output.data = NULL;
4853 __pyx_pybuffernd_output.rcbuffer = &__pyx_pybuffer_output;
4854 __pyx_pybuffer_genealogy.pybuffer.buf = NULL;
4855 __pyx_pybuffer_genealogy.refcount = 0;
4856 __pyx_pybuffernd_genealogy.data = NULL;
4857 __pyx_pybuffernd_genealogy.rcbuffer = &__pyx_pybuffer_genealogy;
4858 __pyx_pybuffer_corners.pybuffer.buf = NULL;
4859 __pyx_pybuffer_corners.refcount = 0;
4860 __pyx_pybuffernd_corners.data = NULL;
4861 __pyx_pybuffernd_corners.rcbuffer = &__pyx_pybuffer_corners;
4862 {
4863 __Pyx_BufFmt_StackElem __pyx_stack[1];
4864 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_curpos.rcbuffer->pybuffer, (PyObject*)__pyx_v_curpos, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(1, 102, __pyx_L1_error)
4865 }
4866 __pyx_pybuffernd_curpos.diminfo[0].strides = __pyx_pybuffernd_curpos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_curpos.diminfo[0].shape = __pyx_pybuffernd_curpos.rcbuffer->pybuffer.shape[0];
4867 {
4868 __Pyx_BufFmt_StackElem __pyx_stack[1];
4869 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output.rcbuffer->pybuffer, (PyObject*)__pyx_v_output, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(1, 102, __pyx_L1_error)
4870 }
4871 __pyx_pybuffernd_output.diminfo[0].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output.diminfo[0].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_output.diminfo[1].strides = __pyx_pybuffernd_output.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_output.diminfo[1].shape = __pyx_pybuffernd_output.rcbuffer->pybuffer.shape[1];
4872 {
4873 __Pyx_BufFmt_StackElem __pyx_stack[1];
4874 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_genealogy.rcbuffer->pybuffer, (PyObject*)__pyx_v_genealogy, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(1, 102, __pyx_L1_error)
4875 }
4876 __pyx_pybuffernd_genealogy.diminfo[0].strides = __pyx_pybuffernd_genealogy.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_genealogy.diminfo[0].shape = __pyx_pybuffernd_genealogy.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_genealogy.diminfo[1].strides = __pyx_pybuffernd_genealogy.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_genealogy.diminfo[1].shape = __pyx_pybuffernd_genealogy.rcbuffer->pybuffer.shape[1];
4877 {
4878 __Pyx_BufFmt_StackElem __pyx_stack[1];
4879 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_corners.rcbuffer->pybuffer, (PyObject*)__pyx_v_corners, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(1, 102, __pyx_L1_error)
4880 }
4881 __pyx_pybuffernd_corners.diminfo[0].strides = __pyx_pybuffernd_corners.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_corners.diminfo[0].shape = __pyx_pybuffernd_corners.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_corners.diminfo[1].strides = __pyx_pybuffernd_corners.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_corners.diminfo[1].shape = __pyx_pybuffernd_corners.rcbuffer->pybuffer.shape[1];
4882
4883 /* "yt/utilities/lib/depth_first_octree.pyx":113
4884 * cdef int child_i, child_j, child_k
4885 * cdef OctreeGrid child_grid
4886 * cdef OctreeGrid grid = grids[gi-1] # <<<<<<<<<<<<<<
4887 * cdef int level = grid.level
4888 * cdef np.ndarray[np.int32_t, ndim=3] child_indices = grid.child_indices
4889 */
4890 __pyx_t_1 = (__pyx_v_gi - 1);
4891 __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_grids), __pyx_t_1, long, 1, __Pyx_PyInt_From_long, 0, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 113, __pyx_L1_error)
4892 __Pyx_GOTREF(__pyx_t_2);
4893 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid))))) __PYX_ERR(1, 113, __pyx_L1_error)
4894 __pyx_v_grid = ((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_t_2);
4895 __pyx_t_2 = 0;
4896
4897 /* "yt/utilities/lib/depth_first_octree.pyx":114
4898 * cdef OctreeGrid child_grid
4899 * cdef OctreeGrid grid = grids[gi-1]
4900 * cdef int level = grid.level # <<<<<<<<<<<<<<
4901 * cdef np.ndarray[np.int32_t, ndim=3] child_indices = grid.child_indices
4902 * cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields
4903 */
4904 __pyx_t_3 = __pyx_v_grid->level;
4905 __pyx_v_level = __pyx_t_3;
4906
4907 /* "yt/utilities/lib/depth_first_octree.pyx":115
4908 * cdef OctreeGrid grid = grids[gi-1]
4909 * cdef int level = grid.level
4910 * cdef np.ndarray[np.int32_t, ndim=3] child_indices = grid.child_indices # <<<<<<<<<<<<<<
4911 * cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields
4912 * cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges
4913 */
4914 if (!(likely(((__pyx_v_grid->child_indices) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_grid->child_indices, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 115, __pyx_L1_error)
4915 __pyx_t_2 = __pyx_v_grid->child_indices;
4916 __Pyx_INCREF(__pyx_t_2);
4917 {
4918 __Pyx_BufFmt_StackElem __pyx_stack[1];
4919 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_child_indices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
4920 __pyx_v_child_indices = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.buf = NULL;
4921 __PYX_ERR(1, 115, __pyx_L1_error)
4922 } else {__pyx_pybuffernd_child_indices.diminfo[0].strides = __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_child_indices.diminfo[0].shape = __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_child_indices.diminfo[1].strides = __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_child_indices.diminfo[1].shape = __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_child_indices.diminfo[2].strides = __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_child_indices.diminfo[2].shape = __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.shape[2];
4923 }
4924 }
4925 __pyx_v_child_indices = ((PyArrayObject *)__pyx_t_2);
4926 __pyx_t_2 = 0;
4927
4928 /* "yt/utilities/lib/depth_first_octree.pyx":116
4929 * cdef int level = grid.level
4930 * cdef np.ndarray[np.int32_t, ndim=3] child_indices = grid.child_indices
4931 * cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields # <<<<<<<<<<<<<<
4932 * cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges
4933 * cdef np.float64_t dx = grid.dx[0]
4934 */
4935 if (!(likely(((__pyx_v_grid->fields) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_grid->fields, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 116, __pyx_L1_error)
4936 __pyx_t_2 = __pyx_v_grid->fields;
4937 __Pyx_INCREF(__pyx_t_2);
4938 {
4939 __Pyx_BufFmt_StackElem __pyx_stack[1];
4940 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fields.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) {
4941 __pyx_v_fields = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_fields.rcbuffer->pybuffer.buf = NULL;
4942 __PYX_ERR(1, 116, __pyx_L1_error)
4943 } else {__pyx_pybuffernd_fields.diminfo[0].strides = __pyx_pybuffernd_fields.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fields.diminfo[0].shape = __pyx_pybuffernd_fields.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_fields.diminfo[1].strides = __pyx_pybuffernd_fields.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_fields.diminfo[1].shape = __pyx_pybuffernd_fields.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_fields.diminfo[2].strides = __pyx_pybuffernd_fields.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_fields.diminfo[2].shape = __pyx_pybuffernd_fields.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_fields.diminfo[3].strides = __pyx_pybuffernd_fields.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_fields.diminfo[3].shape = __pyx_pybuffernd_fields.rcbuffer->pybuffer.shape[3];
4944 }
4945 }
4946 __pyx_v_fields = ((PyArrayObject *)__pyx_t_2);
4947 __pyx_t_2 = 0;
4948
4949 /* "yt/utilities/lib/depth_first_octree.pyx":117
4950 * cdef np.ndarray[np.int32_t, ndim=3] child_indices = grid.child_indices
4951 * cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields
4952 * cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges # <<<<<<<<<<<<<<
4953 * cdef np.float64_t dx = grid.dx[0]
4954 * cdef np.float64_t child_dx
4955 */
4956 if (!(likely(((__pyx_v_grid->left_edges) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_grid->left_edges, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 117, __pyx_L1_error)
4957 __pyx_t_2 = __pyx_v_grid->left_edges;
4958 __Pyx_INCREF(__pyx_t_2);
4959 {
4960 __Pyx_BufFmt_StackElem __pyx_stack[1];
4961 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_leftedges.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
4962 __pyx_v_leftedges = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_leftedges.rcbuffer->pybuffer.buf = NULL;
4963 __PYX_ERR(1, 117, __pyx_L1_error)
4964 } else {__pyx_pybuffernd_leftedges.diminfo[0].strides = __pyx_pybuffernd_leftedges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_leftedges.diminfo[0].shape = __pyx_pybuffernd_leftedges.rcbuffer->pybuffer.shape[0];
4965 }
4966 }
4967 __pyx_v_leftedges = ((PyArrayObject *)__pyx_t_2);
4968 __pyx_t_2 = 0;
4969
4970 /* "yt/utilities/lib/depth_first_octree.pyx":118
4971 * cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields
4972 * cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges
4973 * cdef np.float64_t dx = grid.dx[0] # <<<<<<<<<<<<<<
4974 * cdef np.float64_t child_dx
4975 * cdef np.ndarray[np.float64_t, ndim=1] child_leftedges
4976 */
4977 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_grid->dx, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 118, __pyx_L1_error)
4978 __Pyx_GOTREF(__pyx_t_2);
4979 __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 118, __pyx_L1_error)
4980 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4981 __pyx_v_dx = __pyx_t_4;
4982
4983 /* "yt/utilities/lib/depth_first_octree.pyx":123
4984 * cdef np.float64_t cx, cy, cz
4985 * cdef int cp
4986 * s = None # <<<<<<<<<<<<<<
4987 * for i_off in range(i_f):
4988 * i = i_off + i_i
4989 */
4990 __Pyx_INCREF(Py_None);
4991 __pyx_v_s = Py_None;
4992
4993 /* "yt/utilities/lib/depth_first_octree.pyx":124
4994 * cdef int cp
4995 * s = None
4996 * for i_off in range(i_f): # <<<<<<<<<<<<<<
4997 * i = i_off + i_i
4998 * cx = (leftedges[0] + i*dx)
4999 */
5000 __pyx_t_3 = __pyx_v_i_f;
5001 __pyx_t_5 = __pyx_t_3;
5002 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
5003 __pyx_v_i_off = __pyx_t_6;
5004
5005 /* "yt/utilities/lib/depth_first_octree.pyx":125
5006 * s = None
5007 * for i_off in range(i_f):
5008 * i = i_off + i_i # <<<<<<<<<<<<<<
5009 * cx = (leftedges[0] + i*dx)
5010 * for j_off in range(j_f):
5011 */
5012 __pyx_v_i = (__pyx_v_i_off + __pyx_v_i_i);
5013
5014 /* "yt/utilities/lib/depth_first_octree.pyx":126
5015 * for i_off in range(i_f):
5016 * i = i_off + i_i
5017 * cx = (leftedges[0] + i*dx) # <<<<<<<<<<<<<<
5018 * for j_off in range(j_f):
5019 * j = j_off + j_i
5020 */
5021 __pyx_t_7 = 0;
5022 if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_pybuffernd_leftedges.diminfo[0].shape;
5023 __pyx_v_cx = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_leftedges.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_leftedges.diminfo[0].strides)) + (__pyx_v_i * __pyx_v_dx));
5024
5025 /* "yt/utilities/lib/depth_first_octree.pyx":127
5026 * i = i_off + i_i
5027 * cx = (leftedges[0] + i*dx)
5028 * for j_off in range(j_f): # <<<<<<<<<<<<<<
5029 * j = j_off + j_i
5030 * cy = (leftedges[1] + j*dx)
5031 */
5032 __pyx_t_8 = __pyx_v_j_f;
5033 __pyx_t_9 = __pyx_t_8;
5034 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
5035 __pyx_v_j_off = __pyx_t_10;
5036
5037 /* "yt/utilities/lib/depth_first_octree.pyx":128
5038 * cx = (leftedges[0] + i*dx)
5039 * for j_off in range(j_f):
5040 * j = j_off + j_i # <<<<<<<<<<<<<<
5041 * cy = (leftedges[1] + j*dx)
5042 * for k_off in range(k_f):
5043 */
5044 __pyx_v_j = (__pyx_v_j_off + __pyx_v_j_i);
5045
5046 /* "yt/utilities/lib/depth_first_octree.pyx":129
5047 * for j_off in range(j_f):
5048 * j = j_off + j_i
5049 * cy = (leftedges[1] + j*dx) # <<<<<<<<<<<<<<
5050 * for k_off in range(k_f):
5051 * k = k_off + k_i
5052 */
5053 __pyx_t_11 = 1;
5054 if (__pyx_t_11 < 0) __pyx_t_11 += __pyx_pybuffernd_leftedges.diminfo[0].shape;
5055 __pyx_v_cy = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_leftedges.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_leftedges.diminfo[0].strides)) + (__pyx_v_j * __pyx_v_dx));
5056
5057 /* "yt/utilities/lib/depth_first_octree.pyx":130
5058 * j = j_off + j_i
5059 * cy = (leftedges[1] + j*dx)
5060 * for k_off in range(k_f): # <<<<<<<<<<<<<<
5061 * k = k_off + k_i
5062 * cz = (leftedges[2] + k*dx)
5063 */
5064 __pyx_t_12 = __pyx_v_k_f;
5065 __pyx_t_13 = __pyx_t_12;
5066 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
5067 __pyx_v_k_off = __pyx_t_14;
5068
5069 /* "yt/utilities/lib/depth_first_octree.pyx":131
5070 * cy = (leftedges[1] + j*dx)
5071 * for k_off in range(k_f):
5072 * k = k_off + k_i # <<<<<<<<<<<<<<
5073 * cz = (leftedges[2] + k*dx)
5074 * cp = curpos[level]
5075 */
5076 __pyx_v_k = (__pyx_v_k_off + __pyx_v_k_i);
5077
5078 /* "yt/utilities/lib/depth_first_octree.pyx":132
5079 * for k_off in range(k_f):
5080 * k = k_off + k_i
5081 * cz = (leftedges[2] + k*dx) # <<<<<<<<<<<<<<
5082 * cp = curpos[level]
5083 * corners[cp, 0] = cx
5084 */
5085 __pyx_t_15 = 2;
5086 if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_pybuffernd_leftedges.diminfo[0].shape;
5087 __pyx_v_cz = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_leftedges.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_leftedges.diminfo[0].strides)) + (__pyx_v_k * __pyx_v_dx));
5088
5089 /* "yt/utilities/lib/depth_first_octree.pyx":133
5090 * k = k_off + k_i
5091 * cz = (leftedges[2] + k*dx)
5092 * cp = curpos[level] # <<<<<<<<<<<<<<
5093 * corners[cp, 0] = cx
5094 * corners[cp, 1] = cy
5095 */
5096 __pyx_t_16 = __pyx_v_level;
5097 if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_pybuffernd_curpos.diminfo[0].shape;
5098 __pyx_v_cp = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_curpos.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_curpos.diminfo[0].strides));
5099
5100 /* "yt/utilities/lib/depth_first_octree.pyx":134
5101 * cz = (leftedges[2] + k*dx)
5102 * cp = curpos[level]
5103 * corners[cp, 0] = cx # <<<<<<<<<<<<<<
5104 * corners[cp, 1] = cy
5105 * corners[cp, 2] = cz
5106 */
5107 __pyx_t_17 = __pyx_v_cp;
5108 __pyx_t_18 = 0;
5109 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_pybuffernd_corners.diminfo[0].shape;
5110 if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_pybuffernd_corners.diminfo[1].shape;
5111 *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_corners.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_corners.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_corners.diminfo[1].strides) = __pyx_v_cx;
5112
5113 /* "yt/utilities/lib/depth_first_octree.pyx":135
5114 * cp = curpos[level]
5115 * corners[cp, 0] = cx
5116 * corners[cp, 1] = cy # <<<<<<<<<<<<<<
5117 * corners[cp, 2] = cz
5118 * genealogy[curpos[level], 2] = level
5119 */
5120 __pyx_t_19 = __pyx_v_cp;
5121 __pyx_t_20 = 1;
5122 if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_pybuffernd_corners.diminfo[0].shape;
5123 if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_pybuffernd_corners.diminfo[1].shape;
5124 *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_corners.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_corners.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_corners.diminfo[1].strides) = __pyx_v_cy;
5125
5126 /* "yt/utilities/lib/depth_first_octree.pyx":136
5127 * corners[cp, 0] = cx
5128 * corners[cp, 1] = cy
5129 * corners[cp, 2] = cz # <<<<<<<<<<<<<<
5130 * genealogy[curpos[level], 2] = level
5131 * # always output data
5132 */
5133 __pyx_t_21 = __pyx_v_cp;
5134 __pyx_t_22 = 2;
5135 if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_pybuffernd_corners.diminfo[0].shape;
5136 if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_pybuffernd_corners.diminfo[1].shape;
5137 *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_corners.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_corners.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_corners.diminfo[1].strides) = __pyx_v_cz;
5138
5139 /* "yt/utilities/lib/depth_first_octree.pyx":137
5140 * corners[cp, 1] = cy
5141 * corners[cp, 2] = cz
5142 * genealogy[curpos[level], 2] = level # <<<<<<<<<<<<<<
5143 * # always output data
5144 * for fi in range(fields.shape[0]):
5145 */
5146 __pyx_t_23 = __pyx_v_level;
5147 if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_pybuffernd_curpos.diminfo[0].shape;
5148 __pyx_t_24 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_curpos.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_curpos.diminfo[0].strides));
5149 __pyx_t_25 = 2;
5150 if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_pybuffernd_genealogy.diminfo[0].shape;
5151 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_pybuffernd_genealogy.diminfo[1].shape;
5152 *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_genealogy.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_genealogy.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_genealogy.diminfo[1].strides) = __pyx_v_level;
5153
5154 /* "yt/utilities/lib/depth_first_octree.pyx":139
5155 * genealogy[curpos[level], 2] = level
5156 * # always output data
5157 * for fi in range(fields.shape[0]): # <<<<<<<<<<<<<<
5158 * output[cp,fi] = fields[fi,i,j,k]
5159 * ci = child_indices[i,j,k]
5160 */
5161 __pyx_t_26 = (__pyx_v_fields->dimensions[0]);
5162 __pyx_t_27 = __pyx_t_26;
5163 for (__pyx_t_28 = 0; __pyx_t_28 < __pyx_t_27; __pyx_t_28+=1) {
5164 __pyx_v_fi = __pyx_t_28;
5165
5166 /* "yt/utilities/lib/depth_first_octree.pyx":140
5167 * # always output data
5168 * for fi in range(fields.shape[0]):
5169 * output[cp,fi] = fields[fi,i,j,k] # <<<<<<<<<<<<<<
5170 * ci = child_indices[i,j,k]
5171 * if ci > -1:
5172 */
5173 __pyx_t_29 = __pyx_v_fi;
5174 __pyx_t_30 = __pyx_v_i;
5175 __pyx_t_31 = __pyx_v_j;
5176 __pyx_t_32 = __pyx_v_k;
5177 if (__pyx_t_29 < 0) __pyx_t_29 += __pyx_pybuffernd_fields.diminfo[0].shape;
5178 if (__pyx_t_30 < 0) __pyx_t_30 += __pyx_pybuffernd_fields.diminfo[1].shape;
5179 if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_pybuffernd_fields.diminfo[2].shape;
5180 if (__pyx_t_32 < 0) __pyx_t_32 += __pyx_pybuffernd_fields.diminfo[3].shape;
5181 __pyx_t_33 = __pyx_v_cp;
5182 __pyx_t_34 = __pyx_v_fi;
5183 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_pybuffernd_output.diminfo[0].shape;
5184 if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_pybuffernd_output.diminfo[1].shape;
5185 *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_output.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_output.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_output.diminfo[1].strides) = (*__Pyx_BufPtrStrided4d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_fields.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_fields.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_fields.diminfo[1].strides, __pyx_t_31, __pyx_pybuffernd_fields.diminfo[2].strides, __pyx_t_32, __pyx_pybuffernd_fields.diminfo[3].strides));
5186 }
5187
5188 /* "yt/utilities/lib/depth_first_octree.pyx":141
5189 * for fi in range(fields.shape[0]):
5190 * output[cp,fi] = fields[fi,i,j,k]
5191 * ci = child_indices[i,j,k] # <<<<<<<<<<<<<<
5192 * if ci > -1:
5193 * child_grid = grids[ci-1]
5194 */
5195 __pyx_t_35 = __pyx_v_i;
5196 __pyx_t_36 = __pyx_v_j;
5197 __pyx_t_37 = __pyx_v_k;
5198 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_pybuffernd_child_indices.diminfo[0].shape;
5199 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_pybuffernd_child_indices.diminfo[1].shape;
5200 if (__pyx_t_37 < 0) __pyx_t_37 += __pyx_pybuffernd_child_indices.diminfo[2].shape;
5201 __pyx_v_ci = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_child_indices.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_child_indices.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_child_indices.diminfo[1].strides, __pyx_t_37, __pyx_pybuffernd_child_indices.diminfo[2].strides));
5202
5203 /* "yt/utilities/lib/depth_first_octree.pyx":142
5204 * output[cp,fi] = fields[fi,i,j,k]
5205 * ci = child_indices[i,j,k]
5206 * if ci > -1: # <<<<<<<<<<<<<<
5207 * child_grid = grids[ci-1]
5208 * child_dx = child_grid.dx[0]
5209 */
5210 __pyx_t_38 = ((__pyx_v_ci > -1L) != 0);
5211 if (__pyx_t_38) {
5212
5213 /* "yt/utilities/lib/depth_first_octree.pyx":143
5214 * ci = child_indices[i,j,k]
5215 * if ci > -1:
5216 * child_grid = grids[ci-1] # <<<<<<<<<<<<<<
5217 * child_dx = child_grid.dx[0]
5218 * child_leftedges = child_grid.left_edges
5219 */
5220 __pyx_t_1 = (__pyx_v_ci - 1);
5221 __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_grids), __pyx_t_1, long, 1, __Pyx_PyInt_From_long, 0, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 143, __pyx_L1_error)
5222 __Pyx_GOTREF(__pyx_t_2);
5223 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid))))) __PYX_ERR(1, 143, __pyx_L1_error)
5224 __Pyx_XDECREF_SET(__pyx_v_child_grid, ((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)__pyx_t_2));
5225 __pyx_t_2 = 0;
5226
5227 /* "yt/utilities/lib/depth_first_octree.pyx":144
5228 * if ci > -1:
5229 * child_grid = grids[ci-1]
5230 * child_dx = child_grid.dx[0] # <<<<<<<<<<<<<<
5231 * child_leftedges = child_grid.left_edges
5232 * child_i = int((cx-child_leftedges[0])/child_dx)
5233 */
5234 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_child_grid->dx, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 144, __pyx_L1_error)
5235 __Pyx_GOTREF(__pyx_t_2);
5236 __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 144, __pyx_L1_error)
5237 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5238 __pyx_v_child_dx = __pyx_t_4;
5239
5240 /* "yt/utilities/lib/depth_first_octree.pyx":145
5241 * child_grid = grids[ci-1]
5242 * child_dx = child_grid.dx[0]
5243 * child_leftedges = child_grid.left_edges # <<<<<<<<<<<<<<
5244 * child_i = int((cx-child_leftedges[0])/child_dx)
5245 * child_j = int((cy-child_leftedges[1])/child_dx)
5246 */
5247 if (!(likely(((__pyx_v_child_grid->left_edges) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_child_grid->left_edges, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 145, __pyx_L1_error)
5248 __pyx_t_2 = __pyx_v_child_grid->left_edges;
5249 __Pyx_INCREF(__pyx_t_2);
5250 {
5251 __Pyx_BufFmt_StackElem __pyx_stack[1];
5252 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer);
5253 __pyx_t_39 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
5254 if (unlikely(__pyx_t_39 < 0)) {
5255 PyErr_Fetch(&__pyx_t_40, &__pyx_t_41, &__pyx_t_42);
5256 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer, (PyObject*)__pyx_v_child_leftedges, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
5257 Py_XDECREF(__pyx_t_40); Py_XDECREF(__pyx_t_41); Py_XDECREF(__pyx_t_42);
5258 __Pyx_RaiseBufferFallbackError();
5259 } else {
5260 PyErr_Restore(__pyx_t_40, __pyx_t_41, __pyx_t_42);
5261 }
5262 __pyx_t_40 = __pyx_t_41 = __pyx_t_42 = 0;
5263 }
5264 __pyx_pybuffernd_child_leftedges.diminfo[0].strides = __pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_child_leftedges.diminfo[0].shape = __pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer.shape[0];
5265 if (unlikely(__pyx_t_39 < 0)) __PYX_ERR(1, 145, __pyx_L1_error)
5266 }
5267 __Pyx_XDECREF_SET(__pyx_v_child_leftedges, ((PyArrayObject *)__pyx_t_2));
5268 __pyx_t_2 = 0;
5269
5270 /* "yt/utilities/lib/depth_first_octree.pyx":146
5271 * child_dx = child_grid.dx[0]
5272 * child_leftedges = child_grid.left_edges
5273 * child_i = int((cx-child_leftedges[0])/child_dx) # <<<<<<<<<<<<<<
5274 * child_j = int((cy-child_leftedges[1])/child_dx)
5275 * child_k = int((cz-child_leftedges[2])/child_dx)
5276 */
5277 __pyx_t_43 = 0;
5278 if (__pyx_t_43 < 0) __pyx_t_43 += __pyx_pybuffernd_child_leftedges.diminfo[0].shape;
5279 __pyx_t_4 = (__pyx_v_cx - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_child_leftedges.diminfo[0].strides)));
5280 if (unlikely(__pyx_v_child_dx == 0)) {
5281 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
5282 __PYX_ERR(1, 146, __pyx_L1_error)
5283 }
5284 __pyx_v_child_i = ((int)(__pyx_t_4 / __pyx_v_child_dx));
5285
5286 /* "yt/utilities/lib/depth_first_octree.pyx":147
5287 * child_leftedges = child_grid.left_edges
5288 * child_i = int((cx-child_leftedges[0])/child_dx)
5289 * child_j = int((cy-child_leftedges[1])/child_dx) # <<<<<<<<<<<<<<
5290 * child_k = int((cz-child_leftedges[2])/child_dx)
5291 * # set current child id to id of next cell to examine
5292 */
5293 __pyx_t_44 = 1;
5294 if (__pyx_t_44 < 0) __pyx_t_44 += __pyx_pybuffernd_child_leftedges.diminfo[0].shape;
5295 __pyx_t_4 = (__pyx_v_cy - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_child_leftedges.diminfo[0].strides)));
5296 if (unlikely(__pyx_v_child_dx == 0)) {
5297 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
5298 __PYX_ERR(1, 147, __pyx_L1_error)
5299 }
5300 __pyx_v_child_j = ((int)(__pyx_t_4 / __pyx_v_child_dx));
5301
5302 /* "yt/utilities/lib/depth_first_octree.pyx":148
5303 * child_i = int((cx-child_leftedges[0])/child_dx)
5304 * child_j = int((cy-child_leftedges[1])/child_dx)
5305 * child_k = int((cz-child_leftedges[2])/child_dx) # <<<<<<<<<<<<<<
5306 * # set current child id to id of next cell to examine
5307 * genealogy[cp, 0] = curpos[level+1]
5308 */
5309 __pyx_t_45 = 2;
5310 if (__pyx_t_45 < 0) __pyx_t_45 += __pyx_pybuffernd_child_leftedges.diminfo[0].shape;
5311 __pyx_t_4 = (__pyx_v_cz - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_child_leftedges.diminfo[0].strides)));
5312 if (unlikely(__pyx_v_child_dx == 0)) {
5313 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
5314 __PYX_ERR(1, 148, __pyx_L1_error)
5315 }
5316 __pyx_v_child_k = ((int)(__pyx_t_4 / __pyx_v_child_dx));
5317
5318 /* "yt/utilities/lib/depth_first_octree.pyx":150
5319 * child_k = int((cz-child_leftedges[2])/child_dx)
5320 * # set current child id to id of next cell to examine
5321 * genealogy[cp, 0] = curpos[level+1] # <<<<<<<<<<<<<<
5322 * # set next parent id to id of current cell
5323 * genealogy[curpos[level+1]:curpos[level+1]+8, 1] = cp
5324 */
5325 __pyx_t_46 = (__pyx_v_level + 1);
5326 if (__pyx_t_46 < 0) __pyx_t_46 += __pyx_pybuffernd_curpos.diminfo[0].shape;
5327 __pyx_t_47 = __pyx_v_cp;
5328 __pyx_t_48 = 0;
5329 if (__pyx_t_47 < 0) __pyx_t_47 += __pyx_pybuffernd_genealogy.diminfo[0].shape;
5330 if (__pyx_t_48 < 0) __pyx_t_48 += __pyx_pybuffernd_genealogy.diminfo[1].shape;
5331 *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_genealogy.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_genealogy.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_genealogy.diminfo[1].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_curpos.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_curpos.diminfo[0].strides));
5332
5333 /* "yt/utilities/lib/depth_first_octree.pyx":152
5334 * genealogy[cp, 0] = curpos[level+1]
5335 * # set next parent id to id of current cell
5336 * genealogy[curpos[level+1]:curpos[level+1]+8, 1] = cp # <<<<<<<<<<<<<<
5337 * s = RecurseOctreeByLevels(child_i, child_j, child_k, 2, 2, 2,
5338 * curpos, ci, output, genealogy,
5339 */
5340 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_cp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 152, __pyx_L1_error)
5341 __Pyx_GOTREF(__pyx_t_2);
5342 __pyx_t_49 = (__pyx_v_level + 1);
5343 if (__pyx_t_49 < 0) __pyx_t_49 += __pyx_pybuffernd_curpos.diminfo[0].shape;
5344 __pyx_t_50 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_curpos.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_curpos.diminfo[0].strides))); if (unlikely(!__pyx_t_50)) __PYX_ERR(1, 152, __pyx_L1_error)
5345 __Pyx_GOTREF(__pyx_t_50);
5346 __pyx_t_51 = (__pyx_v_level + 1);
5347 if (__pyx_t_51 < 0) __pyx_t_51 += __pyx_pybuffernd_curpos.diminfo[0].shape;
5348 __pyx_t_52 = __Pyx_PyInt_From_long(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_curpos.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_curpos.diminfo[0].strides)) + 8)); if (unlikely(!__pyx_t_52)) __PYX_ERR(1, 152, __pyx_L1_error)
5349 __Pyx_GOTREF(__pyx_t_52);
5350 __pyx_t_53 = PySlice_New(__pyx_t_50, __pyx_t_52, Py_None); if (unlikely(!__pyx_t_53)) __PYX_ERR(1, 152, __pyx_L1_error)
5351 __Pyx_GOTREF(__pyx_t_53);
5352 __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
5353 __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
5354 __pyx_t_52 = PyTuple_New(2); if (unlikely(!__pyx_t_52)) __PYX_ERR(1, 152, __pyx_L1_error)
5355 __Pyx_GOTREF(__pyx_t_52);
5356 __Pyx_GIVEREF(__pyx_t_53);
5357 PyTuple_SET_ITEM(__pyx_t_52, 0, __pyx_t_53);
5358 __Pyx_INCREF(__pyx_int_1);
5359 __Pyx_GIVEREF(__pyx_int_1);
5360 PyTuple_SET_ITEM(__pyx_t_52, 1, __pyx_int_1);
5361 __pyx_t_53 = 0;
5362 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_genealogy), __pyx_t_52, __pyx_t_2) < 0)) __PYX_ERR(1, 152, __pyx_L1_error)
5363 __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
5364 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5365
5366 /* "yt/utilities/lib/depth_first_octree.pyx":153
5367 * # set next parent id to id of current cell
5368 * genealogy[curpos[level+1]:curpos[level+1]+8, 1] = cp
5369 * s = RecurseOctreeByLevels(child_i, child_j, child_k, 2, 2, 2, # <<<<<<<<<<<<<<
5370 * curpos, ci, output, genealogy,
5371 * corners, grids)
5372 */
5373 __Pyx_GetModuleGlobalName(__pyx_t_52, __pyx_n_s_RecurseOctreeByLevels); if (unlikely(!__pyx_t_52)) __PYX_ERR(1, 153, __pyx_L1_error)
5374 __Pyx_GOTREF(__pyx_t_52);
5375 __pyx_t_53 = __Pyx_PyInt_From_int(__pyx_v_child_i); if (unlikely(!__pyx_t_53)) __PYX_ERR(1, 153, __pyx_L1_error)
5376 __Pyx_GOTREF(__pyx_t_53);
5377 __pyx_t_50 = __Pyx_PyInt_From_int(__pyx_v_child_j); if (unlikely(!__pyx_t_50)) __PYX_ERR(1, 153, __pyx_L1_error)
5378 __Pyx_GOTREF(__pyx_t_50);
5379 __pyx_t_54 = __Pyx_PyInt_From_int(__pyx_v_child_k); if (unlikely(!__pyx_t_54)) __PYX_ERR(1, 153, __pyx_L1_error)
5380 __Pyx_GOTREF(__pyx_t_54);
5381
5382 /* "yt/utilities/lib/depth_first_octree.pyx":154
5383 * genealogy[curpos[level+1]:curpos[level+1]+8, 1] = cp
5384 * s = RecurseOctreeByLevels(child_i, child_j, child_k, 2, 2, 2,
5385 * curpos, ci, output, genealogy, # <<<<<<<<<<<<<<
5386 * corners, grids)
5387 * curpos[level] += 1
5388 */
5389 __pyx_t_55 = __Pyx_PyInt_From_npy_int32(__pyx_v_ci); if (unlikely(!__pyx_t_55)) __PYX_ERR(1, 154, __pyx_L1_error)
5390 __Pyx_GOTREF(__pyx_t_55);
5391
5392 /* "yt/utilities/lib/depth_first_octree.pyx":155
5393 * s = RecurseOctreeByLevels(child_i, child_j, child_k, 2, 2, 2,
5394 * curpos, ci, output, genealogy,
5395 * corners, grids) # <<<<<<<<<<<<<<
5396 * curpos[level] += 1
5397 * return s
5398 */
5399 __pyx_t_56 = NULL;
5400 __pyx_t_39 = 0;
5401 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_52))) {
5402 __pyx_t_56 = PyMethod_GET_SELF(__pyx_t_52);
5403 if (likely(__pyx_t_56)) {
5404 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_52);
5405 __Pyx_INCREF(__pyx_t_56);
5406 __Pyx_INCREF(function);
5407 __Pyx_DECREF_SET(__pyx_t_52, function);
5408 __pyx_t_39 = 1;
5409 }
5410 }
5411 #if CYTHON_FAST_PYCALL
5412 if (PyFunction_Check(__pyx_t_52)) {
5413 PyObject *__pyx_temp[13] = {__pyx_t_56, __pyx_t_53, __pyx_t_50, __pyx_t_54, __pyx_int_2, __pyx_int_2, __pyx_int_2, ((PyObject *)__pyx_v_curpos), __pyx_t_55, ((PyObject *)__pyx_v_output), ((PyObject *)__pyx_v_genealogy), ((PyObject *)__pyx_v_corners), ((PyObject *)__pyx_v_grids)};
5414 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_52, __pyx_temp+1-__pyx_t_39, 12+__pyx_t_39); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 153, __pyx_L1_error)
5415 __Pyx_XDECREF(__pyx_t_56); __pyx_t_56 = 0;
5416 __Pyx_GOTREF(__pyx_t_2);
5417 __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
5418 __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
5419 __Pyx_DECREF(__pyx_t_54); __pyx_t_54 = 0;
5420 __Pyx_DECREF(__pyx_t_55); __pyx_t_55 = 0;
5421 } else
5422 #endif
5423 #if CYTHON_FAST_PYCCALL
5424 if (__Pyx_PyFastCFunction_Check(__pyx_t_52)) {
5425 PyObject *__pyx_temp[13] = {__pyx_t_56, __pyx_t_53, __pyx_t_50, __pyx_t_54, __pyx_int_2, __pyx_int_2, __pyx_int_2, ((PyObject *)__pyx_v_curpos), __pyx_t_55, ((PyObject *)__pyx_v_output), ((PyObject *)__pyx_v_genealogy), ((PyObject *)__pyx_v_corners), ((PyObject *)__pyx_v_grids)};
5426 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_52, __pyx_temp+1-__pyx_t_39, 12+__pyx_t_39); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 153, __pyx_L1_error)
5427 __Pyx_XDECREF(__pyx_t_56); __pyx_t_56 = 0;
5428 __Pyx_GOTREF(__pyx_t_2);
5429 __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
5430 __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
5431 __Pyx_DECREF(__pyx_t_54); __pyx_t_54 = 0;
5432 __Pyx_DECREF(__pyx_t_55); __pyx_t_55 = 0;
5433 } else
5434 #endif
5435 {
5436 __pyx_t_57 = PyTuple_New(12+__pyx_t_39); if (unlikely(!__pyx_t_57)) __PYX_ERR(1, 153, __pyx_L1_error)
5437 __Pyx_GOTREF(__pyx_t_57);
5438 if (__pyx_t_56) {
5439 __Pyx_GIVEREF(__pyx_t_56); PyTuple_SET_ITEM(__pyx_t_57, 0, __pyx_t_56); __pyx_t_56 = NULL;
5440 }
5441 __Pyx_GIVEREF(__pyx_t_53);
5442 PyTuple_SET_ITEM(__pyx_t_57, 0+__pyx_t_39, __pyx_t_53);
5443 __Pyx_GIVEREF(__pyx_t_50);
5444 PyTuple_SET_ITEM(__pyx_t_57, 1+__pyx_t_39, __pyx_t_50);
5445 __Pyx_GIVEREF(__pyx_t_54);
5446 PyTuple_SET_ITEM(__pyx_t_57, 2+__pyx_t_39, __pyx_t_54);
5447 __Pyx_INCREF(__pyx_int_2);
5448 __Pyx_GIVEREF(__pyx_int_2);
5449 PyTuple_SET_ITEM(__pyx_t_57, 3+__pyx_t_39, __pyx_int_2);
5450 __Pyx_INCREF(__pyx_int_2);
5451 __Pyx_GIVEREF(__pyx_int_2);
5452 PyTuple_SET_ITEM(__pyx_t_57, 4+__pyx_t_39, __pyx_int_2);
5453 __Pyx_INCREF(__pyx_int_2);
5454 __Pyx_GIVEREF(__pyx_int_2);
5455 PyTuple_SET_ITEM(__pyx_t_57, 5+__pyx_t_39, __pyx_int_2);
5456 __Pyx_INCREF(((PyObject *)__pyx_v_curpos));
5457 __Pyx_GIVEREF(((PyObject *)__pyx_v_curpos));
5458 PyTuple_SET_ITEM(__pyx_t_57, 6+__pyx_t_39, ((PyObject *)__pyx_v_curpos));
5459 __Pyx_GIVEREF(__pyx_t_55);
5460 PyTuple_SET_ITEM(__pyx_t_57, 7+__pyx_t_39, __pyx_t_55);
5461 __Pyx_INCREF(((PyObject *)__pyx_v_output));
5462 __Pyx_GIVEREF(((PyObject *)__pyx_v_output));
5463 PyTuple_SET_ITEM(__pyx_t_57, 8+__pyx_t_39, ((PyObject *)__pyx_v_output));
5464 __Pyx_INCREF(((PyObject *)__pyx_v_genealogy));
5465 __Pyx_GIVEREF(((PyObject *)__pyx_v_genealogy));
5466 PyTuple_SET_ITEM(__pyx_t_57, 9+__pyx_t_39, ((PyObject *)__pyx_v_genealogy));
5467 __Pyx_INCREF(((PyObject *)__pyx_v_corners));
5468 __Pyx_GIVEREF(((PyObject *)__pyx_v_corners));
5469 PyTuple_SET_ITEM(__pyx_t_57, 10+__pyx_t_39, ((PyObject *)__pyx_v_corners));
5470 __Pyx_INCREF(((PyObject *)__pyx_v_grids));
5471 __Pyx_GIVEREF(((PyObject *)__pyx_v_grids));
5472 PyTuple_SET_ITEM(__pyx_t_57, 11+__pyx_t_39, ((PyObject *)__pyx_v_grids));
5473 __pyx_t_53 = 0;
5474 __pyx_t_50 = 0;
5475 __pyx_t_54 = 0;
5476 __pyx_t_55 = 0;
5477 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_52, __pyx_t_57, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 153, __pyx_L1_error)
5478 __Pyx_GOTREF(__pyx_t_2);
5479 __Pyx_DECREF(__pyx_t_57); __pyx_t_57 = 0;
5480 }
5481 __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
5482 __Pyx_DECREF_SET(__pyx_v_s, __pyx_t_2);
5483 __pyx_t_2 = 0;
5484
5485 /* "yt/utilities/lib/depth_first_octree.pyx":142
5486 * output[cp,fi] = fields[fi,i,j,k]
5487 * ci = child_indices[i,j,k]
5488 * if ci > -1: # <<<<<<<<<<<<<<
5489 * child_grid = grids[ci-1]
5490 * child_dx = child_grid.dx[0]
5491 */
5492 }
5493
5494 /* "yt/utilities/lib/depth_first_octree.pyx":156
5495 * curpos, ci, output, genealogy,
5496 * corners, grids)
5497 * curpos[level] += 1 # <<<<<<<<<<<<<<
5498 * return s
5499 */
5500 __pyx_t_58 = __pyx_v_level;
5501 if (__pyx_t_58 < 0) __pyx_t_58 += __pyx_pybuffernd_curpos.diminfo[0].shape;
5502 *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_curpos.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_curpos.diminfo[0].strides) += 1;
5503 }
5504 }
5505 }
5506
5507 /* "yt/utilities/lib/depth_first_octree.pyx":157
5508 * corners, grids)
5509 * curpos[level] += 1
5510 * return s # <<<<<<<<<<<<<<
5511 */
5512 __Pyx_XDECREF(__pyx_r);
5513 __Pyx_INCREF(__pyx_v_s);
5514 __pyx_r = __pyx_v_s;
5515 goto __pyx_L0;
5516
5517 /* "yt/utilities/lib/depth_first_octree.pyx":102
5518 *
5519 * @cython.boundscheck(False)
5520 * def RecurseOctreeByLevels(int i_i, int j_i, int k_i, # <<<<<<<<<<<<<<
5521 * int i_f, int j_f, int k_f,
5522 * np.ndarray[np.int32_t, ndim=1] curpos,
5523 */
5524
5525 /* function exit code */
5526 __pyx_L1_error:;
5527 __Pyx_XDECREF(__pyx_t_2);
5528 __Pyx_XDECREF(__pyx_t_50);
5529 __Pyx_XDECREF(__pyx_t_52);
5530 __Pyx_XDECREF(__pyx_t_53);
5531 __Pyx_XDECREF(__pyx_t_54);
5532 __Pyx_XDECREF(__pyx_t_55);
5533 __Pyx_XDECREF(__pyx_t_56);
5534 __Pyx_XDECREF(__pyx_t_57);
5535 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5536 __Pyx_PyThreadState_declare
5537 __Pyx_PyThreadState_assign
5538 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5539 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_child_indices.rcbuffer->pybuffer);
5540 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer);
5541 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_corners.rcbuffer->pybuffer);
5542 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_curpos.rcbuffer->pybuffer);
5543 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_fields.rcbuffer->pybuffer);
5544 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_genealogy.rcbuffer->pybuffer);
5545 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_leftedges.rcbuffer->pybuffer);
5546 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
5547 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5548 __Pyx_AddTraceback("yt.utilities.lib.depth_first_octree.RecurseOctreeByLevels", __pyx_clineno, __pyx_lineno, __pyx_filename);
5549 __pyx_r = NULL;
5550 goto __pyx_L2;
5551 __pyx_L0:;
5552 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_child_indices.rcbuffer->pybuffer);
5553 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_child_leftedges.rcbuffer->pybuffer);
5554 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_corners.rcbuffer->pybuffer);
5555 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_curpos.rcbuffer->pybuffer);
5556 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_fields.rcbuffer->pybuffer);
5557 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_genealogy.rcbuffer->pybuffer);
5558 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_leftedges.rcbuffer->pybuffer);
5559 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output.rcbuffer->pybuffer);
5560 __pyx_L2:;
5561 __Pyx_XDECREF((PyObject *)__pyx_v_child_grid);
5562 __Pyx_XDECREF((PyObject *)__pyx_v_grid);
5563 __Pyx_XDECREF((PyObject *)__pyx_v_child_indices);
5564 __Pyx_XDECREF((PyObject *)__pyx_v_fields);
5565 __Pyx_XDECREF((PyObject *)__pyx_v_leftedges);
5566 __Pyx_XDECREF((PyObject *)__pyx_v_child_leftedges);
5567 __Pyx_XDECREF(__pyx_v_s);
5568 __Pyx_XGIVEREF(__pyx_r);
5569 __Pyx_RefNannyFinishContext();
5570 return __pyx_r;
5571 }
5572
5573 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
5574 * # experimental exception made for __getbuffer__ and __releasebuffer__
5575 * # -- the details of this may change.
5576 * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
5577 * # This implementation of getbuffer is geared towards Cython
5578 * # requirements, and does not yet fulfill the PEP.
5579 */
5580
5581 /* Python wrapper */
5582 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)5583 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5584 int __pyx_r;
5585 __Pyx_RefNannyDeclarations
5586 __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
5587 __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
5588
5589 /* function exit code */
5590 __Pyx_RefNannyFinishContext();
5591 return __pyx_r;
5592 }
5593
__pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)5594 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5595 int __pyx_v_i;
5596 int __pyx_v_ndim;
5597 int __pyx_v_endian_detector;
5598 int __pyx_v_little_endian;
5599 int __pyx_v_t;
5600 char *__pyx_v_f;
5601 PyArray_Descr *__pyx_v_descr = 0;
5602 int __pyx_v_offset;
5603 int __pyx_r;
5604 __Pyx_RefNannyDeclarations
5605 int __pyx_t_1;
5606 int __pyx_t_2;
5607 PyObject *__pyx_t_3 = NULL;
5608 int __pyx_t_4;
5609 int __pyx_t_5;
5610 int __pyx_t_6;
5611 PyArray_Descr *__pyx_t_7;
5612 PyObject *__pyx_t_8 = NULL;
5613 char *__pyx_t_9;
5614 if (__pyx_v_info == NULL) {
5615 PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
5616 return -1;
5617 }
5618 __Pyx_RefNannySetupContext("__getbuffer__", 0);
5619 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
5620 __Pyx_GIVEREF(__pyx_v_info->obj);
5621
5622 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265
5623 *
5624 * cdef int i, ndim
5625 * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
5626 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
5627 *
5628 */
5629 __pyx_v_endian_detector = 1;
5630
5631 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266
5632 * cdef int i, ndim
5633 * cdef int endian_detector = 1
5634 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
5635 *
5636 * ndim = PyArray_NDIM(self)
5637 */
5638 __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
5639
5640 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268
5641 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
5642 *
5643 * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
5644 *
5645 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
5646 */
5647 __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
5648
5649 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
5650 * ndim = PyArray_NDIM(self)
5651 *
5652 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
5653 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
5654 * raise ValueError(u"ndarray is not C contiguous")
5655 */
5656 __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
5657 if (__pyx_t_2) {
5658 } else {
5659 __pyx_t_1 = __pyx_t_2;
5660 goto __pyx_L4_bool_binop_done;
5661 }
5662
5663 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271
5664 *
5665 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
5666 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
5667 * raise ValueError(u"ndarray is not C contiguous")
5668 *
5669 */
5670 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
5671 __pyx_t_1 = __pyx_t_2;
5672 __pyx_L4_bool_binop_done:;
5673
5674 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
5675 * ndim = PyArray_NDIM(self)
5676 *
5677 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
5678 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
5679 * raise ValueError(u"ndarray is not C contiguous")
5680 */
5681 if (unlikely(__pyx_t_1)) {
5682
5683 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
5684 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
5685 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
5686 * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
5687 *
5688 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
5689 */
5690 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 272, __pyx_L1_error)
5691 __Pyx_GOTREF(__pyx_t_3);
5692 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5693 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5694 __PYX_ERR(2, 272, __pyx_L1_error)
5695
5696 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
5697 * ndim = PyArray_NDIM(self)
5698 *
5699 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
5700 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
5701 * raise ValueError(u"ndarray is not C contiguous")
5702 */
5703 }
5704
5705 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
5706 * raise ValueError(u"ndarray is not C contiguous")
5707 *
5708 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
5709 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
5710 * raise ValueError(u"ndarray is not Fortran contiguous")
5711 */
5712 __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
5713 if (__pyx_t_2) {
5714 } else {
5715 __pyx_t_1 = __pyx_t_2;
5716 goto __pyx_L7_bool_binop_done;
5717 }
5718
5719 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275
5720 *
5721 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
5722 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
5723 * raise ValueError(u"ndarray is not Fortran contiguous")
5724 *
5725 */
5726 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
5727 __pyx_t_1 = __pyx_t_2;
5728 __pyx_L7_bool_binop_done:;
5729
5730 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
5731 * raise ValueError(u"ndarray is not C contiguous")
5732 *
5733 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
5734 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
5735 * raise ValueError(u"ndarray is not Fortran contiguous")
5736 */
5737 if (unlikely(__pyx_t_1)) {
5738
5739 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
5740 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
5741 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
5742 * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
5743 *
5744 * info.buf = PyArray_DATA(self)
5745 */
5746 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 276, __pyx_L1_error)
5747 __Pyx_GOTREF(__pyx_t_3);
5748 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5749 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5750 __PYX_ERR(2, 276, __pyx_L1_error)
5751
5752 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
5753 * raise ValueError(u"ndarray is not C contiguous")
5754 *
5755 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
5756 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
5757 * raise ValueError(u"ndarray is not Fortran contiguous")
5758 */
5759 }
5760
5761 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278
5762 * raise ValueError(u"ndarray is not Fortran contiguous")
5763 *
5764 * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
5765 * info.ndim = ndim
5766 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
5767 */
5768 __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
5769
5770 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279
5771 *
5772 * info.buf = PyArray_DATA(self)
5773 * info.ndim = ndim # <<<<<<<<<<<<<<
5774 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
5775 * # Allocate new buffer for strides and shape info.
5776 */
5777 __pyx_v_info->ndim = __pyx_v_ndim;
5778
5779 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
5780 * info.buf = PyArray_DATA(self)
5781 * info.ndim = ndim
5782 * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
5783 * # Allocate new buffer for strides and shape info.
5784 * # This is allocated as one block, strides first.
5785 */
5786 __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
5787 if (__pyx_t_1) {
5788
5789 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283
5790 * # Allocate new buffer for strides and shape info.
5791 * # This is allocated as one block, strides first.
5792 * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim) # <<<<<<<<<<<<<<
5793 * info.shape = info.strides + ndim
5794 * for i in range(ndim):
5795 */
5796 __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
5797
5798 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284
5799 * # This is allocated as one block, strides first.
5800 * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
5801 * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
5802 * for i in range(ndim):
5803 * info.strides[i] = PyArray_STRIDES(self)[i]
5804 */
5805 __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
5806
5807 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":285
5808 * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
5809 * info.shape = info.strides + ndim
5810 * for i in range(ndim): # <<<<<<<<<<<<<<
5811 * info.strides[i] = PyArray_STRIDES(self)[i]
5812 * info.shape[i] = PyArray_DIMS(self)[i]
5813 */
5814 __pyx_t_4 = __pyx_v_ndim;
5815 __pyx_t_5 = __pyx_t_4;
5816 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
5817 __pyx_v_i = __pyx_t_6;
5818
5819 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286
5820 * info.shape = info.strides + ndim
5821 * for i in range(ndim):
5822 * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
5823 * info.shape[i] = PyArray_DIMS(self)[i]
5824 * else:
5825 */
5826 (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
5827
5828 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287
5829 * for i in range(ndim):
5830 * info.strides[i] = PyArray_STRIDES(self)[i]
5831 * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
5832 * else:
5833 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
5834 */
5835 (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
5836 }
5837
5838 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
5839 * info.buf = PyArray_DATA(self)
5840 * info.ndim = ndim
5841 * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
5842 * # Allocate new buffer for strides and shape info.
5843 * # This is allocated as one block, strides first.
5844 */
5845 goto __pyx_L9;
5846 }
5847
5848 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289
5849 * info.shape[i] = PyArray_DIMS(self)[i]
5850 * else:
5851 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
5852 * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
5853 * info.suboffsets = NULL
5854 */
5855 /*else*/ {
5856 __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
5857
5858 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":290
5859 * else:
5860 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
5861 * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
5862 * info.suboffsets = NULL
5863 * info.itemsize = PyArray_ITEMSIZE(self)
5864 */
5865 __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
5866 }
5867 __pyx_L9:;
5868
5869 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":291
5870 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
5871 * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
5872 * info.suboffsets = NULL # <<<<<<<<<<<<<<
5873 * info.itemsize = PyArray_ITEMSIZE(self)
5874 * info.readonly = not PyArray_ISWRITEABLE(self)
5875 */
5876 __pyx_v_info->suboffsets = NULL;
5877
5878 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292
5879 * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
5880 * info.suboffsets = NULL
5881 * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
5882 * info.readonly = not PyArray_ISWRITEABLE(self)
5883 *
5884 */
5885 __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
5886
5887 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":293
5888 * info.suboffsets = NULL
5889 * info.itemsize = PyArray_ITEMSIZE(self)
5890 * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
5891 *
5892 * cdef int t
5893 */
5894 __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
5895
5896 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296
5897 *
5898 * cdef int t
5899 * cdef char* f = NULL # <<<<<<<<<<<<<<
5900 * cdef dtype descr = <dtype>PyArray_DESCR(self)
5901 * cdef int offset
5902 */
5903 __pyx_v_f = NULL;
5904
5905 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297
5906 * cdef int t
5907 * cdef char* f = NULL
5908 * cdef dtype descr = <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
5909 * cdef int offset
5910 *
5911 */
5912 __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
5913 __pyx_t_3 = ((PyObject *)__pyx_t_7);
5914 __Pyx_INCREF(__pyx_t_3);
5915 __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
5916 __pyx_t_3 = 0;
5917
5918 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":300
5919 * cdef int offset
5920 *
5921 * info.obj = self # <<<<<<<<<<<<<<
5922 *
5923 * if not PyDataType_HASFIELDS(descr):
5924 */
5925 __Pyx_INCREF(((PyObject *)__pyx_v_self));
5926 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
5927 __Pyx_GOTREF(__pyx_v_info->obj);
5928 __Pyx_DECREF(__pyx_v_info->obj);
5929 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
5930
5931 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
5932 * info.obj = self
5933 *
5934 * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
5935 * t = descr.type_num
5936 * if ((descr.byteorder == c'>' and little_endian) or
5937 */
5938 __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
5939 if (__pyx_t_1) {
5940
5941 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":303
5942 *
5943 * if not PyDataType_HASFIELDS(descr):
5944 * t = descr.type_num # <<<<<<<<<<<<<<
5945 * if ((descr.byteorder == c'>' and little_endian) or
5946 * (descr.byteorder == c'<' and not little_endian)):
5947 */
5948 __pyx_t_4 = __pyx_v_descr->type_num;
5949 __pyx_v_t = __pyx_t_4;
5950
5951 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
5952 * if not PyDataType_HASFIELDS(descr):
5953 * t = descr.type_num
5954 * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
5955 * (descr.byteorder == c'<' and not little_endian)):
5956 * raise ValueError(u"Non-native byte order not supported")
5957 */
5958 __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
5959 if (!__pyx_t_2) {
5960 goto __pyx_L15_next_or;
5961 } else {
5962 }
5963 __pyx_t_2 = (__pyx_v_little_endian != 0);
5964 if (!__pyx_t_2) {
5965 } else {
5966 __pyx_t_1 = __pyx_t_2;
5967 goto __pyx_L14_bool_binop_done;
5968 }
5969 __pyx_L15_next_or:;
5970
5971 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":305
5972 * t = descr.type_num
5973 * if ((descr.byteorder == c'>' and little_endian) or
5974 * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
5975 * raise ValueError(u"Non-native byte order not supported")
5976 * if t == NPY_BYTE: f = "b"
5977 */
5978 __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
5979 if (__pyx_t_2) {
5980 } else {
5981 __pyx_t_1 = __pyx_t_2;
5982 goto __pyx_L14_bool_binop_done;
5983 }
5984 __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
5985 __pyx_t_1 = __pyx_t_2;
5986 __pyx_L14_bool_binop_done:;
5987
5988 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
5989 * if not PyDataType_HASFIELDS(descr):
5990 * t = descr.type_num
5991 * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
5992 * (descr.byteorder == c'<' and not little_endian)):
5993 * raise ValueError(u"Non-native byte order not supported")
5994 */
5995 if (unlikely(__pyx_t_1)) {
5996
5997 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
5998 * if ((descr.byteorder == c'>' and little_endian) or
5999 * (descr.byteorder == c'<' and not little_endian)):
6000 * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
6001 * if t == NPY_BYTE: f = "b"
6002 * elif t == NPY_UBYTE: f = "B"
6003 */
6004 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 306, __pyx_L1_error)
6005 __Pyx_GOTREF(__pyx_t_3);
6006 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6007 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6008 __PYX_ERR(2, 306, __pyx_L1_error)
6009
6010 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
6011 * if not PyDataType_HASFIELDS(descr):
6012 * t = descr.type_num
6013 * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6014 * (descr.byteorder == c'<' and not little_endian)):
6015 * raise ValueError(u"Non-native byte order not supported")
6016 */
6017 }
6018
6019 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":307
6020 * (descr.byteorder == c'<' and not little_endian)):
6021 * raise ValueError(u"Non-native byte order not supported")
6022 * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
6023 * elif t == NPY_UBYTE: f = "B"
6024 * elif t == NPY_SHORT: f = "h"
6025 */
6026 switch (__pyx_v_t) {
6027 case NPY_BYTE:
6028 __pyx_v_f = ((char *)"b");
6029 break;
6030 case NPY_UBYTE:
6031
6032 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":308
6033 * raise ValueError(u"Non-native byte order not supported")
6034 * if t == NPY_BYTE: f = "b"
6035 * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
6036 * elif t == NPY_SHORT: f = "h"
6037 * elif t == NPY_USHORT: f = "H"
6038 */
6039 __pyx_v_f = ((char *)"B");
6040 break;
6041 case NPY_SHORT:
6042
6043 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":309
6044 * if t == NPY_BYTE: f = "b"
6045 * elif t == NPY_UBYTE: f = "B"
6046 * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
6047 * elif t == NPY_USHORT: f = "H"
6048 * elif t == NPY_INT: f = "i"
6049 */
6050 __pyx_v_f = ((char *)"h");
6051 break;
6052 case NPY_USHORT:
6053
6054 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":310
6055 * elif t == NPY_UBYTE: f = "B"
6056 * elif t == NPY_SHORT: f = "h"
6057 * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
6058 * elif t == NPY_INT: f = "i"
6059 * elif t == NPY_UINT: f = "I"
6060 */
6061 __pyx_v_f = ((char *)"H");
6062 break;
6063 case NPY_INT:
6064
6065 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":311
6066 * elif t == NPY_SHORT: f = "h"
6067 * elif t == NPY_USHORT: f = "H"
6068 * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
6069 * elif t == NPY_UINT: f = "I"
6070 * elif t == NPY_LONG: f = "l"
6071 */
6072 __pyx_v_f = ((char *)"i");
6073 break;
6074 case NPY_UINT:
6075
6076 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":312
6077 * elif t == NPY_USHORT: f = "H"
6078 * elif t == NPY_INT: f = "i"
6079 * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
6080 * elif t == NPY_LONG: f = "l"
6081 * elif t == NPY_ULONG: f = "L"
6082 */
6083 __pyx_v_f = ((char *)"I");
6084 break;
6085 case NPY_LONG:
6086
6087 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":313
6088 * elif t == NPY_INT: f = "i"
6089 * elif t == NPY_UINT: f = "I"
6090 * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
6091 * elif t == NPY_ULONG: f = "L"
6092 * elif t == NPY_LONGLONG: f = "q"
6093 */
6094 __pyx_v_f = ((char *)"l");
6095 break;
6096 case NPY_ULONG:
6097
6098 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":314
6099 * elif t == NPY_UINT: f = "I"
6100 * elif t == NPY_LONG: f = "l"
6101 * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
6102 * elif t == NPY_LONGLONG: f = "q"
6103 * elif t == NPY_ULONGLONG: f = "Q"
6104 */
6105 __pyx_v_f = ((char *)"L");
6106 break;
6107 case NPY_LONGLONG:
6108
6109 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":315
6110 * elif t == NPY_LONG: f = "l"
6111 * elif t == NPY_ULONG: f = "L"
6112 * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
6113 * elif t == NPY_ULONGLONG: f = "Q"
6114 * elif t == NPY_FLOAT: f = "f"
6115 */
6116 __pyx_v_f = ((char *)"q");
6117 break;
6118 case NPY_ULONGLONG:
6119
6120 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":316
6121 * elif t == NPY_ULONG: f = "L"
6122 * elif t == NPY_LONGLONG: f = "q"
6123 * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
6124 * elif t == NPY_FLOAT: f = "f"
6125 * elif t == NPY_DOUBLE: f = "d"
6126 */
6127 __pyx_v_f = ((char *)"Q");
6128 break;
6129 case NPY_FLOAT:
6130
6131 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":317
6132 * elif t == NPY_LONGLONG: f = "q"
6133 * elif t == NPY_ULONGLONG: f = "Q"
6134 * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
6135 * elif t == NPY_DOUBLE: f = "d"
6136 * elif t == NPY_LONGDOUBLE: f = "g"
6137 */
6138 __pyx_v_f = ((char *)"f");
6139 break;
6140 case NPY_DOUBLE:
6141
6142 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":318
6143 * elif t == NPY_ULONGLONG: f = "Q"
6144 * elif t == NPY_FLOAT: f = "f"
6145 * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
6146 * elif t == NPY_LONGDOUBLE: f = "g"
6147 * elif t == NPY_CFLOAT: f = "Zf"
6148 */
6149 __pyx_v_f = ((char *)"d");
6150 break;
6151 case NPY_LONGDOUBLE:
6152
6153 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":319
6154 * elif t == NPY_FLOAT: f = "f"
6155 * elif t == NPY_DOUBLE: f = "d"
6156 * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
6157 * elif t == NPY_CFLOAT: f = "Zf"
6158 * elif t == NPY_CDOUBLE: f = "Zd"
6159 */
6160 __pyx_v_f = ((char *)"g");
6161 break;
6162 case NPY_CFLOAT:
6163
6164 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":320
6165 * elif t == NPY_DOUBLE: f = "d"
6166 * elif t == NPY_LONGDOUBLE: f = "g"
6167 * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
6168 * elif t == NPY_CDOUBLE: f = "Zd"
6169 * elif t == NPY_CLONGDOUBLE: f = "Zg"
6170 */
6171 __pyx_v_f = ((char *)"Zf");
6172 break;
6173 case NPY_CDOUBLE:
6174
6175 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":321
6176 * elif t == NPY_LONGDOUBLE: f = "g"
6177 * elif t == NPY_CFLOAT: f = "Zf"
6178 * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
6179 * elif t == NPY_CLONGDOUBLE: f = "Zg"
6180 * elif t == NPY_OBJECT: f = "O"
6181 */
6182 __pyx_v_f = ((char *)"Zd");
6183 break;
6184 case NPY_CLONGDOUBLE:
6185
6186 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":322
6187 * elif t == NPY_CFLOAT: f = "Zf"
6188 * elif t == NPY_CDOUBLE: f = "Zd"
6189 * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
6190 * elif t == NPY_OBJECT: f = "O"
6191 * else:
6192 */
6193 __pyx_v_f = ((char *)"Zg");
6194 break;
6195 case NPY_OBJECT:
6196
6197 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":323
6198 * elif t == NPY_CDOUBLE: f = "Zd"
6199 * elif t == NPY_CLONGDOUBLE: f = "Zg"
6200 * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
6201 * else:
6202 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
6203 */
6204 __pyx_v_f = ((char *)"O");
6205 break;
6206 default:
6207
6208 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":325
6209 * elif t == NPY_OBJECT: f = "O"
6210 * else:
6211 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
6212 * info.format = f
6213 * return
6214 */
6215 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
6216 __Pyx_GOTREF(__pyx_t_3);
6217 __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 325, __pyx_L1_error)
6218 __Pyx_GOTREF(__pyx_t_8);
6219 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6220 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
6221 __Pyx_GOTREF(__pyx_t_3);
6222 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6223 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6224 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6225 __PYX_ERR(2, 325, __pyx_L1_error)
6226 break;
6227 }
6228
6229 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":326
6230 * else:
6231 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
6232 * info.format = f # <<<<<<<<<<<<<<
6233 * return
6234 * else:
6235 */
6236 __pyx_v_info->format = __pyx_v_f;
6237
6238 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":327
6239 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
6240 * info.format = f
6241 * return # <<<<<<<<<<<<<<
6242 * else:
6243 * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
6244 */
6245 __pyx_r = 0;
6246 goto __pyx_L0;
6247
6248 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
6249 * info.obj = self
6250 *
6251 * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
6252 * t = descr.type_num
6253 * if ((descr.byteorder == c'>' and little_endian) or
6254 */
6255 }
6256
6257 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":329
6258 * return
6259 * else:
6260 * info.format = <char*>PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
6261 * info.format[0] = c'^' # Native data types, manual alignment
6262 * offset = 0
6263 */
6264 /*else*/ {
6265 __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
6266
6267 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":330
6268 * else:
6269 * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
6270 * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
6271 * offset = 0
6272 * f = _util_dtypestring(descr, info.format + 1,
6273 */
6274 (__pyx_v_info->format[0]) = '^';
6275
6276 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":331
6277 * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
6278 * info.format[0] = c'^' # Native data types, manual alignment
6279 * offset = 0 # <<<<<<<<<<<<<<
6280 * f = _util_dtypestring(descr, info.format + 1,
6281 * info.format + _buffer_format_string_len,
6282 */
6283 __pyx_v_offset = 0;
6284
6285 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":332
6286 * info.format[0] = c'^' # Native data types, manual alignment
6287 * offset = 0
6288 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
6289 * info.format + _buffer_format_string_len,
6290 * &offset)
6291 */
6292 __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(2, 332, __pyx_L1_error)
6293 __pyx_v_f = __pyx_t_9;
6294
6295 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":335
6296 * info.format + _buffer_format_string_len,
6297 * &offset)
6298 * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
6299 *
6300 * def __releasebuffer__(ndarray self, Py_buffer* info):
6301 */
6302 (__pyx_v_f[0]) = '\x00';
6303 }
6304
6305 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
6306 * # experimental exception made for __getbuffer__ and __releasebuffer__
6307 * # -- the details of this may change.
6308 * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
6309 * # This implementation of getbuffer is geared towards Cython
6310 * # requirements, and does not yet fulfill the PEP.
6311 */
6312
6313 /* function exit code */
6314 __pyx_r = 0;
6315 goto __pyx_L0;
6316 __pyx_L1_error:;
6317 __Pyx_XDECREF(__pyx_t_3);
6318 __Pyx_XDECREF(__pyx_t_8);
6319 __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6320 __pyx_r = -1;
6321 if (__pyx_v_info->obj != NULL) {
6322 __Pyx_GOTREF(__pyx_v_info->obj);
6323 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
6324 }
6325 goto __pyx_L2;
6326 __pyx_L0:;
6327 if (__pyx_v_info->obj == Py_None) {
6328 __Pyx_GOTREF(__pyx_v_info->obj);
6329 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
6330 }
6331 __pyx_L2:;
6332 __Pyx_XDECREF((PyObject *)__pyx_v_descr);
6333 __Pyx_RefNannyFinishContext();
6334 return __pyx_r;
6335 }
6336
6337 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
6338 * f[0] = c'\0' # Terminate format string
6339 *
6340 * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
6341 * if PyArray_HASFIELDS(self):
6342 * PyObject_Free(info.format)
6343 */
6344
6345 /* Python wrapper */
6346 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)6347 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
6348 __Pyx_RefNannyDeclarations
6349 __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
6350 __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
6351
6352 /* function exit code */
6353 __Pyx_RefNannyFinishContext();
6354 }
6355
__pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info)6356 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
6357 __Pyx_RefNannyDeclarations
6358 int __pyx_t_1;
6359 __Pyx_RefNannySetupContext("__releasebuffer__", 0);
6360
6361 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
6362 *
6363 * def __releasebuffer__(ndarray self, Py_buffer* info):
6364 * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
6365 * PyObject_Free(info.format)
6366 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6367 */
6368 __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
6369 if (__pyx_t_1) {
6370
6371 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":339
6372 * def __releasebuffer__(ndarray self, Py_buffer* info):
6373 * if PyArray_HASFIELDS(self):
6374 * PyObject_Free(info.format) # <<<<<<<<<<<<<<
6375 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6376 * PyObject_Free(info.strides)
6377 */
6378 PyObject_Free(__pyx_v_info->format);
6379
6380 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
6381 *
6382 * def __releasebuffer__(ndarray self, Py_buffer* info):
6383 * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
6384 * PyObject_Free(info.format)
6385 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6386 */
6387 }
6388
6389 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
6390 * if PyArray_HASFIELDS(self):
6391 * PyObject_Free(info.format)
6392 * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
6393 * PyObject_Free(info.strides)
6394 * # info.shape was stored after info.strides in the same block
6395 */
6396 __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
6397 if (__pyx_t_1) {
6398
6399 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":341
6400 * PyObject_Free(info.format)
6401 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6402 * PyObject_Free(info.strides) # <<<<<<<<<<<<<<
6403 * # info.shape was stored after info.strides in the same block
6404 *
6405 */
6406 PyObject_Free(__pyx_v_info->strides);
6407
6408 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
6409 * if PyArray_HASFIELDS(self):
6410 * PyObject_Free(info.format)
6411 * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
6412 * PyObject_Free(info.strides)
6413 * # info.shape was stored after info.strides in the same block
6414 */
6415 }
6416
6417 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
6418 * f[0] = c'\0' # Terminate format string
6419 *
6420 * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
6421 * if PyArray_HASFIELDS(self):
6422 * PyObject_Free(info.format)
6423 */
6424
6425 /* function exit code */
6426 __Pyx_RefNannyFinishContext();
6427 }
6428
6429 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
6430 * ctypedef npy_cdouble complex_t
6431 *
6432 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
6433 * return PyArray_MultiIterNew(1, <void*>a)
6434 *
6435 */
6436
__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject * __pyx_v_a)6437 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
6438 PyObject *__pyx_r = NULL;
6439 __Pyx_RefNannyDeclarations
6440 PyObject *__pyx_t_1 = NULL;
6441 __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
6442
6443 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":822
6444 *
6445 * cdef inline object PyArray_MultiIterNew1(a):
6446 * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
6447 *
6448 * cdef inline object PyArray_MultiIterNew2(a, b):
6449 */
6450 __Pyx_XDECREF(__pyx_r);
6451 __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 822, __pyx_L1_error)
6452 __Pyx_GOTREF(__pyx_t_1);
6453 __pyx_r = __pyx_t_1;
6454 __pyx_t_1 = 0;
6455 goto __pyx_L0;
6456
6457 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
6458 * ctypedef npy_cdouble complex_t
6459 *
6460 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
6461 * return PyArray_MultiIterNew(1, <void*>a)
6462 *
6463 */
6464
6465 /* function exit code */
6466 __pyx_L1_error:;
6467 __Pyx_XDECREF(__pyx_t_1);
6468 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
6469 __pyx_r = 0;
6470 __pyx_L0:;
6471 __Pyx_XGIVEREF(__pyx_r);
6472 __Pyx_RefNannyFinishContext();
6473 return __pyx_r;
6474 }
6475
6476 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
6477 * return PyArray_MultiIterNew(1, <void*>a)
6478 *
6479 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
6480 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6481 *
6482 */
6483
__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject * __pyx_v_a,PyObject * __pyx_v_b)6484 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
6485 PyObject *__pyx_r = NULL;
6486 __Pyx_RefNannyDeclarations
6487 PyObject *__pyx_t_1 = NULL;
6488 __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
6489
6490 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825
6491 *
6492 * cdef inline object PyArray_MultiIterNew2(a, b):
6493 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
6494 *
6495 * cdef inline object PyArray_MultiIterNew3(a, b, c):
6496 */
6497 __Pyx_XDECREF(__pyx_r);
6498 __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 825, __pyx_L1_error)
6499 __Pyx_GOTREF(__pyx_t_1);
6500 __pyx_r = __pyx_t_1;
6501 __pyx_t_1 = 0;
6502 goto __pyx_L0;
6503
6504 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
6505 * return PyArray_MultiIterNew(1, <void*>a)
6506 *
6507 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
6508 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6509 *
6510 */
6511
6512 /* function exit code */
6513 __pyx_L1_error:;
6514 __Pyx_XDECREF(__pyx_t_1);
6515 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
6516 __pyx_r = 0;
6517 __pyx_L0:;
6518 __Pyx_XGIVEREF(__pyx_r);
6519 __Pyx_RefNannyFinishContext();
6520 return __pyx_r;
6521 }
6522
6523 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
6524 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6525 *
6526 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
6527 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6528 *
6529 */
6530
__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c)6531 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
6532 PyObject *__pyx_r = NULL;
6533 __Pyx_RefNannyDeclarations
6534 PyObject *__pyx_t_1 = NULL;
6535 __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
6536
6537 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":828
6538 *
6539 * cdef inline object PyArray_MultiIterNew3(a, b, c):
6540 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
6541 *
6542 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
6543 */
6544 __Pyx_XDECREF(__pyx_r);
6545 __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(2, 828, __pyx_L1_error)
6546 __Pyx_GOTREF(__pyx_t_1);
6547 __pyx_r = __pyx_t_1;
6548 __pyx_t_1 = 0;
6549 goto __pyx_L0;
6550
6551 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
6552 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6553 *
6554 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
6555 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6556 *
6557 */
6558
6559 /* function exit code */
6560 __pyx_L1_error:;
6561 __Pyx_XDECREF(__pyx_t_1);
6562 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
6563 __pyx_r = 0;
6564 __pyx_L0:;
6565 __Pyx_XGIVEREF(__pyx_r);
6566 __Pyx_RefNannyFinishContext();
6567 return __pyx_r;
6568 }
6569
6570 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
6571 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6572 *
6573 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
6574 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6575 *
6576 */
6577
__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d)6578 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) {
6579 PyObject *__pyx_r = NULL;
6580 __Pyx_RefNannyDeclarations
6581 PyObject *__pyx_t_1 = NULL;
6582 __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
6583
6584 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831
6585 *
6586 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
6587 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
6588 *
6589 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
6590 */
6591 __Pyx_XDECREF(__pyx_r);
6592 __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(2, 831, __pyx_L1_error)
6593 __Pyx_GOTREF(__pyx_t_1);
6594 __pyx_r = __pyx_t_1;
6595 __pyx_t_1 = 0;
6596 goto __pyx_L0;
6597
6598 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
6599 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6600 *
6601 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
6602 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6603 *
6604 */
6605
6606 /* function exit code */
6607 __pyx_L1_error:;
6608 __Pyx_XDECREF(__pyx_t_1);
6609 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
6610 __pyx_r = 0;
6611 __pyx_L0:;
6612 __Pyx_XGIVEREF(__pyx_r);
6613 __Pyx_RefNannyFinishContext();
6614 return __pyx_r;
6615 }
6616
6617 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
6618 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6619 *
6620 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
6621 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6622 *
6623 */
6624
__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)6625 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) {
6626 PyObject *__pyx_r = NULL;
6627 __Pyx_RefNannyDeclarations
6628 PyObject *__pyx_t_1 = NULL;
6629 __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
6630
6631 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834
6632 *
6633 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
6634 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
6635 *
6636 * cdef inline tuple PyDataType_SHAPE(dtype d):
6637 */
6638 __Pyx_XDECREF(__pyx_r);
6639 __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(2, 834, __pyx_L1_error)
6640 __Pyx_GOTREF(__pyx_t_1);
6641 __pyx_r = __pyx_t_1;
6642 __pyx_t_1 = 0;
6643 goto __pyx_L0;
6644
6645 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
6646 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6647 *
6648 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
6649 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6650 *
6651 */
6652
6653 /* function exit code */
6654 __pyx_L1_error:;
6655 __Pyx_XDECREF(__pyx_t_1);
6656 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
6657 __pyx_r = 0;
6658 __pyx_L0:;
6659 __Pyx_XGIVEREF(__pyx_r);
6660 __Pyx_RefNannyFinishContext();
6661 return __pyx_r;
6662 }
6663
6664 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
6665 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6666 *
6667 * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
6668 * if PyDataType_HASSUBARRAY(d):
6669 * return <tuple>d.subarray.shape
6670 */
6671
__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr * __pyx_v_d)6672 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
6673 PyObject *__pyx_r = NULL;
6674 __Pyx_RefNannyDeclarations
6675 int __pyx_t_1;
6676 __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
6677
6678 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
6679 *
6680 * cdef inline tuple PyDataType_SHAPE(dtype d):
6681 * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
6682 * return <tuple>d.subarray.shape
6683 * else:
6684 */
6685 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
6686 if (__pyx_t_1) {
6687
6688 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838
6689 * cdef inline tuple PyDataType_SHAPE(dtype d):
6690 * if PyDataType_HASSUBARRAY(d):
6691 * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
6692 * else:
6693 * return ()
6694 */
6695 __Pyx_XDECREF(__pyx_r);
6696 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
6697 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
6698 goto __pyx_L0;
6699
6700 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
6701 *
6702 * cdef inline tuple PyDataType_SHAPE(dtype d):
6703 * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
6704 * return <tuple>d.subarray.shape
6705 * else:
6706 */
6707 }
6708
6709 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840
6710 * return <tuple>d.subarray.shape
6711 * else:
6712 * return () # <<<<<<<<<<<<<<
6713 *
6714 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
6715 */
6716 /*else*/ {
6717 __Pyx_XDECREF(__pyx_r);
6718 __Pyx_INCREF(__pyx_empty_tuple);
6719 __pyx_r = __pyx_empty_tuple;
6720 goto __pyx_L0;
6721 }
6722
6723 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
6724 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6725 *
6726 * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
6727 * if PyDataType_HASSUBARRAY(d):
6728 * return <tuple>d.subarray.shape
6729 */
6730
6731 /* function exit code */
6732 __pyx_L0:;
6733 __Pyx_XGIVEREF(__pyx_r);
6734 __Pyx_RefNannyFinishContext();
6735 return __pyx_r;
6736 }
6737
6738 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
6739 * return ()
6740 *
6741 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
6742 * # Recursive utility function used in __getbuffer__ to get format
6743 * # string. The new location in the format string is returned.
6744 */
6745
__pyx_f_5numpy__util_dtypestring(PyArray_Descr * __pyx_v_descr,char * __pyx_v_f,char * __pyx_v_end,int * __pyx_v_offset)6746 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) {
6747 PyArray_Descr *__pyx_v_child = 0;
6748 int __pyx_v_endian_detector;
6749 int __pyx_v_little_endian;
6750 PyObject *__pyx_v_fields = 0;
6751 PyObject *__pyx_v_childname = NULL;
6752 PyObject *__pyx_v_new_offset = NULL;
6753 PyObject *__pyx_v_t = NULL;
6754 char *__pyx_r;
6755 __Pyx_RefNannyDeclarations
6756 PyObject *__pyx_t_1 = NULL;
6757 Py_ssize_t __pyx_t_2;
6758 PyObject *__pyx_t_3 = NULL;
6759 PyObject *__pyx_t_4 = NULL;
6760 int __pyx_t_5;
6761 int __pyx_t_6;
6762 int __pyx_t_7;
6763 long __pyx_t_8;
6764 char *__pyx_t_9;
6765 __Pyx_RefNannySetupContext("_util_dtypestring", 0);
6766
6767 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847
6768 *
6769 * cdef dtype child
6770 * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
6771 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
6772 * cdef tuple fields
6773 */
6774 __pyx_v_endian_detector = 1;
6775
6776 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848
6777 * cdef dtype child
6778 * cdef int endian_detector = 1
6779 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
6780 * cdef tuple fields
6781 *
6782 */
6783 __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
6784
6785 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
6786 * cdef tuple fields
6787 *
6788 * for childname in descr.names: # <<<<<<<<<<<<<<
6789 * fields = descr.fields[childname]
6790 * child, new_offset = fields
6791 */
6792 if (unlikely(__pyx_v_descr->names == Py_None)) {
6793 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
6794 __PYX_ERR(2, 851, __pyx_L1_error)
6795 }
6796 __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
6797 for (;;) {
6798 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
6799 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6800 __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(2, 851, __pyx_L1_error)
6801 #else
6802 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 851, __pyx_L1_error)
6803 __Pyx_GOTREF(__pyx_t_3);
6804 #endif
6805 __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
6806 __pyx_t_3 = 0;
6807
6808 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852
6809 *
6810 * for childname in descr.names:
6811 * fields = descr.fields[childname] # <<<<<<<<<<<<<<
6812 * child, new_offset = fields
6813 *
6814 */
6815 if (unlikely(__pyx_v_descr->fields == Py_None)) {
6816 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6817 __PYX_ERR(2, 852, __pyx_L1_error)
6818 }
6819 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 852, __pyx_L1_error)
6820 __Pyx_GOTREF(__pyx_t_3);
6821 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(2, 852, __pyx_L1_error)
6822 __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
6823 __pyx_t_3 = 0;
6824
6825 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853
6826 * for childname in descr.names:
6827 * fields = descr.fields[childname]
6828 * child, new_offset = fields # <<<<<<<<<<<<<<
6829 *
6830 * if (end - f) - <int>(new_offset - offset[0]) < 15:
6831 */
6832 if (likely(__pyx_v_fields != Py_None)) {
6833 PyObject* sequence = __pyx_v_fields;
6834 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
6835 if (unlikely(size != 2)) {
6836 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
6837 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
6838 __PYX_ERR(2, 853, __pyx_L1_error)
6839 }
6840 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6841 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
6842 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
6843 __Pyx_INCREF(__pyx_t_3);
6844 __Pyx_INCREF(__pyx_t_4);
6845 #else
6846 __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 853, __pyx_L1_error)
6847 __Pyx_GOTREF(__pyx_t_3);
6848 __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 853, __pyx_L1_error)
6849 __Pyx_GOTREF(__pyx_t_4);
6850 #endif
6851 } else {
6852 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 853, __pyx_L1_error)
6853 }
6854 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 853, __pyx_L1_error)
6855 __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
6856 __pyx_t_3 = 0;
6857 __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
6858 __pyx_t_4 = 0;
6859
6860 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
6861 * child, new_offset = fields
6862 *
6863 * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
6864 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
6865 *
6866 */
6867 __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 855, __pyx_L1_error)
6868 __Pyx_GOTREF(__pyx_t_4);
6869 __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 855, __pyx_L1_error)
6870 __Pyx_GOTREF(__pyx_t_3);
6871 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6872 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 855, __pyx_L1_error)
6873 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6874 __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
6875 if (unlikely(__pyx_t_6)) {
6876
6877 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
6878 *
6879 * if (end - f) - <int>(new_offset - offset[0]) < 15:
6880 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
6881 *
6882 * if ((child.byteorder == c'>' and little_endian) or
6883 */
6884 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 856, __pyx_L1_error)
6885 __Pyx_GOTREF(__pyx_t_3);
6886 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6887 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6888 __PYX_ERR(2, 856, __pyx_L1_error)
6889
6890 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
6891 * child, new_offset = fields
6892 *
6893 * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
6894 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
6895 *
6896 */
6897 }
6898
6899 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
6900 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
6901 *
6902 * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6903 * (child.byteorder == c'<' and not little_endian)):
6904 * raise ValueError(u"Non-native byte order not supported")
6905 */
6906 __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
6907 if (!__pyx_t_7) {
6908 goto __pyx_L8_next_or;
6909 } else {
6910 }
6911 __pyx_t_7 = (__pyx_v_little_endian != 0);
6912 if (!__pyx_t_7) {
6913 } else {
6914 __pyx_t_6 = __pyx_t_7;
6915 goto __pyx_L7_bool_binop_done;
6916 }
6917 __pyx_L8_next_or:;
6918
6919 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":859
6920 *
6921 * if ((child.byteorder == c'>' and little_endian) or
6922 * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
6923 * raise ValueError(u"Non-native byte order not supported")
6924 * # One could encode it in the format string and have Cython
6925 */
6926 __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
6927 if (__pyx_t_7) {
6928 } else {
6929 __pyx_t_6 = __pyx_t_7;
6930 goto __pyx_L7_bool_binop_done;
6931 }
6932 __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
6933 __pyx_t_6 = __pyx_t_7;
6934 __pyx_L7_bool_binop_done:;
6935
6936 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
6937 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
6938 *
6939 * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6940 * (child.byteorder == c'<' and not little_endian)):
6941 * raise ValueError(u"Non-native byte order not supported")
6942 */
6943 if (unlikely(__pyx_t_6)) {
6944
6945 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860
6946 * if ((child.byteorder == c'>' and little_endian) or
6947 * (child.byteorder == c'<' and not little_endian)):
6948 * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
6949 * # One could encode it in the format string and have Cython
6950 * # complain instead, BUT: < and > in format strings also imply
6951 */
6952 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 860, __pyx_L1_error)
6953 __Pyx_GOTREF(__pyx_t_3);
6954 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6955 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6956 __PYX_ERR(2, 860, __pyx_L1_error)
6957
6958 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
6959 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
6960 *
6961 * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6962 * (child.byteorder == c'<' and not little_endian)):
6963 * raise ValueError(u"Non-native byte order not supported")
6964 */
6965 }
6966
6967 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":870
6968 *
6969 * # Output padding bytes
6970 * while offset[0] < new_offset: # <<<<<<<<<<<<<<
6971 * f[0] = 120 # "x"; pad byte
6972 * f += 1
6973 */
6974 while (1) {
6975 __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 870, __pyx_L1_error)
6976 __Pyx_GOTREF(__pyx_t_3);
6977 __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(2, 870, __pyx_L1_error)
6978 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6979 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 870, __pyx_L1_error)
6980 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6981 if (!__pyx_t_6) break;
6982
6983 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":871
6984 * # Output padding bytes
6985 * while offset[0] < new_offset:
6986 * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
6987 * f += 1
6988 * offset[0] += 1
6989 */
6990 (__pyx_v_f[0]) = 0x78;
6991
6992 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":872
6993 * while offset[0] < new_offset:
6994 * f[0] = 120 # "x"; pad byte
6995 * f += 1 # <<<<<<<<<<<<<<
6996 * offset[0] += 1
6997 *
6998 */
6999 __pyx_v_f = (__pyx_v_f + 1);
7000
7001 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":873
7002 * f[0] = 120 # "x"; pad byte
7003 * f += 1
7004 * offset[0] += 1 # <<<<<<<<<<<<<<
7005 *
7006 * offset[0] += child.itemsize
7007 */
7008 __pyx_t_8 = 0;
7009 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
7010 }
7011
7012 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":875
7013 * offset[0] += 1
7014 *
7015 * offset[0] += child.itemsize # <<<<<<<<<<<<<<
7016 *
7017 * if not PyDataType_HASFIELDS(child):
7018 */
7019 __pyx_t_8 = 0;
7020 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
7021
7022 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
7023 * offset[0] += child.itemsize
7024 *
7025 * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
7026 * t = child.type_num
7027 * if end - f < 5:
7028 */
7029 __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
7030 if (__pyx_t_6) {
7031
7032 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":878
7033 *
7034 * if not PyDataType_HASFIELDS(child):
7035 * t = child.type_num # <<<<<<<<<<<<<<
7036 * if end - f < 5:
7037 * raise RuntimeError(u"Format string allocated too short.")
7038 */
7039 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 878, __pyx_L1_error)
7040 __Pyx_GOTREF(__pyx_t_4);
7041 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
7042 __pyx_t_4 = 0;
7043
7044 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
7045 * if not PyDataType_HASFIELDS(child):
7046 * t = child.type_num
7047 * if end - f < 5: # <<<<<<<<<<<<<<
7048 * raise RuntimeError(u"Format string allocated too short.")
7049 *
7050 */
7051 __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
7052 if (unlikely(__pyx_t_6)) {
7053
7054 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
7055 * t = child.type_num
7056 * if end - f < 5:
7057 * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
7058 *
7059 * # Until ticket #99 is fixed, use integers to avoid warnings
7060 */
7061 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 880, __pyx_L1_error)
7062 __Pyx_GOTREF(__pyx_t_4);
7063 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7064 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7065 __PYX_ERR(2, 880, __pyx_L1_error)
7066
7067 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
7068 * if not PyDataType_HASFIELDS(child):
7069 * t = child.type_num
7070 * if end - f < 5: # <<<<<<<<<<<<<<
7071 * raise RuntimeError(u"Format string allocated too short.")
7072 *
7073 */
7074 }
7075
7076 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":883
7077 *
7078 * # Until ticket #99 is fixed, use integers to avoid warnings
7079 * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
7080 * elif t == NPY_UBYTE: f[0] = 66 #"B"
7081 * elif t == NPY_SHORT: f[0] = 104 #"h"
7082 */
7083 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 883, __pyx_L1_error)
7084 __Pyx_GOTREF(__pyx_t_4);
7085 __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(2, 883, __pyx_L1_error)
7086 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7087 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 883, __pyx_L1_error)
7088 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7089 if (__pyx_t_6) {
7090 (__pyx_v_f[0]) = 98;
7091 goto __pyx_L15;
7092 }
7093
7094 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":884
7095 * # Until ticket #99 is fixed, use integers to avoid warnings
7096 * if t == NPY_BYTE: f[0] = 98 #"b"
7097 * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
7098 * elif t == NPY_SHORT: f[0] = 104 #"h"
7099 * elif t == NPY_USHORT: f[0] = 72 #"H"
7100 */
7101 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 884, __pyx_L1_error)
7102 __Pyx_GOTREF(__pyx_t_3);
7103 __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(2, 884, __pyx_L1_error)
7104 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7105 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 884, __pyx_L1_error)
7106 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7107 if (__pyx_t_6) {
7108 (__pyx_v_f[0]) = 66;
7109 goto __pyx_L15;
7110 }
7111
7112 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":885
7113 * if t == NPY_BYTE: f[0] = 98 #"b"
7114 * elif t == NPY_UBYTE: f[0] = 66 #"B"
7115 * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
7116 * elif t == NPY_USHORT: f[0] = 72 #"H"
7117 * elif t == NPY_INT: f[0] = 105 #"i"
7118 */
7119 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 885, __pyx_L1_error)
7120 __Pyx_GOTREF(__pyx_t_4);
7121 __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(2, 885, __pyx_L1_error)
7122 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7123 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 885, __pyx_L1_error)
7124 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7125 if (__pyx_t_6) {
7126 (__pyx_v_f[0]) = 0x68;
7127 goto __pyx_L15;
7128 }
7129
7130 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":886
7131 * elif t == NPY_UBYTE: f[0] = 66 #"B"
7132 * elif t == NPY_SHORT: f[0] = 104 #"h"
7133 * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
7134 * elif t == NPY_INT: f[0] = 105 #"i"
7135 * elif t == NPY_UINT: f[0] = 73 #"I"
7136 */
7137 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 886, __pyx_L1_error)
7138 __Pyx_GOTREF(__pyx_t_3);
7139 __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(2, 886, __pyx_L1_error)
7140 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7141 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 886, __pyx_L1_error)
7142 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7143 if (__pyx_t_6) {
7144 (__pyx_v_f[0]) = 72;
7145 goto __pyx_L15;
7146 }
7147
7148 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":887
7149 * elif t == NPY_SHORT: f[0] = 104 #"h"
7150 * elif t == NPY_USHORT: f[0] = 72 #"H"
7151 * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
7152 * elif t == NPY_UINT: f[0] = 73 #"I"
7153 * elif t == NPY_LONG: f[0] = 108 #"l"
7154 */
7155 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 887, __pyx_L1_error)
7156 __Pyx_GOTREF(__pyx_t_4);
7157 __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(2, 887, __pyx_L1_error)
7158 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7159 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 887, __pyx_L1_error)
7160 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7161 if (__pyx_t_6) {
7162 (__pyx_v_f[0]) = 0x69;
7163 goto __pyx_L15;
7164 }
7165
7166 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":888
7167 * elif t == NPY_USHORT: f[0] = 72 #"H"
7168 * elif t == NPY_INT: f[0] = 105 #"i"
7169 * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
7170 * elif t == NPY_LONG: f[0] = 108 #"l"
7171 * elif t == NPY_ULONG: f[0] = 76 #"L"
7172 */
7173 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 888, __pyx_L1_error)
7174 __Pyx_GOTREF(__pyx_t_3);
7175 __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(2, 888, __pyx_L1_error)
7176 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7177 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 888, __pyx_L1_error)
7178 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7179 if (__pyx_t_6) {
7180 (__pyx_v_f[0]) = 73;
7181 goto __pyx_L15;
7182 }
7183
7184 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":889
7185 * elif t == NPY_INT: f[0] = 105 #"i"
7186 * elif t == NPY_UINT: f[0] = 73 #"I"
7187 * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
7188 * elif t == NPY_ULONG: f[0] = 76 #"L"
7189 * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7190 */
7191 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 889, __pyx_L1_error)
7192 __Pyx_GOTREF(__pyx_t_4);
7193 __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(2, 889, __pyx_L1_error)
7194 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7195 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 889, __pyx_L1_error)
7196 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7197 if (__pyx_t_6) {
7198 (__pyx_v_f[0]) = 0x6C;
7199 goto __pyx_L15;
7200 }
7201
7202 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":890
7203 * elif t == NPY_UINT: f[0] = 73 #"I"
7204 * elif t == NPY_LONG: f[0] = 108 #"l"
7205 * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
7206 * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7207 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7208 */
7209 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 890, __pyx_L1_error)
7210 __Pyx_GOTREF(__pyx_t_3);
7211 __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(2, 890, __pyx_L1_error)
7212 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7213 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 890, __pyx_L1_error)
7214 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7215 if (__pyx_t_6) {
7216 (__pyx_v_f[0]) = 76;
7217 goto __pyx_L15;
7218 }
7219
7220 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":891
7221 * elif t == NPY_LONG: f[0] = 108 #"l"
7222 * elif t == NPY_ULONG: f[0] = 76 #"L"
7223 * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
7224 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7225 * elif t == NPY_FLOAT: f[0] = 102 #"f"
7226 */
7227 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 891, __pyx_L1_error)
7228 __Pyx_GOTREF(__pyx_t_4);
7229 __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(2, 891, __pyx_L1_error)
7230 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7231 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 891, __pyx_L1_error)
7232 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7233 if (__pyx_t_6) {
7234 (__pyx_v_f[0]) = 0x71;
7235 goto __pyx_L15;
7236 }
7237
7238 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":892
7239 * elif t == NPY_ULONG: f[0] = 76 #"L"
7240 * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7241 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
7242 * elif t == NPY_FLOAT: f[0] = 102 #"f"
7243 * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7244 */
7245 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 892, __pyx_L1_error)
7246 __Pyx_GOTREF(__pyx_t_3);
7247 __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(2, 892, __pyx_L1_error)
7248 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7249 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 892, __pyx_L1_error)
7250 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7251 if (__pyx_t_6) {
7252 (__pyx_v_f[0]) = 81;
7253 goto __pyx_L15;
7254 }
7255
7256 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":893
7257 * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7258 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7259 * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
7260 * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7261 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7262 */
7263 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 893, __pyx_L1_error)
7264 __Pyx_GOTREF(__pyx_t_4);
7265 __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(2, 893, __pyx_L1_error)
7266 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7267 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 893, __pyx_L1_error)
7268 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7269 if (__pyx_t_6) {
7270 (__pyx_v_f[0]) = 0x66;
7271 goto __pyx_L15;
7272 }
7273
7274 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":894
7275 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7276 * elif t == NPY_FLOAT: f[0] = 102 #"f"
7277 * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
7278 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7279 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7280 */
7281 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 894, __pyx_L1_error)
7282 __Pyx_GOTREF(__pyx_t_3);
7283 __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(2, 894, __pyx_L1_error)
7284 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7285 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 894, __pyx_L1_error)
7286 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7287 if (__pyx_t_6) {
7288 (__pyx_v_f[0]) = 0x64;
7289 goto __pyx_L15;
7290 }
7291
7292 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":895
7293 * elif t == NPY_FLOAT: f[0] = 102 #"f"
7294 * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7295 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
7296 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7297 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7298 */
7299 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 895, __pyx_L1_error)
7300 __Pyx_GOTREF(__pyx_t_4);
7301 __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(2, 895, __pyx_L1_error)
7302 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7303 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 895, __pyx_L1_error)
7304 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7305 if (__pyx_t_6) {
7306 (__pyx_v_f[0]) = 0x67;
7307 goto __pyx_L15;
7308 }
7309
7310 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":896
7311 * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7312 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7313 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
7314 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7315 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
7316 */
7317 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 896, __pyx_L1_error)
7318 __Pyx_GOTREF(__pyx_t_3);
7319 __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(2, 896, __pyx_L1_error)
7320 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7321 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 896, __pyx_L1_error)
7322 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7323 if (__pyx_t_6) {
7324 (__pyx_v_f[0]) = 90;
7325 (__pyx_v_f[1]) = 0x66;
7326 __pyx_v_f = (__pyx_v_f + 1);
7327 goto __pyx_L15;
7328 }
7329
7330 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":897
7331 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7332 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7333 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
7334 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
7335 * elif t == NPY_OBJECT: f[0] = 79 #"O"
7336 */
7337 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 897, __pyx_L1_error)
7338 __Pyx_GOTREF(__pyx_t_4);
7339 __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(2, 897, __pyx_L1_error)
7340 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7341 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 897, __pyx_L1_error)
7342 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7343 if (__pyx_t_6) {
7344 (__pyx_v_f[0]) = 90;
7345 (__pyx_v_f[1]) = 0x64;
7346 __pyx_v_f = (__pyx_v_f + 1);
7347 goto __pyx_L15;
7348 }
7349
7350 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":898
7351 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7352 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7353 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
7354 * elif t == NPY_OBJECT: f[0] = 79 #"O"
7355 * else:
7356 */
7357 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 898, __pyx_L1_error)
7358 __Pyx_GOTREF(__pyx_t_3);
7359 __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(2, 898, __pyx_L1_error)
7360 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7361 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 898, __pyx_L1_error)
7362 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7363 if (__pyx_t_6) {
7364 (__pyx_v_f[0]) = 90;
7365 (__pyx_v_f[1]) = 0x67;
7366 __pyx_v_f = (__pyx_v_f + 1);
7367 goto __pyx_L15;
7368 }
7369
7370 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":899
7371 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7372 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
7373 * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
7374 * else:
7375 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7376 */
7377 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 899, __pyx_L1_error)
7378 __Pyx_GOTREF(__pyx_t_4);
7379 __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(2, 899, __pyx_L1_error)
7380 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7381 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 899, __pyx_L1_error)
7382 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7383 if (likely(__pyx_t_6)) {
7384 (__pyx_v_f[0]) = 79;
7385 goto __pyx_L15;
7386 }
7387
7388 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":901
7389 * elif t == NPY_OBJECT: f[0] = 79 #"O"
7390 * else:
7391 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
7392 * f += 1
7393 * else:
7394 */
7395 /*else*/ {
7396 __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(2, 901, __pyx_L1_error)
7397 __Pyx_GOTREF(__pyx_t_3);
7398 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 901, __pyx_L1_error)
7399 __Pyx_GOTREF(__pyx_t_4);
7400 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7401 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7402 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7403 __PYX_ERR(2, 901, __pyx_L1_error)
7404 }
7405 __pyx_L15:;
7406
7407 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":902
7408 * else:
7409 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7410 * f += 1 # <<<<<<<<<<<<<<
7411 * else:
7412 * # Cython ignores struct boundary information ("T{...}"),
7413 */
7414 __pyx_v_f = (__pyx_v_f + 1);
7415
7416 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
7417 * offset[0] += child.itemsize
7418 *
7419 * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
7420 * t = child.type_num
7421 * if end - f < 5:
7422 */
7423 goto __pyx_L13;
7424 }
7425
7426 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":906
7427 * # Cython ignores struct boundary information ("T{...}"),
7428 * # so don't output it
7429 * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
7430 * return f
7431 *
7432 */
7433 /*else*/ {
7434 __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(2, 906, __pyx_L1_error)
7435 __pyx_v_f = __pyx_t_9;
7436 }
7437 __pyx_L13:;
7438
7439 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
7440 * cdef tuple fields
7441 *
7442 * for childname in descr.names: # <<<<<<<<<<<<<<
7443 * fields = descr.fields[childname]
7444 * child, new_offset = fields
7445 */
7446 }
7447 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7448
7449 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":907
7450 * # so don't output it
7451 * f = _util_dtypestring(child, f, end, offset)
7452 * return f # <<<<<<<<<<<<<<
7453 *
7454 *
7455 */
7456 __pyx_r = __pyx_v_f;
7457 goto __pyx_L0;
7458
7459 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
7460 * return ()
7461 *
7462 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
7463 * # Recursive utility function used in __getbuffer__ to get format
7464 * # string. The new location in the format string is returned.
7465 */
7466
7467 /* function exit code */
7468 __pyx_L1_error:;
7469 __Pyx_XDECREF(__pyx_t_1);
7470 __Pyx_XDECREF(__pyx_t_3);
7471 __Pyx_XDECREF(__pyx_t_4);
7472 __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
7473 __pyx_r = NULL;
7474 __pyx_L0:;
7475 __Pyx_XDECREF((PyObject *)__pyx_v_child);
7476 __Pyx_XDECREF(__pyx_v_fields);
7477 __Pyx_XDECREF(__pyx_v_childname);
7478 __Pyx_XDECREF(__pyx_v_new_offset);
7479 __Pyx_XDECREF(__pyx_v_t);
7480 __Pyx_RefNannyFinishContext();
7481 return __pyx_r;
7482 }
7483
7484 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
7485 * int _import_umath() except -1
7486 *
7487 * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7488 * Py_INCREF(base) # important to do this before stealing the reference below!
7489 * PyArray_SetBaseObject(arr, base)
7490 */
7491
__pyx_f_5numpy_set_array_base(PyArrayObject * __pyx_v_arr,PyObject * __pyx_v_base)7492 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
7493 __Pyx_RefNannyDeclarations
7494 __Pyx_RefNannySetupContext("set_array_base", 0);
7495
7496 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1023
7497 *
7498 * cdef inline void set_array_base(ndarray arr, object base):
7499 * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
7500 * PyArray_SetBaseObject(arr, base)
7501 *
7502 */
7503 Py_INCREF(__pyx_v_base);
7504
7505 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1024
7506 * cdef inline void set_array_base(ndarray arr, object base):
7507 * Py_INCREF(base) # important to do this before stealing the reference below!
7508 * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
7509 *
7510 * cdef inline object get_array_base(ndarray arr):
7511 */
7512 (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
7513
7514 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
7515 * int _import_umath() except -1
7516 *
7517 * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7518 * Py_INCREF(base) # important to do this before stealing the reference below!
7519 * PyArray_SetBaseObject(arr, base)
7520 */
7521
7522 /* function exit code */
7523 __Pyx_RefNannyFinishContext();
7524 }
7525
7526 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
7527 * PyArray_SetBaseObject(arr, base)
7528 *
7529 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7530 * base = PyArray_BASE(arr)
7531 * if base is NULL:
7532 */
7533
__pyx_f_5numpy_get_array_base(PyArrayObject * __pyx_v_arr)7534 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
7535 PyObject *__pyx_v_base;
7536 PyObject *__pyx_r = NULL;
7537 __Pyx_RefNannyDeclarations
7538 int __pyx_t_1;
7539 __Pyx_RefNannySetupContext("get_array_base", 0);
7540
7541 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1027
7542 *
7543 * cdef inline object get_array_base(ndarray arr):
7544 * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
7545 * if base is NULL:
7546 * return None
7547 */
7548 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
7549
7550 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
7551 * cdef inline object get_array_base(ndarray arr):
7552 * base = PyArray_BASE(arr)
7553 * if base is NULL: # <<<<<<<<<<<<<<
7554 * return None
7555 * return <object>base
7556 */
7557 __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
7558 if (__pyx_t_1) {
7559
7560 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1029
7561 * base = PyArray_BASE(arr)
7562 * if base is NULL:
7563 * return None # <<<<<<<<<<<<<<
7564 * return <object>base
7565 *
7566 */
7567 __Pyx_XDECREF(__pyx_r);
7568 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7569 goto __pyx_L0;
7570
7571 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
7572 * cdef inline object get_array_base(ndarray arr):
7573 * base = PyArray_BASE(arr)
7574 * if base is NULL: # <<<<<<<<<<<<<<
7575 * return None
7576 * return <object>base
7577 */
7578 }
7579
7580 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1030
7581 * if base is NULL:
7582 * return None
7583 * return <object>base # <<<<<<<<<<<<<<
7584 *
7585 * # Versions of the import_* functions which are more suitable for
7586 */
7587 __Pyx_XDECREF(__pyx_r);
7588 __Pyx_INCREF(((PyObject *)__pyx_v_base));
7589 __pyx_r = ((PyObject *)__pyx_v_base);
7590 goto __pyx_L0;
7591
7592 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
7593 * PyArray_SetBaseObject(arr, base)
7594 *
7595 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7596 * base = PyArray_BASE(arr)
7597 * if base is NULL:
7598 */
7599
7600 /* function exit code */
7601 __pyx_L0:;
7602 __Pyx_XGIVEREF(__pyx_r);
7603 __Pyx_RefNannyFinishContext();
7604 return __pyx_r;
7605 }
7606
7607 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
7608 * # Versions of the import_* functions which are more suitable for
7609 * # Cython code.
7610 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
7611 * try:
7612 * _import_array()
7613 */
7614
__pyx_f_5numpy_import_array(void)7615 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
7616 int __pyx_r;
7617 __Pyx_RefNannyDeclarations
7618 PyObject *__pyx_t_1 = NULL;
7619 PyObject *__pyx_t_2 = NULL;
7620 PyObject *__pyx_t_3 = NULL;
7621 int __pyx_t_4;
7622 PyObject *__pyx_t_5 = NULL;
7623 PyObject *__pyx_t_6 = NULL;
7624 PyObject *__pyx_t_7 = NULL;
7625 PyObject *__pyx_t_8 = NULL;
7626 __Pyx_RefNannySetupContext("import_array", 0);
7627
7628 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
7629 * # Cython code.
7630 * cdef inline int import_array() except -1:
7631 * try: # <<<<<<<<<<<<<<
7632 * _import_array()
7633 * except Exception:
7634 */
7635 {
7636 __Pyx_PyThreadState_declare
7637 __Pyx_PyThreadState_assign
7638 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7639 __Pyx_XGOTREF(__pyx_t_1);
7640 __Pyx_XGOTREF(__pyx_t_2);
7641 __Pyx_XGOTREF(__pyx_t_3);
7642 /*try:*/ {
7643
7644 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1036
7645 * cdef inline int import_array() except -1:
7646 * try:
7647 * _import_array() # <<<<<<<<<<<<<<
7648 * except Exception:
7649 * raise ImportError("numpy.core.multiarray failed to import")
7650 */
7651 __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1036, __pyx_L3_error)
7652
7653 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
7654 * # Cython code.
7655 * cdef inline int import_array() except -1:
7656 * try: # <<<<<<<<<<<<<<
7657 * _import_array()
7658 * except Exception:
7659 */
7660 }
7661 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7662 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7663 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7664 goto __pyx_L8_try_end;
7665 __pyx_L3_error:;
7666
7667 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1037
7668 * try:
7669 * _import_array()
7670 * except Exception: # <<<<<<<<<<<<<<
7671 * raise ImportError("numpy.core.multiarray failed to import")
7672 *
7673 */
7674 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7675 if (__pyx_t_4) {
7676 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7677 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1037, __pyx_L5_except_error)
7678 __Pyx_GOTREF(__pyx_t_5);
7679 __Pyx_GOTREF(__pyx_t_6);
7680 __Pyx_GOTREF(__pyx_t_7);
7681
7682 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
7683 * _import_array()
7684 * except Exception:
7685 * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
7686 *
7687 * cdef inline int import_umath() except -1:
7688 */
7689 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1038, __pyx_L5_except_error)
7690 __Pyx_GOTREF(__pyx_t_8);
7691 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7692 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7693 __PYX_ERR(2, 1038, __pyx_L5_except_error)
7694 }
7695 goto __pyx_L5_except_error;
7696 __pyx_L5_except_error:;
7697
7698 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
7699 * # Cython code.
7700 * cdef inline int import_array() except -1:
7701 * try: # <<<<<<<<<<<<<<
7702 * _import_array()
7703 * except Exception:
7704 */
7705 __Pyx_XGIVEREF(__pyx_t_1);
7706 __Pyx_XGIVEREF(__pyx_t_2);
7707 __Pyx_XGIVEREF(__pyx_t_3);
7708 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7709 goto __pyx_L1_error;
7710 __pyx_L8_try_end:;
7711 }
7712
7713 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
7714 * # Versions of the import_* functions which are more suitable for
7715 * # Cython code.
7716 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
7717 * try:
7718 * _import_array()
7719 */
7720
7721 /* function exit code */
7722 __pyx_r = 0;
7723 goto __pyx_L0;
7724 __pyx_L1_error:;
7725 __Pyx_XDECREF(__pyx_t_5);
7726 __Pyx_XDECREF(__pyx_t_6);
7727 __Pyx_XDECREF(__pyx_t_7);
7728 __Pyx_XDECREF(__pyx_t_8);
7729 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7730 __pyx_r = -1;
7731 __pyx_L0:;
7732 __Pyx_RefNannyFinishContext();
7733 return __pyx_r;
7734 }
7735
7736 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
7737 * raise ImportError("numpy.core.multiarray failed to import")
7738 *
7739 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
7740 * try:
7741 * _import_umath()
7742 */
7743
__pyx_f_5numpy_import_umath(void)7744 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
7745 int __pyx_r;
7746 __Pyx_RefNannyDeclarations
7747 PyObject *__pyx_t_1 = NULL;
7748 PyObject *__pyx_t_2 = NULL;
7749 PyObject *__pyx_t_3 = NULL;
7750 int __pyx_t_4;
7751 PyObject *__pyx_t_5 = NULL;
7752 PyObject *__pyx_t_6 = NULL;
7753 PyObject *__pyx_t_7 = NULL;
7754 PyObject *__pyx_t_8 = NULL;
7755 __Pyx_RefNannySetupContext("import_umath", 0);
7756
7757 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
7758 *
7759 * cdef inline int import_umath() except -1:
7760 * try: # <<<<<<<<<<<<<<
7761 * _import_umath()
7762 * except Exception:
7763 */
7764 {
7765 __Pyx_PyThreadState_declare
7766 __Pyx_PyThreadState_assign
7767 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7768 __Pyx_XGOTREF(__pyx_t_1);
7769 __Pyx_XGOTREF(__pyx_t_2);
7770 __Pyx_XGOTREF(__pyx_t_3);
7771 /*try:*/ {
7772
7773 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1042
7774 * cdef inline int import_umath() except -1:
7775 * try:
7776 * _import_umath() # <<<<<<<<<<<<<<
7777 * except Exception:
7778 * raise ImportError("numpy.core.umath failed to import")
7779 */
7780 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1042, __pyx_L3_error)
7781
7782 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
7783 *
7784 * cdef inline int import_umath() except -1:
7785 * try: # <<<<<<<<<<<<<<
7786 * _import_umath()
7787 * except Exception:
7788 */
7789 }
7790 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7791 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7792 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7793 goto __pyx_L8_try_end;
7794 __pyx_L3_error:;
7795
7796 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1043
7797 * try:
7798 * _import_umath()
7799 * except Exception: # <<<<<<<<<<<<<<
7800 * raise ImportError("numpy.core.umath failed to import")
7801 *
7802 */
7803 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7804 if (__pyx_t_4) {
7805 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7806 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1043, __pyx_L5_except_error)
7807 __Pyx_GOTREF(__pyx_t_5);
7808 __Pyx_GOTREF(__pyx_t_6);
7809 __Pyx_GOTREF(__pyx_t_7);
7810
7811 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
7812 * _import_umath()
7813 * except Exception:
7814 * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
7815 *
7816 * cdef inline int import_ufunc() except -1:
7817 */
7818 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1044, __pyx_L5_except_error)
7819 __Pyx_GOTREF(__pyx_t_8);
7820 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7821 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7822 __PYX_ERR(2, 1044, __pyx_L5_except_error)
7823 }
7824 goto __pyx_L5_except_error;
7825 __pyx_L5_except_error:;
7826
7827 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
7828 *
7829 * cdef inline int import_umath() except -1:
7830 * try: # <<<<<<<<<<<<<<
7831 * _import_umath()
7832 * except Exception:
7833 */
7834 __Pyx_XGIVEREF(__pyx_t_1);
7835 __Pyx_XGIVEREF(__pyx_t_2);
7836 __Pyx_XGIVEREF(__pyx_t_3);
7837 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7838 goto __pyx_L1_error;
7839 __pyx_L8_try_end:;
7840 }
7841
7842 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
7843 * raise ImportError("numpy.core.multiarray failed to import")
7844 *
7845 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
7846 * try:
7847 * _import_umath()
7848 */
7849
7850 /* function exit code */
7851 __pyx_r = 0;
7852 goto __pyx_L0;
7853 __pyx_L1_error:;
7854 __Pyx_XDECREF(__pyx_t_5);
7855 __Pyx_XDECREF(__pyx_t_6);
7856 __Pyx_XDECREF(__pyx_t_7);
7857 __Pyx_XDECREF(__pyx_t_8);
7858 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7859 __pyx_r = -1;
7860 __pyx_L0:;
7861 __Pyx_RefNannyFinishContext();
7862 return __pyx_r;
7863 }
7864
7865 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
7866 * raise ImportError("numpy.core.umath failed to import")
7867 *
7868 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
7869 * try:
7870 * _import_umath()
7871 */
7872
__pyx_f_5numpy_import_ufunc(void)7873 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
7874 int __pyx_r;
7875 __Pyx_RefNannyDeclarations
7876 PyObject *__pyx_t_1 = NULL;
7877 PyObject *__pyx_t_2 = NULL;
7878 PyObject *__pyx_t_3 = NULL;
7879 int __pyx_t_4;
7880 PyObject *__pyx_t_5 = NULL;
7881 PyObject *__pyx_t_6 = NULL;
7882 PyObject *__pyx_t_7 = NULL;
7883 PyObject *__pyx_t_8 = NULL;
7884 __Pyx_RefNannySetupContext("import_ufunc", 0);
7885
7886 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
7887 *
7888 * cdef inline int import_ufunc() except -1:
7889 * try: # <<<<<<<<<<<<<<
7890 * _import_umath()
7891 * except Exception:
7892 */
7893 {
7894 __Pyx_PyThreadState_declare
7895 __Pyx_PyThreadState_assign
7896 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7897 __Pyx_XGOTREF(__pyx_t_1);
7898 __Pyx_XGOTREF(__pyx_t_2);
7899 __Pyx_XGOTREF(__pyx_t_3);
7900 /*try:*/ {
7901
7902 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1048
7903 * cdef inline int import_ufunc() except -1:
7904 * try:
7905 * _import_umath() # <<<<<<<<<<<<<<
7906 * except Exception:
7907 * raise ImportError("numpy.core.umath failed to import")
7908 */
7909 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1048, __pyx_L3_error)
7910
7911 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
7912 *
7913 * cdef inline int import_ufunc() except -1:
7914 * try: # <<<<<<<<<<<<<<
7915 * _import_umath()
7916 * except Exception:
7917 */
7918 }
7919 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7920 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7921 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7922 goto __pyx_L8_try_end;
7923 __pyx_L3_error:;
7924
7925 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1049
7926 * try:
7927 * _import_umath()
7928 * except Exception: # <<<<<<<<<<<<<<
7929 * raise ImportError("numpy.core.umath failed to import")
7930 */
7931 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7932 if (__pyx_t_4) {
7933 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
7934 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1049, __pyx_L5_except_error)
7935 __Pyx_GOTREF(__pyx_t_5);
7936 __Pyx_GOTREF(__pyx_t_6);
7937 __Pyx_GOTREF(__pyx_t_7);
7938
7939 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1050
7940 * _import_umath()
7941 * except Exception:
7942 * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
7943 */
7944 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1050, __pyx_L5_except_error)
7945 __Pyx_GOTREF(__pyx_t_8);
7946 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7947 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7948 __PYX_ERR(2, 1050, __pyx_L5_except_error)
7949 }
7950 goto __pyx_L5_except_error;
7951 __pyx_L5_except_error:;
7952
7953 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
7954 *
7955 * cdef inline int import_ufunc() except -1:
7956 * try: # <<<<<<<<<<<<<<
7957 * _import_umath()
7958 * except Exception:
7959 */
7960 __Pyx_XGIVEREF(__pyx_t_1);
7961 __Pyx_XGIVEREF(__pyx_t_2);
7962 __Pyx_XGIVEREF(__pyx_t_3);
7963 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7964 goto __pyx_L1_error;
7965 __pyx_L8_try_end:;
7966 }
7967
7968 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
7969 * raise ImportError("numpy.core.umath failed to import")
7970 *
7971 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
7972 * try:
7973 * _import_umath()
7974 */
7975
7976 /* function exit code */
7977 __pyx_r = 0;
7978 goto __pyx_L0;
7979 __pyx_L1_error:;
7980 __Pyx_XDECREF(__pyx_t_5);
7981 __Pyx_XDECREF(__pyx_t_6);
7982 __Pyx_XDECREF(__pyx_t_7);
7983 __Pyx_XDECREF(__pyx_t_8);
7984 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
7985 __pyx_r = -1;
7986 __pyx_L0:;
7987 __Pyx_RefNannyFinishContext();
7988 return __pyx_r;
7989 }
7990
__pyx_tp_new_2yt_9utilities_3lib_18depth_first_octree_position(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)7991 static PyObject *__pyx_tp_new_2yt_9utilities_3lib_18depth_first_octree_position(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
7992 PyObject *o;
7993 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
7994 o = (*t->tp_alloc)(t, 0);
7995 } else {
7996 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
7997 }
7998 if (unlikely(!o)) return 0;
7999 if (unlikely(__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
8000 return o;
8001 bad:
8002 Py_DECREF(o); o = 0;
8003 return NULL;
8004 }
8005
__pyx_tp_dealloc_2yt_9utilities_3lib_18depth_first_octree_position(PyObject * o)8006 static void __pyx_tp_dealloc_2yt_9utilities_3lib_18depth_first_octree_position(PyObject *o) {
8007 #if CYTHON_USE_TP_FINALIZE
8008 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
8009 if (PyObject_CallFinalizerFromDealloc(o)) return;
8010 }
8011 #endif
8012 (*Py_TYPE(o)->tp_free)(o);
8013 }
8014
__pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_8position_output_pos(PyObject * o,CYTHON_UNUSED void * x)8015 static PyObject *__pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_8position_output_pos(PyObject *o, CYTHON_UNUSED void *x) {
8016 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_10output_pos_1__get__(o);
8017 }
8018
__pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_8position_output_pos(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)8019 static int __pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_8position_output_pos(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
8020 if (v) {
8021 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_10output_pos_3__set__(o, v);
8022 }
8023 else {
8024 PyErr_SetString(PyExc_NotImplementedError, "__del__");
8025 return -1;
8026 }
8027 }
8028
__pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_8position_refined_pos(PyObject * o,CYTHON_UNUSED void * x)8029 static PyObject *__pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_8position_refined_pos(PyObject *o, CYTHON_UNUSED void *x) {
8030 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_11refined_pos_1__get__(o);
8031 }
8032
__pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_8position_refined_pos(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)8033 static int __pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_8position_refined_pos(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
8034 if (v) {
8035 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_11refined_pos_3__set__(o, v);
8036 }
8037 else {
8038 PyErr_SetString(PyExc_NotImplementedError, "__del__");
8039 return -1;
8040 }
8041 }
8042
8043 static PyMethodDef __pyx_methods_2yt_9utilities_3lib_18depth_first_octree_position[] = {
8044 {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_3__reduce_cython__, METH_NOARGS, 0},
8045 {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_8position_5__setstate_cython__, METH_O, 0},
8046 {0, 0, 0, 0}
8047 };
8048
8049 static struct PyGetSetDef __pyx_getsets_2yt_9utilities_3lib_18depth_first_octree_position[] = {
8050 {(char *)"output_pos", __pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_8position_output_pos, __pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_8position_output_pos, (char *)0, 0},
8051 {(char *)"refined_pos", __pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_8position_refined_pos, __pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_8position_refined_pos, (char *)0, 0},
8052 {0, 0, 0, 0, 0}
8053 };
8054
8055 static PyTypeObject __pyx_type_2yt_9utilities_3lib_18depth_first_octree_position = {
8056 PyVarObject_HEAD_INIT(0, 0)
8057 "yt.utilities.lib.depth_first_octree.position", /*tp_name*/
8058 sizeof(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_position), /*tp_basicsize*/
8059 0, /*tp_itemsize*/
8060 __pyx_tp_dealloc_2yt_9utilities_3lib_18depth_first_octree_position, /*tp_dealloc*/
8061 0, /*tp_print*/
8062 0, /*tp_getattr*/
8063 0, /*tp_setattr*/
8064 #if PY_MAJOR_VERSION < 3
8065 0, /*tp_compare*/
8066 #endif
8067 #if PY_MAJOR_VERSION >= 3
8068 0, /*tp_as_async*/
8069 #endif
8070 0, /*tp_repr*/
8071 0, /*tp_as_number*/
8072 0, /*tp_as_sequence*/
8073 0, /*tp_as_mapping*/
8074 0, /*tp_hash*/
8075 0, /*tp_call*/
8076 0, /*tp_str*/
8077 0, /*tp_getattro*/
8078 0, /*tp_setattro*/
8079 0, /*tp_as_buffer*/
8080 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
8081 0, /*tp_doc*/
8082 0, /*tp_traverse*/
8083 0, /*tp_clear*/
8084 0, /*tp_richcompare*/
8085 0, /*tp_weaklistoffset*/
8086 0, /*tp_iter*/
8087 0, /*tp_iternext*/
8088 __pyx_methods_2yt_9utilities_3lib_18depth_first_octree_position, /*tp_methods*/
8089 0, /*tp_members*/
8090 __pyx_getsets_2yt_9utilities_3lib_18depth_first_octree_position, /*tp_getset*/
8091 0, /*tp_base*/
8092 0, /*tp_dict*/
8093 0, /*tp_descr_get*/
8094 0, /*tp_descr_set*/
8095 0, /*tp_dictoffset*/
8096 0, /*tp_init*/
8097 0, /*tp_alloc*/
8098 __pyx_tp_new_2yt_9utilities_3lib_18depth_first_octree_position, /*tp_new*/
8099 0, /*tp_free*/
8100 0, /*tp_is_gc*/
8101 0, /*tp_bases*/
8102 0, /*tp_mro*/
8103 0, /*tp_cache*/
8104 0, /*tp_subclasses*/
8105 0, /*tp_weaklist*/
8106 0, /*tp_del*/
8107 0, /*tp_version_tag*/
8108 #if PY_VERSION_HEX >= 0x030400a1
8109 0, /*tp_finalize*/
8110 #endif
8111 #if PY_VERSION_HEX >= 0x030800b1
8112 0, /*tp_vectorcall*/
8113 #endif
8114 };
8115
__pyx_tp_new_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid(PyTypeObject * t,PyObject * a,PyObject * k)8116 static PyObject *__pyx_tp_new_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid(PyTypeObject *t, PyObject *a, PyObject *k) {
8117 struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *p;
8118 PyObject *o;
8119 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
8120 o = (*t->tp_alloc)(t, 0);
8121 } else {
8122 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
8123 }
8124 if (unlikely(!o)) return 0;
8125 p = ((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)o);
8126 p->child_indices = Py_None; Py_INCREF(Py_None);
8127 p->fields = Py_None; Py_INCREF(Py_None);
8128 p->left_edges = Py_None; Py_INCREF(Py_None);
8129 p->dimensions = Py_None; Py_INCREF(Py_None);
8130 p->dx = Py_None; Py_INCREF(Py_None);
8131 if (unlikely(__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_1__cinit__(o, a, k) < 0)) goto bad;
8132 return o;
8133 bad:
8134 Py_DECREF(o); o = 0;
8135 return NULL;
8136 }
8137
__pyx_tp_dealloc_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid(PyObject * o)8138 static void __pyx_tp_dealloc_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid(PyObject *o) {
8139 struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *p = (struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)o;
8140 #if CYTHON_USE_TP_FINALIZE
8141 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
8142 if (PyObject_CallFinalizerFromDealloc(o)) return;
8143 }
8144 #endif
8145 PyObject_GC_UnTrack(o);
8146 Py_CLEAR(p->child_indices);
8147 Py_CLEAR(p->fields);
8148 Py_CLEAR(p->left_edges);
8149 Py_CLEAR(p->dimensions);
8150 Py_CLEAR(p->dx);
8151 (*Py_TYPE(o)->tp_free)(o);
8152 }
8153
__pyx_tp_traverse_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid(PyObject * o,visitproc v,void * a)8154 static int __pyx_tp_traverse_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid(PyObject *o, visitproc v, void *a) {
8155 int e;
8156 struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *p = (struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)o;
8157 if (p->child_indices) {
8158 e = (*v)(p->child_indices, a); if (e) return e;
8159 }
8160 if (p->fields) {
8161 e = (*v)(p->fields, a); if (e) return e;
8162 }
8163 if (p->left_edges) {
8164 e = (*v)(p->left_edges, a); if (e) return e;
8165 }
8166 if (p->dimensions) {
8167 e = (*v)(p->dimensions, a); if (e) return e;
8168 }
8169 if (p->dx) {
8170 e = (*v)(p->dx, a); if (e) return e;
8171 }
8172 return 0;
8173 }
8174
__pyx_tp_clear_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid(PyObject * o)8175 static int __pyx_tp_clear_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid(PyObject *o) {
8176 PyObject* tmp;
8177 struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *p = (struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid *)o;
8178 tmp = ((PyObject*)p->child_indices);
8179 p->child_indices = Py_None; Py_INCREF(Py_None);
8180 Py_XDECREF(tmp);
8181 tmp = ((PyObject*)p->fields);
8182 p->fields = Py_None; Py_INCREF(Py_None);
8183 Py_XDECREF(tmp);
8184 tmp = ((PyObject*)p->left_edges);
8185 p->left_edges = Py_None; Py_INCREF(Py_None);
8186 Py_XDECREF(tmp);
8187 tmp = ((PyObject*)p->dimensions);
8188 p->dimensions = Py_None; Py_INCREF(Py_None);
8189 Py_XDECREF(tmp);
8190 tmp = ((PyObject*)p->dx);
8191 p->dx = Py_None; Py_INCREF(Py_None);
8192 Py_XDECREF(tmp);
8193 return 0;
8194 }
8195
__pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_child_indices(PyObject * o,CYTHON_UNUSED void * x)8196 static PyObject *__pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_child_indices(PyObject *o, CYTHON_UNUSED void *x) {
8197 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices_1__get__(o);
8198 }
8199
__pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_child_indices(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)8200 static int __pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_child_indices(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
8201 if (v) {
8202 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices_3__set__(o, v);
8203 }
8204 else {
8205 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_13child_indices_5__del__(o);
8206 }
8207 }
8208
__pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_fields(PyObject * o,CYTHON_UNUSED void * x)8209 static PyObject *__pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_fields(PyObject *o, CYTHON_UNUSED void *x) {
8210 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6fields_1__get__(o);
8211 }
8212
__pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_fields(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)8213 static int __pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_fields(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
8214 if (v) {
8215 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6fields_3__set__(o, v);
8216 }
8217 else {
8218 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6fields_5__del__(o);
8219 }
8220 }
8221
__pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_left_edges(PyObject * o,CYTHON_UNUSED void * x)8222 static PyObject *__pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_left_edges(PyObject *o, CYTHON_UNUSED void *x) {
8223 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10left_edges_1__get__(o);
8224 }
8225
__pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_left_edges(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)8226 static int __pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_left_edges(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
8227 if (v) {
8228 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10left_edges_3__set__(o, v);
8229 }
8230 else {
8231 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10left_edges_5__del__(o);
8232 }
8233 }
8234
__pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_dimensions(PyObject * o,CYTHON_UNUSED void * x)8235 static PyObject *__pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_dimensions(PyObject *o, CYTHON_UNUSED void *x) {
8236 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10dimensions_1__get__(o);
8237 }
8238
__pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_dimensions(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)8239 static int __pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_dimensions(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
8240 if (v) {
8241 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10dimensions_3__set__(o, v);
8242 }
8243 else {
8244 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_10dimensions_5__del__(o);
8245 }
8246 }
8247
__pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_dx(PyObject * o,CYTHON_UNUSED void * x)8248 static PyObject *__pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_dx(PyObject *o, CYTHON_UNUSED void *x) {
8249 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2dx_1__get__(o);
8250 }
8251
__pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_dx(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)8252 static int __pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_dx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
8253 if (v) {
8254 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2dx_3__set__(o, v);
8255 }
8256 else {
8257 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_2dx_5__del__(o);
8258 }
8259 }
8260
__pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_level(PyObject * o,CYTHON_UNUSED void * x)8261 static PyObject *__pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_level(PyObject *o, CYTHON_UNUSED void *x) {
8262 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_5level_1__get__(o);
8263 }
8264
__pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_level(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)8265 static int __pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_level(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
8266 if (v) {
8267 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_5level_3__set__(o, v);
8268 }
8269 else {
8270 PyErr_SetString(PyExc_NotImplementedError, "__del__");
8271 return -1;
8272 }
8273 }
8274
__pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_offset(PyObject * o,CYTHON_UNUSED void * x)8275 static PyObject *__pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_offset(PyObject *o, CYTHON_UNUSED void *x) {
8276 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6offset_1__get__(o);
8277 }
8278
__pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_offset(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)8279 static int __pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_offset(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
8280 if (v) {
8281 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_6offset_3__set__(o, v);
8282 }
8283 else {
8284 PyErr_SetString(PyExc_NotImplementedError, "__del__");
8285 return -1;
8286 }
8287 }
8288
8289 static PyMethodDef __pyx_methods_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid[] = {
8290 {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_3__reduce_cython__, METH_NOARGS, 0},
8291 {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_5__setstate_cython__, METH_O, 0},
8292 {0, 0, 0, 0}
8293 };
8294
8295 static struct PyGetSetDef __pyx_getsets_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid[] = {
8296 {(char *)"child_indices", __pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_child_indices, __pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_child_indices, (char *)0, 0},
8297 {(char *)"fields", __pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_fields, __pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_fields, (char *)0, 0},
8298 {(char *)"left_edges", __pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_left_edges, __pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_left_edges, (char *)0, 0},
8299 {(char *)"dimensions", __pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_dimensions, __pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_dimensions, (char *)0, 0},
8300 {(char *)"dx", __pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_dx, __pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_dx, (char *)0, 0},
8301 {(char *)"level", __pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_level, __pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_level, (char *)0, 0},
8302 {(char *)"offset", __pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_offset, __pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_10OctreeGrid_offset, (char *)0, 0},
8303 {0, 0, 0, 0, 0}
8304 };
8305
8306 static PyTypeObject __pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid = {
8307 PyVarObject_HEAD_INIT(0, 0)
8308 "yt.utilities.lib.depth_first_octree.OctreeGrid", /*tp_name*/
8309 sizeof(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid), /*tp_basicsize*/
8310 0, /*tp_itemsize*/
8311 __pyx_tp_dealloc_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid, /*tp_dealloc*/
8312 0, /*tp_print*/
8313 0, /*tp_getattr*/
8314 0, /*tp_setattr*/
8315 #if PY_MAJOR_VERSION < 3
8316 0, /*tp_compare*/
8317 #endif
8318 #if PY_MAJOR_VERSION >= 3
8319 0, /*tp_as_async*/
8320 #endif
8321 0, /*tp_repr*/
8322 0, /*tp_as_number*/
8323 0, /*tp_as_sequence*/
8324 0, /*tp_as_mapping*/
8325 0, /*tp_hash*/
8326 0, /*tp_call*/
8327 0, /*tp_str*/
8328 0, /*tp_getattro*/
8329 0, /*tp_setattro*/
8330 0, /*tp_as_buffer*/
8331 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
8332 0, /*tp_doc*/
8333 __pyx_tp_traverse_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid, /*tp_traverse*/
8334 __pyx_tp_clear_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid, /*tp_clear*/
8335 0, /*tp_richcompare*/
8336 0, /*tp_weaklistoffset*/
8337 0, /*tp_iter*/
8338 0, /*tp_iternext*/
8339 __pyx_methods_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid, /*tp_methods*/
8340 0, /*tp_members*/
8341 __pyx_getsets_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid, /*tp_getset*/
8342 0, /*tp_base*/
8343 0, /*tp_dict*/
8344 0, /*tp_descr_get*/
8345 0, /*tp_descr_set*/
8346 0, /*tp_dictoffset*/
8347 0, /*tp_init*/
8348 0, /*tp_alloc*/
8349 __pyx_tp_new_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid, /*tp_new*/
8350 0, /*tp_free*/
8351 0, /*tp_is_gc*/
8352 0, /*tp_bases*/
8353 0, /*tp_mro*/
8354 0, /*tp_cache*/
8355 0, /*tp_subclasses*/
8356 0, /*tp_weaklist*/
8357 0, /*tp_del*/
8358 0, /*tp_version_tag*/
8359 #if PY_VERSION_HEX >= 0x030400a1
8360 0, /*tp_finalize*/
8361 #endif
8362 #if PY_VERSION_HEX >= 0x030800b1
8363 0, /*tp_vectorcall*/
8364 #endif
8365 };
8366
__pyx_tp_new_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList(PyTypeObject * t,PyObject * a,PyObject * k)8367 static PyObject *__pyx_tp_new_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList(PyTypeObject *t, PyObject *a, PyObject *k) {
8368 struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *p;
8369 PyObject *o;
8370 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
8371 o = (*t->tp_alloc)(t, 0);
8372 } else {
8373 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
8374 }
8375 if (unlikely(!o)) return 0;
8376 p = ((struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *)o);
8377 p->grids = Py_None; Py_INCREF(Py_None);
8378 if (unlikely(__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_1__cinit__(o, a, k) < 0)) goto bad;
8379 return o;
8380 bad:
8381 Py_DECREF(o); o = 0;
8382 return NULL;
8383 }
8384
__pyx_tp_dealloc_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList(PyObject * o)8385 static void __pyx_tp_dealloc_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList(PyObject *o) {
8386 struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *p = (struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *)o;
8387 #if CYTHON_USE_TP_FINALIZE
8388 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
8389 if (PyObject_CallFinalizerFromDealloc(o)) return;
8390 }
8391 #endif
8392 PyObject_GC_UnTrack(o);
8393 Py_CLEAR(p->grids);
8394 (*Py_TYPE(o)->tp_free)(o);
8395 }
8396
__pyx_tp_traverse_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList(PyObject * o,visitproc v,void * a)8397 static int __pyx_tp_traverse_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList(PyObject *o, visitproc v, void *a) {
8398 int e;
8399 struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *p = (struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *)o;
8400 if (p->grids) {
8401 e = (*v)(p->grids, a); if (e) return e;
8402 }
8403 return 0;
8404 }
8405
__pyx_tp_clear_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList(PyObject * o)8406 static int __pyx_tp_clear_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList(PyObject *o) {
8407 PyObject* tmp;
8408 struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *p = (struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList *)o;
8409 tmp = ((PyObject*)p->grids);
8410 p->grids = Py_None; Py_INCREF(Py_None);
8411 Py_XDECREF(tmp);
8412 return 0;
8413 }
__pyx_sq_item_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList(PyObject * o,Py_ssize_t i)8414 static PyObject *__pyx_sq_item_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList(PyObject *o, Py_ssize_t i) {
8415 PyObject *r;
8416 PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
8417 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
8418 Py_DECREF(x);
8419 return r;
8420 }
8421
__pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_grids(PyObject * o,CYTHON_UNUSED void * x)8422 static PyObject *__pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_grids(PyObject *o, CYTHON_UNUSED void *x) {
8423 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids_1__get__(o);
8424 }
8425
__pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_grids(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)8426 static int __pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_grids(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
8427 if (v) {
8428 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids_3__set__(o, v);
8429 }
8430 else {
8431 return __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5grids_5__del__(o);
8432 }
8433 }
8434
8435 static PyMethodDef __pyx_methods_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList[] = {
8436 {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_5__reduce_cython__, METH_NOARGS, 0},
8437 {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_7__setstate_cython__, METH_O, 0},
8438 {0, 0, 0, 0}
8439 };
8440
8441 static struct PyGetSetDef __pyx_getsets_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList[] = {
8442 {(char *)"grids", __pyx_getprop_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_grids, __pyx_setprop_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_grids, (char *)0, 0},
8443 {0, 0, 0, 0, 0}
8444 };
8445
8446 static PySequenceMethods __pyx_tp_as_sequence_OctreeGridList = {
8447 0, /*sq_length*/
8448 0, /*sq_concat*/
8449 0, /*sq_repeat*/
8450 __pyx_sq_item_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList, /*sq_item*/
8451 0, /*sq_slice*/
8452 0, /*sq_ass_item*/
8453 0, /*sq_ass_slice*/
8454 0, /*sq_contains*/
8455 0, /*sq_inplace_concat*/
8456 0, /*sq_inplace_repeat*/
8457 };
8458
8459 static PyMappingMethods __pyx_tp_as_mapping_OctreeGridList = {
8460 0, /*mp_length*/
8461 __pyx_pw_2yt_9utilities_3lib_18depth_first_octree_14OctreeGridList_3__getitem__, /*mp_subscript*/
8462 0, /*mp_ass_subscript*/
8463 };
8464
8465 static PyTypeObject __pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList = {
8466 PyVarObject_HEAD_INIT(0, 0)
8467 "yt.utilities.lib.depth_first_octree.OctreeGridList", /*tp_name*/
8468 sizeof(struct __pyx_obj_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList), /*tp_basicsize*/
8469 0, /*tp_itemsize*/
8470 __pyx_tp_dealloc_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList, /*tp_dealloc*/
8471 0, /*tp_print*/
8472 0, /*tp_getattr*/
8473 0, /*tp_setattr*/
8474 #if PY_MAJOR_VERSION < 3
8475 0, /*tp_compare*/
8476 #endif
8477 #if PY_MAJOR_VERSION >= 3
8478 0, /*tp_as_async*/
8479 #endif
8480 0, /*tp_repr*/
8481 0, /*tp_as_number*/
8482 &__pyx_tp_as_sequence_OctreeGridList, /*tp_as_sequence*/
8483 &__pyx_tp_as_mapping_OctreeGridList, /*tp_as_mapping*/
8484 0, /*tp_hash*/
8485 0, /*tp_call*/
8486 0, /*tp_str*/
8487 0, /*tp_getattro*/
8488 0, /*tp_setattro*/
8489 0, /*tp_as_buffer*/
8490 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
8491 0, /*tp_doc*/
8492 __pyx_tp_traverse_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList, /*tp_traverse*/
8493 __pyx_tp_clear_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList, /*tp_clear*/
8494 0, /*tp_richcompare*/
8495 0, /*tp_weaklistoffset*/
8496 0, /*tp_iter*/
8497 0, /*tp_iternext*/
8498 __pyx_methods_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList, /*tp_methods*/
8499 0, /*tp_members*/
8500 __pyx_getsets_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList, /*tp_getset*/
8501 0, /*tp_base*/
8502 0, /*tp_dict*/
8503 0, /*tp_descr_get*/
8504 0, /*tp_descr_set*/
8505 0, /*tp_dictoffset*/
8506 0, /*tp_init*/
8507 0, /*tp_alloc*/
8508 __pyx_tp_new_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList, /*tp_new*/
8509 0, /*tp_free*/
8510 0, /*tp_is_gc*/
8511 0, /*tp_bases*/
8512 0, /*tp_mro*/
8513 0, /*tp_cache*/
8514 0, /*tp_subclasses*/
8515 0, /*tp_weaklist*/
8516 0, /*tp_del*/
8517 0, /*tp_version_tag*/
8518 #if PY_VERSION_HEX >= 0x030400a1
8519 0, /*tp_finalize*/
8520 #endif
8521 #if PY_VERSION_HEX >= 0x030800b1
8522 0, /*tp_vectorcall*/
8523 #endif
8524 };
8525
8526 static PyMethodDef __pyx_methods[] = {
8527 {0, 0, 0, 0}
8528 };
8529
8530 #if PY_MAJOR_VERSION >= 3
8531 #if CYTHON_PEP489_MULTI_PHASE_INIT
8532 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
8533 static int __pyx_pymod_exec_depth_first_octree(PyObject* module); /*proto*/
8534 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
8535 {Py_mod_create, (void*)__pyx_pymod_create},
8536 {Py_mod_exec, (void*)__pyx_pymod_exec_depth_first_octree},
8537 {0, NULL}
8538 };
8539 #endif
8540
8541 static struct PyModuleDef __pyx_moduledef = {
8542 PyModuleDef_HEAD_INIT,
8543 "depth_first_octree",
8544 __pyx_k_This_is_a_recursive_function_to, /* m_doc */
8545 #if CYTHON_PEP489_MULTI_PHASE_INIT
8546 0, /* m_size */
8547 #else
8548 -1, /* m_size */
8549 #endif
8550 __pyx_methods /* m_methods */,
8551 #if CYTHON_PEP489_MULTI_PHASE_INIT
8552 __pyx_moduledef_slots, /* m_slots */
8553 #else
8554 NULL, /* m_reload */
8555 #endif
8556 NULL, /* m_traverse */
8557 NULL, /* m_clear */
8558 NULL /* m_free */
8559 };
8560 #endif
8561 #ifndef CYTHON_SMALL_CODE
8562 #if defined(__clang__)
8563 #define CYTHON_SMALL_CODE
8564 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
8565 #define CYTHON_SMALL_CODE __attribute__((cold))
8566 #else
8567 #define CYTHON_SMALL_CODE
8568 #endif
8569 #endif
8570
8571 static __Pyx_StringTabEntry __pyx_string_tab[] = {
8572 {&__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},
8573 {&__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},
8574 {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
8575 {&__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},
8576 {&__pyx_n_s_OctreeGrid, __pyx_k_OctreeGrid, sizeof(__pyx_k_OctreeGrid), 0, 0, 1, 1},
8577 {&__pyx_n_s_OctreeGridList, __pyx_k_OctreeGridList, sizeof(__pyx_k_OctreeGridList), 0, 0, 1, 1},
8578 {&__pyx_n_s_RecurseOctreeByLevels, __pyx_k_RecurseOctreeByLevels, sizeof(__pyx_k_RecurseOctreeByLevels), 0, 0, 1, 1},
8579 {&__pyx_n_s_RecurseOctreeDepthFirst, __pyx_k_RecurseOctreeDepthFirst, sizeof(__pyx_k_RecurseOctreeDepthFirst), 0, 0, 1, 1},
8580 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
8581 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
8582 {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
8583 {&__pyx_n_s_child_dx, __pyx_k_child_dx, sizeof(__pyx_k_child_dx), 0, 0, 1, 1},
8584 {&__pyx_n_s_child_grid, __pyx_k_child_grid, sizeof(__pyx_k_child_grid), 0, 0, 1, 1},
8585 {&__pyx_n_s_child_i, __pyx_k_child_i, sizeof(__pyx_k_child_i), 0, 0, 1, 1},
8586 {&__pyx_n_s_child_indices, __pyx_k_child_indices, sizeof(__pyx_k_child_indices), 0, 0, 1, 1},
8587 {&__pyx_n_s_child_j, __pyx_k_child_j, sizeof(__pyx_k_child_j), 0, 0, 1, 1},
8588 {&__pyx_n_s_child_k, __pyx_k_child_k, sizeof(__pyx_k_child_k), 0, 0, 1, 1},
8589 {&__pyx_n_s_child_leftedges, __pyx_k_child_leftedges, sizeof(__pyx_k_child_leftedges), 0, 0, 1, 1},
8590 {&__pyx_n_s_ci, __pyx_k_ci, sizeof(__pyx_k_ci), 0, 0, 1, 1},
8591 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
8592 {&__pyx_n_s_corners, __pyx_k_corners, sizeof(__pyx_k_corners), 0, 0, 1, 1},
8593 {&__pyx_n_s_cp, __pyx_k_cp, sizeof(__pyx_k_cp), 0, 0, 1, 1},
8594 {&__pyx_n_s_curpos, __pyx_k_curpos, sizeof(__pyx_k_curpos), 0, 0, 1, 1},
8595 {&__pyx_n_s_cx, __pyx_k_cx, sizeof(__pyx_k_cx), 0, 0, 1, 1},
8596 {&__pyx_n_s_cy, __pyx_k_cy, sizeof(__pyx_k_cy), 0, 0, 1, 1},
8597 {&__pyx_n_s_cz, __pyx_k_cz, sizeof(__pyx_k_cz), 0, 0, 1, 1},
8598 {&__pyx_n_s_dimensions, __pyx_k_dimensions, sizeof(__pyx_k_dimensions), 0, 0, 1, 1},
8599 {&__pyx_n_s_dx, __pyx_k_dx, sizeof(__pyx_k_dx), 0, 0, 1, 1},
8600 {&__pyx_n_s_fi, __pyx_k_fi, sizeof(__pyx_k_fi), 0, 0, 1, 1},
8601 {&__pyx_n_s_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 0, 0, 1, 1},
8602 {&__pyx_n_s_genealogy, __pyx_k_genealogy, sizeof(__pyx_k_genealogy), 0, 0, 1, 1},
8603 {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
8604 {&__pyx_n_s_gi, __pyx_k_gi, sizeof(__pyx_k_gi), 0, 0, 1, 1},
8605 {&__pyx_n_s_grid, __pyx_k_grid, sizeof(__pyx_k_grid), 0, 0, 1, 1},
8606 {&__pyx_n_s_grids, __pyx_k_grids, sizeof(__pyx_k_grids), 0, 0, 1, 1},
8607 {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
8608 {&__pyx_n_s_i_f, __pyx_k_i_f, sizeof(__pyx_k_i_f), 0, 0, 1, 1},
8609 {&__pyx_n_s_i_i, __pyx_k_i_i, sizeof(__pyx_k_i_i), 0, 0, 1, 1},
8610 {&__pyx_n_s_i_off, __pyx_k_i_off, sizeof(__pyx_k_i_off), 0, 0, 1, 1},
8611 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
8612 {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
8613 {&__pyx_n_s_j_f, __pyx_k_j_f, sizeof(__pyx_k_j_f), 0, 0, 1, 1},
8614 {&__pyx_n_s_j_i, __pyx_k_j_i, sizeof(__pyx_k_j_i), 0, 0, 1, 1},
8615 {&__pyx_n_s_j_off, __pyx_k_j_off, sizeof(__pyx_k_j_off), 0, 0, 1, 1},
8616 {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
8617 {&__pyx_n_s_k_f, __pyx_k_k_f, sizeof(__pyx_k_k_f), 0, 0, 1, 1},
8618 {&__pyx_n_s_k_i, __pyx_k_k_i, sizeof(__pyx_k_k_i), 0, 0, 1, 1},
8619 {&__pyx_n_s_k_off, __pyx_k_k_off, sizeof(__pyx_k_k_off), 0, 0, 1, 1},
8620 {&__pyx_n_s_left_edges, __pyx_k_left_edges, sizeof(__pyx_k_left_edges), 0, 0, 1, 1},
8621 {&__pyx_n_s_leftedges, __pyx_k_leftedges, sizeof(__pyx_k_leftedges), 0, 0, 1, 1},
8622 {&__pyx_n_s_level, __pyx_k_level, sizeof(__pyx_k_level), 0, 0, 1, 1},
8623 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
8624 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
8625 {&__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},
8626 {&__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},
8627 {&__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},
8628 {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
8629 {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
8630 {&__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},
8631 {&__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},
8632 {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
8633 {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1},
8634 {&__pyx_n_s_position, __pyx_k_position, sizeof(__pyx_k_position), 0, 0, 1, 1},
8635 {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
8636 {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
8637 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
8638 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
8639 {&__pyx_n_s_refined, __pyx_k_refined, sizeof(__pyx_k_refined), 0, 0, 1, 1},
8640 {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
8641 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
8642 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
8643 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
8644 {&__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},
8645 {&__pyx_kp_s_yt_utilities_lib_depth_first_oct, __pyx_k_yt_utilities_lib_depth_first_oct, sizeof(__pyx_k_yt_utilities_lib_depth_first_oct), 0, 0, 1, 0},
8646 {&__pyx_n_s_yt_utilities_lib_depth_first_oct_2, __pyx_k_yt_utilities_lib_depth_first_oct_2, sizeof(__pyx_k_yt_utilities_lib_depth_first_oct_2), 0, 0, 1, 1},
8647 {0, 0, 0, 0, 0, 0, 0}
8648 };
__Pyx_InitCachedBuiltins(void)8649 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
8650 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error)
8651 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 72, __pyx_L1_error)
8652 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 272, __pyx_L1_error)
8653 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 856, __pyx_L1_error)
8654 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1038, __pyx_L1_error)
8655 return 0;
8656 __pyx_L1_error:;
8657 return -1;
8658 }
8659
__Pyx_InitCachedConstants(void)8660 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
8661 __Pyx_RefNannyDeclarations
8662 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
8663
8664 /* "(tree fragment)":2
8665 * def __reduce_cython__(self):
8666 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8667 * def __setstate_cython__(self, __pyx_state):
8668 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8669 */
8670 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 2, __pyx_L1_error)
8671 __Pyx_GOTREF(__pyx_tuple_);
8672 __Pyx_GIVEREF(__pyx_tuple_);
8673
8674 /* "(tree fragment)":4
8675 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8676 * def __setstate_cython__(self, __pyx_state):
8677 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8678 */
8679 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4, __pyx_L1_error)
8680 __Pyx_GOTREF(__pyx_tuple__2);
8681 __Pyx_GIVEREF(__pyx_tuple__2);
8682
8683 /* "(tree fragment)":2
8684 * def __reduce_cython__(self):
8685 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8686 * def __setstate_cython__(self, __pyx_state):
8687 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8688 */
8689 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 2, __pyx_L1_error)
8690 __Pyx_GOTREF(__pyx_tuple__3);
8691 __Pyx_GIVEREF(__pyx_tuple__3);
8692
8693 /* "(tree fragment)":4
8694 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8695 * def __setstate_cython__(self, __pyx_state):
8696 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8697 */
8698 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 4, __pyx_L1_error)
8699 __Pyx_GOTREF(__pyx_tuple__4);
8700 __Pyx_GIVEREF(__pyx_tuple__4);
8701
8702 /* "(tree fragment)":2
8703 * def __reduce_cython__(self):
8704 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8705 * def __setstate_cython__(self, __pyx_state):
8706 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8707 */
8708 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 2, __pyx_L1_error)
8709 __Pyx_GOTREF(__pyx_tuple__5);
8710 __Pyx_GIVEREF(__pyx_tuple__5);
8711
8712 /* "(tree fragment)":4
8713 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8714 * def __setstate_cython__(self, __pyx_state):
8715 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8716 */
8717 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 4, __pyx_L1_error)
8718 __Pyx_GOTREF(__pyx_tuple__6);
8719 __Pyx_GIVEREF(__pyx_tuple__6);
8720
8721 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
8722 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
8723 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
8724 * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
8725 *
8726 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
8727 */
8728 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 272, __pyx_L1_error)
8729 __Pyx_GOTREF(__pyx_tuple__7);
8730 __Pyx_GIVEREF(__pyx_tuple__7);
8731
8732 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
8733 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
8734 * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
8735 * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
8736 *
8737 * info.buf = PyArray_DATA(self)
8738 */
8739 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 276, __pyx_L1_error)
8740 __Pyx_GOTREF(__pyx_tuple__8);
8741 __Pyx_GIVEREF(__pyx_tuple__8);
8742
8743 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
8744 * if ((descr.byteorder == c'>' and little_endian) or
8745 * (descr.byteorder == c'<' and not little_endian)):
8746 * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
8747 * if t == NPY_BYTE: f = "b"
8748 * elif t == NPY_UBYTE: f = "B"
8749 */
8750 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 306, __pyx_L1_error)
8751 __Pyx_GOTREF(__pyx_tuple__9);
8752 __Pyx_GIVEREF(__pyx_tuple__9);
8753
8754 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
8755 *
8756 * if (end - f) - <int>(new_offset - offset[0]) < 15:
8757 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
8758 *
8759 * if ((child.byteorder == c'>' and little_endian) or
8760 */
8761 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 856, __pyx_L1_error)
8762 __Pyx_GOTREF(__pyx_tuple__10);
8763 __Pyx_GIVEREF(__pyx_tuple__10);
8764
8765 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
8766 * t = child.type_num
8767 * if end - f < 5:
8768 * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
8769 *
8770 * # Until ticket #99 is fixed, use integers to avoid warnings
8771 */
8772 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 880, __pyx_L1_error)
8773 __Pyx_GOTREF(__pyx_tuple__11);
8774 __Pyx_GIVEREF(__pyx_tuple__11);
8775
8776 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
8777 * _import_array()
8778 * except Exception:
8779 * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
8780 *
8781 * cdef inline int import_umath() except -1:
8782 */
8783 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 1038, __pyx_L1_error)
8784 __Pyx_GOTREF(__pyx_tuple__12);
8785 __Pyx_GIVEREF(__pyx_tuple__12);
8786
8787 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
8788 * _import_umath()
8789 * except Exception:
8790 * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
8791 *
8792 * cdef inline int import_ufunc() except -1:
8793 */
8794 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 1044, __pyx_L1_error)
8795 __Pyx_GOTREF(__pyx_tuple__13);
8796 __Pyx_GIVEREF(__pyx_tuple__13);
8797
8798 /* "yt/utilities/lib/depth_first_octree.pyx":50
8799 *
8800 * @cython.boundscheck(False)
8801 * def RecurseOctreeDepthFirst(int i_i, int j_i, int k_i, # <<<<<<<<<<<<<<
8802 * int i_f, int j_f, int k_f,
8803 * position curpos, int gi,
8804 */
8805 __pyx_tuple__14 = PyTuple_Pack(32, __pyx_n_s_i_i, __pyx_n_s_j_i, __pyx_n_s_k_i, __pyx_n_s_i_f, __pyx_n_s_j_f, __pyx_n_s_k_f, __pyx_n_s_curpos, __pyx_n_s_gi, __pyx_n_s_output, __pyx_n_s_refined, __pyx_n_s_grids, __pyx_n_s_i, __pyx_n_s_i_off, __pyx_n_s_j, __pyx_n_s_j_off, __pyx_n_s_k, __pyx_n_s_k_off, __pyx_n_s_ci, __pyx_n_s_fi, __pyx_n_s_child_i, __pyx_n_s_child_j, __pyx_n_s_child_k, __pyx_n_s_child_grid, __pyx_n_s_grid, __pyx_n_s_fields, __pyx_n_s_leftedges, __pyx_n_s_dx, __pyx_n_s_child_dx, __pyx_n_s_child_leftedges, __pyx_n_s_cx, __pyx_n_s_cy, __pyx_n_s_cz); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 50, __pyx_L1_error)
8806 __Pyx_GOTREF(__pyx_tuple__14);
8807 __Pyx_GIVEREF(__pyx_tuple__14);
8808 __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(11, 0, 32, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_depth_first_oct, __pyx_n_s_RecurseOctreeDepthFirst, 50, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(1, 50, __pyx_L1_error)
8809
8810 /* "yt/utilities/lib/depth_first_octree.pyx":102
8811 *
8812 * @cython.boundscheck(False)
8813 * def RecurseOctreeByLevels(int i_i, int j_i, int k_i, # <<<<<<<<<<<<<<
8814 * int i_f, int j_f, int k_f,
8815 * np.ndarray[np.int32_t, ndim=1] curpos,
8816 */
8817 __pyx_tuple__16 = PyTuple_Pack(37, __pyx_n_s_i_i, __pyx_n_s_j_i, __pyx_n_s_k_i, __pyx_n_s_i_f, __pyx_n_s_j_f, __pyx_n_s_k_f, __pyx_n_s_curpos, __pyx_n_s_gi, __pyx_n_s_output, __pyx_n_s_genealogy, __pyx_n_s_corners, __pyx_n_s_grids, __pyx_n_s_i, __pyx_n_s_i_off, __pyx_n_s_j, __pyx_n_s_j_off, __pyx_n_s_k, __pyx_n_s_k_off, __pyx_n_s_ci, __pyx_n_s_fi, __pyx_n_s_child_i, __pyx_n_s_child_j, __pyx_n_s_child_k, __pyx_n_s_child_grid, __pyx_n_s_grid, __pyx_n_s_level, __pyx_n_s_child_indices, __pyx_n_s_fields, __pyx_n_s_leftedges, __pyx_n_s_dx, __pyx_n_s_child_dx, __pyx_n_s_child_leftedges, __pyx_n_s_cx, __pyx_n_s_cy, __pyx_n_s_cz, __pyx_n_s_cp, __pyx_n_s_s); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 102, __pyx_L1_error)
8818 __Pyx_GOTREF(__pyx_tuple__16);
8819 __Pyx_GIVEREF(__pyx_tuple__16);
8820 __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(12, 0, 37, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_utilities_lib_depth_first_oct, __pyx_n_s_RecurseOctreeByLevels, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(1, 102, __pyx_L1_error)
8821 __Pyx_RefNannyFinishContext();
8822 return 0;
8823 __pyx_L1_error:;
8824 __Pyx_RefNannyFinishContext();
8825 return -1;
8826 }
8827
__Pyx_InitGlobals(void)8828 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
8829 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 2, __pyx_L1_error);
8830 __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(1, 2, __pyx_L1_error)
8831 __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(1, 2, __pyx_L1_error)
8832 return 0;
8833 __pyx_L1_error:;
8834 return -1;
8835 }
8836
8837 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
8838 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
8839 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
8840 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
8841 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
8842 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
8843 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
8844
__Pyx_modinit_global_init_code(void)8845 static int __Pyx_modinit_global_init_code(void) {
8846 __Pyx_RefNannyDeclarations
8847 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
8848 /*--- Global init code ---*/
8849 __Pyx_RefNannyFinishContext();
8850 return 0;
8851 }
8852
__Pyx_modinit_variable_export_code(void)8853 static int __Pyx_modinit_variable_export_code(void) {
8854 __Pyx_RefNannyDeclarations
8855 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
8856 /*--- Variable export code ---*/
8857 __Pyx_RefNannyFinishContext();
8858 return 0;
8859 }
8860
__Pyx_modinit_function_export_code(void)8861 static int __Pyx_modinit_function_export_code(void) {
8862 __Pyx_RefNannyDeclarations
8863 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
8864 /*--- Function export code ---*/
8865 __Pyx_RefNannyFinishContext();
8866 return 0;
8867 }
8868
__Pyx_modinit_type_init_code(void)8869 static int __Pyx_modinit_type_init_code(void) {
8870 __Pyx_RefNannyDeclarations
8871 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
8872 /*--- Type init code ---*/
8873 if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_18depth_first_octree_position) < 0) __PYX_ERR(1, 17, __pyx_L1_error)
8874 #if PY_VERSION_HEX < 0x030800B1
8875 __pyx_type_2yt_9utilities_3lib_18depth_first_octree_position.tp_print = 0;
8876 #endif
8877 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2yt_9utilities_3lib_18depth_first_octree_position.tp_dictoffset && __pyx_type_2yt_9utilities_3lib_18depth_first_octree_position.tp_getattro == PyObject_GenericGetAttr)) {
8878 __pyx_type_2yt_9utilities_3lib_18depth_first_octree_position.tp_getattro = __Pyx_PyObject_GenericGetAttr;
8879 }
8880 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_position, (PyObject *)&__pyx_type_2yt_9utilities_3lib_18depth_first_octree_position) < 0) __PYX_ERR(1, 17, __pyx_L1_error)
8881 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_18depth_first_octree_position) < 0) __PYX_ERR(1, 17, __pyx_L1_error)
8882 __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_position = &__pyx_type_2yt_9utilities_3lib_18depth_first_octree_position;
8883 if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid) < 0) __PYX_ERR(1, 23, __pyx_L1_error)
8884 #if PY_VERSION_HEX < 0x030800B1
8885 __pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid.tp_print = 0;
8886 #endif
8887 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid.tp_dictoffset && __pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid.tp_getattro == PyObject_GenericGetAttr)) {
8888 __pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid.tp_getattro = __Pyx_PyObject_GenericGetAttr;
8889 }
8890 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_OctreeGrid, (PyObject *)&__pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid) < 0) __PYX_ERR(1, 23, __pyx_L1_error)
8891 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid) < 0) __PYX_ERR(1, 23, __pyx_L1_error)
8892 __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid = &__pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGrid;
8893 if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList) < 0) __PYX_ERR(1, 41, __pyx_L1_error)
8894 #if PY_VERSION_HEX < 0x030800B1
8895 __pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList.tp_print = 0;
8896 #endif
8897 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList.tp_dictoffset && __pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList.tp_getattro == PyObject_GenericGetAttr)) {
8898 __pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList.tp_getattro = __Pyx_PyObject_GenericGetAttr;
8899 }
8900 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_OctreeGridList, (PyObject *)&__pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList) < 0) __PYX_ERR(1, 41, __pyx_L1_error)
8901 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList) < 0) __PYX_ERR(1, 41, __pyx_L1_error)
8902 __pyx_ptype_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList = &__pyx_type_2yt_9utilities_3lib_18depth_first_octree_OctreeGridList;
8903 __Pyx_RefNannyFinishContext();
8904 return 0;
8905 __pyx_L1_error:;
8906 __Pyx_RefNannyFinishContext();
8907 return -1;
8908 }
8909
__Pyx_modinit_type_import_code(void)8910 static int __Pyx_modinit_type_import_code(void) {
8911 __Pyx_RefNannyDeclarations
8912 PyObject *__pyx_t_1 = NULL;
8913 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
8914 /*--- Type import code ---*/
8915 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
8916 __Pyx_GOTREF(__pyx_t_1);
8917 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
8918 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8919 sizeof(PyTypeObject),
8920 #else
8921 sizeof(PyHeapTypeObject),
8922 #endif
8923 __Pyx_ImportType_CheckSize_Warn);
8924 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
8925 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8926 __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 206, __pyx_L1_error)
8927 __Pyx_GOTREF(__pyx_t_1);
8928 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
8929 if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 206, __pyx_L1_error)
8930 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
8931 if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 229, __pyx_L1_error)
8932 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
8933 if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 233, __pyx_L1_error)
8934 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
8935 if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 242, __pyx_L1_error)
8936 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
8937 if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 918, __pyx_L1_error)
8938 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8939 __Pyx_RefNannyFinishContext();
8940 return 0;
8941 __pyx_L1_error:;
8942 __Pyx_XDECREF(__pyx_t_1);
8943 __Pyx_RefNannyFinishContext();
8944 return -1;
8945 }
8946
__Pyx_modinit_variable_import_code(void)8947 static int __Pyx_modinit_variable_import_code(void) {
8948 __Pyx_RefNannyDeclarations
8949 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
8950 /*--- Variable import code ---*/
8951 __Pyx_RefNannyFinishContext();
8952 return 0;
8953 }
8954
__Pyx_modinit_function_import_code(void)8955 static int __Pyx_modinit_function_import_code(void) {
8956 __Pyx_RefNannyDeclarations
8957 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
8958 /*--- Function import code ---*/
8959 __Pyx_RefNannyFinishContext();
8960 return 0;
8961 }
8962
8963
8964 #if PY_MAJOR_VERSION < 3
8965 #ifdef CYTHON_NO_PYINIT_EXPORT
8966 #define __Pyx_PyMODINIT_FUNC void
8967 #else
8968 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
8969 #endif
8970 #else
8971 #ifdef CYTHON_NO_PYINIT_EXPORT
8972 #define __Pyx_PyMODINIT_FUNC PyObject *
8973 #else
8974 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
8975 #endif
8976 #endif
8977
8978
8979 #if PY_MAJOR_VERSION < 3
8980 __Pyx_PyMODINIT_FUNC initdepth_first_octree(void) CYTHON_SMALL_CODE; /*proto*/
initdepth_first_octree(void)8981 __Pyx_PyMODINIT_FUNC initdepth_first_octree(void)
8982 #else
8983 __Pyx_PyMODINIT_FUNC PyInit_depth_first_octree(void) CYTHON_SMALL_CODE; /*proto*/
8984 __Pyx_PyMODINIT_FUNC PyInit_depth_first_octree(void)
8985 #if CYTHON_PEP489_MULTI_PHASE_INIT
8986 {
8987 return PyModuleDef_Init(&__pyx_moduledef);
8988 }
8989 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
8990 #if PY_VERSION_HEX >= 0x030700A1
8991 static PY_INT64_T main_interpreter_id = -1;
8992 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
8993 if (main_interpreter_id == -1) {
8994 main_interpreter_id = current_id;
8995 return (unlikely(current_id == -1)) ? -1 : 0;
8996 } else if (unlikely(main_interpreter_id != current_id))
8997 #else
8998 static PyInterpreterState *main_interpreter = NULL;
8999 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
9000 if (!main_interpreter) {
9001 main_interpreter = current_interpreter;
9002 } else if (unlikely(main_interpreter != current_interpreter))
9003 #endif
9004 {
9005 PyErr_SetString(
9006 PyExc_ImportError,
9007 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
9008 return -1;
9009 }
9010 return 0;
9011 }
9012 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) {
9013 PyObject *value = PyObject_GetAttrString(spec, from_name);
9014 int result = 0;
9015 if (likely(value)) {
9016 if (allow_none || value != Py_None) {
9017 result = PyDict_SetItemString(moddict, to_name, value);
9018 }
9019 Py_DECREF(value);
9020 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
9021 PyErr_Clear();
9022 } else {
9023 result = -1;
9024 }
9025 return result;
9026 }
9027 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
9028 PyObject *module = NULL, *moddict, *modname;
9029 if (__Pyx_check_single_interpreter())
9030 return NULL;
9031 if (__pyx_m)
9032 return __Pyx_NewRef(__pyx_m);
9033 modname = PyObject_GetAttrString(spec, "name");
9034 if (unlikely(!modname)) goto bad;
9035 module = PyModule_NewObject(modname);
9036 Py_DECREF(modname);
9037 if (unlikely(!module)) goto bad;
9038 moddict = PyModule_GetDict(module);
9039 if (unlikely(!moddict)) goto bad;
9040 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
9041 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
9042 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
9043 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
9044 return module;
9045 bad:
9046 Py_XDECREF(module);
9047 return NULL;
9048 }
9049
9050
9051 static CYTHON_SMALL_CODE int __pyx_pymod_exec_depth_first_octree(PyObject *__pyx_pyinit_module)
9052 #endif
9053 #endif
9054 {
9055 PyObject *__pyx_t_1 = NULL;
9056 __Pyx_RefNannyDeclarations
9057 #if CYTHON_PEP489_MULTI_PHASE_INIT
9058 if (__pyx_m) {
9059 if (__pyx_m == __pyx_pyinit_module) return 0;
9060 PyErr_SetString(PyExc_RuntimeError, "Module 'depth_first_octree' has already been imported. Re-initialisation is not supported.");
9061 return -1;
9062 }
9063 #elif PY_MAJOR_VERSION >= 3
9064 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
9065 #endif
9066 #if CYTHON_REFNANNY
9067 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
9068 if (!__Pyx_RefNanny) {
9069 PyErr_Clear();
9070 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
9071 if (!__Pyx_RefNanny)
9072 Py_FatalError("failed to import 'refnanny' module");
9073 }
9074 #endif
9075 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_depth_first_octree(void)", 0);
9076 if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 2, __pyx_L1_error)
9077 #ifdef __Pxy_PyFrame_Initialize_Offsets
9078 __Pxy_PyFrame_Initialize_Offsets();
9079 #endif
9080 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 2, __pyx_L1_error)
9081 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 2, __pyx_L1_error)
9082 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 2, __pyx_L1_error)
9083 #ifdef __Pyx_CyFunction_USED
9084 if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 2, __pyx_L1_error)
9085 #endif
9086 #ifdef __Pyx_FusedFunction_USED
9087 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 2, __pyx_L1_error)
9088 #endif
9089 #ifdef __Pyx_Coroutine_USED
9090 if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 2, __pyx_L1_error)
9091 #endif
9092 #ifdef __Pyx_Generator_USED
9093 if (__pyx_Generator_init() < 0) __PYX_ERR(1, 2, __pyx_L1_error)
9094 #endif
9095 #ifdef __Pyx_AsyncGen_USED
9096 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(1, 2, __pyx_L1_error)
9097 #endif
9098 #ifdef __Pyx_StopAsyncIteration_USED
9099 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 2, __pyx_L1_error)
9100 #endif
9101 /*--- Library function declarations ---*/
9102 /*--- Threads initialization code ---*/
9103 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
9104 #ifdef WITH_THREAD /* Python build with threading support? */
9105 PyEval_InitThreads();
9106 #endif
9107 #endif
9108 /*--- Module creation code ---*/
9109 #if CYTHON_PEP489_MULTI_PHASE_INIT
9110 __pyx_m = __pyx_pyinit_module;
9111 Py_INCREF(__pyx_m);
9112 #else
9113 #if PY_MAJOR_VERSION < 3
9114 __pyx_m = Py_InitModule4("depth_first_octree", __pyx_methods, __pyx_k_This_is_a_recursive_function_to, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
9115 #else
9116 __pyx_m = PyModule_Create(&__pyx_moduledef);
9117 #endif
9118 if (unlikely(!__pyx_m)) __PYX_ERR(1, 2, __pyx_L1_error)
9119 #endif
9120 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 2, __pyx_L1_error)
9121 Py_INCREF(__pyx_d);
9122 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 2, __pyx_L1_error)
9123 Py_INCREF(__pyx_b);
9124 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 2, __pyx_L1_error)
9125 Py_INCREF(__pyx_cython_runtime);
9126 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 2, __pyx_L1_error);
9127 /*--- Initialize various global constants etc. ---*/
9128 if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 2, __pyx_L1_error)
9129 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
9130 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 2, __pyx_L1_error)
9131 #endif
9132 if (__pyx_module_is_main_yt__utilities__lib__depth_first_octree) {
9133 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(1, 2, __pyx_L1_error)
9134 }
9135 #if PY_MAJOR_VERSION >= 3
9136 {
9137 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 2, __pyx_L1_error)
9138 if (!PyDict_GetItemString(modules, "yt.utilities.lib.depth_first_octree")) {
9139 if (unlikely(PyDict_SetItemString(modules, "yt.utilities.lib.depth_first_octree", __pyx_m) < 0)) __PYX_ERR(1, 2, __pyx_L1_error)
9140 }
9141 }
9142 #endif
9143 /*--- Builtin init code ---*/
9144 if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
9145 /*--- Constants init code ---*/
9146 if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
9147 /*--- Global type/function init code ---*/
9148 (void)__Pyx_modinit_global_init_code();
9149 (void)__Pyx_modinit_variable_export_code();
9150 (void)__Pyx_modinit_function_export_code();
9151 if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
9152 if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
9153 (void)__Pyx_modinit_variable_import_code();
9154 (void)__Pyx_modinit_function_import_code();
9155 /*--- Execution code ---*/
9156 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
9157 if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 2, __pyx_L1_error)
9158 #endif
9159
9160 /* "yt/utilities/lib/depth_first_octree.pyx":11
9161 *
9162 *
9163 * import numpy as np # <<<<<<<<<<<<<<
9164 *
9165 * cimport cython
9166 */
9167 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error)
9168 __Pyx_GOTREF(__pyx_t_1);
9169 if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(1, 11, __pyx_L1_error)
9170 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9171
9172 /* "yt/utilities/lib/depth_first_octree.pyx":50
9173 *
9174 * @cython.boundscheck(False)
9175 * def RecurseOctreeDepthFirst(int i_i, int j_i, int k_i, # <<<<<<<<<<<<<<
9176 * int i_f, int j_f, int k_f,
9177 * position curpos, int gi,
9178 */
9179 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_18depth_first_octree_1RecurseOctreeDepthFirst, NULL, __pyx_n_s_yt_utilities_lib_depth_first_oct_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 50, __pyx_L1_error)
9180 __Pyx_GOTREF(__pyx_t_1);
9181 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RecurseOctreeDepthFirst, __pyx_t_1) < 0) __PYX_ERR(1, 50, __pyx_L1_error)
9182 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9183
9184 /* "yt/utilities/lib/depth_first_octree.pyx":102
9185 *
9186 * @cython.boundscheck(False)
9187 * def RecurseOctreeByLevels(int i_i, int j_i, int k_i, # <<<<<<<<<<<<<<
9188 * int i_f, int j_f, int k_f,
9189 * np.ndarray[np.int32_t, ndim=1] curpos,
9190 */
9191 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2yt_9utilities_3lib_18depth_first_octree_3RecurseOctreeByLevels, NULL, __pyx_n_s_yt_utilities_lib_depth_first_oct_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 102, __pyx_L1_error)
9192 __Pyx_GOTREF(__pyx_t_1);
9193 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RecurseOctreeByLevels, __pyx_t_1) < 0) __PYX_ERR(1, 102, __pyx_L1_error)
9194 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9195
9196 /* "yt/utilities/lib/depth_first_octree.pyx":2
9197 *
9198 * # distutils: libraries = STD_LIBS # <<<<<<<<<<<<<<
9199 * """
9200 * This is a recursive function to return a depth-first octree
9201 */
9202 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
9203 __Pyx_GOTREF(__pyx_t_1);
9204 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(1, 2, __pyx_L1_error)
9205 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9206
9207 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
9208 * raise ImportError("numpy.core.umath failed to import")
9209 *
9210 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
9211 * try:
9212 * _import_umath()
9213 */
9214
9215 /*--- Wrapped vars code ---*/
9216
9217 goto __pyx_L0;
9218 __pyx_L1_error:;
9219 __Pyx_XDECREF(__pyx_t_1);
9220 if (__pyx_m) {
9221 if (__pyx_d) {
9222 __Pyx_AddTraceback("init yt.utilities.lib.depth_first_octree", __pyx_clineno, __pyx_lineno, __pyx_filename);
9223 }
9224 Py_CLEAR(__pyx_m);
9225 } else if (!PyErr_Occurred()) {
9226 PyErr_SetString(PyExc_ImportError, "init yt.utilities.lib.depth_first_octree");
9227 }
9228 __pyx_L0:;
9229 __Pyx_RefNannyFinishContext();
9230 #if CYTHON_PEP489_MULTI_PHASE_INIT
9231 return (__pyx_m != NULL) ? 0 : -1;
9232 #elif PY_MAJOR_VERSION >= 3
9233 return __pyx_m;
9234 #else
9235 return;
9236 #endif
9237 }
9238
9239 /* --- Runtime support code --- */
9240 /* Refnanny */
9241 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)9242 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
9243 PyObject *m = NULL, *p = NULL;
9244 void *r = NULL;
9245 m = PyImport_ImportModule(modname);
9246 if (!m) goto end;
9247 p = PyObject_GetAttrString(m, "RefNannyAPI");
9248 if (!p) goto end;
9249 r = PyLong_AsVoidPtr(p);
9250 end:
9251 Py_XDECREF(p);
9252 Py_XDECREF(m);
9253 return (__Pyx_RefNannyAPIStruct *)r;
9254 }
9255 #endif
9256
9257 /* PyObjectGetAttrStr */
9258 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)9259 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
9260 PyTypeObject* tp = Py_TYPE(obj);
9261 if (likely(tp->tp_getattro))
9262 return tp->tp_getattro(obj, attr_name);
9263 #if PY_MAJOR_VERSION < 3
9264 if (likely(tp->tp_getattr))
9265 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
9266 #endif
9267 return PyObject_GetAttr(obj, attr_name);
9268 }
9269 #endif
9270
9271 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)9272 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
9273 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
9274 if (unlikely(!result)) {
9275 PyErr_Format(PyExc_NameError,
9276 #if PY_MAJOR_VERSION >= 3
9277 "name '%U' is not defined", name);
9278 #else
9279 "name '%.200s' is not defined", PyString_AS_STRING(name));
9280 #endif
9281 }
9282 return result;
9283 }
9284
9285 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)9286 static void __Pyx_RaiseArgtupleInvalid(
9287 const char* func_name,
9288 int exact,
9289 Py_ssize_t num_min,
9290 Py_ssize_t num_max,
9291 Py_ssize_t num_found)
9292 {
9293 Py_ssize_t num_expected;
9294 const char *more_or_less;
9295 if (num_found < num_min) {
9296 num_expected = num_min;
9297 more_or_less = "at least";
9298 } else {
9299 num_expected = num_max;
9300 more_or_less = "at most";
9301 }
9302 if (exact) {
9303 more_or_less = "exactly";
9304 }
9305 PyErr_Format(PyExc_TypeError,
9306 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
9307 func_name, more_or_less, num_expected,
9308 (num_expected == 1) ? "" : "s", num_found);
9309 }
9310
9311 /* KeywordStringCheck */
__Pyx_CheckKeywordStrings(PyObject * kwdict,const char * function_name,int kw_allowed)9312 static int __Pyx_CheckKeywordStrings(
9313 PyObject *kwdict,
9314 const char* function_name,
9315 int kw_allowed)
9316 {
9317 PyObject* key = 0;
9318 Py_ssize_t pos = 0;
9319 #if CYTHON_COMPILING_IN_PYPY
9320 if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
9321 goto invalid_keyword;
9322 return 1;
9323 #else
9324 while (PyDict_Next(kwdict, &pos, &key, 0)) {
9325 #if PY_MAJOR_VERSION < 3
9326 if (unlikely(!PyString_Check(key)))
9327 #endif
9328 if (unlikely(!PyUnicode_Check(key)))
9329 goto invalid_keyword_type;
9330 }
9331 if ((!kw_allowed) && unlikely(key))
9332 goto invalid_keyword;
9333 return 1;
9334 invalid_keyword_type:
9335 PyErr_Format(PyExc_TypeError,
9336 "%.200s() keywords must be strings", function_name);
9337 return 0;
9338 #endif
9339 invalid_keyword:
9340 PyErr_Format(PyExc_TypeError,
9341 #if PY_MAJOR_VERSION < 3
9342 "%.200s() got an unexpected keyword argument '%.200s'",
9343 function_name, PyString_AsString(key));
9344 #else
9345 "%s() got an unexpected keyword argument '%U'",
9346 function_name, key);
9347 #endif
9348 return 0;
9349 }
9350
9351 /* PyObjectCall */
9352 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)9353 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
9354 PyObject *result;
9355 ternaryfunc call = func->ob_type->tp_call;
9356 if (unlikely(!call))
9357 return PyObject_Call(func, arg, kw);
9358 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
9359 return NULL;
9360 result = (*call)(func, arg, kw);
9361 Py_LeaveRecursiveCall();
9362 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
9363 PyErr_SetString(
9364 PyExc_SystemError,
9365 "NULL result without error in PyObject_Call");
9366 }
9367 return result;
9368 }
9369 #endif
9370
9371 /* PyErrFetchRestore */
9372 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)9373 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
9374 PyObject *tmp_type, *tmp_value, *tmp_tb;
9375 tmp_type = tstate->curexc_type;
9376 tmp_value = tstate->curexc_value;
9377 tmp_tb = tstate->curexc_traceback;
9378 tstate->curexc_type = type;
9379 tstate->curexc_value = value;
9380 tstate->curexc_traceback = tb;
9381 Py_XDECREF(tmp_type);
9382 Py_XDECREF(tmp_value);
9383 Py_XDECREF(tmp_tb);
9384 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)9385 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
9386 *type = tstate->curexc_type;
9387 *value = tstate->curexc_value;
9388 *tb = tstate->curexc_traceback;
9389 tstate->curexc_type = 0;
9390 tstate->curexc_value = 0;
9391 tstate->curexc_traceback = 0;
9392 }
9393 #endif
9394
9395 /* RaiseException */
9396 #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)9397 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
9398 CYTHON_UNUSED PyObject *cause) {
9399 __Pyx_PyThreadState_declare
9400 Py_XINCREF(type);
9401 if (!value || value == Py_None)
9402 value = NULL;
9403 else
9404 Py_INCREF(value);
9405 if (!tb || tb == Py_None)
9406 tb = NULL;
9407 else {
9408 Py_INCREF(tb);
9409 if (!PyTraceBack_Check(tb)) {
9410 PyErr_SetString(PyExc_TypeError,
9411 "raise: arg 3 must be a traceback or None");
9412 goto raise_error;
9413 }
9414 }
9415 if (PyType_Check(type)) {
9416 #if CYTHON_COMPILING_IN_PYPY
9417 if (!value) {
9418 Py_INCREF(Py_None);
9419 value = Py_None;
9420 }
9421 #endif
9422 PyErr_NormalizeException(&type, &value, &tb);
9423 } else {
9424 if (value) {
9425 PyErr_SetString(PyExc_TypeError,
9426 "instance exception may not have a separate value");
9427 goto raise_error;
9428 }
9429 value = type;
9430 type = (PyObject*) Py_TYPE(type);
9431 Py_INCREF(type);
9432 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
9433 PyErr_SetString(PyExc_TypeError,
9434 "raise: exception class must be a subclass of BaseException");
9435 goto raise_error;
9436 }
9437 }
9438 __Pyx_PyThreadState_assign
9439 __Pyx_ErrRestore(type, value, tb);
9440 return;
9441 raise_error:
9442 Py_XDECREF(value);
9443 Py_XDECREF(type);
9444 Py_XDECREF(tb);
9445 return;
9446 }
9447 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)9448 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
9449 PyObject* owned_instance = NULL;
9450 if (tb == Py_None) {
9451 tb = 0;
9452 } else if (tb && !PyTraceBack_Check(tb)) {
9453 PyErr_SetString(PyExc_TypeError,
9454 "raise: arg 3 must be a traceback or None");
9455 goto bad;
9456 }
9457 if (value == Py_None)
9458 value = 0;
9459 if (PyExceptionInstance_Check(type)) {
9460 if (value) {
9461 PyErr_SetString(PyExc_TypeError,
9462 "instance exception may not have a separate value");
9463 goto bad;
9464 }
9465 value = type;
9466 type = (PyObject*) Py_TYPE(value);
9467 } else if (PyExceptionClass_Check(type)) {
9468 PyObject *instance_class = NULL;
9469 if (value && PyExceptionInstance_Check(value)) {
9470 instance_class = (PyObject*) Py_TYPE(value);
9471 if (instance_class != type) {
9472 int is_subclass = PyObject_IsSubclass(instance_class, type);
9473 if (!is_subclass) {
9474 instance_class = NULL;
9475 } else if (unlikely(is_subclass == -1)) {
9476 goto bad;
9477 } else {
9478 type = instance_class;
9479 }
9480 }
9481 }
9482 if (!instance_class) {
9483 PyObject *args;
9484 if (!value)
9485 args = PyTuple_New(0);
9486 else if (PyTuple_Check(value)) {
9487 Py_INCREF(value);
9488 args = value;
9489 } else
9490 args = PyTuple_Pack(1, value);
9491 if (!args)
9492 goto bad;
9493 owned_instance = PyObject_Call(type, args, NULL);
9494 Py_DECREF(args);
9495 if (!owned_instance)
9496 goto bad;
9497 value = owned_instance;
9498 if (!PyExceptionInstance_Check(value)) {
9499 PyErr_Format(PyExc_TypeError,
9500 "calling %R should have returned an instance of "
9501 "BaseException, not %R",
9502 type, Py_TYPE(value));
9503 goto bad;
9504 }
9505 }
9506 } else {
9507 PyErr_SetString(PyExc_TypeError,
9508 "raise: exception class must be a subclass of BaseException");
9509 goto bad;
9510 }
9511 if (cause) {
9512 PyObject *fixed_cause;
9513 if (cause == Py_None) {
9514 fixed_cause = NULL;
9515 } else if (PyExceptionClass_Check(cause)) {
9516 fixed_cause = PyObject_CallObject(cause, NULL);
9517 if (fixed_cause == NULL)
9518 goto bad;
9519 } else if (PyExceptionInstance_Check(cause)) {
9520 fixed_cause = cause;
9521 Py_INCREF(fixed_cause);
9522 } else {
9523 PyErr_SetString(PyExc_TypeError,
9524 "exception causes must derive from "
9525 "BaseException");
9526 goto bad;
9527 }
9528 PyException_SetCause(value, fixed_cause);
9529 }
9530 PyErr_SetObject(type, value);
9531 if (tb) {
9532 #if CYTHON_COMPILING_IN_PYPY
9533 PyObject *tmp_type, *tmp_value, *tmp_tb;
9534 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
9535 Py_INCREF(tb);
9536 PyErr_Restore(tmp_type, tmp_value, tb);
9537 Py_XDECREF(tmp_tb);
9538 #else
9539 PyThreadState *tstate = __Pyx_PyThreadState_Current;
9540 PyObject* tmp_tb = tstate->curexc_traceback;
9541 if (tb != tmp_tb) {
9542 Py_INCREF(tb);
9543 tstate->curexc_traceback = tb;
9544 Py_XDECREF(tmp_tb);
9545 }
9546 #endif
9547 }
9548 bad:
9549 Py_XDECREF(owned_instance);
9550 return;
9551 }
9552 #endif
9553
9554 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)9555 static void __Pyx_RaiseDoubleKeywordsError(
9556 const char* func_name,
9557 PyObject* kw_name)
9558 {
9559 PyErr_Format(PyExc_TypeError,
9560 #if PY_MAJOR_VERSION >= 3
9561 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
9562 #else
9563 "%s() got multiple values for keyword argument '%s'", func_name,
9564 PyString_AsString(kw_name));
9565 #endif
9566 }
9567
9568 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)9569 static int __Pyx_ParseOptionalKeywords(
9570 PyObject *kwds,
9571 PyObject **argnames[],
9572 PyObject *kwds2,
9573 PyObject *values[],
9574 Py_ssize_t num_pos_args,
9575 const char* function_name)
9576 {
9577 PyObject *key = 0, *value = 0;
9578 Py_ssize_t pos = 0;
9579 PyObject*** name;
9580 PyObject*** first_kw_arg = argnames + num_pos_args;
9581 while (PyDict_Next(kwds, &pos, &key, &value)) {
9582 name = first_kw_arg;
9583 while (*name && (**name != key)) name++;
9584 if (*name) {
9585 values[name-argnames] = value;
9586 continue;
9587 }
9588 name = first_kw_arg;
9589 #if PY_MAJOR_VERSION < 3
9590 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
9591 while (*name) {
9592 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
9593 && _PyString_Eq(**name, key)) {
9594 values[name-argnames] = value;
9595 break;
9596 }
9597 name++;
9598 }
9599 if (*name) continue;
9600 else {
9601 PyObject*** argname = argnames;
9602 while (argname != first_kw_arg) {
9603 if ((**argname == key) || (
9604 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
9605 && _PyString_Eq(**argname, key))) {
9606 goto arg_passed_twice;
9607 }
9608 argname++;
9609 }
9610 }
9611 } else
9612 #endif
9613 if (likely(PyUnicode_Check(key))) {
9614 while (*name) {
9615 int cmp = (**name == key) ? 0 :
9616 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
9617 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
9618 #endif
9619 PyUnicode_Compare(**name, key);
9620 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
9621 if (cmp == 0) {
9622 values[name-argnames] = value;
9623 break;
9624 }
9625 name++;
9626 }
9627 if (*name) continue;
9628 else {
9629 PyObject*** argname = argnames;
9630 while (argname != first_kw_arg) {
9631 int cmp = (**argname == key) ? 0 :
9632 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
9633 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
9634 #endif
9635 PyUnicode_Compare(**argname, key);
9636 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
9637 if (cmp == 0) goto arg_passed_twice;
9638 argname++;
9639 }
9640 }
9641 } else
9642 goto invalid_keyword_type;
9643 if (kwds2) {
9644 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
9645 } else {
9646 goto invalid_keyword;
9647 }
9648 }
9649 return 0;
9650 arg_passed_twice:
9651 __Pyx_RaiseDoubleKeywordsError(function_name, key);
9652 goto bad;
9653 invalid_keyword_type:
9654 PyErr_Format(PyExc_TypeError,
9655 "%.200s() keywords must be strings", function_name);
9656 goto bad;
9657 invalid_keyword:
9658 PyErr_Format(PyExc_TypeError,
9659 #if PY_MAJOR_VERSION < 3
9660 "%.200s() got an unexpected keyword argument '%.200s'",
9661 function_name, PyString_AsString(key));
9662 #else
9663 "%s() got an unexpected keyword argument '%U'",
9664 function_name, key);
9665 #endif
9666 bad:
9667 return -1;
9668 }
9669
9670 /* ArgTypeTest */
__Pyx__ArgTypeTest(PyObject * obj,PyTypeObject * type,const char * name,int exact)9671 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
9672 {
9673 if (unlikely(!type)) {
9674 PyErr_SetString(PyExc_SystemError, "Missing type object");
9675 return 0;
9676 }
9677 else if (exact) {
9678 #if PY_MAJOR_VERSION == 2
9679 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
9680 #endif
9681 }
9682 else {
9683 if (likely(__Pyx_TypeCheck(obj, type))) return 1;
9684 }
9685 PyErr_Format(PyExc_TypeError,
9686 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
9687 name, type->tp_name, Py_TYPE(obj)->tp_name);
9688 return 0;
9689 }
9690
9691 /* IsLittleEndian */
__Pyx_Is_Little_Endian(void)9692 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
9693 {
9694 union {
9695 uint32_t u32;
9696 uint8_t u8[4];
9697 } S;
9698 S.u32 = 0x01020304;
9699 return S.u8[0] == 4;
9700 }
9701
9702 /* BufferFormatCheck */
__Pyx_BufFmt_Init(__Pyx_BufFmt_Context * ctx,__Pyx_BufFmt_StackElem * stack,__Pyx_TypeInfo * type)9703 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
9704 __Pyx_BufFmt_StackElem* stack,
9705 __Pyx_TypeInfo* type) {
9706 stack[0].field = &ctx->root;
9707 stack[0].parent_offset = 0;
9708 ctx->root.type = type;
9709 ctx->root.name = "buffer dtype";
9710 ctx->root.offset = 0;
9711 ctx->head = stack;
9712 ctx->head->field = &ctx->root;
9713 ctx->fmt_offset = 0;
9714 ctx->head->parent_offset = 0;
9715 ctx->new_packmode = '@';
9716 ctx->enc_packmode = '@';
9717 ctx->new_count = 1;
9718 ctx->enc_count = 0;
9719 ctx->enc_type = 0;
9720 ctx->is_complex = 0;
9721 ctx->is_valid_array = 0;
9722 ctx->struct_alignment = 0;
9723 while (type->typegroup == 'S') {
9724 ++ctx->head;
9725 ctx->head->field = type->fields;
9726 ctx->head->parent_offset = 0;
9727 type = type->fields->type;
9728 }
9729 }
__Pyx_BufFmt_ParseNumber(const char ** ts)9730 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
9731 int count;
9732 const char* t = *ts;
9733 if (*t < '0' || *t > '9') {
9734 return -1;
9735 } else {
9736 count = *t++ - '0';
9737 while (*t >= '0' && *t <= '9') {
9738 count *= 10;
9739 count += *t++ - '0';
9740 }
9741 }
9742 *ts = t;
9743 return count;
9744 }
__Pyx_BufFmt_ExpectNumber(const char ** ts)9745 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
9746 int number = __Pyx_BufFmt_ParseNumber(ts);
9747 if (number == -1)
9748 PyErr_Format(PyExc_ValueError,\
9749 "Does not understand character buffer dtype format string ('%c')", **ts);
9750 return number;
9751 }
__Pyx_BufFmt_RaiseUnexpectedChar(char ch)9752 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
9753 PyErr_Format(PyExc_ValueError,
9754 "Unexpected format string character: '%c'", ch);
9755 }
__Pyx_BufFmt_DescribeTypeChar(char ch,int is_complex)9756 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
9757 switch (ch) {
9758 case 'c': return "'char'";
9759 case 'b': return "'signed char'";
9760 case 'B': return "'unsigned char'";
9761 case 'h': return "'short'";
9762 case 'H': return "'unsigned short'";
9763 case 'i': return "'int'";
9764 case 'I': return "'unsigned int'";
9765 case 'l': return "'long'";
9766 case 'L': return "'unsigned long'";
9767 case 'q': return "'long long'";
9768 case 'Q': return "'unsigned long long'";
9769 case 'f': return (is_complex ? "'complex float'" : "'float'");
9770 case 'd': return (is_complex ? "'complex double'" : "'double'");
9771 case 'g': return (is_complex ? "'complex long double'" : "'long double'");
9772 case 'T': return "a struct";
9773 case 'O': return "Python object";
9774 case 'P': return "a pointer";
9775 case 's': case 'p': return "a string";
9776 case 0: return "end";
9777 default: return "unparseable format string";
9778 }
9779 }
__Pyx_BufFmt_TypeCharToStandardSize(char ch,int is_complex)9780 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
9781 switch (ch) {
9782 case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
9783 case 'h': case 'H': return 2;
9784 case 'i': case 'I': case 'l': case 'L': return 4;
9785 case 'q': case 'Q': return 8;
9786 case 'f': return (is_complex ? 8 : 4);
9787 case 'd': return (is_complex ? 16 : 8);
9788 case 'g': {
9789 PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
9790 return 0;
9791 }
9792 case 'O': case 'P': return sizeof(void*);
9793 default:
9794 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
9795 return 0;
9796 }
9797 }
__Pyx_BufFmt_TypeCharToNativeSize(char ch,int is_complex)9798 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
9799 switch (ch) {
9800 case 'c': case 'b': case 'B': case 's': case 'p': return 1;
9801 case 'h': case 'H': return sizeof(short);
9802 case 'i': case 'I': return sizeof(int);
9803 case 'l': case 'L': return sizeof(long);
9804 #ifdef HAVE_LONG_LONG
9805 case 'q': case 'Q': return sizeof(PY_LONG_LONG);
9806 #endif
9807 case 'f': return sizeof(float) * (is_complex ? 2 : 1);
9808 case 'd': return sizeof(double) * (is_complex ? 2 : 1);
9809 case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
9810 case 'O': case 'P': return sizeof(void*);
9811 default: {
9812 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
9813 return 0;
9814 }
9815 }
9816 }
9817 typedef struct { char c; short x; } __Pyx_st_short;
9818 typedef struct { char c; int x; } __Pyx_st_int;
9819 typedef struct { char c; long x; } __Pyx_st_long;
9820 typedef struct { char c; float x; } __Pyx_st_float;
9821 typedef struct { char c; double x; } __Pyx_st_double;
9822 typedef struct { char c; long double x; } __Pyx_st_longdouble;
9823 typedef struct { char c; void *x; } __Pyx_st_void_p;
9824 #ifdef HAVE_LONG_LONG
9825 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
9826 #endif
__Pyx_BufFmt_TypeCharToAlignment(char ch,CYTHON_UNUSED int is_complex)9827 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
9828 switch (ch) {
9829 case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
9830 case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
9831 case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
9832 case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
9833 #ifdef HAVE_LONG_LONG
9834 case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
9835 #endif
9836 case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
9837 case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
9838 case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
9839 case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
9840 default:
9841 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
9842 return 0;
9843 }
9844 }
9845 /* These are for computing the padding at the end of the struct to align
9846 on the first member of the struct. This will probably the same as above,
9847 but we don't have any guarantees.
9848 */
9849 typedef struct { short x; char c; } __Pyx_pad_short;
9850 typedef struct { int x; char c; } __Pyx_pad_int;
9851 typedef struct { long x; char c; } __Pyx_pad_long;
9852 typedef struct { float x; char c; } __Pyx_pad_float;
9853 typedef struct { double x; char c; } __Pyx_pad_double;
9854 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
9855 typedef struct { void *x; char c; } __Pyx_pad_void_p;
9856 #ifdef HAVE_LONG_LONG
9857 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
9858 #endif
__Pyx_BufFmt_TypeCharToPadding(char ch,CYTHON_UNUSED int is_complex)9859 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
9860 switch (ch) {
9861 case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
9862 case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
9863 case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
9864 case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
9865 #ifdef HAVE_LONG_LONG
9866 case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
9867 #endif
9868 case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
9869 case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
9870 case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
9871 case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
9872 default:
9873 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
9874 return 0;
9875 }
9876 }
__Pyx_BufFmt_TypeCharToGroup(char ch,int is_complex)9877 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
9878 switch (ch) {
9879 case 'c':
9880 return 'H';
9881 case 'b': case 'h': case 'i':
9882 case 'l': case 'q': case 's': case 'p':
9883 return 'I';
9884 case 'B': case 'H': case 'I': case 'L': case 'Q':
9885 return 'U';
9886 case 'f': case 'd': case 'g':
9887 return (is_complex ? 'C' : 'R');
9888 case 'O':
9889 return 'O';
9890 case 'P':
9891 return 'P';
9892 default: {
9893 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
9894 return 0;
9895 }
9896 }
9897 }
__Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context * ctx)9898 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
9899 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
9900 const char* expected;
9901 const char* quote;
9902 if (ctx->head == NULL) {
9903 expected = "end";
9904 quote = "";
9905 } else {
9906 expected = ctx->head->field->type->name;
9907 quote = "'";
9908 }
9909 PyErr_Format(PyExc_ValueError,
9910 "Buffer dtype mismatch, expected %s%s%s but got %s",
9911 quote, expected, quote,
9912 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
9913 } else {
9914 __Pyx_StructField* field = ctx->head->field;
9915 __Pyx_StructField* parent = (ctx->head - 1)->field;
9916 PyErr_Format(PyExc_ValueError,
9917 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
9918 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
9919 parent->type->name, field->name);
9920 }
9921 }
__Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context * ctx)9922 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
9923 char group;
9924 size_t size, offset, arraysize = 1;
9925 if (ctx->enc_type == 0) return 0;
9926 if (ctx->head->field->type->arraysize[0]) {
9927 int i, ndim = 0;
9928 if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
9929 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
9930 ndim = 1;
9931 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
9932 PyErr_Format(PyExc_ValueError,
9933 "Expected a dimension of size %zu, got %zu",
9934 ctx->head->field->type->arraysize[0], ctx->enc_count);
9935 return -1;
9936 }
9937 }
9938 if (!ctx->is_valid_array) {
9939 PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
9940 ctx->head->field->type->ndim, ndim);
9941 return -1;
9942 }
9943 for (i = 0; i < ctx->head->field->type->ndim; i++) {
9944 arraysize *= ctx->head->field->type->arraysize[i];
9945 }
9946 ctx->is_valid_array = 0;
9947 ctx->enc_count = 1;
9948 }
9949 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
9950 do {
9951 __Pyx_StructField* field = ctx->head->field;
9952 __Pyx_TypeInfo* type = field->type;
9953 if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
9954 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
9955 } else {
9956 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
9957 }
9958 if (ctx->enc_packmode == '@') {
9959 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
9960 size_t align_mod_offset;
9961 if (align_at == 0) return -1;
9962 align_mod_offset = ctx->fmt_offset % align_at;
9963 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
9964 if (ctx->struct_alignment == 0)
9965 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
9966 ctx->is_complex);
9967 }
9968 if (type->size != size || type->typegroup != group) {
9969 if (type->typegroup == 'C' && type->fields != NULL) {
9970 size_t parent_offset = ctx->head->parent_offset + field->offset;
9971 ++ctx->head;
9972 ctx->head->field = type->fields;
9973 ctx->head->parent_offset = parent_offset;
9974 continue;
9975 }
9976 if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
9977 } else {
9978 __Pyx_BufFmt_RaiseExpected(ctx);
9979 return -1;
9980 }
9981 }
9982 offset = ctx->head->parent_offset + field->offset;
9983 if (ctx->fmt_offset != offset) {
9984 PyErr_Format(PyExc_ValueError,
9985 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
9986 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
9987 return -1;
9988 }
9989 ctx->fmt_offset += size;
9990 if (arraysize)
9991 ctx->fmt_offset += (arraysize - 1) * size;
9992 --ctx->enc_count;
9993 while (1) {
9994 if (field == &ctx->root) {
9995 ctx->head = NULL;
9996 if (ctx->enc_count != 0) {
9997 __Pyx_BufFmt_RaiseExpected(ctx);
9998 return -1;
9999 }
10000 break;
10001 }
10002 ctx->head->field = ++field;
10003 if (field->type == NULL) {
10004 --ctx->head;
10005 field = ctx->head->field;
10006 continue;
10007 } else if (field->type->typegroup == 'S') {
10008 size_t parent_offset = ctx->head->parent_offset + field->offset;
10009 if (field->type->fields->type == NULL) continue;
10010 field = field->type->fields;
10011 ++ctx->head;
10012 ctx->head->field = field;
10013 ctx->head->parent_offset = parent_offset;
10014 break;
10015 } else {
10016 break;
10017 }
10018 }
10019 } while (ctx->enc_count);
10020 ctx->enc_type = 0;
10021 ctx->is_complex = 0;
10022 return 0;
10023 }
10024 static PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context * ctx,const char ** tsp)10025 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
10026 {
10027 const char *ts = *tsp;
10028 int i = 0, number;
10029 int ndim = ctx->head->field->type->ndim;
10030 ;
10031 ++ts;
10032 if (ctx->new_count != 1) {
10033 PyErr_SetString(PyExc_ValueError,
10034 "Cannot handle repeated arrays in format string");
10035 return NULL;
10036 }
10037 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
10038 while (*ts && *ts != ')') {
10039 switch (*ts) {
10040 case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
10041 default: break;
10042 }
10043 number = __Pyx_BufFmt_ExpectNumber(&ts);
10044 if (number == -1) return NULL;
10045 if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
10046 return PyErr_Format(PyExc_ValueError,
10047 "Expected a dimension of size %zu, got %d",
10048 ctx->head->field->type->arraysize[i], number);
10049 if (*ts != ',' && *ts != ')')
10050 return PyErr_Format(PyExc_ValueError,
10051 "Expected a comma in format string, got '%c'", *ts);
10052 if (*ts == ',') ts++;
10053 i++;
10054 }
10055 if (i != ndim)
10056 return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
10057 ctx->head->field->type->ndim, i);
10058 if (!*ts) {
10059 PyErr_SetString(PyExc_ValueError,
10060 "Unexpected end of format string, expected ')'");
10061 return NULL;
10062 }
10063 ctx->is_valid_array = 1;
10064 ctx->new_count = 1;
10065 *tsp = ++ts;
10066 return Py_None;
10067 }
__Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context * ctx,const char * ts)10068 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
10069 int got_Z = 0;
10070 while (1) {
10071 switch(*ts) {
10072 case 0:
10073 if (ctx->enc_type != 0 && ctx->head == NULL) {
10074 __Pyx_BufFmt_RaiseExpected(ctx);
10075 return NULL;
10076 }
10077 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
10078 if (ctx->head != NULL) {
10079 __Pyx_BufFmt_RaiseExpected(ctx);
10080 return NULL;
10081 }
10082 return ts;
10083 case ' ':
10084 case '\r':
10085 case '\n':
10086 ++ts;
10087 break;
10088 case '<':
10089 if (!__Pyx_Is_Little_Endian()) {
10090 PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
10091 return NULL;
10092 }
10093 ctx->new_packmode = '=';
10094 ++ts;
10095 break;
10096 case '>':
10097 case '!':
10098 if (__Pyx_Is_Little_Endian()) {
10099 PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
10100 return NULL;
10101 }
10102 ctx->new_packmode = '=';
10103 ++ts;
10104 break;
10105 case '=':
10106 case '@':
10107 case '^':
10108 ctx->new_packmode = *ts++;
10109 break;
10110 case 'T':
10111 {
10112 const char* ts_after_sub;
10113 size_t i, struct_count = ctx->new_count;
10114 size_t struct_alignment = ctx->struct_alignment;
10115 ctx->new_count = 1;
10116 ++ts;
10117 if (*ts != '{') {
10118 PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
10119 return NULL;
10120 }
10121 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
10122 ctx->enc_type = 0;
10123 ctx->enc_count = 0;
10124 ctx->struct_alignment = 0;
10125 ++ts;
10126 ts_after_sub = ts;
10127 for (i = 0; i != struct_count; ++i) {
10128 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
10129 if (!ts_after_sub) return NULL;
10130 }
10131 ts = ts_after_sub;
10132 if (struct_alignment) ctx->struct_alignment = struct_alignment;
10133 }
10134 break;
10135 case '}':
10136 {
10137 size_t alignment = ctx->struct_alignment;
10138 ++ts;
10139 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
10140 ctx->enc_type = 0;
10141 if (alignment && ctx->fmt_offset % alignment) {
10142 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
10143 }
10144 }
10145 return ts;
10146 case 'x':
10147 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
10148 ctx->fmt_offset += ctx->new_count;
10149 ctx->new_count = 1;
10150 ctx->enc_count = 0;
10151 ctx->enc_type = 0;
10152 ctx->enc_packmode = ctx->new_packmode;
10153 ++ts;
10154 break;
10155 case 'Z':
10156 got_Z = 1;
10157 ++ts;
10158 if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
10159 __Pyx_BufFmt_RaiseUnexpectedChar('Z');
10160 return NULL;
10161 }
10162 CYTHON_FALLTHROUGH;
10163 case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
10164 case 'l': case 'L': case 'q': case 'Q':
10165 case 'f': case 'd': case 'g':
10166 case 'O': case 'p':
10167 if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
10168 ctx->enc_packmode == ctx->new_packmode) {
10169 ctx->enc_count += ctx->new_count;
10170 ctx->new_count = 1;
10171 got_Z = 0;
10172 ++ts;
10173 break;
10174 }
10175 CYTHON_FALLTHROUGH;
10176 case 's':
10177 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
10178 ctx->enc_count = ctx->new_count;
10179 ctx->enc_packmode = ctx->new_packmode;
10180 ctx->enc_type = *ts;
10181 ctx->is_complex = got_Z;
10182 ++ts;
10183 ctx->new_count = 1;
10184 got_Z = 0;
10185 break;
10186 case ':':
10187 ++ts;
10188 while(*ts != ':') ++ts;
10189 ++ts;
10190 break;
10191 case '(':
10192 if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
10193 break;
10194 default:
10195 {
10196 int number = __Pyx_BufFmt_ExpectNumber(&ts);
10197 if (number == -1) return NULL;
10198 ctx->new_count = (size_t)number;
10199 }
10200 }
10201 }
10202 }
10203
10204 /* BufferGetAndValidate */
__Pyx_SafeReleaseBuffer(Py_buffer * info)10205 static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
10206 if (unlikely(info->buf == NULL)) return;
10207 if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
10208 __Pyx_ReleaseBuffer(info);
10209 }
__Pyx_ZeroBuffer(Py_buffer * buf)10210 static void __Pyx_ZeroBuffer(Py_buffer* buf) {
10211 buf->buf = NULL;
10212 buf->obj = NULL;
10213 buf->strides = __Pyx_zeros;
10214 buf->shape = __Pyx_zeros;
10215 buf->suboffsets = __Pyx_minusones;
10216 }
__Pyx__GetBufferAndValidate(Py_buffer * buf,PyObject * obj,__Pyx_TypeInfo * dtype,int flags,int nd,int cast,__Pyx_BufFmt_StackElem * stack)10217 static int __Pyx__GetBufferAndValidate(
10218 Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags,
10219 int nd, int cast, __Pyx_BufFmt_StackElem* stack)
10220 {
10221 buf->buf = NULL;
10222 if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
10223 __Pyx_ZeroBuffer(buf);
10224 return -1;
10225 }
10226 if (unlikely(buf->ndim != nd)) {
10227 PyErr_Format(PyExc_ValueError,
10228 "Buffer has wrong number of dimensions (expected %d, got %d)",
10229 nd, buf->ndim);
10230 goto fail;
10231 }
10232 if (!cast) {
10233 __Pyx_BufFmt_Context ctx;
10234 __Pyx_BufFmt_Init(&ctx, stack, dtype);
10235 if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
10236 }
10237 if (unlikely((size_t)buf->itemsize != dtype->size)) {
10238 PyErr_Format(PyExc_ValueError,
10239 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
10240 buf->itemsize, (buf->itemsize > 1) ? "s" : "",
10241 dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
10242 goto fail;
10243 }
10244 if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
10245 return 0;
10246 fail:;
10247 __Pyx_SafeReleaseBuffer(buf);
10248 return -1;
10249 }
10250
10251 /* GetItemInt */
__Pyx_GetItemInt_Generic(PyObject * o,PyObject * j)10252 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
10253 PyObject *r;
10254 if (!j) return NULL;
10255 r = PyObject_GetItem(o, j);
10256 Py_DECREF(j);
10257 return r;
10258 }
__Pyx_GetItemInt_List_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)10259 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
10260 CYTHON_NCP_UNUSED int wraparound,
10261 CYTHON_NCP_UNUSED int boundscheck) {
10262 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10263 Py_ssize_t wrapped_i = i;
10264 if (wraparound & unlikely(i < 0)) {
10265 wrapped_i += PyList_GET_SIZE(o);
10266 }
10267 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
10268 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
10269 Py_INCREF(r);
10270 return r;
10271 }
10272 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
10273 #else
10274 return PySequence_GetItem(o, i);
10275 #endif
10276 }
__Pyx_GetItemInt_Tuple_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)10277 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
10278 CYTHON_NCP_UNUSED int wraparound,
10279 CYTHON_NCP_UNUSED int boundscheck) {
10280 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10281 Py_ssize_t wrapped_i = i;
10282 if (wraparound & unlikely(i < 0)) {
10283 wrapped_i += PyTuple_GET_SIZE(o);
10284 }
10285 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
10286 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
10287 Py_INCREF(r);
10288 return r;
10289 }
10290 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
10291 #else
10292 return PySequence_GetItem(o, i);
10293 #endif
10294 }
__Pyx_GetItemInt_Fast(PyObject * o,Py_ssize_t i,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)10295 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
10296 CYTHON_NCP_UNUSED int wraparound,
10297 CYTHON_NCP_UNUSED int boundscheck) {
10298 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
10299 if (is_list || PyList_CheckExact(o)) {
10300 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
10301 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
10302 PyObject *r = PyList_GET_ITEM(o, n);
10303 Py_INCREF(r);
10304 return r;
10305 }
10306 }
10307 else if (PyTuple_CheckExact(o)) {
10308 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
10309 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
10310 PyObject *r = PyTuple_GET_ITEM(o, n);
10311 Py_INCREF(r);
10312 return r;
10313 }
10314 } else {
10315 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
10316 if (likely(m && m->sq_item)) {
10317 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
10318 Py_ssize_t l = m->sq_length(o);
10319 if (likely(l >= 0)) {
10320 i += l;
10321 } else {
10322 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
10323 return NULL;
10324 PyErr_Clear();
10325 }
10326 }
10327 return m->sq_item(o, i);
10328 }
10329 }
10330 #else
10331 if (is_list || PySequence_Check(o)) {
10332 return PySequence_GetItem(o, i);
10333 }
10334 #endif
10335 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
10336 }
10337
10338 /* ExtTypeTest */
__Pyx_TypeTest(PyObject * obj,PyTypeObject * type)10339 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
10340 if (unlikely(!type)) {
10341 PyErr_SetString(PyExc_SystemError, "Missing type object");
10342 return 0;
10343 }
10344 if (likely(__Pyx_TypeCheck(obj, type)))
10345 return 1;
10346 PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
10347 Py_TYPE(obj)->tp_name, type->tp_name);
10348 return 0;
10349 }
10350
10351 /* ObjectGetItem */
10352 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetIndex(PyObject * obj,PyObject * index)10353 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
10354 PyObject *runerr;
10355 Py_ssize_t key_value;
10356 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
10357 if (unlikely(!(m && m->sq_item))) {
10358 PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
10359 return NULL;
10360 }
10361 key_value = __Pyx_PyIndex_AsSsize_t(index);
10362 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
10363 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
10364 }
10365 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
10366 PyErr_Clear();
10367 PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
10368 }
10369 return NULL;
10370 }
__Pyx_PyObject_GetItem(PyObject * obj,PyObject * key)10371 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
10372 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
10373 if (likely(m && m->mp_subscript)) {
10374 return m->mp_subscript(obj, key);
10375 }
10376 return __Pyx_PyObject_GetIndex(obj, key);
10377 }
10378 #endif
10379
10380 /* BufferFallbackError */
__Pyx_RaiseBufferFallbackError(void)10381 static void __Pyx_RaiseBufferFallbackError(void) {
10382 PyErr_SetString(PyExc_ValueError,
10383 "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
10384 }
10385
10386 /* PyDictVersioning */
10387 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)10388 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
10389 PyObject *dict = Py_TYPE(obj)->tp_dict;
10390 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
10391 }
__Pyx_get_object_dict_version(PyObject * obj)10392 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
10393 PyObject **dictptr = NULL;
10394 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
10395 if (offset) {
10396 #if CYTHON_COMPILING_IN_CPYTHON
10397 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
10398 #else
10399 dictptr = _PyObject_GetDictPtr(obj);
10400 #endif
10401 }
10402 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
10403 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)10404 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
10405 PyObject *dict = Py_TYPE(obj)->tp_dict;
10406 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
10407 return 0;
10408 return obj_dict_version == __Pyx_get_object_dict_version(obj);
10409 }
10410 #endif
10411
10412 /* GetModuleGlobalName */
10413 #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)10414 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
10415 #else
10416 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
10417 #endif
10418 {
10419 PyObject *result;
10420 #if !CYTHON_AVOID_BORROWED_REFS
10421 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
10422 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
10423 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
10424 if (likely(result)) {
10425 return __Pyx_NewRef(result);
10426 } else if (unlikely(PyErr_Occurred())) {
10427 return NULL;
10428 }
10429 #else
10430 result = PyDict_GetItem(__pyx_d, name);
10431 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
10432 if (likely(result)) {
10433 return __Pyx_NewRef(result);
10434 }
10435 #endif
10436 #else
10437 result = PyObject_GetItem(__pyx_d, name);
10438 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
10439 if (likely(result)) {
10440 return __Pyx_NewRef(result);
10441 }
10442 PyErr_Clear();
10443 #endif
10444 return __Pyx_GetBuiltinName(name);
10445 }
10446
10447 /* PyFunctionFastCall */
10448 #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)10449 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
10450 PyObject *globals) {
10451 PyFrameObject *f;
10452 PyThreadState *tstate = __Pyx_PyThreadState_Current;
10453 PyObject **fastlocals;
10454 Py_ssize_t i;
10455 PyObject *result;
10456 assert(globals != NULL);
10457 /* XXX Perhaps we should create a specialized
10458 PyFrame_New() that doesn't take locals, but does
10459 take builtins without sanity checking them.
10460 */
10461 assert(tstate != NULL);
10462 f = PyFrame_New(tstate, co, globals, NULL);
10463 if (f == NULL) {
10464 return NULL;
10465 }
10466 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
10467 for (i = 0; i < na; i++) {
10468 Py_INCREF(*args);
10469 fastlocals[i] = *args++;
10470 }
10471 result = PyEval_EvalFrameEx(f,0);
10472 ++tstate->recursion_depth;
10473 Py_DECREF(f);
10474 --tstate->recursion_depth;
10475 return result;
10476 }
10477 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)10478 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
10479 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
10480 PyObject *globals = PyFunction_GET_GLOBALS(func);
10481 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
10482 PyObject *closure;
10483 #if PY_MAJOR_VERSION >= 3
10484 PyObject *kwdefs;
10485 #endif
10486 PyObject *kwtuple, **k;
10487 PyObject **d;
10488 Py_ssize_t nd;
10489 Py_ssize_t nk;
10490 PyObject *result;
10491 assert(kwargs == NULL || PyDict_Check(kwargs));
10492 nk = kwargs ? PyDict_Size(kwargs) : 0;
10493 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
10494 return NULL;
10495 }
10496 if (
10497 #if PY_MAJOR_VERSION >= 3
10498 co->co_kwonlyargcount == 0 &&
10499 #endif
10500 likely(kwargs == NULL || nk == 0) &&
10501 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
10502 if (argdefs == NULL && co->co_argcount == nargs) {
10503 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
10504 goto done;
10505 }
10506 else if (nargs == 0 && argdefs != NULL
10507 && co->co_argcount == Py_SIZE(argdefs)) {
10508 /* function called with no arguments, but all parameters have
10509 a default value: use default values as arguments .*/
10510 args = &PyTuple_GET_ITEM(argdefs, 0);
10511 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
10512 goto done;
10513 }
10514 }
10515 if (kwargs != NULL) {
10516 Py_ssize_t pos, i;
10517 kwtuple = PyTuple_New(2 * nk);
10518 if (kwtuple == NULL) {
10519 result = NULL;
10520 goto done;
10521 }
10522 k = &PyTuple_GET_ITEM(kwtuple, 0);
10523 pos = i = 0;
10524 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
10525 Py_INCREF(k[i]);
10526 Py_INCREF(k[i+1]);
10527 i += 2;
10528 }
10529 nk = i / 2;
10530 }
10531 else {
10532 kwtuple = NULL;
10533 k = NULL;
10534 }
10535 closure = PyFunction_GET_CLOSURE(func);
10536 #if PY_MAJOR_VERSION >= 3
10537 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
10538 #endif
10539 if (argdefs != NULL) {
10540 d = &PyTuple_GET_ITEM(argdefs, 0);
10541 nd = Py_SIZE(argdefs);
10542 }
10543 else {
10544 d = NULL;
10545 nd = 0;
10546 }
10547 #if PY_MAJOR_VERSION >= 3
10548 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
10549 args, (int)nargs,
10550 k, (int)nk,
10551 d, (int)nd, kwdefs, closure);
10552 #else
10553 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
10554 args, (int)nargs,
10555 k, (int)nk,
10556 d, (int)nd, closure);
10557 #endif
10558 Py_XDECREF(kwtuple);
10559 done:
10560 Py_LeaveRecursiveCall();
10561 return result;
10562 }
10563 #endif
10564 #endif
10565
10566 /* PyCFunctionFastCall */
10567 #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)10568 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
10569 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
10570 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
10571 PyObject *self = PyCFunction_GET_SELF(func);
10572 int flags = PyCFunction_GET_FLAGS(func);
10573 assert(PyCFunction_Check(func));
10574 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
10575 assert(nargs >= 0);
10576 assert(nargs == 0 || args != NULL);
10577 /* _PyCFunction_FastCallDict() must not be called with an exception set,
10578 because it may clear it (directly or indirectly) and so the
10579 caller loses its exception */
10580 assert(!PyErr_Occurred());
10581 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
10582 return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
10583 } else {
10584 return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
10585 }
10586 }
10587 #endif
10588
10589 /* PyObjectCallMethO */
10590 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)10591 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
10592 PyObject *self, *result;
10593 PyCFunction cfunc;
10594 cfunc = PyCFunction_GET_FUNCTION(func);
10595 self = PyCFunction_GET_SELF(func);
10596 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
10597 return NULL;
10598 result = cfunc(self, arg);
10599 Py_LeaveRecursiveCall();
10600 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
10601 PyErr_SetString(
10602 PyExc_SystemError,
10603 "NULL result without error in PyObject_Call");
10604 }
10605 return result;
10606 }
10607 #endif
10608
10609 /* PyObjectCallOneArg */
10610 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)10611 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
10612 PyObject *result;
10613 PyObject *args = PyTuple_New(1);
10614 if (unlikely(!args)) return NULL;
10615 Py_INCREF(arg);
10616 PyTuple_SET_ITEM(args, 0, arg);
10617 result = __Pyx_PyObject_Call(func, args, NULL);
10618 Py_DECREF(args);
10619 return result;
10620 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)10621 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
10622 #if CYTHON_FAST_PYCALL
10623 if (PyFunction_Check(func)) {
10624 return __Pyx_PyFunction_FastCall(func, &arg, 1);
10625 }
10626 #endif
10627 if (likely(PyCFunction_Check(func))) {
10628 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
10629 return __Pyx_PyObject_CallMethO(func, arg);
10630 #if CYTHON_FAST_PYCCALL
10631 } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
10632 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
10633 #endif
10634 }
10635 }
10636 return __Pyx__PyObject_CallOneArg(func, arg);
10637 }
10638 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)10639 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
10640 PyObject *result;
10641 PyObject *args = PyTuple_Pack(1, arg);
10642 if (unlikely(!args)) return NULL;
10643 result = __Pyx_PyObject_Call(func, args, NULL);
10644 Py_DECREF(args);
10645 return result;
10646 }
10647 #endif
10648
10649 /* DictGetItem */
10650 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
__Pyx_PyDict_GetItem(PyObject * d,PyObject * key)10651 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
10652 PyObject *value;
10653 value = PyDict_GetItemWithError(d, key);
10654 if (unlikely(!value)) {
10655 if (!PyErr_Occurred()) {
10656 if (unlikely(PyTuple_Check(key))) {
10657 PyObject* args = PyTuple_Pack(1, key);
10658 if (likely(args)) {
10659 PyErr_SetObject(PyExc_KeyError, args);
10660 Py_DECREF(args);
10661 }
10662 } else {
10663 PyErr_SetObject(PyExc_KeyError, key);
10664 }
10665 }
10666 return NULL;
10667 }
10668 Py_INCREF(value);
10669 return value;
10670 }
10671 #endif
10672
10673 /* RaiseTooManyValuesToUnpack */
__Pyx_RaiseTooManyValuesError(Py_ssize_t expected)10674 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
10675 PyErr_Format(PyExc_ValueError,
10676 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
10677 }
10678
10679 /* RaiseNeedMoreValuesToUnpack */
__Pyx_RaiseNeedMoreValuesError(Py_ssize_t index)10680 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
10681 PyErr_Format(PyExc_ValueError,
10682 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
10683 index, (index == 1) ? "" : "s");
10684 }
10685
10686 /* RaiseNoneIterError */
__Pyx_RaiseNoneNotIterableError(void)10687 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
10688 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
10689 }
10690
10691 /* GetTopmostException */
10692 #if CYTHON_USE_EXC_INFO_STACK
10693 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)10694 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
10695 {
10696 _PyErr_StackItem *exc_info = tstate->exc_info;
10697 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
10698 exc_info->previous_item != NULL)
10699 {
10700 exc_info = exc_info->previous_item;
10701 }
10702 return exc_info;
10703 }
10704 #endif
10705
10706 /* SaveResetException */
10707 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSave(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)10708 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
10709 #if CYTHON_USE_EXC_INFO_STACK
10710 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
10711 *type = exc_info->exc_type;
10712 *value = exc_info->exc_value;
10713 *tb = exc_info->exc_traceback;
10714 #else
10715 *type = tstate->exc_type;
10716 *value = tstate->exc_value;
10717 *tb = tstate->exc_traceback;
10718 #endif
10719 Py_XINCREF(*type);
10720 Py_XINCREF(*value);
10721 Py_XINCREF(*tb);
10722 }
__Pyx__ExceptionReset(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)10723 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
10724 PyObject *tmp_type, *tmp_value, *tmp_tb;
10725 #if CYTHON_USE_EXC_INFO_STACK
10726 _PyErr_StackItem *exc_info = tstate->exc_info;
10727 tmp_type = exc_info->exc_type;
10728 tmp_value = exc_info->exc_value;
10729 tmp_tb = exc_info->exc_traceback;
10730 exc_info->exc_type = type;
10731 exc_info->exc_value = value;
10732 exc_info->exc_traceback = tb;
10733 #else
10734 tmp_type = tstate->exc_type;
10735 tmp_value = tstate->exc_value;
10736 tmp_tb = tstate->exc_traceback;
10737 tstate->exc_type = type;
10738 tstate->exc_value = value;
10739 tstate->exc_traceback = tb;
10740 #endif
10741 Py_XDECREF(tmp_type);
10742 Py_XDECREF(tmp_value);
10743 Py_XDECREF(tmp_tb);
10744 }
10745 #endif
10746
10747 /* PyErrExceptionMatches */
10748 #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)10749 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
10750 Py_ssize_t i, n;
10751 n = PyTuple_GET_SIZE(tuple);
10752 #if PY_MAJOR_VERSION >= 3
10753 for (i=0; i<n; i++) {
10754 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
10755 }
10756 #endif
10757 for (i=0; i<n; i++) {
10758 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
10759 }
10760 return 0;
10761 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)10762 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
10763 PyObject *exc_type = tstate->curexc_type;
10764 if (exc_type == err) return 1;
10765 if (unlikely(!exc_type)) return 0;
10766 if (unlikely(PyTuple_Check(err)))
10767 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
10768 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
10769 }
10770 #endif
10771
10772 /* GetException */
10773 #if CYTHON_FAST_THREAD_STATE
__Pyx__GetException(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)10774 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
10775 #else
10776 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
10777 #endif
10778 {
10779 PyObject *local_type, *local_value, *local_tb;
10780 #if CYTHON_FAST_THREAD_STATE
10781 PyObject *tmp_type, *tmp_value, *tmp_tb;
10782 local_type = tstate->curexc_type;
10783 local_value = tstate->curexc_value;
10784 local_tb = tstate->curexc_traceback;
10785 tstate->curexc_type = 0;
10786 tstate->curexc_value = 0;
10787 tstate->curexc_traceback = 0;
10788 #else
10789 PyErr_Fetch(&local_type, &local_value, &local_tb);
10790 #endif
10791 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
10792 #if CYTHON_FAST_THREAD_STATE
10793 if (unlikely(tstate->curexc_type))
10794 #else
10795 if (unlikely(PyErr_Occurred()))
10796 #endif
10797 goto bad;
10798 #if PY_MAJOR_VERSION >= 3
10799 if (local_tb) {
10800 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
10801 goto bad;
10802 }
10803 #endif
10804 Py_XINCREF(local_tb);
10805 Py_XINCREF(local_type);
10806 Py_XINCREF(local_value);
10807 *type = local_type;
10808 *value = local_value;
10809 *tb = local_tb;
10810 #if CYTHON_FAST_THREAD_STATE
10811 #if CYTHON_USE_EXC_INFO_STACK
10812 {
10813 _PyErr_StackItem *exc_info = tstate->exc_info;
10814 tmp_type = exc_info->exc_type;
10815 tmp_value = exc_info->exc_value;
10816 tmp_tb = exc_info->exc_traceback;
10817 exc_info->exc_type = local_type;
10818 exc_info->exc_value = local_value;
10819 exc_info->exc_traceback = local_tb;
10820 }
10821 #else
10822 tmp_type = tstate->exc_type;
10823 tmp_value = tstate->exc_value;
10824 tmp_tb = tstate->exc_traceback;
10825 tstate->exc_type = local_type;
10826 tstate->exc_value = local_value;
10827 tstate->exc_traceback = local_tb;
10828 #endif
10829 Py_XDECREF(tmp_type);
10830 Py_XDECREF(tmp_value);
10831 Py_XDECREF(tmp_tb);
10832 #else
10833 PyErr_SetExcInfo(local_type, local_value, local_tb);
10834 #endif
10835 return 0;
10836 bad:
10837 *type = 0;
10838 *value = 0;
10839 *tb = 0;
10840 Py_XDECREF(local_type);
10841 Py_XDECREF(local_value);
10842 Py_XDECREF(local_tb);
10843 return -1;
10844 }
10845
10846 /* PyObject_GenericGetAttrNoDict */
10847 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_RaiseGenericGetAttributeError(PyTypeObject * tp,PyObject * attr_name)10848 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
10849 PyErr_Format(PyExc_AttributeError,
10850 #if PY_MAJOR_VERSION >= 3
10851 "'%.50s' object has no attribute '%U'",
10852 tp->tp_name, attr_name);
10853 #else
10854 "'%.50s' object has no attribute '%.400s'",
10855 tp->tp_name, PyString_AS_STRING(attr_name));
10856 #endif
10857 return NULL;
10858 }
__Pyx_PyObject_GenericGetAttrNoDict(PyObject * obj,PyObject * attr_name)10859 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
10860 PyObject *descr;
10861 PyTypeObject *tp = Py_TYPE(obj);
10862 if (unlikely(!PyString_Check(attr_name))) {
10863 return PyObject_GenericGetAttr(obj, attr_name);
10864 }
10865 assert(!tp->tp_dictoffset);
10866 descr = _PyType_Lookup(tp, attr_name);
10867 if (unlikely(!descr)) {
10868 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
10869 }
10870 Py_INCREF(descr);
10871 #if PY_MAJOR_VERSION < 3
10872 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
10873 #endif
10874 {
10875 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
10876 if (unlikely(f)) {
10877 PyObject *res = f(descr, obj, (PyObject *)tp);
10878 Py_DECREF(descr);
10879 return res;
10880 }
10881 }
10882 return descr;
10883 }
10884 #endif
10885
10886 /* PyObject_GenericGetAttr */
10887 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_PyObject_GenericGetAttr(PyObject * obj,PyObject * attr_name)10888 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
10889 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
10890 return PyObject_GenericGetAttr(obj, attr_name);
10891 }
10892 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
10893 }
10894 #endif
10895
10896 /* SetupReduce */
__Pyx_setup_reduce_is_named(PyObject * meth,PyObject * name)10897 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
10898 int ret;
10899 PyObject *name_attr;
10900 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
10901 if (likely(name_attr)) {
10902 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
10903 } else {
10904 ret = -1;
10905 }
10906 if (unlikely(ret < 0)) {
10907 PyErr_Clear();
10908 ret = 0;
10909 }
10910 Py_XDECREF(name_attr);
10911 return ret;
10912 }
__Pyx_setup_reduce(PyObject * type_obj)10913 static int __Pyx_setup_reduce(PyObject* type_obj) {
10914 int ret = 0;
10915 PyObject *object_reduce = NULL;
10916 PyObject *object_reduce_ex = NULL;
10917 PyObject *reduce = NULL;
10918 PyObject *reduce_ex = NULL;
10919 PyObject *reduce_cython = NULL;
10920 PyObject *setstate = NULL;
10921 PyObject *setstate_cython = NULL;
10922 #if CYTHON_USE_PYTYPE_LOOKUP
10923 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
10924 #else
10925 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
10926 #endif
10927 #if CYTHON_USE_PYTYPE_LOOKUP
10928 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
10929 #else
10930 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
10931 #endif
10932 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
10933 if (reduce_ex == object_reduce_ex) {
10934 #if CYTHON_USE_PYTYPE_LOOKUP
10935 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
10936 #else
10937 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
10938 #endif
10939 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
10940 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
10941 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
10942 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
10943 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
10944 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
10945 if (!setstate) PyErr_Clear();
10946 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
10947 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
10948 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
10949 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
10950 }
10951 PyType_Modified((PyTypeObject*)type_obj);
10952 }
10953 }
10954 goto GOOD;
10955 BAD:
10956 if (!PyErr_Occurred())
10957 PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
10958 ret = -1;
10959 GOOD:
10960 #if !CYTHON_USE_PYTYPE_LOOKUP
10961 Py_XDECREF(object_reduce);
10962 Py_XDECREF(object_reduce_ex);
10963 #endif
10964 Py_XDECREF(reduce);
10965 Py_XDECREF(reduce_ex);
10966 Py_XDECREF(reduce_cython);
10967 Py_XDECREF(setstate);
10968 Py_XDECREF(setstate_cython);
10969 return ret;
10970 }
10971
10972 /* TypeImport */
10973 #ifndef __PYX_HAVE_RT_ImportType
10974 #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)10975 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
10976 size_t size, enum __Pyx_ImportType_CheckSize check_size)
10977 {
10978 PyObject *result = 0;
10979 char warning[200];
10980 Py_ssize_t basicsize;
10981 #ifdef Py_LIMITED_API
10982 PyObject *py_basicsize;
10983 #endif
10984 result = PyObject_GetAttrString(module, class_name);
10985 if (!result)
10986 goto bad;
10987 if (!PyType_Check(result)) {
10988 PyErr_Format(PyExc_TypeError,
10989 "%.200s.%.200s is not a type object",
10990 module_name, class_name);
10991 goto bad;
10992 }
10993 #ifndef Py_LIMITED_API
10994 basicsize = ((PyTypeObject *)result)->tp_basicsize;
10995 #else
10996 py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
10997 if (!py_basicsize)
10998 goto bad;
10999 basicsize = PyLong_AsSsize_t(py_basicsize);
11000 Py_DECREF(py_basicsize);
11001 py_basicsize = 0;
11002 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
11003 goto bad;
11004 #endif
11005 if ((size_t)basicsize < size) {
11006 PyErr_Format(PyExc_ValueError,
11007 "%.200s.%.200s size changed, may indicate binary incompatibility. "
11008 "Expected %zd from C header, got %zd from PyObject",
11009 module_name, class_name, size, basicsize);
11010 goto bad;
11011 }
11012 if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
11013 PyErr_Format(PyExc_ValueError,
11014 "%.200s.%.200s size changed, may indicate binary incompatibility. "
11015 "Expected %zd from C header, got %zd from PyObject",
11016 module_name, class_name, size, basicsize);
11017 goto bad;
11018 }
11019 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
11020 PyOS_snprintf(warning, sizeof(warning),
11021 "%s.%s size changed, may indicate binary incompatibility. "
11022 "Expected %zd from C header, got %zd from PyObject",
11023 module_name, class_name, size, basicsize);
11024 if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
11025 }
11026 return (PyTypeObject *)result;
11027 bad:
11028 Py_XDECREF(result);
11029 return NULL;
11030 }
11031 #endif
11032
11033 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)11034 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
11035 PyObject *empty_list = 0;
11036 PyObject *module = 0;
11037 PyObject *global_dict = 0;
11038 PyObject *empty_dict = 0;
11039 PyObject *list;
11040 #if PY_MAJOR_VERSION < 3
11041 PyObject *py_import;
11042 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
11043 if (!py_import)
11044 goto bad;
11045 #endif
11046 if (from_list)
11047 list = from_list;
11048 else {
11049 empty_list = PyList_New(0);
11050 if (!empty_list)
11051 goto bad;
11052 list = empty_list;
11053 }
11054 global_dict = PyModule_GetDict(__pyx_m);
11055 if (!global_dict)
11056 goto bad;
11057 empty_dict = PyDict_New();
11058 if (!empty_dict)
11059 goto bad;
11060 {
11061 #if PY_MAJOR_VERSION >= 3
11062 if (level == -1) {
11063 if (strchr(__Pyx_MODULE_NAME, '.')) {
11064 module = PyImport_ImportModuleLevelObject(
11065 name, global_dict, empty_dict, list, 1);
11066 if (!module) {
11067 if (!PyErr_ExceptionMatches(PyExc_ImportError))
11068 goto bad;
11069 PyErr_Clear();
11070 }
11071 }
11072 level = 0;
11073 }
11074 #endif
11075 if (!module) {
11076 #if PY_MAJOR_VERSION < 3
11077 PyObject *py_level = PyInt_FromLong(level);
11078 if (!py_level)
11079 goto bad;
11080 module = PyObject_CallFunctionObjArgs(py_import,
11081 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
11082 Py_DECREF(py_level);
11083 #else
11084 module = PyImport_ImportModuleLevelObject(
11085 name, global_dict, empty_dict, list, level);
11086 #endif
11087 }
11088 }
11089 bad:
11090 #if PY_MAJOR_VERSION < 3
11091 Py_XDECREF(py_import);
11092 #endif
11093 Py_XDECREF(empty_list);
11094 Py_XDECREF(empty_dict);
11095 return module;
11096 }
11097
11098 /* CLineInTraceback */
11099 #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(PyThreadState * tstate,int c_line)11100 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
11101 PyObject *use_cline;
11102 PyObject *ptype, *pvalue, *ptraceback;
11103 #if CYTHON_COMPILING_IN_CPYTHON
11104 PyObject **cython_runtime_dict;
11105 #endif
11106 if (unlikely(!__pyx_cython_runtime)) {
11107 return c_line;
11108 }
11109 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
11110 #if CYTHON_COMPILING_IN_CPYTHON
11111 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
11112 if (likely(cython_runtime_dict)) {
11113 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
11114 use_cline, *cython_runtime_dict,
11115 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
11116 } else
11117 #endif
11118 {
11119 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
11120 if (use_cline_obj) {
11121 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
11122 Py_DECREF(use_cline_obj);
11123 } else {
11124 PyErr_Clear();
11125 use_cline = NULL;
11126 }
11127 }
11128 if (!use_cline) {
11129 c_line = 0;
11130 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
11131 }
11132 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
11133 c_line = 0;
11134 }
11135 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
11136 return c_line;
11137 }
11138 #endif
11139
11140 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)11141 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
11142 int start = 0, mid = 0, end = count - 1;
11143 if (end >= 0 && code_line > entries[end].code_line) {
11144 return count;
11145 }
11146 while (start < end) {
11147 mid = start + (end - start) / 2;
11148 if (code_line < entries[mid].code_line) {
11149 end = mid;
11150 } else if (code_line > entries[mid].code_line) {
11151 start = mid + 1;
11152 } else {
11153 return mid;
11154 }
11155 }
11156 if (code_line <= entries[mid].code_line) {
11157 return mid;
11158 } else {
11159 return mid + 1;
11160 }
11161 }
__pyx_find_code_object(int code_line)11162 static PyCodeObject *__pyx_find_code_object(int code_line) {
11163 PyCodeObject* code_object;
11164 int pos;
11165 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
11166 return NULL;
11167 }
11168 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
11169 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
11170 return NULL;
11171 }
11172 code_object = __pyx_code_cache.entries[pos].code_object;
11173 Py_INCREF(code_object);
11174 return code_object;
11175 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)11176 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
11177 int pos, i;
11178 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
11179 if (unlikely(!code_line)) {
11180 return;
11181 }
11182 if (unlikely(!entries)) {
11183 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
11184 if (likely(entries)) {
11185 __pyx_code_cache.entries = entries;
11186 __pyx_code_cache.max_count = 64;
11187 __pyx_code_cache.count = 1;
11188 entries[0].code_line = code_line;
11189 entries[0].code_object = code_object;
11190 Py_INCREF(code_object);
11191 }
11192 return;
11193 }
11194 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
11195 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
11196 PyCodeObject* tmp = entries[pos].code_object;
11197 entries[pos].code_object = code_object;
11198 Py_DECREF(tmp);
11199 return;
11200 }
11201 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
11202 int new_max = __pyx_code_cache.max_count + 64;
11203 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
11204 __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
11205 if (unlikely(!entries)) {
11206 return;
11207 }
11208 __pyx_code_cache.entries = entries;
11209 __pyx_code_cache.max_count = new_max;
11210 }
11211 for (i=__pyx_code_cache.count; i>pos; i--) {
11212 entries[i] = entries[i-1];
11213 }
11214 entries[pos].code_line = code_line;
11215 entries[pos].code_object = code_object;
11216 __pyx_code_cache.count++;
11217 Py_INCREF(code_object);
11218 }
11219
11220 /* AddTraceback */
11221 #include "compile.h"
11222 #include "frameobject.h"
11223 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)11224 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
11225 const char *funcname, int c_line,
11226 int py_line, const char *filename) {
11227 PyCodeObject *py_code = 0;
11228 PyObject *py_srcfile = 0;
11229 PyObject *py_funcname = 0;
11230 #if PY_MAJOR_VERSION < 3
11231 py_srcfile = PyString_FromString(filename);
11232 #else
11233 py_srcfile = PyUnicode_FromString(filename);
11234 #endif
11235 if (!py_srcfile) goto bad;
11236 if (c_line) {
11237 #if PY_MAJOR_VERSION < 3
11238 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
11239 #else
11240 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
11241 #endif
11242 }
11243 else {
11244 #if PY_MAJOR_VERSION < 3
11245 py_funcname = PyString_FromString(funcname);
11246 #else
11247 py_funcname = PyUnicode_FromString(funcname);
11248 #endif
11249 }
11250 if (!py_funcname) goto bad;
11251 py_code = __Pyx_PyCode_New(
11252 0,
11253 0,
11254 0,
11255 0,
11256 0,
11257 __pyx_empty_bytes, /*PyObject *code,*/
11258 __pyx_empty_tuple, /*PyObject *consts,*/
11259 __pyx_empty_tuple, /*PyObject *names,*/
11260 __pyx_empty_tuple, /*PyObject *varnames,*/
11261 __pyx_empty_tuple, /*PyObject *freevars,*/
11262 __pyx_empty_tuple, /*PyObject *cellvars,*/
11263 py_srcfile, /*PyObject *filename,*/
11264 py_funcname, /*PyObject *name,*/
11265 py_line,
11266 __pyx_empty_bytes /*PyObject *lnotab*/
11267 );
11268 Py_DECREF(py_srcfile);
11269 Py_DECREF(py_funcname);
11270 return py_code;
11271 bad:
11272 Py_XDECREF(py_srcfile);
11273 Py_XDECREF(py_funcname);
11274 return NULL;
11275 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)11276 static void __Pyx_AddTraceback(const char *funcname, int c_line,
11277 int py_line, const char *filename) {
11278 PyCodeObject *py_code = 0;
11279 PyFrameObject *py_frame = 0;
11280 PyThreadState *tstate = __Pyx_PyThreadState_Current;
11281 if (c_line) {
11282 c_line = __Pyx_CLineForTraceback(tstate, c_line);
11283 }
11284 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
11285 if (!py_code) {
11286 py_code = __Pyx_CreateCodeObjectForTraceback(
11287 funcname, c_line, py_line, filename);
11288 if (!py_code) goto bad;
11289 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
11290 }
11291 py_frame = PyFrame_New(
11292 tstate, /*PyThreadState *tstate,*/
11293 py_code, /*PyCodeObject *code,*/
11294 __pyx_d, /*PyObject *globals,*/
11295 0 /*PyObject *locals*/
11296 );
11297 if (!py_frame) goto bad;
11298 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
11299 PyTraceBack_Here(py_frame);
11300 bad:
11301 Py_XDECREF(py_code);
11302 Py_XDECREF(py_frame);
11303 }
11304
11305 #if PY_MAJOR_VERSION < 3
__Pyx_GetBuffer(PyObject * obj,Py_buffer * view,int flags)11306 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
11307 if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
11308 if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
11309 PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
11310 return -1;
11311 }
__Pyx_ReleaseBuffer(Py_buffer * view)11312 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
11313 PyObject *obj = view->obj;
11314 if (!obj) return;
11315 if (PyObject_CheckBuffer(obj)) {
11316 PyBuffer_Release(view);
11317 return;
11318 }
11319 if ((0)) {}
11320 else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
11321 view->obj = NULL;
11322 Py_DECREF(obj);
11323 }
11324 #endif
11325
11326
11327 /* CIntFromPyVerify */
11328 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
11329 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
11330 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
11331 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
11332 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
11333 {\
11334 func_type value = func_value;\
11335 if (sizeof(target_type) < sizeof(func_type)) {\
11336 if (unlikely(value != (func_type) (target_type) value)) {\
11337 func_type zero = 0;\
11338 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
11339 return (target_type) -1;\
11340 if (is_unsigned && unlikely(value < zero))\
11341 goto raise_neg_overflow;\
11342 else\
11343 goto raise_overflow;\
11344 }\
11345 }\
11346 return (target_type) value;\
11347 }
11348
11349 /* CIntToPy */
__Pyx_PyInt_From_int(int value)11350 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
11351 const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
11352 const int is_unsigned = neg_one > const_zero;
11353 if (is_unsigned) {
11354 if (sizeof(int) < sizeof(long)) {
11355 return PyInt_FromLong((long) value);
11356 } else if (sizeof(int) <= sizeof(unsigned long)) {
11357 return PyLong_FromUnsignedLong((unsigned long) value);
11358 #ifdef HAVE_LONG_LONG
11359 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
11360 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
11361 #endif
11362 }
11363 } else {
11364 if (sizeof(int) <= sizeof(long)) {
11365 return PyInt_FromLong((long) value);
11366 #ifdef HAVE_LONG_LONG
11367 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
11368 return PyLong_FromLongLong((PY_LONG_LONG) value);
11369 #endif
11370 }
11371 }
11372 {
11373 int one = 1; int little = (int)*(unsigned char *)&one;
11374 unsigned char *bytes = (unsigned char *)&value;
11375 return _PyLong_FromByteArray(bytes, sizeof(int),
11376 little, !is_unsigned);
11377 }
11378 }
11379
11380 /* CIntToPy */
__Pyx_PyInt_From_long(long value)11381 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
11382 const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
11383 const int is_unsigned = neg_one > const_zero;
11384 if (is_unsigned) {
11385 if (sizeof(long) < sizeof(long)) {
11386 return PyInt_FromLong((long) value);
11387 } else if (sizeof(long) <= sizeof(unsigned long)) {
11388 return PyLong_FromUnsignedLong((unsigned long) value);
11389 #ifdef HAVE_LONG_LONG
11390 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
11391 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
11392 #endif
11393 }
11394 } else {
11395 if (sizeof(long) <= sizeof(long)) {
11396 return PyInt_FromLong((long) value);
11397 #ifdef HAVE_LONG_LONG
11398 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
11399 return PyLong_FromLongLong((PY_LONG_LONG) value);
11400 #endif
11401 }
11402 }
11403 {
11404 int one = 1; int little = (int)*(unsigned char *)&one;
11405 unsigned char *bytes = (unsigned char *)&value;
11406 return _PyLong_FromByteArray(bytes, sizeof(long),
11407 little, !is_unsigned);
11408 }
11409 }
11410
11411 /* CIntToPy */
__Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value)11412 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
11413 const Py_intptr_t neg_one = (Py_intptr_t) ((Py_intptr_t) 0 - (Py_intptr_t) 1), const_zero = (Py_intptr_t) 0;
11414 const int is_unsigned = neg_one > const_zero;
11415 if (is_unsigned) {
11416 if (sizeof(Py_intptr_t) < sizeof(long)) {
11417 return PyInt_FromLong((long) value);
11418 } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
11419 return PyLong_FromUnsignedLong((unsigned long) value);
11420 #ifdef HAVE_LONG_LONG
11421 } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) {
11422 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
11423 #endif
11424 }
11425 } else {
11426 if (sizeof(Py_intptr_t) <= sizeof(long)) {
11427 return PyInt_FromLong((long) value);
11428 #ifdef HAVE_LONG_LONG
11429 } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) {
11430 return PyLong_FromLongLong((PY_LONG_LONG) value);
11431 #endif
11432 }
11433 }
11434 {
11435 int one = 1; int little = (int)*(unsigned char *)&one;
11436 unsigned char *bytes = (unsigned char *)&value;
11437 return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t),
11438 little, !is_unsigned);
11439 }
11440 }
11441
11442 /* CIntToPy */
__Pyx_PyInt_From_npy_int32(npy_int32 value)11443 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) {
11444 const npy_int32 neg_one = (npy_int32) ((npy_int32) 0 - (npy_int32) 1), const_zero = (npy_int32) 0;
11445 const int is_unsigned = neg_one > const_zero;
11446 if (is_unsigned) {
11447 if (sizeof(npy_int32) < sizeof(long)) {
11448 return PyInt_FromLong((long) value);
11449 } else if (sizeof(npy_int32) <= sizeof(unsigned long)) {
11450 return PyLong_FromUnsignedLong((unsigned long) value);
11451 #ifdef HAVE_LONG_LONG
11452 } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
11453 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
11454 #endif
11455 }
11456 } else {
11457 if (sizeof(npy_int32) <= sizeof(long)) {
11458 return PyInt_FromLong((long) value);
11459 #ifdef HAVE_LONG_LONG
11460 } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
11461 return PyLong_FromLongLong((PY_LONG_LONG) value);
11462 #endif
11463 }
11464 }
11465 {
11466 int one = 1; int little = (int)*(unsigned char *)&one;
11467 unsigned char *bytes = (unsigned char *)&value;
11468 return _PyLong_FromByteArray(bytes, sizeof(npy_int32),
11469 little, !is_unsigned);
11470 }
11471 }
11472
11473 /* Declarations */
11474 #if CYTHON_CCOMPLEX
11475 #ifdef __cplusplus
__pyx_t_float_complex_from_parts(float x,float y)11476 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
11477 return ::std::complex< float >(x, y);
11478 }
11479 #else
__pyx_t_float_complex_from_parts(float x,float y)11480 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
11481 return x + y*(__pyx_t_float_complex)_Complex_I;
11482 }
11483 #endif
11484 #else
__pyx_t_float_complex_from_parts(float x,float y)11485 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
11486 __pyx_t_float_complex z;
11487 z.real = x;
11488 z.imag = y;
11489 return z;
11490 }
11491 #endif
11492
11493 /* Arithmetic */
11494 #if CYTHON_CCOMPLEX
11495 #else
__Pyx_c_eq_float(__pyx_t_float_complex a,__pyx_t_float_complex b)11496 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11497 return (a.real == b.real) && (a.imag == b.imag);
11498 }
__Pyx_c_sum_float(__pyx_t_float_complex a,__pyx_t_float_complex b)11499 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11500 __pyx_t_float_complex z;
11501 z.real = a.real + b.real;
11502 z.imag = a.imag + b.imag;
11503 return z;
11504 }
__Pyx_c_diff_float(__pyx_t_float_complex a,__pyx_t_float_complex b)11505 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11506 __pyx_t_float_complex z;
11507 z.real = a.real - b.real;
11508 z.imag = a.imag - b.imag;
11509 return z;
11510 }
__Pyx_c_prod_float(__pyx_t_float_complex a,__pyx_t_float_complex b)11511 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11512 __pyx_t_float_complex z;
11513 z.real = a.real * b.real - a.imag * b.imag;
11514 z.imag = a.real * b.imag + a.imag * b.real;
11515 return z;
11516 }
11517 #if 1
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)11518 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11519 if (b.imag == 0) {
11520 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
11521 } else if (fabsf(b.real) >= fabsf(b.imag)) {
11522 if (b.real == 0 && b.imag == 0) {
11523 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
11524 } else {
11525 float r = b.imag / b.real;
11526 float s = (float)(1.0) / (b.real + b.imag * r);
11527 return __pyx_t_float_complex_from_parts(
11528 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
11529 }
11530 } else {
11531 float r = b.real / b.imag;
11532 float s = (float)(1.0) / (b.imag + b.real * r);
11533 return __pyx_t_float_complex_from_parts(
11534 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
11535 }
11536 }
11537 #else
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)11538 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11539 if (b.imag == 0) {
11540 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
11541 } else {
11542 float denom = b.real * b.real + b.imag * b.imag;
11543 return __pyx_t_float_complex_from_parts(
11544 (a.real * b.real + a.imag * b.imag) / denom,
11545 (a.imag * b.real - a.real * b.imag) / denom);
11546 }
11547 }
11548 #endif
__Pyx_c_neg_float(__pyx_t_float_complex a)11549 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
11550 __pyx_t_float_complex z;
11551 z.real = -a.real;
11552 z.imag = -a.imag;
11553 return z;
11554 }
__Pyx_c_is_zero_float(__pyx_t_float_complex a)11555 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
11556 return (a.real == 0) && (a.imag == 0);
11557 }
__Pyx_c_conj_float(__pyx_t_float_complex a)11558 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
11559 __pyx_t_float_complex z;
11560 z.real = a.real;
11561 z.imag = -a.imag;
11562 return z;
11563 }
11564 #if 1
__Pyx_c_abs_float(__pyx_t_float_complex z)11565 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
11566 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
11567 return sqrtf(z.real*z.real + z.imag*z.imag);
11568 #else
11569 return hypotf(z.real, z.imag);
11570 #endif
11571 }
__Pyx_c_pow_float(__pyx_t_float_complex a,__pyx_t_float_complex b)11572 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11573 __pyx_t_float_complex z;
11574 float r, lnr, theta, z_r, z_theta;
11575 if (b.imag == 0 && b.real == (int)b.real) {
11576 if (b.real < 0) {
11577 float denom = a.real * a.real + a.imag * a.imag;
11578 a.real = a.real / denom;
11579 a.imag = -a.imag / denom;
11580 b.real = -b.real;
11581 }
11582 switch ((int)b.real) {
11583 case 0:
11584 z.real = 1;
11585 z.imag = 0;
11586 return z;
11587 case 1:
11588 return a;
11589 case 2:
11590 z = __Pyx_c_prod_float(a, a);
11591 return __Pyx_c_prod_float(a, a);
11592 case 3:
11593 z = __Pyx_c_prod_float(a, a);
11594 return __Pyx_c_prod_float(z, a);
11595 case 4:
11596 z = __Pyx_c_prod_float(a, a);
11597 return __Pyx_c_prod_float(z, z);
11598 }
11599 }
11600 if (a.imag == 0) {
11601 if (a.real == 0) {
11602 return a;
11603 } else if (b.imag == 0) {
11604 z.real = powf(a.real, b.real);
11605 z.imag = 0;
11606 return z;
11607 } else if (a.real > 0) {
11608 r = a.real;
11609 theta = 0;
11610 } else {
11611 r = -a.real;
11612 theta = atan2f(0.0, -1.0);
11613 }
11614 } else {
11615 r = __Pyx_c_abs_float(a);
11616 theta = atan2f(a.imag, a.real);
11617 }
11618 lnr = logf(r);
11619 z_r = expf(lnr * b.real - theta * b.imag);
11620 z_theta = theta * b.real + lnr * b.imag;
11621 z.real = z_r * cosf(z_theta);
11622 z.imag = z_r * sinf(z_theta);
11623 return z;
11624 }
11625 #endif
11626 #endif
11627
11628 /* Declarations */
11629 #if CYTHON_CCOMPLEX
11630 #ifdef __cplusplus
__pyx_t_double_complex_from_parts(double x,double y)11631 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
11632 return ::std::complex< double >(x, y);
11633 }
11634 #else
__pyx_t_double_complex_from_parts(double x,double y)11635 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
11636 return x + y*(__pyx_t_double_complex)_Complex_I;
11637 }
11638 #endif
11639 #else
__pyx_t_double_complex_from_parts(double x,double y)11640 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
11641 __pyx_t_double_complex z;
11642 z.real = x;
11643 z.imag = y;
11644 return z;
11645 }
11646 #endif
11647
11648 /* Arithmetic */
11649 #if CYTHON_CCOMPLEX
11650 #else
__Pyx_c_eq_double(__pyx_t_double_complex a,__pyx_t_double_complex b)11651 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11652 return (a.real == b.real) && (a.imag == b.imag);
11653 }
__Pyx_c_sum_double(__pyx_t_double_complex a,__pyx_t_double_complex b)11654 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11655 __pyx_t_double_complex z;
11656 z.real = a.real + b.real;
11657 z.imag = a.imag + b.imag;
11658 return z;
11659 }
__Pyx_c_diff_double(__pyx_t_double_complex a,__pyx_t_double_complex b)11660 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11661 __pyx_t_double_complex z;
11662 z.real = a.real - b.real;
11663 z.imag = a.imag - b.imag;
11664 return z;
11665 }
__Pyx_c_prod_double(__pyx_t_double_complex a,__pyx_t_double_complex b)11666 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11667 __pyx_t_double_complex z;
11668 z.real = a.real * b.real - a.imag * b.imag;
11669 z.imag = a.real * b.imag + a.imag * b.real;
11670 return z;
11671 }
11672 #if 1
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)11673 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11674 if (b.imag == 0) {
11675 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
11676 } else if (fabs(b.real) >= fabs(b.imag)) {
11677 if (b.real == 0 && b.imag == 0) {
11678 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
11679 } else {
11680 double r = b.imag / b.real;
11681 double s = (double)(1.0) / (b.real + b.imag * r);
11682 return __pyx_t_double_complex_from_parts(
11683 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
11684 }
11685 } else {
11686 double r = b.real / b.imag;
11687 double s = (double)(1.0) / (b.imag + b.real * r);
11688 return __pyx_t_double_complex_from_parts(
11689 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
11690 }
11691 }
11692 #else
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)11693 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11694 if (b.imag == 0) {
11695 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
11696 } else {
11697 double denom = b.real * b.real + b.imag * b.imag;
11698 return __pyx_t_double_complex_from_parts(
11699 (a.real * b.real + a.imag * b.imag) / denom,
11700 (a.imag * b.real - a.real * b.imag) / denom);
11701 }
11702 }
11703 #endif
__Pyx_c_neg_double(__pyx_t_double_complex a)11704 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
11705 __pyx_t_double_complex z;
11706 z.real = -a.real;
11707 z.imag = -a.imag;
11708 return z;
11709 }
__Pyx_c_is_zero_double(__pyx_t_double_complex a)11710 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
11711 return (a.real == 0) && (a.imag == 0);
11712 }
__Pyx_c_conj_double(__pyx_t_double_complex a)11713 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
11714 __pyx_t_double_complex z;
11715 z.real = a.real;
11716 z.imag = -a.imag;
11717 return z;
11718 }
11719 #if 1
__Pyx_c_abs_double(__pyx_t_double_complex z)11720 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
11721 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
11722 return sqrt(z.real*z.real + z.imag*z.imag);
11723 #else
11724 return hypot(z.real, z.imag);
11725 #endif
11726 }
__Pyx_c_pow_double(__pyx_t_double_complex a,__pyx_t_double_complex b)11727 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11728 __pyx_t_double_complex z;
11729 double r, lnr, theta, z_r, z_theta;
11730 if (b.imag == 0 && b.real == (int)b.real) {
11731 if (b.real < 0) {
11732 double denom = a.real * a.real + a.imag * a.imag;
11733 a.real = a.real / denom;
11734 a.imag = -a.imag / denom;
11735 b.real = -b.real;
11736 }
11737 switch ((int)b.real) {
11738 case 0:
11739 z.real = 1;
11740 z.imag = 0;
11741 return z;
11742 case 1:
11743 return a;
11744 case 2:
11745 z = __Pyx_c_prod_double(a, a);
11746 return __Pyx_c_prod_double(a, a);
11747 case 3:
11748 z = __Pyx_c_prod_double(a, a);
11749 return __Pyx_c_prod_double(z, a);
11750 case 4:
11751 z = __Pyx_c_prod_double(a, a);
11752 return __Pyx_c_prod_double(z, z);
11753 }
11754 }
11755 if (a.imag == 0) {
11756 if (a.real == 0) {
11757 return a;
11758 } else if (b.imag == 0) {
11759 z.real = pow(a.real, b.real);
11760 z.imag = 0;
11761 return z;
11762 } else if (a.real > 0) {
11763 r = a.real;
11764 theta = 0;
11765 } else {
11766 r = -a.real;
11767 theta = atan2(0.0, -1.0);
11768 }
11769 } else {
11770 r = __Pyx_c_abs_double(a);
11771 theta = atan2(a.imag, a.real);
11772 }
11773 lnr = log(r);
11774 z_r = exp(lnr * b.real - theta * b.imag);
11775 z_theta = theta * b.real + lnr * b.imag;
11776 z.real = z_r * cos(z_theta);
11777 z.imag = z_r * sin(z_theta);
11778 return z;
11779 }
11780 #endif
11781 #endif
11782
11783 /* CIntToPy */
__Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value)11784 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
11785 const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
11786 const int is_unsigned = neg_one > const_zero;
11787 if (is_unsigned) {
11788 if (sizeof(enum NPY_TYPES) < sizeof(long)) {
11789 return PyInt_FromLong((long) value);
11790 } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
11791 return PyLong_FromUnsignedLong((unsigned long) value);
11792 #ifdef HAVE_LONG_LONG
11793 } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
11794 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
11795 #endif
11796 }
11797 } else {
11798 if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
11799 return PyInt_FromLong((long) value);
11800 #ifdef HAVE_LONG_LONG
11801 } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
11802 return PyLong_FromLongLong((PY_LONG_LONG) value);
11803 #endif
11804 }
11805 }
11806 {
11807 int one = 1; int little = (int)*(unsigned char *)&one;
11808 unsigned char *bytes = (unsigned char *)&value;
11809 return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
11810 little, !is_unsigned);
11811 }
11812 }
11813
11814 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)11815 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
11816 const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
11817 const int is_unsigned = neg_one > const_zero;
11818 #if PY_MAJOR_VERSION < 3
11819 if (likely(PyInt_Check(x))) {
11820 if (sizeof(int) < sizeof(long)) {
11821 __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
11822 } else {
11823 long val = PyInt_AS_LONG(x);
11824 if (is_unsigned && unlikely(val < 0)) {
11825 goto raise_neg_overflow;
11826 }
11827 return (int) val;
11828 }
11829 } else
11830 #endif
11831 if (likely(PyLong_Check(x))) {
11832 if (is_unsigned) {
11833 #if CYTHON_USE_PYLONG_INTERNALS
11834 const digit* digits = ((PyLongObject*)x)->ob_digit;
11835 switch (Py_SIZE(x)) {
11836 case 0: return (int) 0;
11837 case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
11838 case 2:
11839 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
11840 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
11841 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11842 } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
11843 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
11844 }
11845 }
11846 break;
11847 case 3:
11848 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
11849 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
11850 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11851 } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
11852 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
11853 }
11854 }
11855 break;
11856 case 4:
11857 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
11858 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
11859 __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])))
11860 } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
11861 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
11862 }
11863 }
11864 break;
11865 }
11866 #endif
11867 #if CYTHON_COMPILING_IN_CPYTHON
11868 if (unlikely(Py_SIZE(x) < 0)) {
11869 goto raise_neg_overflow;
11870 }
11871 #else
11872 {
11873 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
11874 if (unlikely(result < 0))
11875 return (int) -1;
11876 if (unlikely(result == 1))
11877 goto raise_neg_overflow;
11878 }
11879 #endif
11880 if (sizeof(int) <= sizeof(unsigned long)) {
11881 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
11882 #ifdef HAVE_LONG_LONG
11883 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
11884 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
11885 #endif
11886 }
11887 } else {
11888 #if CYTHON_USE_PYLONG_INTERNALS
11889 const digit* digits = ((PyLongObject*)x)->ob_digit;
11890 switch (Py_SIZE(x)) {
11891 case 0: return (int) 0;
11892 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
11893 case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
11894 case -2:
11895 if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
11896 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
11897 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11898 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
11899 return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
11900 }
11901 }
11902 break;
11903 case 2:
11904 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
11905 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
11906 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11907 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
11908 return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
11909 }
11910 }
11911 break;
11912 case -3:
11913 if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
11914 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
11915 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11916 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
11917 return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
11918 }
11919 }
11920 break;
11921 case 3:
11922 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
11923 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
11924 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11925 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
11926 return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
11927 }
11928 }
11929 break;
11930 case -4:
11931 if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
11932 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
11933 __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])))
11934 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
11935 return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
11936 }
11937 }
11938 break;
11939 case 4:
11940 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
11941 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
11942 __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])))
11943 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
11944 return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
11945 }
11946 }
11947 break;
11948 }
11949 #endif
11950 if (sizeof(int) <= sizeof(long)) {
11951 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
11952 #ifdef HAVE_LONG_LONG
11953 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
11954 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
11955 #endif
11956 }
11957 }
11958 {
11959 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
11960 PyErr_SetString(PyExc_RuntimeError,
11961 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
11962 #else
11963 int val;
11964 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
11965 #if PY_MAJOR_VERSION < 3
11966 if (likely(v) && !PyLong_Check(v)) {
11967 PyObject *tmp = v;
11968 v = PyNumber_Long(tmp);
11969 Py_DECREF(tmp);
11970 }
11971 #endif
11972 if (likely(v)) {
11973 int one = 1; int is_little = (int)*(unsigned char *)&one;
11974 unsigned char *bytes = (unsigned char *)&val;
11975 int ret = _PyLong_AsByteArray((PyLongObject *)v,
11976 bytes, sizeof(val),
11977 is_little, !is_unsigned);
11978 Py_DECREF(v);
11979 if (likely(!ret))
11980 return val;
11981 }
11982 #endif
11983 return (int) -1;
11984 }
11985 } else {
11986 int val;
11987 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
11988 if (!tmp) return (int) -1;
11989 val = __Pyx_PyInt_As_int(tmp);
11990 Py_DECREF(tmp);
11991 return val;
11992 }
11993 raise_overflow:
11994 PyErr_SetString(PyExc_OverflowError,
11995 "value too large to convert to int");
11996 return (int) -1;
11997 raise_neg_overflow:
11998 PyErr_SetString(PyExc_OverflowError,
11999 "can't convert negative value to int");
12000 return (int) -1;
12001 }
12002
12003 /* CIntFromPy */
__Pyx_PyInt_As_npy_int32(PyObject * x)12004 static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) {
12005 const npy_int32 neg_one = (npy_int32) ((npy_int32) 0 - (npy_int32) 1), const_zero = (npy_int32) 0;
12006 const int is_unsigned = neg_one > const_zero;
12007 #if PY_MAJOR_VERSION < 3
12008 if (likely(PyInt_Check(x))) {
12009 if (sizeof(npy_int32) < sizeof(long)) {
12010 __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG(x))
12011 } else {
12012 long val = PyInt_AS_LONG(x);
12013 if (is_unsigned && unlikely(val < 0)) {
12014 goto raise_neg_overflow;
12015 }
12016 return (npy_int32) val;
12017 }
12018 } else
12019 #endif
12020 if (likely(PyLong_Check(x))) {
12021 if (is_unsigned) {
12022 #if CYTHON_USE_PYLONG_INTERNALS
12023 const digit* digits = ((PyLongObject*)x)->ob_digit;
12024 switch (Py_SIZE(x)) {
12025 case 0: return (npy_int32) 0;
12026 case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, digits[0])
12027 case 2:
12028 if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) {
12029 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12030 __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12031 } else if (8 * sizeof(npy_int32) >= 2 * PyLong_SHIFT) {
12032 return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
12033 }
12034 }
12035 break;
12036 case 3:
12037 if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) {
12038 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12039 __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12040 } else if (8 * sizeof(npy_int32) >= 3 * PyLong_SHIFT) {
12041 return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
12042 }
12043 }
12044 break;
12045 case 4:
12046 if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) {
12047 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12048 __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12049 } else if (8 * sizeof(npy_int32) >= 4 * PyLong_SHIFT) {
12050 return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
12051 }
12052 }
12053 break;
12054 }
12055 #endif
12056 #if CYTHON_COMPILING_IN_CPYTHON
12057 if (unlikely(Py_SIZE(x) < 0)) {
12058 goto raise_neg_overflow;
12059 }
12060 #else
12061 {
12062 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
12063 if (unlikely(result < 0))
12064 return (npy_int32) -1;
12065 if (unlikely(result == 1))
12066 goto raise_neg_overflow;
12067 }
12068 #endif
12069 if (sizeof(npy_int32) <= sizeof(unsigned long)) {
12070 __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned long, PyLong_AsUnsignedLong(x))
12071 #ifdef HAVE_LONG_LONG
12072 } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
12073 __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
12074 #endif
12075 }
12076 } else {
12077 #if CYTHON_USE_PYLONG_INTERNALS
12078 const digit* digits = ((PyLongObject*)x)->ob_digit;
12079 switch (Py_SIZE(x)) {
12080 case 0: return (npy_int32) 0;
12081 case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, (sdigit) (-(sdigit)digits[0]))
12082 case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, +digits[0])
12083 case -2:
12084 if (8 * sizeof(npy_int32) - 1 > 1 * PyLong_SHIFT) {
12085 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12086 __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12087 } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
12088 return (npy_int32) (((npy_int32)-1)*(((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
12089 }
12090 }
12091 break;
12092 case 2:
12093 if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) {
12094 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12095 __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12096 } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
12097 return (npy_int32) ((((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
12098 }
12099 }
12100 break;
12101 case -3:
12102 if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
12103 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12104 __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12105 } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
12106 return (npy_int32) (((npy_int32)-1)*(((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
12107 }
12108 }
12109 break;
12110 case 3:
12111 if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) {
12112 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12113 __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12114 } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
12115 return (npy_int32) ((((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
12116 }
12117 }
12118 break;
12119 case -4:
12120 if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
12121 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12122 __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12123 } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
12124 return (npy_int32) (((npy_int32)-1)*(((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
12125 }
12126 }
12127 break;
12128 case 4:
12129 if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) {
12130 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12131 __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12132 } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
12133 return (npy_int32) ((((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
12134 }
12135 }
12136 break;
12137 }
12138 #endif
12139 if (sizeof(npy_int32) <= sizeof(long)) {
12140 __PYX_VERIFY_RETURN_INT_EXC(npy_int32, long, PyLong_AsLong(x))
12141 #ifdef HAVE_LONG_LONG
12142 } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
12143 __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x))
12144 #endif
12145 }
12146 }
12147 {
12148 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
12149 PyErr_SetString(PyExc_RuntimeError,
12150 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
12151 #else
12152 npy_int32 val;
12153 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
12154 #if PY_MAJOR_VERSION < 3
12155 if (likely(v) && !PyLong_Check(v)) {
12156 PyObject *tmp = v;
12157 v = PyNumber_Long(tmp);
12158 Py_DECREF(tmp);
12159 }
12160 #endif
12161 if (likely(v)) {
12162 int one = 1; int is_little = (int)*(unsigned char *)&one;
12163 unsigned char *bytes = (unsigned char *)&val;
12164 int ret = _PyLong_AsByteArray((PyLongObject *)v,
12165 bytes, sizeof(val),
12166 is_little, !is_unsigned);
12167 Py_DECREF(v);
12168 if (likely(!ret))
12169 return val;
12170 }
12171 #endif
12172 return (npy_int32) -1;
12173 }
12174 } else {
12175 npy_int32 val;
12176 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
12177 if (!tmp) return (npy_int32) -1;
12178 val = __Pyx_PyInt_As_npy_int32(tmp);
12179 Py_DECREF(tmp);
12180 return val;
12181 }
12182 raise_overflow:
12183 PyErr_SetString(PyExc_OverflowError,
12184 "value too large to convert to npy_int32");
12185 return (npy_int32) -1;
12186 raise_neg_overflow:
12187 PyErr_SetString(PyExc_OverflowError,
12188 "can't convert negative value to npy_int32");
12189 return (npy_int32) -1;
12190 }
12191
12192 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)12193 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
12194 const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
12195 const int is_unsigned = neg_one > const_zero;
12196 #if PY_MAJOR_VERSION < 3
12197 if (likely(PyInt_Check(x))) {
12198 if (sizeof(long) < sizeof(long)) {
12199 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
12200 } else {
12201 long val = PyInt_AS_LONG(x);
12202 if (is_unsigned && unlikely(val < 0)) {
12203 goto raise_neg_overflow;
12204 }
12205 return (long) val;
12206 }
12207 } else
12208 #endif
12209 if (likely(PyLong_Check(x))) {
12210 if (is_unsigned) {
12211 #if CYTHON_USE_PYLONG_INTERNALS
12212 const digit* digits = ((PyLongObject*)x)->ob_digit;
12213 switch (Py_SIZE(x)) {
12214 case 0: return (long) 0;
12215 case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
12216 case 2:
12217 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
12218 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12219 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12220 } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
12221 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
12222 }
12223 }
12224 break;
12225 case 3:
12226 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
12227 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12228 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12229 } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
12230 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
12231 }
12232 }
12233 break;
12234 case 4:
12235 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
12236 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12237 __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])))
12238 } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
12239 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
12240 }
12241 }
12242 break;
12243 }
12244 #endif
12245 #if CYTHON_COMPILING_IN_CPYTHON
12246 if (unlikely(Py_SIZE(x) < 0)) {
12247 goto raise_neg_overflow;
12248 }
12249 #else
12250 {
12251 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
12252 if (unlikely(result < 0))
12253 return (long) -1;
12254 if (unlikely(result == 1))
12255 goto raise_neg_overflow;
12256 }
12257 #endif
12258 if (sizeof(long) <= sizeof(unsigned long)) {
12259 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
12260 #ifdef HAVE_LONG_LONG
12261 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
12262 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
12263 #endif
12264 }
12265 } else {
12266 #if CYTHON_USE_PYLONG_INTERNALS
12267 const digit* digits = ((PyLongObject*)x)->ob_digit;
12268 switch (Py_SIZE(x)) {
12269 case 0: return (long) 0;
12270 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
12271 case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
12272 case -2:
12273 if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
12274 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12275 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12276 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
12277 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12278 }
12279 }
12280 break;
12281 case 2:
12282 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
12283 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12284 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12285 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
12286 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12287 }
12288 }
12289 break;
12290 case -3:
12291 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
12292 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12293 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12294 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
12295 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12296 }
12297 }
12298 break;
12299 case 3:
12300 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
12301 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12302 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12303 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
12304 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12305 }
12306 }
12307 break;
12308 case -4:
12309 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
12310 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12311 __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])))
12312 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
12313 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12314 }
12315 }
12316 break;
12317 case 4:
12318 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
12319 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12320 __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])))
12321 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
12322 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12323 }
12324 }
12325 break;
12326 }
12327 #endif
12328 if (sizeof(long) <= sizeof(long)) {
12329 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
12330 #ifdef HAVE_LONG_LONG
12331 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
12332 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
12333 #endif
12334 }
12335 }
12336 {
12337 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
12338 PyErr_SetString(PyExc_RuntimeError,
12339 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
12340 #else
12341 long val;
12342 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
12343 #if PY_MAJOR_VERSION < 3
12344 if (likely(v) && !PyLong_Check(v)) {
12345 PyObject *tmp = v;
12346 v = PyNumber_Long(tmp);
12347 Py_DECREF(tmp);
12348 }
12349 #endif
12350 if (likely(v)) {
12351 int one = 1; int is_little = (int)*(unsigned char *)&one;
12352 unsigned char *bytes = (unsigned char *)&val;
12353 int ret = _PyLong_AsByteArray((PyLongObject *)v,
12354 bytes, sizeof(val),
12355 is_little, !is_unsigned);
12356 Py_DECREF(v);
12357 if (likely(!ret))
12358 return val;
12359 }
12360 #endif
12361 return (long) -1;
12362 }
12363 } else {
12364 long val;
12365 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
12366 if (!tmp) return (long) -1;
12367 val = __Pyx_PyInt_As_long(tmp);
12368 Py_DECREF(tmp);
12369 return val;
12370 }
12371 raise_overflow:
12372 PyErr_SetString(PyExc_OverflowError,
12373 "value too large to convert to long");
12374 return (long) -1;
12375 raise_neg_overflow:
12376 PyErr_SetString(PyExc_OverflowError,
12377 "can't convert negative value to long");
12378 return (long) -1;
12379 }
12380
12381 /* FastTypeChecks */
12382 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)12383 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
12384 while (a) {
12385 a = a->tp_base;
12386 if (a == b)
12387 return 1;
12388 }
12389 return b == &PyBaseObject_Type;
12390 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)12391 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
12392 PyObject *mro;
12393 if (a == b) return 1;
12394 mro = a->tp_mro;
12395 if (likely(mro)) {
12396 Py_ssize_t i, n;
12397 n = PyTuple_GET_SIZE(mro);
12398 for (i = 0; i < n; i++) {
12399 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
12400 return 1;
12401 }
12402 return 0;
12403 }
12404 return __Pyx_InBases(a, b);
12405 }
12406 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)12407 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
12408 PyObject *exception, *value, *tb;
12409 int res;
12410 __Pyx_PyThreadState_declare
12411 __Pyx_PyThreadState_assign
12412 __Pyx_ErrFetch(&exception, &value, &tb);
12413 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
12414 if (unlikely(res == -1)) {
12415 PyErr_WriteUnraisable(err);
12416 res = 0;
12417 }
12418 if (!res) {
12419 res = PyObject_IsSubclass(err, exc_type2);
12420 if (unlikely(res == -1)) {
12421 PyErr_WriteUnraisable(err);
12422 res = 0;
12423 }
12424 }
12425 __Pyx_ErrRestore(exception, value, tb);
12426 return res;
12427 }
12428 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)12429 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
12430 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
12431 if (!res) {
12432 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
12433 }
12434 return res;
12435 }
12436 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)12437 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
12438 Py_ssize_t i, n;
12439 assert(PyExceptionClass_Check(exc_type));
12440 n = PyTuple_GET_SIZE(tuple);
12441 #if PY_MAJOR_VERSION >= 3
12442 for (i=0; i<n; i++) {
12443 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
12444 }
12445 #endif
12446 for (i=0; i<n; i++) {
12447 PyObject *t = PyTuple_GET_ITEM(tuple, i);
12448 #if PY_MAJOR_VERSION < 3
12449 if (likely(exc_type == t)) return 1;
12450 #endif
12451 if (likely(PyExceptionClass_Check(t))) {
12452 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
12453 } else {
12454 }
12455 }
12456 return 0;
12457 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)12458 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
12459 if (likely(err == exc_type)) return 1;
12460 if (likely(PyExceptionClass_Check(err))) {
12461 if (likely(PyExceptionClass_Check(exc_type))) {
12462 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
12463 } else if (likely(PyTuple_Check(exc_type))) {
12464 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
12465 } else {
12466 }
12467 }
12468 return PyErr_GivenExceptionMatches(err, exc_type);
12469 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)12470 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
12471 assert(PyExceptionClass_Check(exc_type1));
12472 assert(PyExceptionClass_Check(exc_type2));
12473 if (likely(err == exc_type1 || err == exc_type2)) return 1;
12474 if (likely(PyExceptionClass_Check(err))) {
12475 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
12476 }
12477 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
12478 }
12479 #endif
12480
12481 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)12482 static int __Pyx_check_binary_version(void) {
12483 char ctversion[4], rtversion[4];
12484 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
12485 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
12486 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
12487 char message[200];
12488 PyOS_snprintf(message, sizeof(message),
12489 "compiletime version %s of module '%.100s' "
12490 "does not match runtime version %s",
12491 ctversion, __Pyx_MODULE_NAME, rtversion);
12492 return PyErr_WarnEx(NULL, message, 1);
12493 }
12494 return 0;
12495 }
12496
12497 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)12498 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
12499 while (t->p) {
12500 #if PY_MAJOR_VERSION < 3
12501 if (t->is_unicode) {
12502 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
12503 } else if (t->intern) {
12504 *t->p = PyString_InternFromString(t->s);
12505 } else {
12506 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
12507 }
12508 #else
12509 if (t->is_unicode | t->is_str) {
12510 if (t->intern) {
12511 *t->p = PyUnicode_InternFromString(t->s);
12512 } else if (t->encoding) {
12513 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
12514 } else {
12515 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
12516 }
12517 } else {
12518 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
12519 }
12520 #endif
12521 if (!*t->p)
12522 return -1;
12523 if (PyObject_Hash(*t->p) == -1)
12524 return -1;
12525 ++t;
12526 }
12527 return 0;
12528 }
12529
__Pyx_PyUnicode_FromString(const char * c_str)12530 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
12531 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
12532 }
__Pyx_PyObject_AsString(PyObject * o)12533 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
12534 Py_ssize_t ignore;
12535 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
12536 }
12537 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
12538 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)12539 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
12540 char* defenc_c;
12541 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
12542 if (!defenc) return NULL;
12543 defenc_c = PyBytes_AS_STRING(defenc);
12544 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
12545 {
12546 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
12547 char* c;
12548 for (c = defenc_c; c < end; c++) {
12549 if ((unsigned char) (*c) >= 128) {
12550 PyUnicode_AsASCIIString(o);
12551 return NULL;
12552 }
12553 }
12554 }
12555 #endif
12556 *length = PyBytes_GET_SIZE(defenc);
12557 return defenc_c;
12558 }
12559 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)12560 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
12561 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
12562 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
12563 if (likely(PyUnicode_IS_ASCII(o))) {
12564 *length = PyUnicode_GET_LENGTH(o);
12565 return PyUnicode_AsUTF8(o);
12566 } else {
12567 PyUnicode_AsASCIIString(o);
12568 return NULL;
12569 }
12570 #else
12571 return PyUnicode_AsUTF8AndSize(o, length);
12572 #endif
12573 }
12574 #endif
12575 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)12576 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
12577 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
12578 if (
12579 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
12580 __Pyx_sys_getdefaultencoding_not_ascii &&
12581 #endif
12582 PyUnicode_Check(o)) {
12583 return __Pyx_PyUnicode_AsStringAndSize(o, length);
12584 } else
12585 #endif
12586 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
12587 if (PyByteArray_Check(o)) {
12588 *length = PyByteArray_GET_SIZE(o);
12589 return PyByteArray_AS_STRING(o);
12590 } else
12591 #endif
12592 {
12593 char* result;
12594 int r = PyBytes_AsStringAndSize(o, &result, length);
12595 if (unlikely(r < 0)) {
12596 return NULL;
12597 } else {
12598 return result;
12599 }
12600 }
12601 }
__Pyx_PyObject_IsTrue(PyObject * x)12602 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
12603 int is_true = x == Py_True;
12604 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
12605 else return PyObject_IsTrue(x);
12606 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)12607 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
12608 int retval;
12609 if (unlikely(!x)) return -1;
12610 retval = __Pyx_PyObject_IsTrue(x);
12611 Py_DECREF(x);
12612 return retval;
12613 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)12614 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
12615 #if PY_MAJOR_VERSION >= 3
12616 if (PyLong_Check(result)) {
12617 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
12618 "__int__ returned non-int (type %.200s). "
12619 "The ability to return an instance of a strict subclass of int "
12620 "is deprecated, and may be removed in a future version of Python.",
12621 Py_TYPE(result)->tp_name)) {
12622 Py_DECREF(result);
12623 return NULL;
12624 }
12625 return result;
12626 }
12627 #endif
12628 PyErr_Format(PyExc_TypeError,
12629 "__%.4s__ returned non-%.4s (type %.200s)",
12630 type_name, type_name, Py_TYPE(result)->tp_name);
12631 Py_DECREF(result);
12632 return NULL;
12633 }
__Pyx_PyNumber_IntOrLong(PyObject * x)12634 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
12635 #if CYTHON_USE_TYPE_SLOTS
12636 PyNumberMethods *m;
12637 #endif
12638 const char *name = NULL;
12639 PyObject *res = NULL;
12640 #if PY_MAJOR_VERSION < 3
12641 if (likely(PyInt_Check(x) || PyLong_Check(x)))
12642 #else
12643 if (likely(PyLong_Check(x)))
12644 #endif
12645 return __Pyx_NewRef(x);
12646 #if CYTHON_USE_TYPE_SLOTS
12647 m = Py_TYPE(x)->tp_as_number;
12648 #if PY_MAJOR_VERSION < 3
12649 if (m && m->nb_int) {
12650 name = "int";
12651 res = m->nb_int(x);
12652 }
12653 else if (m && m->nb_long) {
12654 name = "long";
12655 res = m->nb_long(x);
12656 }
12657 #else
12658 if (likely(m && m->nb_int)) {
12659 name = "int";
12660 res = m->nb_int(x);
12661 }
12662 #endif
12663 #else
12664 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
12665 res = PyNumber_Int(x);
12666 }
12667 #endif
12668 if (likely(res)) {
12669 #if PY_MAJOR_VERSION < 3
12670 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
12671 #else
12672 if (unlikely(!PyLong_CheckExact(res))) {
12673 #endif
12674 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
12675 }
12676 }
12677 else if (!PyErr_Occurred()) {
12678 PyErr_SetString(PyExc_TypeError,
12679 "an integer is required");
12680 }
12681 return res;
12682 }
12683 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
12684 Py_ssize_t ival;
12685 PyObject *x;
12686 #if PY_MAJOR_VERSION < 3
12687 if (likely(PyInt_CheckExact(b))) {
12688 if (sizeof(Py_ssize_t) >= sizeof(long))
12689 return PyInt_AS_LONG(b);
12690 else
12691 return PyInt_AsSsize_t(b);
12692 }
12693 #endif
12694 if (likely(PyLong_CheckExact(b))) {
12695 #if CYTHON_USE_PYLONG_INTERNALS
12696 const digit* digits = ((PyLongObject*)b)->ob_digit;
12697 const Py_ssize_t size = Py_SIZE(b);
12698 if (likely(__Pyx_sst_abs(size) <= 1)) {
12699 ival = likely(size) ? digits[0] : 0;
12700 if (size == -1) ival = -ival;
12701 return ival;
12702 } else {
12703 switch (size) {
12704 case 2:
12705 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
12706 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
12707 }
12708 break;
12709 case -2:
12710 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
12711 return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
12712 }
12713 break;
12714 case 3:
12715 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
12716 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
12717 }
12718 break;
12719 case -3:
12720 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
12721 return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
12722 }
12723 break;
12724 case 4:
12725 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
12726 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]));
12727 }
12728 break;
12729 case -4:
12730 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
12731 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]));
12732 }
12733 break;
12734 }
12735 }
12736 #endif
12737 return PyLong_AsSsize_t(b);
12738 }
12739 x = PyNumber_Index(b);
12740 if (!x) return -1;
12741 ival = PyInt_AsSsize_t(x);
12742 Py_DECREF(x);
12743 return ival;
12744 }
12745 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
12746 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
12747 }
12748 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
12749 return PyInt_FromSize_t(ival);
12750 }
12751
12752
12753 #endif /* Py_PYTHON_H */
12754